From d184de93fce861f4b632f410bde8d527ce1bf34f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 31 Jul 2012 04:34:18 +0000 Subject: Move continuous value setting stuff from AudioBuffer to PortImpl. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4582 a436a847-0d15-0410-975c-d299462d15a1 --- src/server/PortImpl.hpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/server/PortImpl.hpp') diff --git a/src/server/PortImpl.hpp b/src/server/PortImpl.hpp index 459c1858..f4a8975b 100644 --- a/src/server/PortImpl.hpp +++ b/src/server/PortImpl.hpp @@ -98,6 +98,15 @@ public: return _prepared_buffers->at(voice); } + void update_set_state(Context& context, uint32_t voice); + + void set_voice_value(Context& context, + uint32_t voice, + FrameTime time, + Sample value); + + void set_control_value(Context& context, FrameTime time, Sample value); + /** Called once per process cycle */ virtual void pre_process(Context& context) = 0; virtual void post_process(Context& context) = 0; @@ -175,6 +184,16 @@ protected: const Raul::Atom& value, size_t buffer_size); + struct SetState { + enum State { SET, HALF_SET_CYCLE_1, HALF_SET_CYCLE_2 }; + + SetState() : state(SET), value(0), time(0) {} + + State state; ///< State of buffer for setting control value + Sample value; ///< Value currently being set + FrameTime time; ///< Time value was set + }; + BufferFactory& _bufs; uint32_t _index; uint32_t _poly; @@ -185,6 +204,8 @@ protected: Raul::Atom _min; Raul::Atom _max; Raul::Atom _last_broadcasted_value; + Raul::Array* _set_states; + Raul::Array* _prepared_set_states; Raul::Array* _buffers; Raul::Array* _prepared_buffers; bool _broadcast; -- cgit v1.2.1