Loading...
Searching...
No Matches
RecordTools.hpp
1#pragma once
2
3#include <State/Address.hpp>
4
5#include <Device/Address/AddressSettings.hpp>
6#include <Device/Node/DeviceNode.hpp>
7
8#include <Process/TimeValue.hpp>
9
10#include <Scenario/Commands/Scenario/Displacement/MoveNewEvent.hpp>
11
12#include <Recording/Commands/Record.hpp>
13
14#include <score/command/Dispatchers/MacroCommandDispatcher.hpp>
15#include <score/tools/std/HashMap.hpp>
16
17#include <chrono>
18#include <memory>
19#include <vector>
20
21namespace RedoStrategy
22{
23struct Quiet;
24}
25namespace Explorer
26{
27class DeviceExplorerModel;
28}
29namespace Scenario
30{
31class ProcessModel;
32class IntervalModel;
33class EventModel;
34struct Point;
35}
36
37namespace std
38{
39// MOVEME
40template <>
41struct hash<Device::FullAddressSettings>
42{
43 std::size_t operator()(const Device::FullAddressSettings& k) const
44 {
45 return std::hash<State::Address>{}(k.address);
46 }
47};
48}
49
50namespace Recording
51{
52struct RecordContext;
59using RecordListening = std::vector<std::vector<Device::Node*>>;
60using RecordCommandDispatcher = GenericMacroCommandDispatcher<
62
63struct Box
64{
66 // In the first slot.
67
70};
71/*
72// Only the selected addresses
73RecordListening GetAddressesToRecord(
74 Explorer::DeviceExplorerModel& m_explorer);
75*/
76// The selected addresses and all their children
77RecordListening GetAddressesToRecordRecursive(Explorer::DeviceExplorerModel& explorer);
78
79Box CreateBox(RecordContext&);
80
81inline double GetTimeDifferenceInDouble(std::chrono::steady_clock::time_point start)
82{
83 using namespace std::chrono;
84 return duration_cast<microseconds>(steady_clock::now() - start).count() / 1000.;
85}
86inline TimeVal GetTimeDifference(std::chrono::steady_clock::time_point start)
87{
88 using namespace std::chrono;
89 return TimeVal::fromMsecs(GetTimeDifferenceInDouble(start));
90}
91
97constexpr int ReasonableUpdateInterval(int numberOfCurves)
98{
99 return numberOfCurves < 10 ? 8
100 : numberOfCurves < 50 ? 16
101 : numberOfCurves < 100 ? 100
102 : numberOfCurves < 1000 ? 1000
103 : 5000;
104}
105}
Definition DeviceExplorerModel.hpp:67
The MacroCommandDispatcher class.
Definition MacroCommandDispatcher.hpp:18
Definition Record.hpp:11
Definition MoveNewEvent.hpp:34
Definition IntervalModel.hpp:50
The id_base_t class.
Definition Identifier.hpp:57
Manipulation of Devices from Qt.
Definition AddressSettings.cpp:14
Main plug-in of score.
Definition score-plugin-dataflow/Dataflow/PortItem.hpp:13
STL namespace.
Definition AddressSettings.hpp:62
Definition RecordTools.hpp:64
Definition RecordProviderFactory.hpp:39
Definition SendStrategy.hpp:42
Definition SendStrategy.hpp:23
Definition TimeValue.hpp:21