2 #include <Process/Process.hpp>
3 #include <Process/TimeValue.hpp>
5 #include <Scenario/Document/CommentBlock/CommentBlockModel.hpp>
6 #include <Scenario/Document/Event/EventModel.hpp>
7 #include <Scenario/Document/Interval/IntervalModel.hpp>
8 #include <Scenario/Document/State/StateModel.hpp>
9 #include <Scenario/Document/TimeSync/TimeSyncModel.hpp>
10 #include <Scenario/Instantiations.hpp>
11 #include <Scenario/Process/ScenarioInterface.hpp>
12 #include <Scenario/Process/ScenarioProcessMetadata.hpp>
14 #include <score/model/EntityMap.hpp>
15 #include <score/model/IdentifiedObjectMap.hpp>
16 #include <score/model/Identifier.hpp>
17 #include <score/selection/Selection.hpp>
19 #include <score/serialization/VisitorInterface.hpp>
20 #include <score/tools/std/Optional.hpp>
40 SCORE_SERIALIZE_FRIENDS
45 std::unique_ptr<Process::AudioInlet> inlet;
46 std::unique_ptr<Process::AudioOutlet> outlet;
51 template <
typename Impl>
62 bool hasCycles()
const noexcept;
71 return intervals.map().as_indirect_vec();
76 return states.map().as_indirect_vec();
81 return events.map().as_indirect_vec();
86 return timeSyncs.map().as_indirect_vec();
91 if(
auto it = intervals.map().m_map.find(
id); it != intervals.map().m_map.end())
99 if(
auto it = events.map().m_map.find(
id); it != events.map().m_map.end())
107 if(
auto it = timeSyncs.map().m_map.find(
id); it != timeSyncs.map().m_map.end())
115 if(
auto it = states.map().m_map.find(
id); it != states.map().m_map.end())
124 return intervals.at(intervalId);
128 return events.at(eventId);
132 return timeSyncs.at(timeSyncId);
136 return states.at(stId);
140 return comments.at(cmtId);
143 TimeSyncModel& startTimeSync()
const {
return timeSyncs.at(m_startTimeSyncId); }
145 EventModel& startEvent()
const {
return events.at(m_startEventId); }
154 E_SIGNAL(SCORE_PLUGIN_SCENARIO_EXPORT, intervalMoved, arg_1)
156 void locked() E_SIGNAL(SCORE_PLUGIN_SCENARIO_EXPORT, locked)
157 void unlocked() E_SIGNAL(SCORE_PLUGIN_SCENARIO_EXPORT, unlocked)
159 void lock() { locked(); };
161 void unlock() { unlocked(); };
165 void setDurationAndScale(
const TimeVal& newDuration) noexcept
override;
166 void setDurationAndGrow(
const TimeVal& newDuration) noexcept
override;
167 void setDurationAndShrink(
const TimeVal& newDuration) noexcept
override;
169 void ancestorStartDateChanged()
override;
170 void ancestorTempoChanged()
override;
172 Selection selectableChildren()
const noexcept
override;
173 Selection selectedChildren()
const noexcept
override;
175 INLINE_PROPERTY_VALUE(
176 bool, exclusive, =
false, exclusive, setExclusive, exclusiveChanged)
182 void setSelection(
const Selection& s)
const noexcept
override;
183 bool event(QEvent* e)
override {
return QObject::event(e); }
185 TimeVal contentDuration()
const noexcept
override;
187 template <
typename Fun>
188 void apply(Fun fun)
const
190 fun(&ProcessModel::intervals);
191 fun(&ProcessModel::states);
192 fun(&ProcessModel::events);
193 fun(&ProcessModel::timeSyncs);
194 fun(&ProcessModel::comments);
204 std::unique_ptr<TimenodeGraph> m_graph;
210 template <
typename Vector>
211 std::vector<const typename Vector::value_type*> selectedElements(
const Vector& in)
213 std::vector<const typename Vector::value_type*> out;
214 for(
const auto& elt : in)
216 if(elt.selection.get())
223 template <
typename T,
typename Container>
224 std::vector<const T*> filterSelectionByType(
const Container& sel)
226 std::vector<const T*> selected_elements;
230 if(
auto casted_obj = qobject_cast<const T*>(obj.data()))
232 if(casted_obj->selection.get())
234 selected_elements.push_back(casted_obj);
239 return selected_elements;
244 SCORE_PLUGIN_SCENARIO_EXPORT
const QVector<Id<IntervalModel>> intervalsBeforeTimeSync(
249 return scenar.intervals;
253 return scenar.events;
257 return scenar.timeSyncs;
261 return scenar.states;
267 static const constexpr
auto accessor =
static_cast<
274 static const constexpr
auto accessor =
static_cast<
280 static const constexpr
auto accessor =
static_cast<
287 static const constexpr
auto accessor =
static_cast<
293 Q_DECLARE_METATYPE(const
Scenario::ProcessModel*)
294 Q_DECLARE_METATYPE(
Scenario::ProcessModel*)
295 W_REGISTER_ARGTYPE(const
Scenario::ProcessModel*)
296 W_REGISTER_ARGTYPE(
Scenario::ProcessModel*)
297 W_REGISTER_ARGTYPE(const
Scenario::ProcessModel&)
298 W_REGISTER_ARGTYPE(
Scenario::ProcessModel&)
299 W_REGISTER_ARGTYPE(
Scenario::ProcessModel)
The Process class.
Definition: score-lib-process/Process/Process.hpp:61
Definition: EventModel.hpp:36
Definition: IntervalModel.hpp:50
The core hierarchical and temporal process of score.
Definition: ScenarioModel.hpp:37
Definition: ScenarioInterface.hpp:20
Definition: ScenarioFactory.hpp:25
Definition: StateModel.hpp:63
Definition: TimeSyncModel.hpp:34
Definition: Selection.hpp:12
The id_base_t class.
Definition: Identifier.hpp:57
The EntityMap class.
Definition: EntityMap.hpp:36
Definition: IndirectContainer.hpp:129
Main plug-in of score.
Definition: score-plugin-dataflow/Dataflow/PortItem.hpp:14
Definition: Preset.hpp:32
Definition: ScenarioInterface.hpp:55
Definition: TimeValue.hpp:21
Definition: DocumentContext.hpp:18