Loading...
Searching...
No Matches
BaseScenarioComponent.hpp
1#pragma once
2#include <ossia/editor/scenario/clock.hpp>
3
4#include <QObject>
5
6#include <score_plugin_engine_export.h>
7
8#include <memory>
9#include <verdigris>
10namespace ossia
11{
12struct time_value;
13class scenario;
14}
15
16namespace Scenario
17{
18class IntervalModel;
19class EventModel;
20class StateModel;
21class TimeSyncModel;
22class BaseScenario;
23class ScenarioInterface;
24}
25class DeviceList;
26namespace Execution
27{
28class IntervalComponent;
29class EventComponent;
30class StateComponent;
31class TimeSyncComponent;
32}
33
34// MOVEME
35// Like BaseScenarioContainer but with references
36// to existing elements instead.
38{
39public:
42
44 Scenario::IntervalModel& interval, Scenario::StateModel& startState,
45 Scenario::StateModel& endState, Scenario::EventModel& startEvent,
48 : m_interval{interval}
49 , m_startState{startState}
50 , m_endState{endState}
51 , m_startEvent{startEvent}
52 , m_endEvent{endEvent}
53 , m_startNode{startNode}
54 , m_endNode{endNode}
55 {
56 }
57
58 Scenario::IntervalModel& interval() const { return m_interval; }
59
60 Scenario::TimeSyncModel& startTimeSync() const { return m_startNode; }
61 Scenario::TimeSyncModel& endTimeSync() const { return m_endNode; }
62
63 Scenario::EventModel& startEvent() const { return m_startEvent; }
64 Scenario::EventModel& endEvent() const { return m_endEvent; }
65
66 Scenario::StateModel& startState() const { return m_startState; }
67 Scenario::StateModel& endState() const { return m_endState; }
68
69private:
70 Scenario::IntervalModel& m_interval;
71 Scenario::StateModel& m_startState;
72 Scenario::StateModel& m_endState;
73 Scenario::EventModel& m_startEvent;
74 Scenario::EventModel& m_endEvent;
75 Scenario::TimeSyncModel& m_startNode;
76 Scenario::TimeSyncModel& m_endNode;
77};
78
79namespace Execution
80{
81struct Context;
82class SCORE_PLUGIN_ENGINE_EXPORT BaseScenarioElement final : public QObject
83{
84 W_OBJECT(BaseScenarioElement)
85public:
86 BaseScenarioElement(const Context&, QObject* parent);
87 ~BaseScenarioElement();
88
89 void init(bool forcePlay, BaseScenarioRefContainer);
90 void cleanup();
91 bool active() const { return bool(m_ossia_interval); }
92
93 IntervalComponent& baseInterval() const;
94
95 TimeSyncComponent& startTimeSync() const;
96 TimeSyncComponent& endTimeSync() const;
97
98 EventComponent& startEvent() const;
99 EventComponent& endEvent() const;
100
101 StateComponent& startState() const;
102 StateComponent& endState() const;
103
104 ossia::scenario& baseScenario() const;
105
106public:
107 void finished() E_SIGNAL(SCORE_PLUGIN_ENGINE_EXPORT, finished)
108
109private:
110 const Context& m_ctx;
111 std::shared_ptr<ossia::scenario> m_ossia_scenario;
112 std::shared_ptr<IntervalComponent> m_ossia_interval;
113
114 std::shared_ptr<TimeSyncComponent> m_ossia_startTimeSync;
115 std::shared_ptr<TimeSyncComponent> m_ossia_endTimeSync;
116
117 std::shared_ptr<EventComponent> m_ossia_startEvent;
118 std::shared_ptr<EventComponent> m_ossia_endEvent;
119
120 std::shared_ptr<StateComponent> m_ossia_startState;
121 std::shared_ptr<StateComponent> m_ossia_endState;
122};
123}
Definition BaseScenarioComponent.hpp:38
Definition EventModel.hpp:36
Definition IntervalModel.hpp:50
Definition ScenarioInterface.hpp:20
Definition StateModel.hpp:63
Definition TimeSyncModel.hpp:34
Components used for the execution of a score.
Definition ProcessComponent.cpp:12
Main plug-in of score.
Definition score-plugin-dataflow/Dataflow/PortItem.hpp:13
STL namespace.