InterpStateProcess.hpp
1 #pragma once
2 #include <State/Message.hpp>
3 
4 #include <Process/ProcessMetadata.hpp>
5 
6 #include <Curve/Process/CurveProcessModel.hpp>
7 
8 #include <score_plugin_scenario_export.h>
9 namespace InterpState
10 {
11 class ProcessModel;
12 }
13 
14 PROCESS_METADATA(
15  , InterpState::ProcessModel, "09fa6f72-55d5-4fee-8bc7-6f983c2e62d8", "InterpState",
16  "State interpolation", Process::ProcessCategory::Automation, "Automations",
17  "Interpolate between two states", "ossia score",
18  (QStringList{"Curve", "Automation"}), {},
19  {std::vector<Process::PortType>{Process::PortType::Message}},
20  Process::ProcessFlags::SupportsTemporal)
21 namespace InterpState
22 {
23 class SCORE_PLUGIN_SCENARIO_EXPORT ProcessModel final : public Curve::CurveProcessModel
24 {
25  SCORE_SERIALIZE_FRIENDS
26  PROCESS_METADATA_IMPL(InterpState::ProcessModel)
27 
28  W_OBJECT(ProcessModel)
29 
30 public:
31  ProcessModel(
32  const TimeVal& duration, const Id<Process::ProcessModel>& id, QObject* parent);
33 
34  ~ProcessModel() override;
35 
36  template <typename Impl>
37  ProcessModel(Impl& vis, QObject* parent)
38  : CurveProcessModel{vis, parent}
39  {
40  vis.writeTo(*this);
41  }
42 
43  QString prettyName() const noexcept override;
44  QString prettyValue(double x, double y) const noexcept override;
45 
46  State::MessageList startMessages() const;
47  State::MessageList endMessages() const;
48 
49 private:
51  void setDurationAndScale(const TimeVal& newDuration) noexcept override;
52  void setDurationAndGrow(const TimeVal& newDuration) noexcept override;
53  void setDurationAndShrink(const TimeVal& newDuration) noexcept override;
54 };
55 }
Definition: CurveProcessModel.hpp:11
The id_base_t class.
Definition: Identifier.hpp:57
Utilities for OSSIA data structures.
Definition: DeviceInterface.hpp:33
Definition: TimeValue.hpp:21