Loading...
Searching...
No Matches
RecordManager.hpp
1#pragma once
2#include <Curve/Settings/CurveSettingsModel.hpp>
3
4#include <Recording/Record/RecordData.hpp>
5#include <Recording/Record/RecordProviderFactory.hpp>
6#include <Recording/Record/RecordTools.hpp>
7
8#include <score/tools/std/HashMap.hpp>
9
10#include <verdigris>
11namespace Curve
12{
13namespace Settings
14{
15class Model;
16}
17}
18namespace Recording
19{
20struct RecordContext;
21// TODO for some reason we have to undo redo
22// to be able to send the curve at execution. Investigate why.
24 : public QObject
25 , public RecordProvider
26 , public Nano::Observer
27{
28 W_OBJECT(AutomationRecorder)
29public:
30 RecordContext& context;
32
33 bool setup(const Box&, const RecordListening&) override;
34 void stop() override;
35
36 int count()
37 {
38 return numeric_records.size() + vec2_records.size() + vec3_records.size()
39 + vec4_records.size() + list_records.size();
40 }
41
42 void commit();
43
44 score::hash_map<State::Address, RecordData> numeric_records;
45 score::hash_map<State::Address, std::array<RecordData, 2>> vec2_records;
46 score::hash_map<State::Address, std::array<RecordData, 3>> vec3_records;
47 score::hash_map<State::Address, std::array<RecordData, 4>> vec4_records;
48 score::hash_map<State::Address, std::vector<RecordData>> list_records;
49
50public:
51 void firstMessageReceived() W_SIGNAL(firstMessageReceived);
52
53private:
54 void messageCallback_sig(const State::Address& addr, const ossia::value& val)
55 W_SIGNAL(messageCallback_sig, addr, val)
56 void parameterCallback_sig(const State::Address& addr, const ossia::value& val)
57 W_SIGNAL(parameterCallback_sig, addr, val)
58
59 void messageCallback(const State::Address& addr, const ossia::value& val);
60 void parameterCallback(const State::Address& addr, const ossia::value& val);
61
62 bool finish(
63 State::AddressAccessor addr, const RecordData& dat, const TimeVal& msecs, bool,
64 int);
65 const Curve::Settings::Model& m_settings;
66 Curve::Settings::Mode m_recordingMode{};
67 std::vector<QPointer<Device::DeviceInterface>> m_recordCallbackConnections;
68
69 // TODO see this :
70 // http://stackoverflow.com/questions/34596768/stdunordered-mapfind-using-a-type-different-than-the-key-type
71};
72/*
73class AutomationRecorderFactory final : public RecorderFactory
74{
75 Priority
76 matches(const Device::Node&, const score::DocumentContext& ctx) override;
77
78 std::unique_ptr<RecordProvider>
79 make(const Device::NodeList&, const score::DocumentContext& ctx) override;
80};
81*/
82}
Definition CurveSettingsModel.hpp:29
Definition RecordManager.hpp:27
Utilities and base classes for 1D curves.
Definition FocusDispatcher.hpp:12
Definition RecordTools.hpp:64
Definition RecordProviderFactory.hpp:39
Definition RecordData.hpp:26
Definition RecordProviderFactory.hpp:86
Definition Address.hpp:108
The Address struct.
Definition Address.hpp:58
Definition TimeValue.hpp:21