2 #include <Process/TimeValue.hpp>
3 #include <Process/TimeValueSerialization.hpp>
5 #include <Scenario/Commands/ScenarioCommandFactory.hpp>
6 #include <Scenario/Document/Interval/IntervalModel.hpp>
8 #include <score/command/Command.hpp>
9 #include <score/model/path/Path.hpp>
11 #include <tests/helpers/ForwardDeclaration.hpp>
25 SCORE_COMMAND_DECL(CommandFactoryName(),
SetMaxDuration,
"Set interval maximum")
27 static const constexpr
auto corresponding_member
28 = &IntervalDurations::maxDuration;
33 , m_oldVal{cst.duration.maxDuration()}
34 , m_newVal{std::move(newval)}
35 , m_newInfinite{isInfinite}
36 , m_oldInfinite{cst.duration.isMaxInfinite()}
43 auto& cstrDuration = cst.duration;
44 if(m_newVal < cstrDuration.defaultDuration())
45 m_newVal = cstrDuration.defaultDuration();
50 m_path.find(ctx).duration.setMaxInfinite(m_oldInfinite);
51 m_path.find(ctx).duration.setMaxDuration(m_oldVal);
56 m_path.find(ctx).duration.setMaxInfinite(m_newInfinite);
57 m_path.find(ctx).duration.setMaxDuration(m_newVal);
63 s << m_path << m_oldVal << m_newVal << m_newInfinite << m_oldInfinite;
67 s >> m_path >> m_oldVal >> m_newVal >> m_newInfinite >> m_oldInfinite;
The Path class is a typesafe wrapper around ObjectPath.
Definition: Path.hpp:52
The SetMaxDuration class.
Definition: SetMaxDuration.hpp:24
Definition: IntervalModel.hpp:50
The Command class.
Definition: Command.hpp:34
Main plug-in of score.
Definition: score-plugin-dataflow/Dataflow/PortItem.hpp:14
Definition: DataStreamHelpers.hpp:103
Definition: TimeValue.hpp:21
Definition: DocumentContext.hpp:18