summaryrefslogtreecommitdiffstats
path: root/ingen/client
diff options
context:
space:
mode:
Diffstat (limited to 'ingen/client')
-rw-r--r--ingen/client/BlockModel.hpp4
-rw-r--r--ingen/client/ClientStore.hpp1
-rw-r--r--ingen/client/PluginModel.hpp27
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