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: 
  

Returns:

S_OK

Succeeds

Throws:

DM_FAILED Error, see DirectMidi causes

Top    Index


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

Top    Index


Function: GetClockInfo
Declaration: HRESULT CMasterClock::GetClockInfo(DWORD dwNumClock, LPCLOCKINFO ClockInfo)
Purpose:
Retrieves the clock information from a given system clock identificator
Parameters: 
  

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

Top    Index


Function: GetReferenceClock
Declaration: IReferenceClock* CMasterClock::GetReferenceClock()
Purpose:
Returns a pointer to the internal IReferenceClock interface
Parameters: 
 none

Returns:

IReferenceClock Pointer to the IReferenceClock interface

Top    Index


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: 
  

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

Top    Index


Function: ReleaseMasterClock
Declaration: HRESULT CMasterClock::ReleaseMasterClock()
Purpose:
Releases the reference to a system clock 
Parameters: 
  none

Returns:

S_OK

Succeeds

Top    Index