2 #include <Process/TimeValue.hpp>
4 #include <Scenario/Commands/ScenarioCommandFactory.hpp>
5 #include <Scenario/Document/Interval/IntervalModel.hpp>
7 #include <score/command/Command.hpp>
8 #include <score/model/path/Path.hpp>
9 #include <score/model/path/PathSerialization.hpp>
11 #include <tests/helpers/ForwardDeclaration.hpp>
25 SCORE_COMMAND_DECL(CommandFactoryName(),
SetMinDuration,
"Set interval minimum")
27 static const constexpr
auto corresponding_member = &IntervalDurations::minDuration;
31 , m_oldVal{cst.duration.minDuration()}
33 , m_oldMinNull{cst.duration.isMinNull()}
34 , m_newMinNull{isMinNull}
41 auto& cstrDuration = cst.duration;
42 if(m_newVal < TimeVal::zero())
43 m_newVal = TimeVal::zero();
44 if(m_newVal > cstrDuration.defaultDuration())
45 m_newVal = cstrDuration.defaultDuration();
50 auto& cstrDuration = m_path.find(ctx).duration;
51 cstrDuration.setMinNull(m_oldMinNull);
52 cstrDuration.setMinDuration(m_oldVal);
57 auto& cstrDuration = m_path.find(ctx).duration;
58 cstrDuration.setMinNull(m_newMinNull);
59 cstrDuration.setMinDuration(m_newVal);
65 s << m_path << m_oldVal << m_newVal << m_oldMinNull << m_newMinNull;
69 s >> m_path >> m_oldVal >> m_newVal >> m_oldMinNull >> m_newMinNull;
77 bool m_oldMinNull{}, m_newMinNull{};
The Path class is a typesafe wrapper around ObjectPath.
Definition: Path.hpp:52
The SetMinDuration class.
Definition: SetMinDuration.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