// -------------------------------------------------------------------------- // ========================================================================== // File: TDMus_SynthStats.CPP // Authors: BCB_Code_Generator v2.00, // Darren Dwyer (source code, documentation, demos, website), // Hugh Edwards (documentation, icons) // Description: This file contains the code for the TDMus_SynthStats // Component // // "TDx9_Music_Library v1.00" // (c) 2005 BCB-Tools.com Pty. Ltd., Sydney, Australia. // All Rights Reserved. // // Refer to the 'Licence.Txt' file for licencing & copyright information. // ========================================================================== // -------------------------------------------------------------------------- // #includes ... // -------------------------------------------------------------------------- #include #pragma hdrstop // -------------------------------------------------------------------------- #include "TDMus_SynthStats.H" // -------------------------------------------------------------------------- #pragma link "TDx_Library_Defns" #pragma link "TDx_Library_Functions" #pragma link "TDx9_Music_Library_Defns" #pragma link "TDx9_Music_Library_Functions" // -------------------------------------------------------------------------- // Object Registration... // -------------------------------------------------------------------------- #if (__BORLANDC__ >= 0x0530) // BCB Version 3+ #pragma package(smart_init) #endif // -------------------------------------------------------------------------- static inline void ValidCtrCheck(TDMus_SynthStats*) { new TDMus_SynthStats(NULL); } // -------------------------------------------------------------------------- namespace Tdmus_synthstats { #if (__BORLANDC__ >= 0x0530) // BCB Version 3+ void __fastcall PACKAGE Register() #else void __fastcall Register() #endif { TComponentClass classes[1] = {__classid(TDMus_SynthStats)}; RegisterComponents("", classes, 0); } } // -------------------------------------------------------------------------- // Constructor: TDMus_SynthStats::TDMus_SynthStats() // Description: The default constructor for the TDMus_SynthStats object. // -------------------------------------------------------------------------- __fastcall TDMus_SynthStats::TDMus_SynthStats(TComponent* Owner) : TComponent(Owner) { Clear(); } // -------------------------------------------------------------------------- // Destructor: TDMus_SynthStats::~TDMus_SynthStats() // Description: The destructor for the TDMus_SynthStats object. // -------------------------------------------------------------------------- __fastcall TDMus_SynthStats::~TDMus_SynthStats() { } // -------------------------------------------------------------------------- // Property: CPUPerVoice // Description: ... // -------------------------------------------------------------------------- dword __fastcall TDMus_SynthStats::FGetCPUPerVoice() { return fDMUS_SYNTHSTATS.dwCPUPerVoice; } // -------------------------------------------------------------------------- void __fastcall TDMus_SynthStats::FSetCPUPerVoice( dword pCPUPerVoice ) { fDMUS_SYNTHSTATS.dwCPUPerVoice = pCPUPerVoice; } // -------------------------------------------------------------------------- // Property: ErrorValue // Description: The ErrorValue property contains the last error value // returned from a call to a TDMus_SynthStats method or // fget/fset. eg. S_OK or DDERR_SURFACELOST or TDX_ERROR // -------------------------------------------------------------------------- HRESULT __fastcall TDMus_SynthStats::FGetErrorValue() { return fErrorValue; } // -------------------------------------------------------------------------- void __fastcall TDMus_SynthStats::FSetErrorValue( HRESULT pErrorValue ) { fErrorValue = pErrorValue; } // -------------------------------------------------------------------------- // Property: FreeMemory // Description: ... // -------------------------------------------------------------------------- dword __fastcall TDMus_SynthStats::FGetFreeMemory() { return fDMUS_SYNTHSTATS.dwFreeMemory; } // -------------------------------------------------------------------------- void __fastcall TDMus_SynthStats::FSetFreeMemory( dword pFreeMemory ) { fDMUS_SYNTHSTATS.dwFreeMemory = pFreeMemory; } // -------------------------------------------------------------------------- // Property: LostNotes // Description: ... // -------------------------------------------------------------------------- dword __fastcall TDMus_SynthStats::FGetLostNotes() { return fDMUS_SYNTHSTATS.dwLostNotes; } // -------------------------------------------------------------------------- void __fastcall TDMus_SynthStats::FSetLostNotes( dword pLostNotes ) { fDMUS_SYNTHSTATS.dwLostNotes = pLostNotes; } // -------------------------------------------------------------------------- // Property: PeakVolume // Description: ... // -------------------------------------------------------------------------- long __fastcall TDMus_SynthStats::FGetPeakVolume() { return fDMUS_SYNTHSTATS.lPeakVolume; } // -------------------------------------------------------------------------- void __fastcall TDMus_SynthStats::FSetPeakVolume( long pPeakVolume ) { fDMUS_SYNTHSTATS.lPeakVolume = pPeakVolume; } // -------------------------------------------------------------------------- // Property: Size // Description: The Size property contains the size in bytes of the internal // DMUS_SYNTHSTATS structure. // -------------------------------------------------------------------------- dword __fastcall TDMus_SynthStat::FGetSize() { return fSize; } // -------------------------------------------------------------------------- void __fastcall TDMus_SynthStat::FSetSize( dword pSize ) { fSize = pSize; } // -------------------------------------------------------------------------- // Property: SynthMemUse // Description: ... // -------------------------------------------------------------------------- dword __fastcall TDMus_SynthStats::FGetSynthMemUse() { return fDMUS_SYNTHSTATS.dwSynthMemUse; } // -------------------------------------------------------------------------- void __fastcall TDMus_SynthStats::FSetSynthMemUse( dword pSynthMemUse ) { fDMUS_SYNTHSTATS.dwSynthMemUse = pSynthMemUse; } // -------------------------------------------------------------------------- // Property: TotalCPU // Description: ... // -------------------------------------------------------------------------- dword __fastcall TDMus_SynthStats::FGetTotalCPU() { return fDMUS_SYNTHSTATS.dwTotalCPU; } // -------------------------------------------------------------------------- void __fastcall TDMus_SynthStats::FSetTotalCPU( dword pTotalCPU ) { fDMUS_SYNTHSTATS.dwTotalCPU = pTotalCPU; } // -------------------------------------------------------------------------- // Property: ValidStats // Description: ... // -------------------------------------------------------------------------- dword __fastcall TDMus_SynthStats::FGetValidStats() { return fDMUS_SYNTHSTATS.dwValidStats; } // -------------------------------------------------------------------------- void __fastcall TDMus_SynthStats::FSetValidStats( dword pValidStats ) { fDMUS_SYNTHSTATS.dwValidStats = pValidStats; } // -------------------------------------------------------------------------- // Property: Voices // Description: ... // -------------------------------------------------------------------------- dword __fastcall TDMus_SynthStats::FGetVoices() { return fDMUS_SYNTHSTATS.dwVoices; } // -------------------------------------------------------------------------- void __fastcall TDMus_SynthStats::FSetVoices( dword pVoices ) { fDMUS_SYNTHSTATS.dwVoices = pVoices; } // -------------------------------------------------------------------------- // Method: Clear() // Description: The Clear() method can be used to clear the contents of the // TDMus_SynthStats's internal DMUS_SYNTHSTATS structure. // Note: if you have manually linked a structure member to a // chunk of memory, make sure you release this memory before // calling Clear(). // -------------------------------------------------------------------------- void __fastcall TDMus_SynthStats::Clear() { fDMUS_SYNTHSTATS.dwCPUPerVoice = 0; fErrorValue = S_OK; fDMUS_SYNTHSTATS.dwFreeMemory = 0; fDMUS_SYNTHSTATS.dwLostNotes = 0; fDMUS_SYNTHSTATS.lPeakVolume = 0; fSize = sizeof(DMUS_SYNTHSTATS); fDMUS_SYNTHSTATS.dwSynthMemUse = 0; fDMUS_SYNTHSTATS.dwTotalCPU = 0; fDMUS_SYNTHSTATS.dwValidStats = 0; fDMUS_SYNTHSTATS.dwVoices = 0; } // -------------------------------------------------------------------------- // Internal Structure Access // -------------------------------------------------------------------------- DMUS_SYNTHSTATS* __fastcall TDMus_SynthStats::FGetInternal_DMUS_SYNTHSTATS_Ptr() { return &fDMUS_SYNTHSTATS; } // -------------------------------------------------------------------------- void __fastcall TDMus_SynthStats::FSetInternal_DMUS_SYNTHSTATS( DMUS_SYNTHSTATS* pDMUS_SYNTHSTATS ) { if (pDMUS_SYNTHSTATS==NULL) { fErrorValue = TDX_ERROR; if (FOnError) FOnError(this, "TDMus_SynthStats::FSetInternal_DMUS_SYNTHSTATS()", "TDX_ERROR", "The supplied DMUS_SYNTHSTATS* was NULL" ); return; } CopyMemory( &fDMUS_SYNTHSTATS, pDMUS_SYNTHSTATS, sizeof(DMUS_SYNTHSTATS) ); Internal_DMUS_SYNTHSTATS_Update(); } // -------------------------------------------------------------------------- void __fastcall TDMus_SynthStats::Internal_DMUS_SYNTHSTATS_Update() { } // --------------------------------------------------------------------------