Isle
Loading...
Searching...
No Matches
MxPresenter Class Reference

[AI] Abstract base class for all presenter types in the LEGO Island engine, responsible for managing the lifecycle of the presentation of actions and their corresponding tickle (update) state. More...

#include <mxpresenter.h>

Inheritance diagram for MxPresenter:
Collaboration diagram for MxPresenter:

Public Types

enum  TickleState {
  e_idle = 0 , e_ready , e_starting , e_streaming ,
  e_repeating , e_freezing , e_done
}
 [AI] Represents the state of the presenter's tickle (update) lifecycle. More...
 

Public Member Functions

 MxPresenter ()
 [AI] Constructor. Initializes internal tickle state and other members. More...
 
MxResult Tickle () override
 [AI] Main tickle handler, called periodically to progress presenter's internal state. More...
 
virtual void VTable0x14 ()
 [AI] Reserved for future or specialized use in derived classes. More...
 
virtual void ReadyTickle ()
 [AI] Handles the transition and setup for the Ready state. Parses extra action data and advances state. More...
 
virtual void StartingTickle ()
 [AI] Handles actions required when first starting presentation. Advances to streaming state. More...
 
virtual void StreamingTickle ()
 [AI] Handles periodic updates during the streaming/presentation stage. Advances to repeating state. More...
 
virtual void RepeatingTickle ()
 [AI] Handles updates when in a repeating (looping) stage. Advances to freezing state. More...
 
virtual void FreezingTickle ()
 [AI] Handles updates during the freezing/suspended state. Advances to done state. More...
 
 ~MxPresenter () override
 [AI] Destructor, cleans up resources (base class: does nothing beyond Init). More...
 
virtual MxResult AddToManager ()
 [AI] Optional registration with a manager (such as TickleManager); by default does nothing. More...
 
virtual void Destroy ()
 [AI] Resets presenter state or cleans up resources after completion/removal. More...
 
virtual MxResult StartAction (MxStreamController *, MxDSAction *)
 [AI] Initiates presenter for a new action, setting up context and state. More...
 
virtual void EndAction ()
 [AI] Terminates the current action, notifies listeners and resets state. More...
 
virtual void SetTickleState (TickleState p_tickleState)
 [AI] Forces the tickle state, advancing to the requested lifecycle stage. More...
 
virtual MxBool HasTickleStatePassed (TickleState p_tickleState)
 [AI] Checks if the specified tickle state has ever been passed since last reset. More...
 
virtual MxResult PutData ()
 [AI] Allows the presenter to submit pending results or output to the engine. More...
 
virtual MxBool IsHit (MxS32 p_x, MxS32 p_y)
 [AI] Returns TRUE if the given (x, y) falls within hit-test bounds for the presenter (e.g. More...
 
virtual void Enable (MxBool p_enable)
 [AI] Enables or disables this presenter (controls action flags accordingly). More...
 
const char * ClassName () const override
 [AI] Returns the run-time class name for this presenter. More...
 
MxBool IsA (const char *p_name) const override
 [AI] Determines if this object is of (or inherits) the specified named class. More...
 
MxEntityCreateEntity (const char *p_defaultName)
 [AI] Creates an entity based on action 'extra' data, or uses the provided default name. More...
 
void SendToCompositePresenter (MxOmni *p_omni)
 [AI] Notifies a composite presenter (if one exists) that this presenter wishes to join a group. More...
 
MxBool IsEnabled ()
 [AI] Returns whether this presenter is logically enabled (based on the associated action's flags). More...
 
MxS32 GetCurrentTickleState () const
 [AI] Returns the current tickle state. More...
 
MxPoint32 GetLocation () const
 [AI] Returns the presenter's screen location (in pixels). More...
 
MxS32 GetX () const
 [AI] Returns the X coordinate of screen location. More...
 
MxS32 GetY () const
 [AI] Returns the Y coordinate of screen location. More...
 
MxS32 GetDisplayZ () const
 [AI] Returns the display Z (depth) order. More...
 
MxDSActionGetAction () const
 [AI] Returns the current action being presented. More...
 
void SetAction (MxDSAction *p_action)
 [AI] Sets the action associated with this presenter. More...
 
void SetCompositePresenter (MxCompositePresenter *p_compositePresenter)
 [AI] Sets the composite presenter to notify/join on completion. More...
 
void SetDisplayZ (MxS32 p_displayZ)
 [AI] Sets the display Z (depth) order for the presenter. More...
 
- Public Member Functions inherited from MxCore
 MxCore ()
 [AI] Constructs a new MxCore object and assigns it a unique id. More...
 
virtual ~MxCore ()
 [AI] Virtual destructor. Required for correct polymorphic cleanup in derived classes. More...
 
virtual MxLong Notify (MxParam &p_param)
 [AI] Virtual callback notification mechanism. More...
 
virtual MxResult Tickle ()
 [AI] Called by tickle managers to allow the object to update itself. More...
 
virtual const char * ClassName () const
 [AI] Returns the runtime class name of this object. More...
 
virtual MxBool IsA (const char *p_name) const
 [AI] Checks whether this object's class type or parents match the given name. More...
 
MxU32 GetId ()
 [AI] Gets the unique (per-process) id assigned to this object instance. More...
 

Static Public Member Functions

static const char * HandlerClassName ()
 [AI] Returns the handler class name for identification and reflection purposes. More...
 

Protected Member Functions

virtual void DoneTickle ()
 [AI] Handles any post-completion logic, resetting to idle state. More...
 
virtual void ParseExtra ()
 [AI] Parses additional data from the associated action for configuration or world interaction. More...
 
void ProgressTickleState (TickleState p_tickleState)
 [AI] Helper for advancing the presenter's tickle state and updating transition history. More...
 
void Init ()
 [AI] Initializes object state to post-construction defaults. More...
 

Protected Attributes

TickleState m_currentTickleState
 [AI] Current state in the tickle lifecycle. More...
 
MxU32 m_previousTickleStates
 [AI] Bitfield representing all tickle states that have already occurred during this lifetime. More...
 
MxPoint32 m_location
 [AI] 2D display location for the presenter. More...
 
MxS32 m_displayZ
 [AI] Z-order value for display stacking. More...
 
MxDSActionm_action
 [AI] The associated action currently being presented by this presenter. More...
 
MxCriticalSection m_criticalSection
 [AI] Thread synchronization for presenter state and data. More...
 
MxCompositePresenterm_compositePresenter
 [AI] Owner composite presenter, if any. More...
 

Detailed Description

[AI] Abstract base class for all presenter types in the LEGO Island engine, responsible for managing the lifecycle of the presentation of actions and their corresponding tickle (update) state.

The presenter tracks and transitions its tickle state and serves as an interface for derived classes which implement rendering, sound, and other forms of presentation logic.

[AI] Presenters are tickled by the engine and handle different stages of playback (idle, ready, starting, streaming, repeating, freezing, done). Each presenter holds an associated action (MxDSAction), its location, display depth order (Z), and optionally links to a composite presenter for hierarchical composition of presentational logic. Most derived classes correspond to specific media types or action groupings.

See also
[AI] MxMediaPresenter, MxCompositePresenter, MxFlcPresenter, MxSmkPresenter, etc.

Definition at line 20 of file mxpresenter.h.

Member Enumeration Documentation

◆ TickleState

[AI] Represents the state of the presenter's tickle (update) lifecycle.

Enumerator
e_idle 

[AI] Not processing an action.

e_ready 

[AI] Prepared to start processing an action.

e_starting 

[AI] In the process of starting playback/presentation.

e_streaming 

[AI] Streaming or rendering actively.

e_repeating 

[AI] Presentation is repeating (e.g., looping media).

e_freezing 

[AI] Temporarily suspending updates or playback.

e_done 

[AI] Completed processing the current action.

Definition at line 23 of file mxpresenter.h.

Constructor & Destructor Documentation

◆ MxPresenter()

MxPresenter::MxPresenter ( )
inline

[AI] Constructor. Initializes internal tickle state and other members.

Definition at line 34 of file mxpresenter.h.

◆ ~MxPresenter()

MxPresenter::~MxPresenter ( )
inlineoverride

[AI] Destructor, cleans up resources (base class: does nothing beyond Init).

Definition at line 80 of file mxpresenter.h.

Member Function Documentation

◆ AddToManager()

virtual MxResult MxPresenter::AddToManager ( )
inlinevirtual

[AI] Optional registration with a manager (such as TickleManager); by default does nothing.

Returns
[AI] Always returns SUCCESS in base class.

Reimplemented in Lego3DWavePresenter, LegoActionControlPresenter, LegoAnimPresenter, LegoHideAnimPresenter, LegoLocomotionAnimPresenter, LegoPartPresenter, LegoPathPresenter, LegoTexturePresenter, MxControlPresenter, MxEventPresenter, MxLoopingFlcPresenter, MxLoopingSmkPresenter, MxMusicPresenter, MxSmkPresenter, MxSoundPresenter, MxVideoPresenter, and MxWavePresenter.

Definition at line 84 of file mxpresenter.h.

◆ ClassName()

const char * MxPresenter::ClassName ( ) const
inlineoverridevirtual

[AI] Returns the run-time class name for this presenter.

Reimplemented from MxCore.

Reimplemented in MxSmkPresenter, MxSoundPresenter, MxStillPresenter, MxVideoPresenter, and MxWavePresenter.

Definition at line 133 of file mxpresenter.h.

◆ CreateEntity()

MxEntity * MxPresenter::CreateEntity ( const char *  p_defaultName)

[AI] Creates an entity based on action 'extra' data, or uses the provided default name.

Parameters
p_defaultName[AI] Fallback name to use if no OBJECT: key found in action extra data.
Returns
[AI] Pointer to the created entity, or NULL if creation failed.

Definition at line 241 of file mxpresenter.cpp.

◆ Destroy()

◆ DoneTickle()

virtual void MxPresenter::DoneTickle ( )
inlineprotectedvirtual

[AI] Handles any post-completion logic, resetting to idle state.

Reimplemented in LegoAnimMMPresenter, LegoAnimPresenter, LegoLoadCacheSoundPresenter, LegoTexturePresenter, MxLoopingMIDIPresenter, MxMediaPresenter, MxMIDIPresenter, and MxWavePresenter.

Definition at line 65 of file mxpresenter.h.

◆ Enable()

void MxPresenter::Enable ( MxBool  p_enable)
virtual

[AI] Enables or disables this presenter (controls action flags accordingly).

Parameters
p_enable[AI] TRUE to enable, FALSE to disable.

Reimplemented in MxControlPresenter, MxCompositePresenter, MxMediaPresenter, MxStillPresenter, and MxWavePresenter.

Definition at line 171 of file mxpresenter.cpp.

◆ EndAction()

void MxPresenter::EndAction ( )
virtual

◆ FreezingTickle()

virtual void MxPresenter::FreezingTickle ( )
inlinevirtual

[AI] Handles updates during the freezing/suspended state. Advances to done state.

Reimplemented in MxVideoPresenter.

Definition at line 61 of file mxpresenter.h.

◆ GetAction()

MxDSAction * MxPresenter::GetAction ( ) const
inline

[AI] Returns the current action being presented.

Definition at line 175 of file mxpresenter.h.

◆ GetCurrentTickleState()

MxS32 MxPresenter::GetCurrentTickleState ( ) const
inline

[AI] Returns the current tickle state.

Definition at line 160 of file mxpresenter.h.

◆ GetDisplayZ()

MxS32 MxPresenter::GetDisplayZ ( ) const
inline

[AI] Returns the display Z (depth) order.

Definition at line 172 of file mxpresenter.h.

◆ GetLocation()

MxPoint32 MxPresenter::GetLocation ( ) const
inline

[AI] Returns the presenter's screen location (in pixels).

Definition at line 163 of file mxpresenter.h.

◆ GetX()

MxS32 MxPresenter::GetX ( ) const
inline

[AI] Returns the X coordinate of screen location.

Definition at line 166 of file mxpresenter.h.

◆ GetY()

MxS32 MxPresenter::GetY ( ) const
inline

[AI] Returns the Y coordinate of screen location.

Definition at line 169 of file mxpresenter.h.

◆ HandlerClassName()

static const char * MxPresenter::HandlerClassName ( )
inlinestatic

[AI] Returns the handler class name for identification and reflection purposes.

Returns
[AI] Static string representing the handler class ("MxPresenter" by default).

Definition at line 126 of file mxpresenter.h.

◆ HasTickleStatePassed()

virtual MxBool MxPresenter::HasTickleStatePassed ( TickleState  p_tickleState)
inlinevirtual

[AI] Checks if the specified tickle state has ever been passed since last reset.

Parameters
p_tickleState[AI] The tickle state to check for.
Returns
[AI] TRUE if the specified state is in the state history bitmask.

Reimplemented in MxControlPresenter, and MxCompositePresenter.

Definition at line 105 of file mxpresenter.h.

◆ Init()

void MxPresenter::Init ( )
protected

[AI] Initializes object state to post-construction defaults.

Definition at line 33 of file mxpresenter.cpp.

◆ IsA()

MxBool MxPresenter::IsA ( const char *  p_name) const
inlineoverridevirtual

[AI] Determines if this object is of (or inherits) the specified named class.

Parameters
p_name[AI] Name of the class to check for.
Returns
[AI] TRUE if type is MxPresenter or ancestor.

Reimplemented from MxCore.

Reimplemented in MxSmkPresenter, MxSoundPresenter, MxStillPresenter, MxVideoPresenter, and MxWavePresenter.

Definition at line 141 of file mxpresenter.h.

◆ IsEnabled()

MxBool MxPresenter::IsEnabled ( )

[AI] Returns whether this presenter is logically enabled (based on the associated action's flags).

Returns
[AI] TRUE if action and c_enabled flag are both set.

Definition at line 265 of file mxpresenter.cpp.

◆ IsHit()

virtual MxBool MxPresenter::IsHit ( MxS32  p_x,
MxS32  p_y 
)
inlinevirtual

[AI] Returns TRUE if the given (x, y) falls within hit-test bounds for the presenter (e.g.

clickable geometry).

Parameters
p_x[AI] X position to test.
p_y[AI] Y position to test.
Returns
[AI] FALSE in base class, override for hit-detection in derived types.

Reimplemented in MxVideoPresenter.

Definition at line 118 of file mxpresenter.h.

◆ ParseExtra()

void MxPresenter::ParseExtra ( )
protectedvirtual

[AI] Parses additional data from the associated action for configuration or world interaction.

Reimplemented in LegoActionControlPresenter, LegoActorPresenter, LegoAnimMMPresenter, LegoAnimPresenter, LegoEntityPresenter, LegoMeterPresenter, LegoModelPresenter, LegoPathPresenter, LegoWorldPresenter, MxControlPresenter, MxStillPresenter, and MxWavePresenter.

Definition at line 80 of file mxpresenter.cpp.

◆ ProgressTickleState()

void MxPresenter::ProgressTickleState ( TickleState  p_tickleState)
inlineprotected

[AI] Helper for advancing the presenter's tickle state and updating transition history.

Parameters
p_tickleState[AI] New tickle state to transition to.

Definition at line 72 of file mxpresenter.h.

◆ PutData()

virtual MxResult MxPresenter::PutData ( )
inlinevirtual

[AI] Allows the presenter to submit pending results or output to the engine.

[AI] Placeholder implementation, always returns SUCCESS.

Reimplemented in LegoInputManager, LegoLoadCacheSoundPresenter, LegoTexturePresenter, MxCompositeMediaPresenter, MxEventPresenter, MxLoopingMIDIPresenter, MxMIDIPresenter, MxVideoPresenter, and MxWavePresenter.

Definition at line 112 of file mxpresenter.h.

◆ ReadyTickle()

◆ RepeatingTickle()

virtual void MxPresenter::RepeatingTickle ( )
inlinevirtual

◆ SendToCompositePresenter()

void MxPresenter::SendToCompositePresenter ( MxOmni p_omni)

[AI] Notifies a composite presenter (if one exists) that this presenter wishes to join a group.

Parameters
p_omni[AI] The central engine context; may be NULL to retrieve singleton instance.

Definition at line 114 of file mxpresenter.cpp.

◆ SetAction()

void MxPresenter::SetAction ( MxDSAction p_action)
inline

[AI] Sets the action associated with this presenter.

Parameters
p_action[AI] Action to associate with the presenter.

Definition at line 179 of file mxpresenter.h.

◆ SetCompositePresenter()

void MxPresenter::SetCompositePresenter ( MxCompositePresenter p_compositePresenter)
inline

[AI] Sets the composite presenter to notify/join on completion.

Parameters
p_compositePresenter[AI] Composite presenter instance to associate.

Definition at line 183 of file mxpresenter.h.

◆ SetDisplayZ()

void MxPresenter::SetDisplayZ ( MxS32  p_displayZ)
inline

[AI] Sets the display Z (depth) order for the presenter.

Parameters
p_displayZ[AI] Z order value.

Definition at line 190 of file mxpresenter.h.

◆ SetTickleState()

virtual void MxPresenter::SetTickleState ( TickleState  p_tickleState)
inlinevirtual

[AI] Forces the tickle state, advancing to the requested lifecycle stage.

Parameters
p_tickleState[AI] The tickle state to transition into.

Reimplemented in MxCompositePresenter.

Definition at line 100 of file mxpresenter.h.

◆ StartAction()

MxResult MxPresenter::StartAction ( MxStreamController ,
MxDSAction p_action 
)
virtual

[AI] Initiates presenter for a new action, setting up context and state.

Parameters
p_controller[AI] Stream controller supplying data for the action (can be NULL for some presenters).
p_action[AI] Action to be presented.
Returns
[AI] SUCCESS if successfully started.

Reimplemented in MxControlPresenter, MxMediaPresenter, MxCompositeMediaPresenter, LegoAnimMMPresenter, LegoAnimPresenter, LegoEntityPresenter, LegoWorldPresenter, and MxCompositePresenter.

Definition at line 45 of file mxpresenter.cpp.

◆ StartingTickle()

virtual void MxPresenter::StartingTickle ( )
inlinevirtual

◆ StreamingTickle()

virtual void MxPresenter::StreamingTickle ( )
inlinevirtual

◆ Tickle()

MxResult MxPresenter::Tickle ( )
overridevirtual

[AI] Main tickle handler, called periodically to progress presenter's internal state.

[AI] Depending on the current tickle state, will delegate to the appropriate stage tickle method.

Returns
[AI] Result code from tickling, always SUCCESS in the base class.

Reimplemented from MxCore.

Definition at line 126 of file mxpresenter.cpp.

◆ VTable0x14()

virtual void MxPresenter::VTable0x14 ( )
inlinevirtual

[AI] Reserved for future or specialized use in derived classes.

Definition at line 42 of file mxpresenter.h.

Member Data Documentation

◆ m_action

MxDSAction* MxPresenter::m_action
protected

[AI] The associated action currently being presented by this presenter.

Definition at line 211 of file mxpresenter.h.

◆ m_compositePresenter

MxCompositePresenter* MxPresenter::m_compositePresenter
protected

[AI] Owner composite presenter, if any.

Definition at line 217 of file mxpresenter.h.

◆ m_criticalSection

MxCriticalSection MxPresenter::m_criticalSection
protected

[AI] Thread synchronization for presenter state and data.

Definition at line 214 of file mxpresenter.h.

◆ m_currentTickleState

TickleState MxPresenter::m_currentTickleState
protected

[AI] Current state in the tickle lifecycle.

Definition at line 199 of file mxpresenter.h.

◆ m_displayZ

MxS32 MxPresenter::m_displayZ
protected

[AI] Z-order value for display stacking.

Definition at line 208 of file mxpresenter.h.

◆ m_location

MxPoint32 MxPresenter::m_location
protected

[AI] 2D display location for the presenter.

Definition at line 205 of file mxpresenter.h.

◆ m_previousTickleStates

MxU32 MxPresenter::m_previousTickleStates
protected

[AI] Bitfield representing all tickle states that have already occurred during this lifetime.

Definition at line 202 of file mxpresenter.h.


The documentation for this class was generated from the following files: