CSegment


Purpose:
It represents a segment, which is a playable unit of data made up of multiple tracks
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: ConnectToDLS
Declaration: HRESULT CSegment::ConnectToDLS(CCollection &Collection)
Purpose:  Connects all bands in the track to a DLS collection  
Parameters:    

Returns:  

S_OK

Succeeds

Throws:

DMUS_E_SET_UNSUPPORTED Setting the parameter is not supported.
DM_FAILED Error, see DirectMidi causes
DMUS_E_TRACK_NOT_FOUND There is no track of the requested type

Top    Index

Function: Download
Declaration: HRESULT CSegment::Download(CPerformance &Performance)
Purpose:  Downloads band data to a performance 
Parameters:    

               
Remarks: This object keeps a list of all current performances where the segment has been downloaded

Returns:  

S_OK

Succeeds

Throws:

DMUS_E_NOT_FOUND The requested item is not contained by the object
DM_FAILED Error, see DirectMidi causes
E_POINTER An invalid pointer, usually NULL, was passed as a parameter
DMUS_E_TRACK_NOT_FOUND There is no track of the requested type

Top    Index

Function: GetDefaultResolution
Declaration: HRESULT CSegment::GetDefaultResolution(DWORD *pdwResolution)
Purpose:  Retrieves the default resolution of the segment. This is the value used to determine how times such as the segment start time are adjusted for synchronization with the rhythm
Parameters:    

Value Description
DMUS_SEGF_MEASURE Resolve times to next measure.
DMUS_SEGF_BEAT Resolve times to next beat.
DMUS_SEGF_GRID Resolve times to next grid.


Returns:  

S_OK

Succeeds

Throws:

DM_FAILED Error, see DirectMidi causes
E_POINTER An invalid pointer, usually NULL, was passed as a parameter

Top    Index

Function: GetLength
Declaration: HRESULT CSegment::GetLength(MUSIC_TIME *pmtLength)
Purpose:  Retrieves the length of the segment
Parameters:   

Returns:  

S_OK

Succeeds

Throws:

DM_FAILED Error, see DirectMidi causes
E_POINTER An invalid pointer, usually NULL, was passed as a parameter

Top    Index

Function: GetLoopPoints
Declaration: HRESULT CSegment::GetLoopPoints(MUSIC_TIME *pmtStart,MUSIC_TIME *pmtEnd)
Purpose:  Retrieves the start and end loop points
Parameters:   

Returns:  

S_OK

Succeeds

Throws:

DM_FAILED Error, see DirectMidi causes
E_POINTER An invalid pointer, usually NULL, was passed as a parameter

Top    Index

Function: GetRepeats
Declaration: HRESULT CSegment::GetRepeats(DWORD *pdwRepeats)
Purpose: Retrieves the number of times the looping portion of the segment is set to repeat
Parameters:    

Returns:  

S_OK

Succeeds

Throws:

DM_FAILED Error, see DirectMidi causes
E_POINTER An invalid pointer, usually NULL, was passed as a parameter

Top    Index

Function: GetSeek
Declaration: HRESULT CSegment::GetSeek(MUSIC_TIME *pmtSeek)
Purpose: This method retrieves the seek pointer in the segment
Parameters:   

Returns:  

S_OK

Succeeds

Throws:

DM_FAILED Error, see DirectMidi causes
E_POINTER An invalid pointer, usually NULL, was passed as a parameter

Top    Index

Function: GetSegment
Declaration: HRESULT CSegment::GetSegment(IDirectMusicSegment **ppSegment)
Purpose: Retrieves a pointer to the segment interface that owns this segment 
Parameters:   

Returns:  

S_OK

Succeeds

Throws:

DMUS_E_NOT_FOUND The requested item is not contained by the object
DM_FAILED Error, see DirectMidi causes
E_POINTER An invalid pointer, usually NULL, was passed as a parameter

Top    Index

Function: GetStartPoint
Declaration: HRESULT CSegment::GetStartPoint(MUSIC_TIME *pmtStart)
Purpose: Retrieves the time within the segment at which it started playing
Parameters:    

Returns:  

S_OK

Succeeds

Throws:

DM_FAILED Error, see DirectMidi causes
E_POINTER An invalid pointer, usually NULL, was passed as a parameter

Top    Index

Function: GetStartTime
Declaration: HRESULT CSegment::GetStartTime(MUSIC_TIME *pmtStart)
Purpose: Retrieves the performance time at which the segment started playing
Parameters:   

Returns:  

S_OK

Succeeds

Throws:

DM_FAILED Error, see DirectMidi causes
E_POINTER An invalid pointer, usually NULL, was passed as a parameter

Top    Index

Function: ReleaseSegment
Declaration: HRESULT CSegment::ReleaseSegment()
Purpose: Releases the segment. Unloads the segment from all downloaded performances
Parameters:    none

Returns:  

S_FALSE Error
S_OK

Succeeds

Top    Index

Function: SetDefaultResolution
Declaration: HRESULT CSegment::SetDefaultResolution(DWORD dwResolution)
Purpose: Sets the default resolution of the segment
Parameters:   


Remarks: This method is used primarily by secondary segments to specify whether they are synchronized to the measure, beat, or grid of the primary segment by default.

Value Description
DMUS_SEGF_MEASURE Resolve times to next measure.
DMUS_SEGF_BEAT Resolve times to next beat.
DMUS_SEGF_GRID Resolve times to next grid.

Returns:  

S_OK

Succeeds

Throws:

DM_FAILED Error, see DirectMidi causes

Top    Index

Function: SetLength
Declaration: HRESULT CSegment::SetLength(MUSIC_TIME mtLength)
Purpose: Sets the default resolution of the segment
Parameters:   


Returns:
 

S_OK

Succeeds

Throws:

DMUS_E_OUT_OF_RANGE The requested time is outside the range of the segment
E_INVALIDARG Invalid argument. Often, this error results from failing to initialize the dwSize member of a structure before passing it to the method
DM_FAILED Error, see DirectMidi causes

Top    Index

Function: SetLoopPoints
Declaration: HRESULT CSegment::SetLoopPoints(MUSIC_TIME mtStart,MUSIC_TIME mtEnd)
Purpose: This method sets the start and end points of the part of the segment that repeats the number of times set by the CSegment::SetRepeats method
Parameters:   


Returns:
 

S_OK

Succeeds

Throws:

DMUS_E_OUT_OF_RANGE The requested time is outside the range of the segment
DM_FAILED Error, see DirectMidi causes

Top    Index

Function: SetPChannelsUsed
Declaration: HRESULT CSegment::SetPChannelsUsed(DWORD dwNumPChannels,DWORD *paPChannels)
Purpose: This method sets the performance channels that this segment uses
Parameters:   


Returns:  

S_OK

Succeeds

Throws:

E_POINTER An invalid pointer, usually NULL, was passed as a parameter.
E_OUTOFMEMORY Insufficient memory to complete the task
E_INVALIDARG Invalid argument. Often, this error results from failing to initialize the dwSize member of a structure before passing it to the method
DM_FAILED Error, see DirectMidi causes

Top    Index

Function: SetRepeats
Declaration: HRESULT CSegment::SetRepeats(DWORD dwRepeats)
Purpose: This method sets the number of times the looping portion of the segment is to repeat
Parameters:  

          
Returns:  

S_OK

Succeeds

Throws:

DM_FAILED Error, see DirectMidi causes

Top    Index

Function: SetStartPoint
Declaration: HRESULT CSegment::SetStartPoint(MUSIC_TIME mtStart)
Purpose: This method sets the point within the segment at which it starts playing
Parameters:   


Returns:  

S_OK

Succeeds

Throws:

DMUS_E_OUT_OF_RANGE The requested time is outside the range of the segment
DM_FAILED Error, see DirectMidi causes

Top    Index

Function: Unload
Declaration: HRESULT CSegment::Unload(CPerformance &Performance)
Purpose: Unloads a segment from a performance
Parameters:   

Remarks: The performance is removed from the download list

Returns:
 

S_OK

Succeeds

Throws:

DMUS_E_TRACK_NOT_FOUND There is no track of the requested type
E_POINTER An invalid pointer, usually NULL, was passed as a parameter
DM_FAILED Error, see DirectMidi causes

Top    Index

Function: UnloadAllPerformances
Declaration: HRESULT CSegment::UnloadAllPerformances()
Purpose: Unloads the references to a segment in all downloaded performances
Parameters:  none 

Returns:
 

S_OK

Succeeds

Top    Index

Function: operator = (CSegment &Segment)
Declaration: CSegment& CSegment::operator = (const CSegment &Segment)
Purpose:  Clones a segment to another CSegment object
Parameters:   

Returns:  

CSegment A cloned CSement

Throws:

DM_FAILED Error, see DirectMidi causes
E_POINTER An invalid pointer, usually NULL, was passed as a parameter
E_OUTOFMEMORY Insufficient memory to complete the task

Top    Index