Notifying threads about TPlayer events

Threads can request notification of TPlayer events such as the completion of a play or record operation. This is useful when you don't want to block the calling thread during a play or record operation, or when another thread needs to take an action when a play or record operation completes.

NOTE When you do want to block the calling thread until the player finishes, use TPlayer::WaitUntilComplete.

When you want to be notified when an audio player finishes playing or recording a sequence, you:

  1. Create a notification connection object.
  2. Call CreateStoppedInterest on the TPlayer.
  3. Add the stop interest to the connection object.
  4. Specify the member function to be called when the connection receives notifications with that interest.
  5. Call Connect on the connection object.
When playback or recording is complete, classes derived from TPlayer call NotifyOfStopped, notifying any threads that have requested stop notification. (Refer to Desktop Frameworks Concepts for more information about using notification in the CommonPoint application system.)


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker