DirectX SDK

DMUS_NOTIFICATION_PMSG

The DMUS_NOTIFICATION_PMSG structure is a DMUS_PMSG that represents a notification.

typedef struct DMUS_NOTIFICATION_PMSG {
    DMUS_PMSG_PART
    GUID   guidNotificationType;
    DWORD  dwNotificationOption;
    DWORD  dwField1;
    DWORD  dwField2;
} DMUS_NOTIFICATION_PMSG;
DMUS_PMSG_PART
Macro for common message members. See DMUS_PMSG.
guidNotificationType
Identifier of the notification type. The following types are defined:
GUID_NOTIFICATION_CHORD
Chord change.
GUID_NOTIFICATION_COMMAND
Command event.
GUID_NOTIFICATION_MEASUREANDBEAT
Measure and beat event.
GUID_NOTIFICATION_PERFORMANCE
Performance event, further defined in dwNotificationOption.
GUID_NOTIFICATION_SEGMENT
Segment event, further defined in dwNotificationOption.
dwNotificationOption
Identifier of the notification subtype.

If the notification type is GUID_NOTIFICATION_SEGMENT, this member can contain one of the following values:

DMUS_NOTIFICATION_SEGABORT
The segment was stopped by IDirectMusicPerformance::Stop.
DMUS_NOTIFICATION_SEGALMOSTEND
The segment has reached the end minus the prepare time.
DMUS_NOTIFICATION_SEGEND
The segment has ended.
DMUS_NOTIFICATION_SEGLOOP
The segment has looped.
DMUS_NOTIFICATION_SEGSTART
The segment has started.

If the notification type is GUID_NOTIFICATION_COMMAND, this member can contain one of the following values:

DMUS_NOTIFICATION_GROOVE
Groove change.
DMUS_NOTIFICATION_EMBELLISHMENT
Embellishment command (intro, fill, break, or end).

If the notification type is GUID_NOTIFICATION_PERFORMANCE, this member can contain one of the following values:

DMUS_NOTIFICATION_MUSICSTARTED
Playback has started.
DMUS_NOTIFICATION_MUSICSTOPPED
Playback has stopped.

If the notification type is GUID_NOTIFICATION_MEASUREANDBEAT, this member contains DMUS_NOTIFICATION_MEASUREBEAT. No other subtypes are defined.

If the notification type is GUID_NOTIFICATION_CHORD, this member contains DMUS_NOTIFICATION_CHORD. No other subtypes are defined.

dwField1
Extra data specific to the type of notification. For GUID_NOTIFICATION_MEASUREANDBEAT notifications, this member returns the beat number within the measure.
dwField2
Extra data specific to the type of notification. Reserved for future or application-defined use.

Remarks

For most notifications, the punkUser member (see DMUS_PMSG) contains the IUnknown pointer of the segment state. This is especially useful in the cases of chords and commands, in which you can query for the IDirectMusicSegmentState interface, call IDirectMusicSegmentState::GetSegment to get the IDirectMusicSegment pointer, and then call the IDirectMusicSegment::GetParam method to get the chord or command at the time given in the notification message's mtTime member.

For notifications of type GUID_NOTIFICATION_PERFORMANCE, the punkUser member is always NULL.

Applications can define their own notification message types and subtypes and use dwField1 and dwField2 for extra data. Such custom notification messages can be allocated and sent like any other message. Application-defined tracks can send messages of a particular type after the GUID (guidNotificationType) has been handed to IDirectMusicTrack::AddNotificationType.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Header: Declared in dmusici.h.

See Also

Notification and Event Handling, IDirectMusicPerformance::SendPMsg