OSSIA
Open Scenario System for Interactive Application
Loading...
Searching...
No Matches
local_state_execution_policy.hpp
1#pragma once
2#include <ossia/dataflow/execution/execution_policy.hpp>
3#include <ossia/dataflow/typed_value.hpp>
4#include <ossia/dataflow/value_vector.hpp>
5#include <ossia/detail/audio_spin_mutex.hpp>
6#include <ossia/detail/hash_map.hpp>
7
8#include <libremidi/ump.hpp>
9
10namespace ossia
11{
12
13struct OSSIA_TEST_EXPORT local_state_execution_policy : execution_state_policy
14{
15 local_state_execution_policy();
16 virtual ~local_state_execution_policy();
17
18 bool find_and_copy(net::parameter_base& addr, inlet& in) override;
19 void clear_local_state() override;
20
21 void commit_common();
22
23 bool in_local_scope(net::parameter_base& other) const override;
24
25 void insert(ossia::net::parameter_base& dest, const ossia::value_port& v) override;
26 void insert(ossia::audio_parameter& dest, const audio_port& v) override;
27 void insert(ossia::net::midi::midi_parameter& dest, const midi_port& v) override;
28
29 mutable ossia::audio_spin_mutex mutex;
30 // private:// disabled due to tests, but for some reason can't make friend
31 // work
32 // using value_state_impl = ossia::flat_multimap<int64_t,
33 // std::pair<ossia::value, int>>;
34
35 TS_GUARDED_BY(mutex)
36 ossia::hash_map<ossia::net::parameter_base*, value_vector<std::pair<typed_value, int>>>
37 m_valueState;
38
39 TS_GUARDED_BY(mutex)
40 ossia::hash_map<ossia::audio_parameter*, audio_port> m_audioState;
41
42 TS_GUARDED_BY(mutex)
43 ossia::hash_map<ossia::net::parameter_base*, value_vector<libremidi::ump>> m_midiState;
44
45 TS_GUARDED_BY(mutex)
46 int m_msgIndex{};
47};
48}
The parameter_base class.
Definition ossia/network/base/parameter.hpp:48
Definition git_info.h:7