diff options
author | David Robillard <d@drobilla.net> | 2016-10-14 17:09:01 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2016-10-14 17:47:35 -0400 |
commit | 01e143ed3353de6ef2bd0e4648b9b2a1a72a9959 (patch) | |
tree | c8a87b597fb8f5ade1b508082c93d127ae578266 /src/server/events | |
parent | 8d92e5a38e141236b3687e8d775ee5d034127fb8 (diff) | |
download | ingen-01e143ed3353de6ef2bd0e4648b9b2a1a72a9959.tar.gz ingen-01e143ed3353de6ef2bd0e4648b9b2a1a72a9959.tar.bz2 ingen-01e143ed3353de6ef2bd0e4648b9b2a1a72a9959.zip |
Fix sequence ports with values
Diffstat (limited to 'src/server/events')
-rw-r--r-- | src/server/events/Delta.cpp | 5 | ||||
-rw-r--r-- | src/server/events/SetPortValue.cpp | 14 | ||||
-rw-r--r-- | src/server/events/SetPortValue.hpp | 2 |
3 files changed, 14 insertions, 7 deletions
diff --git a/src/server/events/Delta.cpp b/src/server/events/Delta.cpp index d2c56f0c..ad4f78a1 100644 --- a/src/server/events/Delta.cpp +++ b/src/server/events/Delta.cpp @@ -97,7 +97,7 @@ Delta::add_set_event(const char* port_symbol, SetPortValue* ev = new SetPortValue( _engine, _request_client, _request_id, _time, - port, Atom(size, type, value), true); + port, Atom(size, type, value), false, true); _set_events.push_back(ev); } @@ -293,7 +293,8 @@ Delta::pre_process(PreProcessContext& ctx) } } else if (key == uris.ingen_value || key == uris.ingen_activity) { SetPortValue* ev = new SetPortValue( - _engine, _request_client, _request_id, _time, port, value); + _engine, _request_client, _request_id, _time, port, value, + key == uris.ingen_activity); _set_events.push_back(ev); } else if (key == uris.midi_binding) { if (port->is_a(PortType::CONTROL) || port->is_a(PortType::CV)) { diff --git a/src/server/events/SetPortValue.cpp b/src/server/events/SetPortValue.cpp index 2af9841b..4ab0271c 100644 --- a/src/server/events/SetPortValue.cpp +++ b/src/server/events/SetPortValue.cpp @@ -40,10 +40,12 @@ SetPortValue::SetPortValue(Engine& engine, SampleCount timestamp, PortImpl* port, const Atom& value, + bool activity, bool synthetic) : Event(engine, client, id, timestamp) , _port(port) , _value(value) + , _activity(activity) , _synthetic(synthetic) { } @@ -60,16 +62,18 @@ SetPortValue::pre_process(PreProcessContext& ctx) return Event::pre_process_done(Status::DIRECTION_MISMATCH, _port->path()); } - // Set value metadata (does not affect buffers) - _port->set_value(_value); - _port->set_property(_engine.world()->uris().ingen_value, _value); + if (!_activity) { + // Set value metadata (does not affect buffers) + _port->set_value(_value); + _port->set_property(_engine.world()->uris().ingen_value, _value); + } _binding = _engine.control_bindings()->port_binding(_port); if (_port->buffer_type() == uris.atom_Sequence) { _buffer = _engine.buffer_factory()->get_buffer( _port->buffer_type(), - _port->value_type(), + 0, _engine.buffer_factory()->default_size(_port->buffer_type()), false, false); @@ -129,7 +133,7 @@ void SetPortValue::post_process() { Broadcaster::Transfer t(*_engine.broadcaster()); - if (respond() == Status::SUCCESS) { + if (respond() == Status::SUCCESS && !_activity) { _engine.broadcaster()->set_property( _port->uri(), _engine.world()->uris().ingen_value, diff --git a/src/server/events/SetPortValue.hpp b/src/server/events/SetPortValue.hpp index 03902acb..07f1bbac 100644 --- a/src/server/events/SetPortValue.hpp +++ b/src/server/events/SetPortValue.hpp @@ -44,6 +44,7 @@ public: SampleCount timestamp, PortImpl* port, const Atom& value, + bool activity, bool synthetic = false); ~SetPortValue(); @@ -61,6 +62,7 @@ private: const Atom _value; BufferRef _buffer; ControlBindings::Key _binding; + bool _activity; bool _synthetic; }; |