diff options
author | David Robillard <d@drobilla.net> | 2011-05-24 20:52:22 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-05-24 20:52:22 +0000 |
commit | c85f3ab4c7d4c1e793519a400f10fc8499459d80 (patch) | |
tree | e5ec7d84a6ea3c437c0fc555d4c7dda96c84c196 /src/client | |
parent | a63ca8cb96f95849c42250500f327e0fa2f2f850 (diff) | |
download | ingen-c85f3ab4c7d4c1e793519a400f10fc8499459d80.tar.gz ingen-c85f3ab4c7d4c1e793519a400f10fc8499459d80.tar.bz2 ingen-c85f3ab4c7d4c1e793519a400f10fc8499459d80.zip |
Remove use of ingen-config.h in soon-to-be-public headers.
Make Lilv dependency mandatory.
Reduce dependency on ingen-config.h.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3316 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/NodeModel.cpp | 7 | ||||
-rw-r--r-- | src/client/PluginModel.cpp | 39 | ||||
-rw-r--r-- | src/client/PluginModel.hpp | 20 |
3 files changed, 23 insertions, 43 deletions
diff --git a/src/client/NodeModel.cpp b/src/client/NodeModel.cpp index 39ce7c8d..8adbfe90 100644 --- a/src/client/NodeModel.cpp +++ b/src/client/NodeModel.cpp @@ -17,7 +17,7 @@ #include <cassert> #include <cmath> -#include "ingen-config.h" + #include "ingen/Port.hpp" #include "shared/World.hpp" #include "shared/LV2URIMap.hpp" @@ -174,9 +174,7 @@ NodeModel::default_port_value_range(SharedPtr<const PortModel> port, max = 1.0; // Get range from client-side LV2 data -#ifdef HAVE_LILV if (_plugin && _plugin->type() == PluginModel::LV2) { - if (!_min_values) { _num_values = lilv_plugin_get_num_ports(_plugin->lilv_plugin()); _min_values = new float[_num_values]; @@ -190,7 +188,6 @@ NodeModel::default_port_value_range(SharedPtr<const PortModel> port, if (!std::isnan(_max_values[port->index()])) max = _max_values[port->index()]; } -#endif } void @@ -220,7 +217,6 @@ NodeModel::port_label(SharedPtr<const PortModel> port) const return name.get_string(); } -#ifdef HAVE_LILV if (_plugin && _plugin->type() == PluginModel::LV2) { LilvWorld* c_world = _plugin->lilv_world(); const LilvPlugin* c_plugin = _plugin->lilv_plugin(); @@ -236,7 +232,6 @@ NodeModel::port_label(SharedPtr<const PortModel> port) const lilv_node_free(c_name); } } -#endif return port->symbol().c_str(); } diff --git a/src/client/PluginModel.cpp b/src/client/PluginModel.cpp index 3f0bf735..59f68caa 100644 --- a/src/client/PluginModel.cpp +++ b/src/client/PluginModel.cpp @@ -27,18 +27,14 @@ #include "PluginUI.hpp" #include "shared/LV2URIMap.hpp" -#include "ingen-config.h" - using namespace std; using namespace Raul; namespace Ingen { namespace Client { -#ifdef HAVE_LILV LilvWorld* PluginModel::_lilv_world = NULL; const LilvPlugins* PluginModel::_lilv_plugins = NULL; -#endif Sord::World* PluginModel::_rdf_world = NULL; @@ -51,11 +47,10 @@ PluginModel::PluginModel(Shared::LV2URIMap& uris, assert(_rdf_world); add_property("http://www.w3.org/1999/02/22-rdf-syntax-ns#type", this->type_uri()); -#ifdef HAVE_LILV LilvNode* plugin_uri = lilv_new_uri(_lilv_world, uri.c_str()); _lilv_plugin = lilv_plugins_get_by_uri(_lilv_plugins, plugin_uri); lilv_node_free(plugin_uri); -#endif + if (_type == Internal) set_property("http://usefulinc.com/ns/doap#name", Atom(uri.substr(uri.find_last_of('#') + 1).c_str())); @@ -97,7 +92,6 @@ PluginModel::get_property(const URI& key) const return get_property(key); } -#ifdef HAVE_LILV if (_lilv_plugin) { boost::optional<Raul::Atom&> ret; LilvNode* lv2_pred = lilv_new_uri(_lilv_world, key.str().c_str()); @@ -124,7 +118,6 @@ PluginModel::get_property(const URI& key) const if (ret) return *ret; } -#endif return nil; } @@ -134,11 +127,9 @@ PluginModel::set(SharedPtr<PluginModel> p) { _type = p->_type; -#ifdef HAVE_LILV _icon_path = p->_icon_path; if (p->_lilv_plugin) _lilv_plugin = p->_lilv_plugin; -#endif for (Properties::const_iterator v = p->properties().begin(); v != p->properties().end(); ++v) { ResourceImpl::set_property(v->first, v->second); @@ -171,7 +162,6 @@ PluginModel::human_name() const string PluginModel::port_human_name(uint32_t index) const { -#ifdef HAVE_LILV if (_lilv_plugin) { const LilvPort* port = lilv_plugin_get_port_by_index(_lilv_plugin, index); LilvNode* name = lilv_port_get_name(_lilv_plugin, port); @@ -179,11 +169,9 @@ PluginModel::port_human_name(uint32_t index) const lilv_node_free(name); return ret; } -#endif return ""; } -#ifdef HAVE_LILV bool PluginModel::has_ui() const { @@ -191,6 +179,7 @@ PluginModel::has_ui() const const bool ret = (lilv_nodes_size(uis) > 0); lilv_uis_free(uis); return ret; + } SharedPtr<PluginUI> @@ -200,8 +189,7 @@ PluginModel::ui(Ingen::Shared::World* world, if (_type != LV2) return SharedPtr<PluginUI>(); - SharedPtr<PluginUI> ret = PluginUI::create(world, node, _lilv_plugin); - return ret; + return PluginUI::create(world, node, _lilv_plugin); } const string& @@ -234,13 +222,11 @@ PluginModel::get_lv2_icon_path(const LilvPlugin* plugin) lilv_node_free(svg_icon_pred); return result; } -#endif std::string PluginModel::documentation() const { std::string doc; - #ifdef HAVE_LILV if (!_lilv_plugin) return doc; @@ -257,7 +243,7 @@ PluginModel::documentation() const } lilv_node_free(rdfs_comment); lilv_nodes_free(vals); - #endif + return doc; } @@ -265,7 +251,7 @@ std::string PluginModel::port_documentation(uint32_t index) const { std::string doc; - #ifdef HAVE_LILV + if (!_lilv_plugin) return doc; @@ -285,9 +271,22 @@ PluginModel::port_documentation(uint32_t index) const } lilv_node_free(rdfs_comment); lilv_nodes_free(vals); - #endif return doc; } +const LilvPort* +PluginModel::lilv_port(uint32_t index) const +{ + return lilv_plugin_get_port_by_index(_lilv_plugin, index); +} + +void +PluginModel::set_lilv_world(LilvWorld* world) +{ + _lilv_world = world; + _lilv_plugins = lilv_world_get_all_plugins(_lilv_world); +} + + } // namespace Client } // namespace Ingen diff --git a/src/client/PluginModel.hpp b/src/client/PluginModel.hpp index 852a554d..c76960fe 100644 --- a/src/client/PluginModel.hpp +++ b/src/client/PluginModel.hpp @@ -18,16 +18,11 @@ #ifndef INGEN_CLIENT_PLUGINMODEL_HPP #define INGEN_CLIENT_PLUGINMODEL_HPP +#include "lilv/lilv.h" #include "raul/SharedPtr.hpp" #include "raul/Symbol.hpp" - #include "sord/sordmm.hpp" -#include "ingen-config.h" - -#ifdef HAVE_LILV -#include "lilv/lilv.h" -#endif #include "ingen/ServerInterface.hpp" #include "ingen/Plugin.hpp" #include "shared/World.hpp" @@ -66,18 +61,12 @@ public: std::string human_name() const; std::string port_human_name(uint32_t index) const; -#ifdef HAVE_LILV static LilvWorld* lilv_world() { return _lilv_world; } const LilvPlugin* lilv_plugin() const { return _lilv_plugin; } - const LilvPort* lilv_port(uint32_t index) { - return lilv_plugin_get_port_by_index(_lilv_plugin, index); - } + const LilvPort* lilv_port(uint32_t index) const; - static void set_lilv_world(LilvWorld* world) { - _lilv_world = world; - _lilv_plugins = lilv_world_get_all_plugins(_lilv_world); - } + static void set_lilv_world(LilvWorld* world); bool has_ui() const; @@ -86,7 +75,6 @@ public: const std::string& icon_path() const; static std::string get_lv2_icon_path(const LilvPlugin* plugin); -#endif std::string documentation() const; std::string port_documentation(uint32_t index) const; @@ -108,13 +96,11 @@ protected: private: Type _type; -#ifdef HAVE_LILV static LilvWorld* _lilv_world; static const LilvPlugins* _lilv_plugins; const LilvPlugin* _lilv_plugin; mutable std::string _icon_path; -#endif static Sord::World* _rdf_world; }; |