# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

play_list_manager_user.h

Go to the documentation of this file.
00001 
00007 /* Copyright, 2001 Nevrax Ltd.
00008  *
00009  * This file is part of NEVRAX NEL.
00010  * NEVRAX NEL is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License as published by
00012  * the Free Software Foundation; either version 2, or (at your option)
00013  * any later version.
00014 
00015  * NEVRAX NEL is distributed in the hope that it will be useful, but
00016  * WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00018  * General Public License for more details.
00019 
00020  * You should have received a copy of the GNU General Public License
00021  * along with NEVRAX NEL; see the file COPYING. If not, write to the
00022  * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
00023  * MA 02111-1307, USA.
00024  */
00025 
00026 #ifndef NL_PLAY_LIST_MANAGER_USER_H
00027 #define NL_PLAY_LIST_MANAGER_USER_H
00028 
00029 #include "nel/misc/types_nl.h"
00030 #include "nel/3d/u_play_list_manager.h"
00031 #include "3d/play_list_manager.h"
00032 #include "3d/play_list_user.h"
00033 #include "3d/animation_set_user.h"
00034 #include "3d/ptr_set.h"
00035 
00036 
00037 namespace NL3D 
00038 {
00039 
00040 
00041 // ***************************************************************************
00048 class CPlayListManagerUser : public UPlayListManager
00049 {
00050 private:
00051         CPlayListManager                _PlayListManager;
00052         CPtrSet<CPlayListUser>  _PlayLists;
00053 
00054 
00055 public:
00056 
00058         CPlayListManagerUser()
00059         {
00060         }
00061 
00062 
00065         virtual UPlayList       *createPlayList(UAnimationSet   *animSet)
00066         {
00067                 if(!animSet)
00068                         nlerror("createPlayList(): animSet==NULL");
00069                 
00070                 nlassert(dynamic_cast<CAnimationSetUser*>(animSet));
00071                 CPlayListUser   *pl= new CPlayListUser( ((CAnimationSetUser*)animSet)->_AnimationSet );
00072                 _PlayLists.insert(pl);
00073 
00074                 _PlayListManager.addPlaylist(&pl->_PlayList, &pl->_ChannelMixer);
00075 
00076                 return pl;
00077         }
00080         virtual void            deletePlayList(UPlayList *playList)
00081         {
00082                 nlassert(dynamic_cast<CPlayListUser*>(playList));
00083                 CPlayListUser   *pl= (CPlayListUser*)playList;
00084 
00085                 _PlayListManager.removePlaylist(&pl->_PlayList);
00086                 _PlayLists.erase(pl, "deletePlayList(): bad playList");
00087         }
00088 
00089 
00093         virtual void            animate(TGlobalAnimationTime    time)
00094         {
00095                 _PlayListManager.animate(time);
00096         }
00097 
00098 
00099 };
00100 
00101 
00102 } // NL3D
00103 
00104 
00105 #endif // NL_PLAY_LIST_MANAGER_USER_H
00106 
00107 /* End of play_list_manager_user.h */