Class: TMediaPresenter

Declaration: MediaUI.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TGUIPresenter

Inherited By:

None.

Purpose:

TMediaPresenter is derived from TGUIPresenter. This class provides the single media player abstraction and understands how to playback all media types. TMediaPresenter processes all actions sent from the player controls via the media view. Note that the TMediaPresenter constructor takes a pointer to a polymorphic TPlayer or TGUIBundle. TMediaPresenter creates and manages the media presentation. It exports the TPlayer protocol, processes all actions that are sent by the player controls, and provides accessor member functions for the player object.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

None.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Other Considerations:

None.

Member Function: TMediaPresenter::TMediaPresenter

  1. TMediaPresenter (TPlayer * playerToAdopt)
  2. TMediaPresenter (const TGUIBundle &)
  3. TMediaPresenter ()

Interface Category:

API.

Purpose:

  1. Constructs a TMediaPresenter object from a pointer to a TPlayer object.
  2. Constructs a TMediaPresenter object from a reference to a TGUIBundle.
  3. Default constructor.

Calling Context:

  1. Called to construct a TMediaPresenter from a TPlayer.
  2. Called to construct a TMediaPresenter from a TGUIBundle. This constructor is called when the presenter is used in a Document framework context; that is, when it is created by the presenter state. Normally, the presenter is constructed from a TPlayer.
  3. Called by the stream-in operators and derived classes only.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMediaPresenter::~TMediaPresenter

virtual ~ TMediaPresenter ()

Interface Category:

API.

Purpose:

Destructor.

Calling Context:

Called to destroy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMediaPresenter::Hash

virtual long Hash () const

Interface Category:

API.

Purpose:

Returns the hash value that uniquely identifies this object within its type. Hash values are used to build dictionaries of objects.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the hash value that uniquely identifies this object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMediaPresenter::operator==

bool operator ==(const TMediaPresenter &) const

Interface Category:

API.

Purpose:

Tests for equality between the specified TMediaPresenter object and this TMediaPresenter object.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if both objects are equal; otherwise, returns false.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMediaPresenter::operator!=

bool operator != (const TMediaPresenter &) const

Interface Category:

API.

Purpose:

Tests for inequality between the specified TMediaPresenter object and this TMediaPresenter object.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if both objects are different; otherwise, returns false.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMediaPresenter::operator>>=

virtual TStream & operator >>=(TStream &) const

Interface Category:

API.

Purpose:

Stream-out operator.

Calling Context:

Called to stream out data.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself out to.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMediaPresenter::operator<<=

virtual TStream & operator <<= (TStream &)

Interface Category:

API.

Purpose:

Stream-in operator.

Calling Context:

Called to stream in data.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself in from.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMediaPresenter::SetVolume

virtual void SetVolume (const float &)

Interface Category:

API.

Purpose:

Sets the volume of the media presentation to the new value.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMediaPresenter::Play

virtual void Play ()

Interface Category:

API.

Purpose:

Starts the media presentation playback by the media player. This is part of the TPlayer protocol.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMediaPresenter::Stop

virtual void Stop ()

Interface Category:

API.

Purpose:

Stops the media presentation playback by the media player. This is part of the TPlayer protocol.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMediaPresenter::Record

virtual void Record ()

Interface Category:

API.

Purpose:

Records the media presentation by the media player or presenter. This is part of the TPlayer protocol.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMediaPresenter::IsRecordable

virtual bool IsRecordable () const

Interface Category:

API.

Purpose:

Returns a Boolean value that indicates whether the media player can record the media presentation. This is part of the TPlayer protocol.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if it is possible to record the media presentation; otherwise, returns false.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMediaPresenter::IsPlaying

virtual bool IsPlaying () const

Interface Category:

API.

Purpose:

Indicates whether the media player is currently playing a media sequence. This is part of the TPlayer protocol.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if the media presenter is currently playing a media sequence; otherwise, returns false.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMediaPresenter::CreatePlayer

virtual void CreatePlayer()

Interface Category:

API.

Purpose:

Creates the media player for the media presenter.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMediaPresenter::IsSyncable

virtual bool IsSyncable() const

Interface Category:

API.

Purpose:

Indicates whether the media player supports synchronization.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if the media presenter object is currently able to be synchronized; otherwise, returns false.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMediaPresenter::IsRecording

virtual bool IsRecording () const

Interface Category:

API.

Purpose:

Tests if the media player is currently recording a media sequence. This is part of the TPlayer protocol.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if the media presenter object is currently in recording mode; otherwise, returns false.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMediaPresenter::WaitUntilComplete

virtual void WaitUntilComplete ()

Interface Category:

API.

Purpose:

Sets up the media player to suspend any processing until the media presentation is finished. This is part of the TPlayer protocol.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMediaPresenter::AdviseWillPlay

virtual void AdviseWillPlay ()

Interface Category:

API.

Purpose:

Notifies interested processes that this media player is about to begin media playback.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMediaPresenter::AdviseWillRecord

virtual void AdviseWillRecord ()

Interface Category:

API.

Purpose:

Notifies interested processes that this media player is about to begin media recording.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMediaPresenter::GetPreroll

virtual void GetPreroll (TTime &) const

Interface Category:

API.

Purpose:

Readies the media presentation resources in preparation for media playback. The media presentation is synchronized to begin at the specified time.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMediaPresenter::GetDuration

virtual void GetDuration (TTime &) const

Interface Category:

API.

Purpose:

Returns the duration of the media performance.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMediaPresenter::Seek

virtual void Seek (const TTime &)

Interface Category:

API.

Purpose:

Moves the playback of the media performance to the specified point in time within the media sequence. The point in time is relative to the duration (or length) of the media sequence.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMediaPresenter::GetPosition

virtual void GetPosition (TTime &) const

Interface Category:

API.

Purpose:

Returns the current point in time within the media sequence playback, relative to the length of the sequence.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMediaPresenter::AdoptSequence

virtual void AdoptSequence (TMediaSequence *)

Interface Category:

API.

Purpose:

Deletes the current sequence and then adopts the new sequence.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMediaPresenter::OrphanSequence

virtual TMediaSequence * OrphanSequence ()

Interface Category:

API.

Purpose:

Returns a media sequence that had been previously adopted. The currently referenced media sequence is set to NIL.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a pointer to the media sequence that is orphaned.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMediaPresenter::GetClock

virtual void GetClock (TSyncableClockSurrogate &) const

Interface Category:

API.

Purpose:

Returns a reference to the clock object used for synchronizing interactive media players to the same time source.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMediaPresenter::SyncTo

virtual void SyncTo (const TSyncableClockSurrogate & externalClock, double rate =1.0, const TTime & offset =TTime :: kZero)

Interface Category:

API.

Purpose:

Sets the media playerŐs clock in sync with the external clock. This is used to synchronize media players to the same time source.

Calling Context:

Called directly to synchronize a media player to the external time source.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMediaPresenter::SyncToKeepMyTime

virtual void SyncToKeepMyTime (const TSyncableClockSurrogate & externalClock, double rate =1.0)

Interface Category:

API.

Purpose:

Sets the media playerŐs clock in sync with the external clock. The media player is now in sync with the external time source.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMediaPresenter::SyncToSelf

virtual void SyncToSelf ()

Interface Category:

API.

Purpose:

Indicates that synchronization of players will be to the this media playerŐs own clock, not the external clock.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMediaPresenter::AdoptPlayer

virtual void AdoptPlayer (TPlayer *)

Interface Category:

API.

Purpose:

Deletes the current player and then adopts the specified player object. This is a TPlayer accessor function.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMediaPresenter::OrphanPlayer

virtual TPlayer * OrphanPlayer ()

Interface Category:

API.

Purpose:

Returns the current media player from the media presenter and then sets the current player to NIL. This is a TPlayer accessor function.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a pointer to the player object that was just released.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMediaPresenter::GetPlayer

virtual const TPlayer * GetPlayer () const

Interface Category:

API.

Purpose:

Returns a reference to the media player. This is a TPlayer accessor function.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a pointer to the current media player.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMediaPresenter::GetMediaComponentType

virtual const TMediaComponentType & GetMediaComponentType () const

Interface Category:

API.

Purpose:

Returns the type of the media component. This is a TPlayer accessor function.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the constant value that indicates the type of the media component.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMediaPresenter::GetRegistry

virtual TMediaRegistryCaller * GetRegistry () const

Interface Category:

API.

Purpose:

Returns an alias to the media registry, which is a repository of time-media resources. The registry can be used to look up the following media components: a media-specific view, a player control view, a media player, and a nonplayer media component.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a pointer to the media registry caller object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMediaPresenter::GetPositionChangedInterest

virtual const TInterest & GetPositionChangedInterest () const

Interface Category:

API.

Purpose:

Returns a reference to a TInterest for receiving notification regarding a change in position of the media player.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a reference to the TInterest interested object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMediaPresenter::HandleMenuAction

virtual bool HandleMenuAction(TMenuAction & action)

Interface Category:

API.

Purpose:

Handles the menu action--the action selected from the menuŐs list of options. This signals that the selected action has been successfully passed on to the appropriate handler.

Calling Context:

Called to signal that the menu action has been handled.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMediaPresenter::HandleMenuDeactivate

virtual void HandleMenuDeactivate(TMenu & theMainMenu)

Interface Category:

API.

Purpose:

Handles the deactivation of the menu view. Normally, the menu is activated, then a selection is made from the menuŐs list of options, and then the menu is deactivated.

Calling Context:

Called to signal that the activated menu view is no longer active.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMediaPresenter::HandleMenuActivate

virtual void HandleMenuActivate(TMenu & theMainMenu)

Interface Category:

API.

Purpose:

Handles the activation of the menu view. When the menu is activated, then a selection from the menuŐs list of options can be made.

Calling Context:

Called to signal that a particular menu view is now active.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMediaPresenter::HandleViewAction

virtual bool HandleViewAction (TViewAction & )

Interface Category:

API.

Purpose:

Handles actions generated by player controls.

Calling Context:

Called to signal that a view action that occurred has been handled.

Parameters:

Return Value:

Returns true if the action is handled; otherwise, returns false.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMediaPresenter::UpdateMediaView

virtual void UpdateMediaView ()

Interface Category:

API.

Purpose:

Updates a media view as a result of a change to the presentation.

Calling Context:

Called directly to update a media view with the most recent action.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMediaPresenter::ThreadOff

virtual void ThreadOff (const TNotification &)

Interface Category:

API.

Purpose:

Turns off background notification for updating the position of the seek slider thumb.

Calling Context:

Call this function to remove a thread from notification.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMediaPresenter::HandleCreateMainView

virtual TView * HandleCreateMainView (TGUIBundle *) const

Interface Category:

API.

Purpose:

Creates the actual media presentation. It queries the media registry server for both the media-specific view and the player control view, and then adopts both into TMediaView. Classes derived from TMediaPresenter can override this function to use a different policy for selecting the media-specific and player control views.

Calling Context:

Call this protected function directly from a derived class.

Parameters:

Return Value:

Returns a pointer to the view object for the display.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMediaPresenter::HandleCreateLayoutView

virtual TView * HandleCreateLayoutView () const

Interface Category:

API.

Purpose:

Creates the view layout. The layout definition comes from the associated media-specific and player control views. This function adopts them into the TMediaView.

Calling Context:

Call this protected function directly from a derived class.

Parameters:

Return Value:

Returns a pointer to the newly created media view object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMediaPresenter::HandleCreateDisplayView

virtual TView * HandleCreateDisplayView () const

Interface Category:

API.

Purpose:

Creates the media display view using the associated media-specific display view.

Calling Context:

Call this protected function directly from a derived class.

Parameters:

Return Value:

Returns a pointer to the newly created view object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMediaPresenter::HandleCreateControlView

virtual TView * HandleCreateControlView () const

Interface Category:

API.

Purpose:

Creates the player control view.

Calling Context:

Call this protected function directly from a derived class.

Parameters:

Return Value:

Returns a pointer to the newly created view object for the control view.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMediaPresenter::InitializeMediaType

virtual void InitializeMediaType ()

Interface Category:

API.

Purpose:

Initializes the media type for the current media sequence.

Calling Context:

Call this protected function directly from a derived class.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMediaPresenter::CreateMainView

virtual TView * CreateMainView () const

Interface Category:

API.

Purpose:

Creates the main view for displaying the media data.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.