Loading...
Searching...
No Matches
ResizeSlotVertically.hpp
1#pragma once
2#include <Scenario/Commands/ScenarioCommandFactory.hpp>
3#include <Scenario/Document/Interval/Slot.hpp>
4
5#include <score/command/Command.hpp>
6#include <score/model/path/Path.hpp>
7#include <score/tools/Unused.hpp>
8
9#include <score_plugin_scenario_export.h>
10struct DataStreamInput;
11struct DataStreamOutput;
12
13namespace Scenario
14{
15namespace Command
16{
22class SCORE_PLUGIN_SCENARIO_EXPORT ResizeSlotVertically final : public score::Command
23{
24 SCORE_COMMAND_DECL(CommandFactoryName(), ResizeSlotVertically, "Resize a slot")
25public:
27 const IntervalModel& cst, const SlotPath& slotPath, double newSize);
28 ResizeSlotVertically(const IntervalModel& cst, SlotPath&& slotPath, double newSize);
29
30 void undo(const score::DocumentContext& ctx) const override;
31 void redo(const score::DocumentContext& ctx) const override;
32
33 void update(unused_t, unused_t, double size) { m_newSize = size; }
34
35protected:
36 void serializeImpl(DataStreamInput&) const override;
37 void deserializeImpl(DataStreamOutput&) override;
38
39private:
40 SlotPath m_path;
41
42 double m_originalSize{};
43 double m_newSize{};
44};
45}
46}
The ResizeSlotVerticallyCommand class.
Definition ResizeSlotVertically.hpp:23
Definition IntervalModel.hpp:50
The Command class.
Definition Command.hpp:34
Main plug-in of score.
Definition score-plugin-dataflow/Dataflow/PortItem.hpp:13
Definition DataStreamHelpers.hpp:99
Definition DataStreamHelpers.hpp:103
Definition Slot.hpp:54
Definition DocumentContext.hpp:18
Definition Unused.hpp:3