Version
menu_open
link

include/AK/SoundEngine/Common/AkDynamicSequence.h

Go to the documentation of this file.
00001 
00002 //
00003 // Copyright (c) 2006 Audiokinetic Inc. / All Rights Reserved
00004 //
00006 
00007 #ifndef _AK_SOUNDENGINE_AKDYNAMICSEQUENCE_H
00008 #define _AK_SOUNDENGINE_AKDYNAMICSEQUENCE_H
00009 
00010 #include <AK/SoundEngine/Common/AkSoundEngine.h>
00011 #include <AK/Tools/Common/AkArray.h>
00012 
00013 class AkExternalSourceArray;
00014 
00015 namespace AK
00016 {
00017     namespace SoundEngine
00018     {
00021         namespace DynamicSequence
00022         {
00028             class PlaylistItem
00029             {
00030             public:
00031                 PlaylistItem();
00032                 PlaylistItem(const PlaylistItem& in_rCopy);
00033                 ~PlaylistItem();
00034 
00035                 PlaylistItem& operator=(const PlaylistItem& in_rCopy);
00036                 bool operator==(const PlaylistItem& in_rCopy)
00037                 {
00038                     AKASSERT(pExternalSrcs == NULL);
00039                     return audioNodeID == in_rCopy.audioNodeID && 
00040                         msDelay == in_rCopy.msDelay && 
00041                         pCustomInfo == in_rCopy.pCustomInfo;
00042                 };
00043 
00047                 AKRESULT SetExternalSources(AkUInt32 in_nExternalSrc, AkExternalSourceInfo* in_pExternalSrc);
00048 
00050                 AkExternalSourceArray* GetExternalSources(){return pExternalSrcs;}
00051 
00052                 AkUniqueID audioNodeID; 
00053                 AkTimeMs   msDelay;     
00054                 void *     pCustomInfo; 
00055 
00056             private:
00057                 AkExternalSourceArray *pExternalSrcs;
00058             };
00059 
00064             class Playlist
00065                 : public AkArray<PlaylistItem, const PlaylistItem&, ArrayPoolDefault, 4>
00066             {
00067             public:
00070                 AkForceInline AKRESULT Enqueue( 
00071                     AkUniqueID in_audioNodeID,      
00072                     AkTimeMs in_msDelay = 0,        
00073                     void * in_pCustomInfo = NULL,   
00074                     AkUInt32 in_cExternals = 0,                 
00075                     AkExternalSourceInfo *in_pExternalSources = NULL
00076                     )
00077                 {
00078                     PlaylistItem * pItem = AddLast();
00079                     if ( !pItem )
00080                         return AK_Fail;
00081 
00082                     pItem->audioNodeID = in_audioNodeID;
00083                     pItem->msDelay = in_msDelay;
00084                     pItem->pCustomInfo = in_pCustomInfo;
00085                     return pItem->SetExternalSources(in_cExternals, in_pExternalSources);
00086                 }
00087             };
00088 
00109             enum DynamicSequenceType
00110             {
00111                 DynamicSequenceType_SampleAccurate,         
00112                 DynamicSequenceType_NormalTransition        
00113             };
00114 
00120             AK_EXTERNAPIFUNC( AkPlayingID, Open )(
00121                 AkGameObjectID      in_gameObjectID,            
00122                 AkUInt32            in_uFlags      = 0,         
00123                 AkCallbackFunc      in_pfnCallback = NULL,      
00124                 void*               in_pCookie     = NULL,      
00125                 DynamicSequenceType in_eDynamicSequenceType = DynamicSequenceType_SampleAccurate 
00126                 );
00127                                                         
00130             AK_EXTERNAPIFUNC( AKRESULT, Close )(
00131                 AkPlayingID in_playingID                        
00132                 );
00133 
00135             AK_EXTERNAPIFUNC( AKRESULT, Play )( 
00136                 AkPlayingID in_playingID,                                           
00137                 AkTimeMs in_uTransitionDuration = 0,                                
00138                 AkCurveInterpolation in_eFadeCurve = AkCurveInterpolation_Linear    
00139                 );
00140 
00143             AK_EXTERNAPIFUNC( AKRESULT, Pause )( 
00144                 AkPlayingID in_playingID,                                           
00145                 AkTimeMs in_uTransitionDuration = 0,                                
00146                 AkCurveInterpolation in_eFadeCurve = AkCurveInterpolation_Linear    
00147                 );
00148 
00150             AK_EXTERNAPIFUNC( AKRESULT, Resume )(
00151                 AkPlayingID in_playingID,                                           
00152                 AkTimeMs in_uTransitionDuration = 0,                                    
00153                 AkCurveInterpolation in_eFadeCurve = AkCurveInterpolation_Linear    
00154                 );
00155 
00159             AK_EXTERNAPIFUNC( AKRESULT, Stop )(
00160                 AkPlayingID in_playingID,                                           
00161                 AkTimeMs in_uTransitionDuration = 0,                                
00162                 AkCurveInterpolation in_eFadeCurve = AkCurveInterpolation_Linear    
00163                 );
00164 
00166             AK_EXTERNAPIFUNC( AKRESULT, Break )(
00167                 AkPlayingID in_playingID                        
00168                 );
00169 
00174             AK_EXTERNAPIFUNC( Playlist *, LockPlaylist )(
00175                 AkPlayingID in_playingID                        
00176                 );
00177 
00181             AK_EXTERNAPIFUNC( AKRESULT, UnlockPlaylist )(
00182                 AkPlayingID in_playingID                        
00183                 );
00184         }
00185     }
00186 }
00187 
00188 #endif // _AK_SOUNDENGINE_AKDYNAMICSEQUENCE_H

Was this page helpful?

Need Support?

Questions? Problems? Need more info? Contact us, and we can help!

Visit our Support page

Tell us about your project. We're here to help.

Register your project and we'll help you get started with no strings attached!

Get started with Wwise