Version
menu_open
link

include/AK/SoundEngine/Common/AkStreamMgrModule.h

Go to the documentation of this file.
00001 
00002 //
00003 // Copyright (c) 2006 Audiokinetic Inc. / All Rights Reserved
00004 //
00006 
00014 
00015 #ifndef _AK_STREAM_MGR_MODULE_H_
00016 #define _AK_STREAM_MGR_MODULE_H_
00017 
00018 #include <AK/SoundEngine/Common/IAkStreamMgr.h>
00019 #include <AK/Tools/Common/AkPlatformFuncs.h>
00020 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 struct AkStreamMgrSettings
00030 {
00031     AkUInt32            uMemorySize;        
00032 
00033 
00034 
00035 
00036 
00037 
00038 
00039 };
00040 
00046 struct AkDeviceSettings
00047 {
00048     void *              pIOMemory;                  
00049 
00050 
00051     AkUInt32            uIOMemorySize;              
00052     AkUInt32            uIOMemoryAlignment;         
00053     AkMemPoolAttributes ePoolAttributes;            
00054     AkUInt32            uGranularity;               
00055     AkUInt32            uSchedulerTypeFlags;        
00056     AkThreadProperties  threadProperties;           
00057     AkReal32            fTargetAutoStmBufferLength; 
00058     AkUInt32            uMaxConcurrentIO;           
00059     bool                bUseStreamCache;            
00060     AkUInt32            uMaxCachePinnedBytes;       
00061 };
00062 
00064 
00067 #define AK_SCHEDULER_BLOCKING          (0x01)
00068 
00069 
00070 
00071 #define AK_SCHEDULER_DEFERRED_LINED_UP (0x02)
00072 
00076 struct AkFileDesc
00077 {
00078     AkInt64             iFileSize;          
00079     AkUInt32            uSector;            
00080 
00081 
00082 
00083     AkUInt32            uCustomParamSize;   
00084     void *              pCustomParam;       
00085     AkFileHandle        hFile;              
00086     AkDeviceID          deviceID;           
00087 };
00088 
00091 struct AkIOTransferInfo
00092 {
00093     AkUInt64        uFilePosition;      
00094     AkUInt32        uBufferSize;        
00095     AkUInt32        uRequestedSize;     
00096 };
00097 
00098 struct AkAsyncIOTransferInfo;
00108 AK_CALLBACK( void, AkIOCallback )( 
00109     AkAsyncIOTransferInfo * in_pTransferInfo,   
00110     AKRESULT        in_eResult          
00111     );
00112 
00118 struct AkAsyncIOTransferInfo : public AkIOTransferInfo
00119 {
00120     void *          pBuffer;            
00121     AkIOCallback    pCallback;          
00122     void *          pCookie;            
00123     void *          pUserData;          
00124 };
00125 
00133 struct AkIoHeuristics
00134 {
00135     AkReal32        fDeadline;          
00136     AkPriority      priority;           
00137 };
00138 
00139 
00140 
00142 
00143 namespace AK
00144 {
00145     // Audiokinetic Stream Manager's implementation-specific interfaces of the Low-Level IO submodule.
00146     namespace StreamMgr
00147     {
00149         class IAkLowLevelIOHook
00150         {
00151         protected:
00153             virtual ~IAkLowLevelIOHook(){}
00154 
00155         public:
00158             virtual AKRESULT Close(
00159                 AkFileDesc &            in_fileDesc         
00160                 ) = 0;
00161 
00184             virtual AkUInt32 GetBlockSize(
00185                 AkFileDesc &            in_fileDesc         
00186                 ) = 0;
00187 
00191             virtual void GetDeviceDesc(
00192                 AkDeviceDesc &          out_deviceDesc      
00193                 ) = 0;
00194 
00202             virtual AkUInt32 GetDeviceData() = 0;
00203         };
00204 
00209         class IAkIOHookBlocking : public IAkLowLevelIOHook
00210         {
00211         protected:
00213             virtual ~IAkIOHookBlocking(){}
00214 
00215         public:
00216 
00228             virtual AKRESULT Read(
00229                 AkFileDesc &            in_fileDesc,        
00230                 const AkIoHeuristics &  in_heuristics,      
00231                 void *                  out_pBuffer,        
00232                 AkIOTransferInfo &      in_transferInfo     
00233                 ) = 0;
00234 
00245             virtual AKRESULT Write(
00246                 AkFileDesc &            in_fileDesc,        
00247                 const AkIoHeuristics &  in_heuristics,      
00248                 void *                  in_pData,           
00249                 AkIOTransferInfo &      io_transferInfo     
00250                 ) = 0;
00251         };
00252 
00269         class IAkIOHookDeferred : public IAkLowLevelIOHook
00270         {
00271         protected:
00273             virtual ~IAkIOHookDeferred(){}
00274 
00275         public:
00276 
00295             virtual AKRESULT Read(
00296                 AkFileDesc &            in_fileDesc,        
00297                 const AkIoHeuristics &  in_heuristics,      
00298                 AkAsyncIOTransferInfo & io_transferInfo     
00299                 ) = 0;
00300 
00319             virtual AKRESULT Write(
00320                 AkFileDesc &            in_fileDesc,        
00321                 const AkIoHeuristics &  in_heuristics,      
00322                 AkAsyncIOTransferInfo & io_transferInfo     
00323                 ) = 0;
00324 
00356             virtual void Cancel(
00357                 AkFileDesc &        in_fileDesc,            
00358                 AkAsyncIOTransferInfo & io_transferInfo,    
00359                 bool & io_bCancelAllTransfersForThisFile    
00360                 ) = 0;
00361         };
00362 
00378         class IAkFileLocationResolver
00379         {
00380         protected:
00382             virtual ~IAkFileLocationResolver(){}
00383 
00384         public:
00385 
00427             virtual AKRESULT Open( 
00428                 const AkOSChar*         in_pszFileName,     
00429                 AkOpenMode              in_eOpenMode,       
00430                 AkFileSystemFlags *     in_pFlags,          
00431                 bool &                  io_bSyncOpen,       
00432                 AkFileDesc &            io_fileDesc         
00433                 ) = 0;
00434 
00478             virtual AKRESULT Open( 
00479                 AkFileID                in_fileID,          
00480                 AkOpenMode              in_eOpenMode,       
00481                 AkFileSystemFlags *     in_pFlags,          
00482                 bool &                  io_bSyncOpen,       
00483                 AkFileDesc &            io_fileDesc         
00484                 ) = 0;
00485         };
00486 
00488 
00489 
00490 
00491 
00492 
00493 
00494 
00495 
00496 
00497 
00498 
00499 
00500         AK_EXTERNAPIFUNC( IAkStreamMgr *, Create )( 
00501             const AkStreamMgrSettings & in_settings     
00502             );
00503 
00509         AK_EXTERNAPIFUNC( void, GetDefaultSettings )(
00510             AkStreamMgrSettings &       out_settings    
00511             );
00512 
00517         AK_EXTERNAPIFUNC( IAkFileLocationResolver *, GetFileLocationResolver )();
00518 
00522         AK_EXTERNAPIFUNC( void, SetFileLocationResolver )(
00523             IAkFileLocationResolver *   in_pFileLocationResolver 
00524             );
00525 
00532         AK_EXTERNAPIFUNC( AkMemPoolId, GetPoolID )();
00533 
00535 
00537 
00538 
00539 
00540 
00541 
00542 
00543 
00544 
00545 
00546 
00547 
00548 
00549 
00550 
00551 
00552 
00553 
00554 
00555 
00556 
00557 
00558         AK_EXTERNAPIFUNC( AkDeviceID, CreateDevice )(
00559             const AkDeviceSettings &    in_settings,        
00560             IAkLowLevelIOHook *         in_pLowLevelHook    
00561             );
00565         AK_EXTERNAPIFUNC( AKRESULT, DestroyDevice )(
00566             AkDeviceID                  in_deviceID         
00567             );
00568 
00575         AK_EXTERNAPIFUNC( void, GetDefaultDeviceSettings )(
00576             AkDeviceSettings &          out_settings        
00577             );
00579 
00581 
00582 
00583 
00584 
00585 
00586 
00587 
00588 
00589 
00590 
00591 
00592 
00593 
00594 
00595         AK_EXTERNAPIFUNC( AKRESULT, SetCurrentLanguage )(
00596             const AkOSChar *    in_pszLanguageName          
00597             );
00598 
00606         AK_EXTERNAPIFUNC( const AkOSChar *, GetCurrentLanguage )();
00607 
00615         AK_CALLBACK( void, AkLanguageChangeHandler )( 
00616             const AkOSChar * const in_pLanguageName,
00617             void * in_pCookie                       
00618             );
00619 
00626         AK_EXTERNAPIFUNC( AKRESULT, AddLanguageChangeObserver )(
00627             AkLanguageChangeHandler in_handler, 
00628             void * in_pCookie                   
00629             );
00630 
00637         AK_EXTERNAPIFUNC( void, RemoveLanguageChangeObserver )(
00638             void * in_pCookie                   
00639             );
00640 
00642 
00643 
00644 
00645 
00646 
00647         AK_EXTERNAPIFUNC( void, FlushAllCaches )();
00648         
00650     }
00651 }
00652 
00653 #endif //_AK_STREAM_MGR_MODULE_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