Isle
Loading...
Searching...
No Matches
mxmediamanager.cpp
Go to the documentation of this file.
1#include "mxmediamanager.h"
2
3#include "decomp.h"
4#include "mxautolock.h"
5#include "mxomni.h"
6#include "mxpresenter.h"
7#include "mxticklemanager.h"
8
12
13// FUNCTION: LEGO1 0x100b84c0
15{
16 Init();
17}
18
19// FUNCTION: LEGO1 0x100b8560
21{
22 Destroy();
23}
24
25// FUNCTION: LEGO1 0x100b85d0
27{
28 this->m_presenters = NULL;
29 this->m_thread = NULL;
30 return SUCCESS;
31}
32
33// FUNCTION: LEGO1 0x100b85e0
35{
37
38 this->m_presenters = new MxPresenterList;
39
40 if (!this->m_presenters) {
41 this->Destroy();
42 return FAILURE;
43 }
44
45 return SUCCESS;
46}
47
48// FUNCTION: LEGO1 0x100b8710
50{
52
53 if (this->m_presenters) {
54 delete this->m_presenters;
55 }
56
57 Init();
58}
59
60// FUNCTION: LEGO1 0x100b8790
62{
64 MxPresenter* presenter;
66
67 while (cursor.Next(presenter)) {
68 presenter->Tickle();
69 }
70
71 cursor.Reset();
72
73 while (cursor.Next(presenter)) {
74 presenter->PutData();
75 }
76
77 return SUCCESS;
78}
79
80// FUNCTION: LEGO1 0x100b88c0
82{
84
85 this->m_presenters->Append(&p_presenter);
86}
87
88// FUNCTION: LEGO1 0x100b8980
90{
93
94 if (cursor.Find(&p_presenter)) {
95 cursor.Detach();
96 }
97}
98
99// FUNCTION: LEGO1 0x100b8ac0
101{
103 MxPresenter* presenter;
105
106 while (cursor.Next(presenter)) {
107 presenter->EndAction();
108 }
109}
MxBool Next()
[AI]
void Detach()
[AI]
void Reset()
[AI]
Definition: mxlist.h:269
MxBool Find(T p_obj)
[AI]
void Append(T p_obj)
[AI]
Definition: mxlist.h:100
[AI] Central class for managing the lifecycle and thread-safety of MxPresenter objects for audio/vide...
MxResult Init()
[AI] Initializes all internal members to their default values.
MxPresenterList * m_presenters
[AI] Pointer to list of currently registered (active) presenters.
virtual void RegisterPresenter(MxPresenter &p_presenter)
[AI] Register a new presenter for tickle management and playback coordination.
MxMediaManager()
[AI] Constructor.
~MxMediaManager() override
[AI] Destructor.
MxCriticalSection m_criticalSection
[AI] Critical section object used for guarding access to the presenter list and internal members for ...
MxThread * m_thread
[AI] Optional pointer to a worker thread used for media dispatch/IO (if multi-threaded operation is u...
MxResult Tickle() override
[AI] Called by the tickle manager to step through and update all presenters, and process their output...
virtual void StopPresenters()
[AI] Stops/ends the action on all registered presenters, typically halting all playback and output.
virtual void Destroy()
[AI] Destroys all registered presenters and resets the internal state, ensuring safe resource disposa...
virtual MxResult Create()
[AI] Allocates and initializes the internal presenter list for this manager, ensuring thread safety.
virtual void UnregisterPresenter(MxPresenter &p_presenter)
[AI] Remove a presenter from tickle and managed output lists.
[AI] Cursor/iterator for traversing an MxPresenterList.
[AI] List to hold pointers to MxPresenter objects with optional ownership semantics.
[AI] Abstract base class for all presenter types in the LEGO Island engine, responsible for managing ...
Definition: mxpresenter.h:20
virtual void EndAction()
[AI] Terminates the current action, notifies listeners and resets state.
Definition: mxpresenter.cpp:59
virtual MxResult PutData()
[AI] Allows the presenter to submit pending results or output to the engine.
Definition: mxpresenter.h:112
MxResult Tickle() override
[AI] Main tickle handler, called periodically to progress presenter's internal state.
#define DECOMP_SIZE_ASSERT(T, S)
Definition: decomp.h:19
#define NULL
[AI] Null pointer value (C/C++ semantics).
Definition: legotypes.h:26
#define FAILURE
[AI] Used to indicate a failed operation in result codes.
Definition: legotypes.h:34
#define SUCCESS
[AI] Used to indicate a successful operation in result codes.
Definition: legotypes.h:30
#define AUTOLOCK(CS)
[AI] Macro for automatic locking using the MxAutoLock class. This macro instantiates an MxAutoLock ob...
Definition: mxautolock.h:5
MxLong MxResult
[AI]
Definition: mxtypes.h:106