Loading...
Searching...
No Matches
TempoProcess.hpp
1#pragma once
2#include <Process/ProcessMetadata.hpp>
3
4#include <Curve/Process/CurveProcessModel.hpp>
5
6namespace Scenario
7{
8class TempoProcess;
9}
10
11PROCESS_METADATA(
12 , Scenario::TempoProcess, "14bcc6d2-cb34-4bc6-8c70-e512f11d1ceb", "Tempo", "Tempo",
13 Process::ProcessCategory::Automation, "Automations",
14 "Tempo curve - only one per interval", "ossia score",
15 (QStringList{"Curve", "Automation"}), {}, {},
16 QUrl("https://ossia.io/score-docs/processes/tempo.html#tempo"),
18
19namespace Scenario
20{
21class TempoProcess final : public Curve::CurveProcessModel
22{
23 SCORE_SERIALIZE_FRIENDS
24 PROCESS_METADATA_IMPL(Scenario::TempoProcess)
25
26 W_OBJECT(TempoProcess)
27
28public:
29 static constexpr double min = 20.;
30 static constexpr double max = 500.;
31
32 std::unique_ptr<Process::Inlet> tempo_inlet;
33 std::unique_ptr<Process::Inlet> speed_inlet;
34 std::unique_ptr<Process::Inlet> position_inlet;
35
36 TempoProcess(
37 const TimeVal& duration, const Id<Process::ProcessModel>& id, QObject* parent);
38 ~TempoProcess() override;
39 void init();
40
41 template <typename Impl>
42 TempoProcess(Impl& vis, QObject* parent)
43 : CurveProcessModel{vis, parent}
44 {
45 vis.writeTo(*this);
46 init();
47 }
48
49 QString prettyName() const noexcept override;
50 QString prettyValue(double x, double y) const noexcept override;
51
52private:
54 void setDurationAndScale(const TimeVal& newDuration) noexcept override;
55 void setDurationAndGrow(const TimeVal& newDuration) noexcept override;
56 void setDurationAndShrink(const TimeVal& newDuration) noexcept override;
57
58 void setCurve_impl() override;
59};
60}
Definition CurveProcessModel.hpp:11
The id_base_t class.
Definition Identifier.hpp:57
@ SupportsTemporal
Can be loaded as a process of an interval.
Definition ProcessFlags.hpp:19
Main plug-in of score.
Definition score-plugin-dataflow/Dataflow/PortItem.hpp:13
Definition TimeValue.hpp:21