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 /ingen/client | |
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 'ingen/client')
-rw-r--r-- | ingen/client/BlockModel.hpp | 4 | ||||
-rw-r--r-- | ingen/client/ClientStore.hpp | 1 | ||||
-rw-r--r-- | ingen/client/PluginModel.hpp | 27 |
3 files changed, 24 insertions, 8 deletions
diff --git a/ingen/client/BlockModel.hpp b/ingen/client/BlockModel.hpp index 93dcb1a7..e689414c 100644 --- a/ingen/client/BlockModel.hpp +++ b/ingen/client/BlockModel.hpp @@ -59,8 +59,8 @@ public: Node* port(uint32_t index) const; const Raul::URI& plugin_uri() const { return _plugin_uri; } - const Plugin* plugin() const { return _plugin.get(); } - Plugin* plugin() { return _plugin.get(); } + const Resource* plugin() const { return _plugin.get(); } + Resource* plugin() { return _plugin.get(); } SPtr<PluginModel> plugin_model() const { return _plugin; } uint32_t num_ports() const { return _ports.size(); } const Ports& ports() const { return _ports; } diff --git a/ingen/client/ClientStore.hpp b/ingen/client/ClientStore.hpp index 9ba4aa26..e9fda479 100644 --- a/ingen/client/ClientStore.hpp +++ b/ingen/client/ClientStore.hpp @@ -113,6 +113,7 @@ public: private: SPtr<ObjectModel> _object(const Raul::Path& path); SPtr<PluginModel> _plugin(const Raul::URI& uri); + SPtr<PluginModel> _plugin(const Atom& uri); SPtr<Resource> _resource(const Raul::URI& uri); void add_object(SPtr<ObjectModel> object); diff --git a/ingen/client/PluginModel.hpp b/ingen/client/PluginModel.hpp index bbc6308d..e468aede 100644 --- a/ingen/client/PluginModel.hpp +++ b/ingen/client/PluginModel.hpp @@ -18,11 +18,10 @@ #define INGEN_CLIENT_PLUGINMODEL_HPP #include <list> +#include <map> #include <string> #include <utility> -#include "ingen/Plugin.hpp" -#include "ingen/Resource.hpp" #include "ingen/Resource.hpp" #include "ingen/World.hpp" #include "ingen/client/signal.hpp" @@ -46,15 +45,20 @@ class PluginUI; * * @ingroup IngenClient */ -class INGEN_API PluginModel : public Ingen::Plugin +class INGEN_API PluginModel : public Ingen::Resource { public: PluginModel(URIs& uris, const Raul::URI& uri, - const Raul::URI& type_uri, + const Atom& type, const Ingen::Resource::Properties& properties); - Type type() const { return _type; } + const Atom& type() const { return _type; } + const Raul::URI type_uri() const { + return Raul::URI(_type.is_valid() + ? _uris.forge.str(_type) + : "http://www.w3.org/2002/07/owl#Nothing"); + } virtual const Atom& get_property(const Raul::URI& key) const; @@ -65,6 +69,9 @@ public: typedef std::map<float, std::string> ScalePoints; ScalePoints port_scale_points(uint32_t i) const; + typedef std::map<Raul::URI, std::string> Presets; + const Presets& presets() const { return _presets; } + static LilvWorld* lilv_world() { return _lilv_world; } const LilvPlugin* lilv_plugin() const { return _lilv_plugin; } @@ -89,11 +96,17 @@ public: // Signals INGEN_SIGNAL(changed, void); INGEN_SIGNAL(property, void, const Raul::URI&, const Atom&); + INGEN_SIGNAL(preset, void, const Raul::URI&, const std::string&); + + bool fetched() const { return _fetched; } + void set_fetched(bool f) { _fetched = f; } protected: friend class ClientStore; void set(SPtr<PluginModel> p); + void add_preset(const Raul::URI& uri, const std::string& label); + private: std::string get_documentation(const LilvNode* subject, bool html) const; @@ -101,8 +114,10 @@ private: static LilvWorld* _lilv_world; static const LilvPlugins* _lilv_plugins; - Type _type; + Atom _type; const LilvPlugin* _lilv_plugin; + Presets _presets; + bool _fetched; }; } // namespace Client |