From dd79e76e41446833088482588456afed37231bff Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 12 Aug 2015 04:46:29 +0000 Subject: Server-side presets. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5703 a436a847-0d15-0410-975c-d299462d15a1 --- ingen/client/PluginModel.hpp | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'ingen/client/PluginModel.hpp') 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 +#include #include #include -#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 ScalePoints; ScalePoints port_scale_points(uint32_t i) const; + typedef std::map 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 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 -- cgit v1.2.1