CMasterClock |
Purpose: Handles the system clock
used in a DirectMusic application
Remark: The returns values are based on the
DirectX9
constants except DM_FAILED.
The functions raise a CDMusicException
exception type with the error
data.
Member functions:
Function: Initialize
Declaration: HRESULT CMasterClock::Initialize(CDirectMusic &pDMusic)
Purpose: Initializes
the application Master Clock
Parameters:
pDMusic [in]: Reference to the main CDirectMusic object
Returns:
S_OK |
Succeeds |
Throws:
DM_FAILED | Error, see DirectMidi causes |
Function: GetNumClocks
Declaration: HRESULT CMasterClock::GetNumClocks()
Purpose:
Returns the number of current system clocks
Parameters:
None
Returns:
Number of clocks |
Number of clocks present. A value greater than 0 |
Throws:
DM_FAILED | Error, see DirectMidi causes |
E_INVALIDARG | Invalid argument. Often, this error results from failing to initialize the dwSize member of a structure before passing it to the method |
E_POINTER | An invalid pointer, usually NULL, was passed as a parameter |
E_NOINTERFACE | No object interface is available |
Function: GetClockInfo
Declaration: HRESULT CMasterClock::GetClockInfo(DWORD
dwNumClock, LPCLOCKINFO ClockInfo)
Purpose: Retrieves the clock
information from a given system clock identificator
Parameters:
dwNumClock [in]: Clock indentificator
ClockInfo [in]: Pointer to a given CLOCKINFO structure
Returns:
S_FALSE | There is no port with that index value |
S_OK |
Succeeds |
Throws:
DM_FAILED | Error, see DirectMidi causes |
E_INVALIDARG | Invalid argument. Often, this error results from failing to initialize the dwSize member of a structure before passing it to the method |
E_POINTER | An invalid pointer, usually NULL, was passed as a parameter |
E_NOINTERFACE | No object interface is available |
Function: GetReferenceClock
Declaration: IReferenceClock* CMasterClock::GetReferenceClock()
Purpose:
Returns a pointer to the internal IReferenceClock interface
Parameters: none
Returns:
IReferenceClock | Pointer to the IReferenceClock interface |
Function: ActivateMasterClock
Declaration: HRESULT CMasterClock::ActivateMasterClock(LPCLOCKINFO ClockInfo)
Purpose:
Activates a selected system clock as master clock, given a pointer to a
CLOCKINFO structure
Parameters:
ClockInfo [in]: Pointer to a given CLOCKINFO structure
Returns:
S_OK |
Succeeds |
Throws:
DM_FAILED | Error, see DirectMidi causes |
DMUS_E_PORTS_OPEN | The requested operation cannot be performed while there are instantiated ports in any process in the system |
E_POINTER | An invalid pointer, usually NULL, was passed as a parameter |
E_NOINTERFACE | No object interface is available |
Function: ReleaseMasterClock
Declaration: HRESULT CMasterClock::ReleaseMasterClock()
Purpose:
Releases the reference to a system clock
Parameters:
none
Returns:
S_OK |
Succeeds |