Version

menu_open

include/AK/Wwise/AudioPlugin.h

Go to the documentation of this file.
00001 /*******************************************************************************
00002 The content of this file includes portions of the AUDIOKINETIC Wwise Technology
00003 released in source code form as part of the SDK installer package.
00004 
00005 Commercial License Usage
00006 
00007 Licensees holding valid commercial licenses to the AUDIOKINETIC Wwise Technology
00008 may use this file in accordance with the end user license agreement provided 
00009 with the software or, alternatively, in accordance with the terms contained in a
00010 written agreement between you and Audiokinetic Inc.
00011 
00012 Apache License Usage
00013 
00014 Alternatively, this file may be used under the Apache License, Version 2.0 (the 
00015 "Apache License"); you may not use this file except in compliance with the 
00016 Apache License. You may obtain a copy of the Apache License at 
00017 http://www.apache.org/licenses/LICENSE-2.0.
00018 
00019 Unless required by applicable law or agreed to in writing, software distributed
00020 under the Apache License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
00021 OR CONDITIONS OF ANY KIND, either express or implied. See the Apache License for
00022 the specific language governing permissions and limitations under the License.
00023 
00024   Version: <VERSION>  Build: <BUILDNUMBER>
00025   Copyright (c) <COPYRIGHTYEAR> Audiokinetic Inc.
00026 *******************************************************************************/
00027 
00030 
00031 #ifndef _AK_WWISE_AUDIOPLUGIN_H
00032 #define _AK_WWISE_AUDIOPLUGIN_H
00033 
00034 #include "Undo.h"
00035 
00036 #include <AK/Wwise/Utilities.h>
00037 #include <AK/SoundEngine/Common/AkSoundEngine.h> 
00038 #include <AK/Wwise/PlatformID.h>
00039 
00040 #include <float.h>
00041 
00042 // Audiokinetic namespace
00043 namespace AK
00044 {
00045     class IXmlTextReader;
00046     class IXmlTextWriter;
00047 
00048     // Audiokinetic Wwise namespace
00049     namespace Wwise
00050     {
00051         class IPluginMediaConverter
00052         {
00053         public:
00058             virtual ConversionResult ConvertFile( 
00059                 const GUID & in_guidPlatform,                   
00060                 const BasePlatformID & in_basePlatform,         
00061                 LPCWSTR in_szSourceFile,                        
00062                 LPCWSTR in_szDestFile,                          
00063                 AkUInt32 in_uSampleRate,                        
00064                 AkUInt32 in_uBlockLength,                       
00065                 AK::Wwise::IProgress* in_pProgress,             
00066                 IWriteString* io_pError                         
00067                 ) = 0;
00068 
00069             virtual ULONG GetCurrentConversionSettingsHash(
00070                 const GUID & in_guidPlatform,           
00071                 AkUInt32 in_uSampleRate = 0,            
00072                 AkUInt32 in_uBlockLength = 0            
00073                 ) = 0;
00074         };
00075 
00085         class IPluginPropertySet
00086         {
00087         public:
00092             virtual bool GetValue( 
00093                 const GUID & in_guidPlatform,   
00094                 LPCWSTR in_pszPropertyName,     
00095                 VARIANT & out_varProperty       
00096                 ) = 0;
00097             
00100             virtual bool SetValue( 
00101                 const GUID & in_guidPlatform,   
00102                 LPCWSTR in_pszPropertyName,     
00103                 const VARIANT & in_varProperty  
00104                 ) = 0;
00105 
00108             virtual bool PropertyHasRTPC(
00109                 LPCWSTR in_pszPropertyName      
00110                 ) = 0;
00111 
00117             virtual GUID GetCurrentPlatform() = 0;
00118 
00121             virtual BasePlatformID GetCurrentBasePlatform() = 0;
00122 
00124             virtual BasePlatformID GetDefaultNativeAuthoringPlaybackPlatform() = 0;
00125 
00127             virtual GUID GetAuthoringPlaybackPlatform() = 0;
00128 
00134             virtual void NotifyInternalDataChanged(AkPluginParamID in_idData) = 0;
00135 
00139             virtual bool CanLogUndos() = 0;
00140 
00143             virtual AK::Wwise::IUndoManager * GetUndoManager() = 0;
00144 
00146             virtual void GetLicenseStatus(
00147                 const GUID & in_guidPlatform,           
00148                 AK::Wwise::LicenseType & out_eType,     
00149                 AK::Wwise::LicenseStatus & out_eStatus, 
00150                 UINT32 & out_uDaysToExpiry              
00151                 ) = 0;
00152 
00154             virtual void GetAssetLicenseStatus( 
00155                 const GUID & in_guidPlatform,           
00156                 AkUInt32 in_uAssetID,                   
00157                 AK::Wwise::LicenseType & out_eType,     
00158                 AK::Wwise::LicenseStatus & out_eStatus, 
00159                 UINT32 & out_uDaysToExpiry              
00160                 ) = 0;
00161         };
00162 
00172         class IPluginObjectStore
00173         {
00174         public:
00178             virtual void InsertObject( 
00179                 LPCWSTR in_pszListName,
00180                 unsigned int in_uiIndex,
00181                 IPluginPropertySet* in_pPropertySet
00182                 ) = 0;
00183             
00187             virtual bool RemoveObject( 
00188                 IPluginPropertySet* in_pPropertySet
00189                 ) = 0;
00190 
00193             virtual IPluginPropertySet* GetObject( 
00194                 LPCWSTR in_pszListName,
00195                 unsigned int in_uiIndex
00196                 ) const = 0;
00197 
00200             virtual unsigned int GetObjectCount( 
00201                 LPCWSTR in_pszListName
00202                 ) const = 0;
00203 
00207             virtual IPluginPropertySet* CreateObject( 
00208                 LPCWSTR in_pszType
00209                 ) = 0;
00210 
00213             virtual void DeleteObject( 
00214                 IPluginPropertySet* in_pPropertySet
00215                 ) = 0;
00216 
00219             virtual unsigned int GetListCount() const = 0;
00220 
00224             virtual unsigned int GetListName( 
00225                 unsigned int in_uiListIndex,
00226                 LPWSTR out_pszListName,
00227                 unsigned int in_uiBufferSize
00228                 ) const = 0;
00229         };
00230 
00236         class IPluginObjectMedia
00237         {
00238         public:
00239             
00241             virtual bool SetMediaSource( 
00242                 LPCWSTR in_pszFilePathToImport, 
00243                 unsigned int in_Index = 0,      
00244                 bool in_bReplace = false        
00245                 ) = 0;
00246 
00248             virtual void RemoveMediaSource( 
00249                 unsigned int in_Index = 0   
00250                 ) = 0;
00251 
00254             virtual unsigned int GetMediaSourceCount() const = 0;
00255 
00260             virtual unsigned int GetMediaSourceFileName(
00261                 LPWSTR out_pszFileName,         
00262                 unsigned int in_uiBufferSize,   
00263                 unsigned int in_Index = 0       
00264                 ) const = 0;
00265 
00268             virtual unsigned int GetMediaSourceOriginalFilePath(
00269                 LPWSTR out_pszFileName,         
00270                 unsigned int in_uiBufferSize,   
00271                 unsigned int in_Index = 0       
00272                 ) const = 0;
00273 
00276             virtual unsigned int GetMediaSourceConvertedFilePath(
00277                 LPWSTR out_pszFileName,         
00278                 unsigned int in_uiBufferSize,   
00279                 const GUID & in_guidPlatform,   
00280                 unsigned int in_Index = 0       
00281                 ) const = 0;
00282 
00284             virtual void InvalidateMediaSource( unsigned int in_Index = 0 ) = 0;
00285 
00288             virtual unsigned int GetOriginalDirectory(
00289                 LPWSTR out_pszDirectory,        
00290                 unsigned int in_uiBufferSize    
00291                 ) const = 0;
00292 
00295             virtual unsigned int GetConvertedDirectory(
00296                 LPWSTR out_pszDirectory,        
00297                 unsigned int in_uiBufferSize,   
00298                 const GUID & in_guidPlatform    
00299                 ) const = 0;
00300         };
00301 
00307         class IAudioPlugin
00308             : public IPluginBase
00309         {
00310         public:
00316             enum eDialog
00317             {
00318                 SettingsDialog,         
00319 
00320 
00321                 ContentsEditorDialog    
00322 
00323             };
00324 
00326             enum NotifyInnerObjectOperation
00327             {
00328                 InnerObjectAdded,
00329                 InnerObjectRemoved
00330             };
00331 
00337             virtual void SetPluginPropertySet( 
00338                 IPluginPropertySet * in_pPSet   
00339                 ) = 0;
00340 
00347             virtual void SetPluginObjectStore( 
00348                 IPluginObjectStore * in_pObjectStore 
00349                 ) = 0;
00350 
00361             virtual void SetPluginObjectMedia( 
00362                 IPluginObjectMedia * in_pObjectMedia
00363                 ) = 0;
00364 
00368             virtual bool IsPlayable() const = 0;
00369 
00374             virtual void InitToDefault() = 0;
00375 
00379             virtual void Delete() = 0;
00380 
00383             virtual bool Load( IXmlTextReader* in_pReader ) = 0;
00384 
00387             virtual bool Save( IXmlTextWriter* in_pWriter ) = 0;
00388 
00393             virtual bool CopyInto(
00394                 IAudioPlugin* io_pWObject        // The object that will receive the custom data of this object.
00395                 ) const = 0;
00396 
00401             virtual void NotifyCurrentPlatformChanged( 
00402                 const GUID & in_guidCurrentPlatform     
00403                 ) = 0;
00404 
00411             virtual void NotifyPropertyChanged( 
00412                 const GUID & in_guidPlatform,   
00413                 LPCWSTR in_pszPropertyName      
00414                 ) = 0;
00415 
00423             virtual void NotifyInnerObjectPropertyChanged( 
00424                 IPluginPropertySet* in_pPSet,   
00425                 const GUID & in_guidPlatform,   
00426                 LPCWSTR in_pszPropertyName      
00427                 ) = 0;
00428 
00435             virtual void NotifyInnerObjectAddedRemoved( 
00436                 IPluginPropertySet* in_pPSet,   
00437                 unsigned int in_uiIndex,        
00438                 NotifyInnerObjectOperation in_eOperation    
00439                 ) = 0;
00440 
00449             virtual void NotifyPluginMediaChanged() = 0;
00450 
00459             virtual bool GetBankParameters( 
00460                 const GUID & in_guidPlatform,   
00461                 IWriteData* in_pDataWriter      
00462                 ) const = 0;
00463 
00474             virtual bool GetPluginData(
00475                 const GUID & in_guidPlatform,       
00476                 AkPluginParamID in_idParam, 
00477                 IWriteData* in_pDataWriter          
00478                 ) const = 0;
00479 
00485             virtual HINSTANCE GetResourceHandle() const = 0;
00486 
00493             virtual bool GetDialog( 
00494                 eDialog in_eDialog,             
00495                 UINT & out_uiDialogID,          
00496                 PopulateTableItem *& out_pTable 
00497                 ) const = 0;
00498 
00504             virtual bool WindowProc( 
00505                 eDialog in_eDialog,     
00506                 HWND in_hWnd,           
00507                 UINT in_message,        
00508                 WPARAM in_wParam,       
00509                 LPARAM in_lParam,       
00510                 LRESULT & out_lResult   
00511                 ) = 0;
00512 
00522             virtual bool DisplayNameForProp( 
00523                 LPCWSTR in_pszPropertyName,     
00524                 LPWSTR out_pszDisplayName,      
00525                 UINT in_unCharCount             
00526                 ) const = 0;
00527 
00543             virtual bool DisplayNamesForPropValues( 
00544                 LPCWSTR in_pszPropertyName,     
00545                 LPWSTR out_pszValuesName,       
00546                 UINT in_unCharCount             
00547                 ) const = 0;
00548 
00554             virtual bool Help( 
00555                 HWND in_hWnd,                   
00556                 eDialog in_eDialog,             
00557                 LPCWSTR in_szLanguageCode       
00558                 ) const = 0;
00559 
00563             virtual void NotifyMonitorData( 
00564                 void * in_pData,                
00565                 unsigned int in_uDataSize,      
00566                 bool in_bNeedsByteSwap          
00567                 ) = 0;
00568 
00571             virtual IPluginMediaConverter* GetPluginMediaConverterInterface() = 0;
00572 
00578             virtual AK::Wwise::LicenseStatus GetLicenseStatus(
00579                 const GUID & in_guidPlatform,       
00580                 AK::Wwise::Severity& out_eSeverity, 
00581                 LPWSTR out_pszMessage,              
00582                 unsigned int in_uiBufferSize        
00583                 ) = 0;
00584 
00587             virtual bool GetSourceDuration(
00588                 double& out_dblMinDuration, 
00589                 double& out_dblMaxDuration  
00590                 ) const = 0;
00591         };
00592 
00594         class DefaultAudioPluginImplementation : public IAudioPlugin
00595         {
00596         public:
00597             virtual void SetPluginPropertySet( IPluginPropertySet * in_pPSet ){}
00598             virtual void SetPluginObjectStore( IPluginObjectStore * in_pObjectStore ){}
00599             virtual void SetPluginObjectMedia( IPluginObjectMedia * in_pObjectMedia ){}
00600             virtual bool IsPlayable() const { return true; }
00601             virtual void InitToDefault() {}
00602             virtual void Delete() {}
00603             virtual bool Load( IXmlTextReader* in_pReader ) { return false; }
00604             virtual bool Save( IXmlTextWriter* in_pWriter ) { return false; }
00605             virtual bool CopyInto( IAudioPlugin* io_pWObject ) const { return true; }
00606             virtual void NotifyCurrentPlatformChanged( const GUID & in_guidCurrentPlatform ) {}
00607             virtual void NotifyPropertyChanged( const GUID & in_guidPlatform, LPCWSTR in_pszPropertyName ) {}
00608             virtual void NotifyInnerObjectPropertyChanged( IPluginPropertySet* in_pPSet, const GUID & in_guidPlatform, LPCWSTR in_pszPropertyName ) {}
00609             virtual void NotifyInnerObjectAddedRemoved( IPluginPropertySet* in_pPSet, unsigned int in_uiIndex, NotifyInnerObjectOperation in_eOperation ) {}
00610             virtual void NotifyPluginMediaChanged() {}
00611             virtual bool GetBankParameters( const GUID & in_guidPlatform, IWriteData* in_pDataWriter ) const { return false; }
00612             virtual bool GetPluginData( const GUID & in_guidPlatform, AkPluginParamID in_idParam, IWriteData* in_pDataWriter ) const { return false; }
00613             virtual bool WindowProc( eDialog in_eDialog, HWND in_hWnd, UINT in_message, WPARAM in_wParam, LPARAM in_lParam, LRESULT & out_lResult ){ return false; }
00614             virtual bool DisplayNameForProp( LPCWSTR in_pszPropertyName, LPWSTR out_pszDisplayName, UINT in_unCharCount ) const { return false; }
00615             virtual bool DisplayNamesForPropValues( LPCWSTR in_pszPropertyName, LPWSTR out_pszValuesName, UINT in_unCharCount ) const { return false; }
00616             virtual bool Help( HWND in_hWnd, eDialog in_eDialog, LPCWSTR in_szLanguageCode ) const { return false; }
00617             virtual void NotifyMonitorData( void * in_pData, unsigned int in_uDataSize, bool in_bNeedsByteSwap ){}
00618             virtual IPluginMediaConverter* GetPluginMediaConverterInterface() { return NULL; }
00619             virtual AK::Wwise::LicenseStatus GetLicenseStatus(const GUID &, AK::Wwise::Severity&, LPWSTR, unsigned int in_uiBufferSize){ return AK::Wwise::LicenseStatus_Valid; }
00620             virtual bool GetSourceDuration( double& out_dblMinDuration, double& out_dblMaxDuration ) const { out_dblMinDuration = 0.f; out_dblMaxDuration = FLT_MAX; return false; }
00621         };
00622 
00623         typedef AKRESULT(CALLBACK* RegisterWwisePluginFn)(AK::PluginRegistration *in_pList);
00624         inline AKRESULT RegisterWwisePlugin()
00625         {
00626             if (!g_pAKPluginList)
00627             {
00628                 AKASSERT(!"g_pAKPluginList is NULL. Did you use the AK_STATIC_LINK_PLUGIN macro in your DLL?"); // Should be populated by now.
00629                 return AK_Fail;
00630             }
00631 
00632             HMODULE hLib = ::LoadLibrary(L"WwiseSoundEngine.dll");
00633             if (hLib == NULL)
00634                 return AK_Fail;
00635 
00636             RegisterWwisePluginFn pReg = (RegisterWwisePluginFn)::GetProcAddress(hLib, "RegisterWwisePlugin");
00637             if (pReg == NULL)
00638                 return AK_Fail;
00639 
00640             return pReg(g_pAKPluginList);
00641         }
00642     }
00643 }
00644 
00647 #define WM_AK_PRIVATE_SHOW_HELP_TOPIC   0x4981
00648 
00649 #endif // _AK_WWISE_AUDIOPLUGIN_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