diff options
Diffstat (limited to 'src/engine/ControlBindings.hpp')
-rw-r--r-- | src/engine/ControlBindings.hpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/engine/ControlBindings.hpp b/src/engine/ControlBindings.hpp index 8477a0fa..8823ecb1 100644 --- a/src/engine/ControlBindings.hpp +++ b/src/engine/ControlBindings.hpp @@ -15,12 +15,13 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef CONTROL_BINDIGNS_HPP +#ifndef CONTROL_BINDINGS_HPP #define CONTROL_BINDINGS_HPP #include <stdint.h> #include <map> #include "raul/SharedPtr.hpp" +#include "raul/Path.hpp" #include "shared/LV2URIMap.hpp" namespace Ingen { @@ -32,15 +33,24 @@ class PortImpl; class ControlBindings { public: + typedef std::map<int8_t, PortImpl*> Bindings; + ControlBindings(Engine& engine, SharedPtr<Shared::LV2URIMap> map) : _engine(engine) , _map(map) , _learn_port(NULL) + , _bindings(new Bindings()) {} void learn(PortImpl* port); void process(ProcessContext& context, EventBuffer* buffer); + /** Remove all bindings for @a path or children of @a path. + * The caller must safely drop the returned reference in the + * post-processing thread after at least one process thread has run. + */ + SharedPtr<Bindings> remove(const Raul::Path& path); + private: Engine& _engine; SharedPtr<Shared::LV2URIMap> _map; @@ -49,8 +59,7 @@ private: void set_port_value(ProcessContext& context, PortImpl* port, int8_t cc_value); void bind(ProcessContext& context, int8_t cc_num); - typedef std::map<int8_t, PortImpl*> Bindings; - Bindings _bindings; + SharedPtr<Bindings> _bindings; }; } // namespace Ingen |