NL3D::CPlayListManager Class Reference

#include <play_list_manager.h>


Detailed Description

This class handles a list of pair PlayList/ChannelMixer RefPointer. It is just a container, with a animate() method. PlayList/ChannelMixer are sotred with RefPtr. They are auto-removed from the list if the playlist or the channelmixer is deleted (done in animate()).
Author:
Lionel Berenguier

Nevrax France

Date:
2001

Definition at line 48 of file play_list_manager.h.

Public Member Functions

void addPlaylist (CAnimationPlaylist *plist, CChannelMixer *chanMixer)
 add a playlist/channelmixer to the manager. nlassert(plist). chanMixer replaced if playlist already IN.

void animate (TGlobalAnimationTime time)
 CPlayListManager ()
 Constructor.

void deleteAll ()
void removePlaylist (CAnimationPlaylist *plist)
 remove a playlist/channelmixer from the manager. nlassert(plist). no op if not here.

void setup (TGlobalAnimationTime time)

Private Types

typedef std::map< CAnimationPlaylist *,
CNode
TPlayListList
 CAnimationPlaylist* is just the key.


Private Attributes

TPlayListList _List


Member Typedef Documentation

typedef std::map<CAnimationPlaylist*, CNode> NL3D::CPlayListManager::TPlayListList [private]
 

CAnimationPlaylist* is just the key.

Definition at line 90 of file play_list_manager.h.


Constructor & Destructor Documentation

NL3D::CPlayListManager::CPlayListManager  )  [inline]
 

Constructor.

Definition at line 53 of file play_list_manager.h.

00053 {}


Member Function Documentation

void NL3D::CPlayListManager::addPlaylist CAnimationPlaylist plist,
CChannelMixer chanMixer
 

add a playlist/channelmixer to the manager. nlassert(plist). chanMixer replaced if playlist already IN.

Definition at line 36 of file play_list_manager.cpp.

References _List, and nlassert.

Referenced by NL3D::CPlayListManagerUser::createPlayList(), and NL3D::CScene::setAutomaticAnimationSet().

00037 {
00038         nlassert(plist);
00039         if(!chanMixer)
00040                 return;
00041         // this do all the good things.
00042         _List[plist]= CNode(plist, chanMixer);
00043 }

void NL3D::CPlayListManager::animate TGlobalAnimationTime  time  ) 
 

animate all the playlist: setupMixer() the channelMixer, and eval(false) (eval global part). If a playlist/channelmixer has been deleted (RefPtr), the node is removed from the list.

Definition at line 56 of file play_list_manager.cpp.

References _List, NL3D::CPlayListManager::CNode::ChannelMixer, NL3D::CPlayListManager::CNode::PlayList, and NL3D::TGlobalAnimationTime.

Referenced by NL3D::CScene::animate(), and NL3D::CPlayListManagerUser::animate().

00057 {
00058         TPlayListList::iterator         it;
00059 
00060         for(it=_List.begin();it!=_List.end();)
00061         {
00062                 CNode   *node= &(it->second);
00063                 // Test refPtrs.
00064                 if( node->PlayList==NULL || node->ChannelMixer==NULL)
00065                 {
00066                         // erase it from map.
00067                         TPlayListList::iterator         itDel= it++;
00068                         _List.erase(itDel);
00069                 }
00070                 else
00071                 {
00072                         // animate!!
00073                         node->PlayList->setupMixer(*node->ChannelMixer, time);
00074                         node->ChannelMixer->eval(false);
00075                         it++;
00076                 }
00077         }
00078 }

void NL3D::CPlayListManager::deleteAll  ) 
 

Perform a deletion of all pair playlist channel mixer

Definition at line 107 of file play_list_manager.cpp.

References _List, NL3D::CPlayListManager::CNode::ChannelMixer, and NL3D::CPlayListManager::CNode::PlayList.

Referenced by NL3D::CScene::release(), and NL3D::CScene::setAutomaticAnimationSet().

00108 {
00109         TPlayListList::iterator it = _List.begin();
00110         while (it != _List.end())
00111         {
00112                 TPlayListList::iterator itDel = it;
00113                 ++it;
00114                 CNode *node= &(itDel->second);
00115                 delete node->ChannelMixer;
00116                 delete node->PlayList;
00117                 _List.erase(itDel);
00118         }
00119         _List.clear();
00120 }

void NL3D::CPlayListManager::removePlaylist CAnimationPlaylist plist  ) 
 

remove a playlist/channelmixer from the manager. nlassert(plist). no op if not here.

Definition at line 47 of file play_list_manager.cpp.

References _List, and nlassert.

Referenced by NL3D::CPlayListManagerUser::deletePlayList().

00048 {
00049         nlassert(plist);
00050         // this do all the good things.
00051         _List.erase(plist);
00052 }

void NL3D::CPlayListManager::setup TGlobalAnimationTime  time  ) 
 

steup all the playlist: setupMixer() the channelMixer. If a playlist/channelmixer has been deleted (RefPtr), the node is removed from the list.

Definition at line 82 of file play_list_manager.cpp.

References _List, NL3D::CPlayListManager::CNode::ChannelMixer, NL3D::CPlayListManager::CNode::PlayList, and NL3D::TGlobalAnimationTime.

Referenced by NL3D::CPlayListManagerUser::setup().

00083 {
00084         TPlayListList::iterator         it;
00085         
00086         for(it=_List.begin();it!=_List.end();)
00087         {
00088                 CNode   *node= &(it->second);
00089                 // Test refPtrs.
00090                 if( node->PlayList==NULL || node->ChannelMixer==NULL)
00091                 {
00092                         // erase it from map.
00093                         TPlayListList::iterator         itDel= it++;
00094                         _List.erase(itDel);
00095                 }
00096                 else
00097                 {
00098                         // animate!!
00099                         node->PlayList->setupMixer(*node->ChannelMixer, time);
00100                         it++;
00101                 }
00102         }
00103 }


Field Documentation

TPlayListList NL3D::CPlayListManager::_List [private]
 

Definition at line 91 of file play_list_manager.h.

Referenced by addPlaylist(), animate(), deleteAll(), removePlaylist(), and setup().


The documentation for this class was generated from the following files:
Generated on Tue Mar 16 07:01:18 2004 for NeL by doxygen 1.3.6