diff options
author | David Robillard <d@drobilla.net> | 2015-08-12 04:46:29 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2015-08-12 04:46:29 +0000 |
commit | dd79e76e41446833088482588456afed37231bff (patch) | |
tree | c0f3c5c2fc74b286d529df69ad2206e2fddd96f9 /src/server/PluginImpl.hpp | |
parent | 44af7b7b66e2083819103c760ab3bf4980469f86 (diff) | |
download | ingen-dd79e76e41446833088482588456afed37231bff.tar.gz ingen-dd79e76e41446833088482588456afed37231bff.tar.bz2 ingen-dd79e76e41446833088482588456afed37231bff.zip |
Server-side presets.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5703 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/PluginImpl.hpp')
-rw-r--r-- | src/server/PluginImpl.hpp | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/src/server/PluginImpl.hpp b/src/server/PluginImpl.hpp index 92338b70..414bd1f1 100644 --- a/src/server/PluginImpl.hpp +++ b/src/server/PluginImpl.hpp @@ -21,7 +21,6 @@ #include <boost/utility.hpp> -#include "ingen/Plugin.hpp" #include "ingen/Resource.hpp" #include "raul/Symbol.hpp" #include "raul/URI.hpp" @@ -41,17 +40,19 @@ class GraphImpl; * * Conceptually, a Block is an instance of this. */ -class PluginImpl : public Plugin +class PluginImpl : public Resource , public boost::noncopyable { public: PluginImpl(Ingen::URIs& uris, - Type type, + const Atom& type, const Raul::URI& uri) - : Plugin(uris, uri) + : Resource(uris, uri) , _type(type) {} + virtual ~PluginImpl() {} + virtual BlockImpl* instantiate(BufferFactory& bufs, const Raul::Symbol& symbol, bool polyphonic, @@ -60,11 +61,26 @@ public: virtual const Raul::Symbol symbol() const = 0; - Plugin::Type type() const { return _type; } - void type(Plugin::Type t) { _type = t; } + const Atom& type() const { return _type; } + void set_type(const Atom& t) { _type = t; } + + typedef std::pair<Raul::URI, std::string> Preset; + typedef std::map<Raul::URI, std::string> Presets; + + const Presets& presets(bool force_reload=false) { + if (!_presets_loaded || force_reload) { + load_presets(); + } + + return _presets; + } + + virtual void load_presets() { _presets_loaded = true; } protected: - Plugin::Type _type; + Atom _type; + Presets _presets; + bool _presets_loaded; }; } // namespace Server |