diff options
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/interface/ClientInterface.hpp | 20 | ||||
-rw-r--r-- | src/common/interface/CommonInterface.hpp | 54 | ||||
-rw-r--r-- | src/common/interface/DataType.hpp | 10 | ||||
-rw-r--r-- | src/common/interface/EngineInterface.hpp | 31 | ||||
-rw-r--r-- | src/common/interface/Resource.hpp | 12 |
5 files changed, 65 insertions, 62 deletions
diff --git a/src/common/interface/ClientInterface.hpp b/src/common/interface/ClientInterface.hpp index 23e3c375..104427e6 100644 --- a/src/common/interface/ClientInterface.hpp +++ b/src/common/interface/ClientInterface.hpp @@ -23,6 +23,8 @@ #include <inttypes.h> #include "interface/CommonInterface.hpp" +namespace Raul { class Path; class URI; } + namespace Ingen { namespace Shared { @@ -37,7 +39,7 @@ class ClientInterface : public CommonInterface public: virtual ~ClientInterface() {} - virtual std::string uri() const = 0; + virtual Raul::URI uri() const = 0; virtual void response_ok(int32_t id) = 0; virtual void response_error(int32_t id, const std::string& msg) = 0; @@ -61,20 +63,20 @@ public: virtual void error(const std::string& msg) = 0; - virtual void new_plugin(const std::string& uri, - const std::string& type_uri, - const std::string& symbol) = 0; + virtual void new_plugin(const Raul::URI& uri, + const Raul::URI& type_uri, + const Raul::Symbol& symbol) = 0; - virtual void activity(const std::string& path) = 0; + virtual void activity(const Raul::Path& path) = 0; - virtual void program_add(const std::string& node_path, + virtual void program_add(const Raul::Path& node_path, uint32_t bank, uint32_t program, const std::string& program_name) = 0; - virtual void program_remove(const std::string& node_path, - uint32_t bank, - uint32_t program) = 0; + virtual void program_remove(const Raul::Path& node_path, + uint32_t bank, + uint32_t program) = 0; }; diff --git a/src/common/interface/CommonInterface.hpp b/src/common/interface/CommonInterface.hpp index 9bbef09d..aaa06628 100644 --- a/src/common/interface/CommonInterface.hpp +++ b/src/common/interface/CommonInterface.hpp @@ -23,7 +23,7 @@ #include "interface/CommonInterface.hpp" #include "interface/GraphObject.hpp" -namespace Raul { class Atom; } +namespace Raul { class Atom; class Path; class URI; } namespace Ingen { namespace Shared { @@ -47,44 +47,44 @@ public: virtual bool new_object(const GraphObject* object) = 0; - virtual void new_patch(const std::string& path, - uint32_t poly) = 0; + virtual void new_patch(const Raul::Path& path, + uint32_t poly) = 0; - virtual void new_node(const std::string& path, - const std::string& plugin_uri) = 0; + virtual void new_node(const Raul::Path& path, + const Raul::URI& plugin_uri) = 0; - virtual void new_port(const std::string& path, - const std::string& type, - uint32_t index, - bool is_output) = 0; + virtual void new_port(const Raul::Path& path, + const Raul::URI& type, + uint32_t index, + bool is_output) = 0; - virtual void rename(const std::string& old_path, - const std::string& new_path) = 0; + virtual void rename(const Raul::Path& old_path, + const Raul::Path& new_path) = 0; - virtual void connect(const std::string& src_port_path, - const std::string& dst_port_path) = 0; + virtual void connect(const Raul::Path& src_port_path, + const Raul::Path& dst_port_path) = 0; - virtual void disconnect(const std::string& src_port_path, - const std::string& dst_port_path) = 0; + virtual void disconnect(const Raul::Path& src_port_path, + const Raul::Path& dst_port_path) = 0; - virtual void set_variable(const std::string& subject_path, - const std::string& predicate, - const Raul::Atom& value) = 0; + virtual void set_variable(const Raul::Path& subject_path, + const Raul::URI& predicate, + const Raul::Atom& value) = 0; - virtual void set_property(const std::string& subject_path, - const std::string& predicate, - const Raul::Atom& value) = 0; + virtual void set_property(const Raul::Path& subject_path, + const Raul::URI& predicate, + const Raul::Atom& value) = 0; - virtual void set_port_value(const std::string& port_path, + virtual void set_port_value(const Raul::Path& port_path, const Raul::Atom& value) = 0; - virtual void set_voice_value(const std::string& port_path, - uint32_t voice, - const Raul::Atom& value) = 0; + virtual void set_voice_value(const Raul::Path& port_path, + uint32_t voice, + const Raul::Atom& value) = 0; - virtual void destroy(const std::string& path) = 0; + virtual void destroy(const Raul::Path& path) = 0; - virtual void clear_patch(const std::string& patch_path) = 0; + virtual void clear_patch(const Raul::Path& patch_path) = 0; }; diff --git a/src/common/interface/DataType.hpp b/src/common/interface/DataType.hpp index 52831e2a..c2ef6674 100644 --- a/src/common/interface/DataType.hpp +++ b/src/common/interface/DataType.hpp @@ -18,6 +18,8 @@ #ifndef DATATYPE_H #define DATATYPE_H +#include <raul/URI.hpp> + namespace Ingen { namespace Shared { @@ -40,14 +42,14 @@ public: EVENT = 3 }; - DataType(const std::string& uri) + DataType(const Raul::URI& uri) : _symbol(UNKNOWN) { - if (uri == type_uri(AUDIO)) { + if (uri.str() == type_uri(AUDIO)) { _symbol = AUDIO; - } else if (uri == type_uri(CONTROL)) { + } else if (uri.str() == type_uri(CONTROL)) { _symbol = CONTROL; - } else if (uri == type_uri(EVENT) || uri == "lv2ev:EventPort") { + } else if (uri.str() == type_uri(EVENT) || uri.str() == "lv2ev:EventPort") { _symbol = EVENT; } } diff --git a/src/common/interface/EngineInterface.hpp b/src/common/interface/EngineInterface.hpp index 14289c20..b8462226 100644 --- a/src/common/interface/EngineInterface.hpp +++ b/src/common/interface/EngineInterface.hpp @@ -19,7 +19,6 @@ #define ENGINEINTERFACE_H #include <inttypes.h> -#include <string> #include "interface/CommonInterface.hpp" namespace Ingen { @@ -38,7 +37,7 @@ class EngineInterface : public CommonInterface public: virtual ~EngineInterface() {} - virtual std::string uri() const = 0; + virtual Raul::URI uri() const = 0; // Responses virtual void set_next_response_id(int32_t id) = 0; @@ -46,7 +45,7 @@ public: // Client registration virtual void register_client(ClientInterface* client) = 0; - virtual void unregister_client(const std::string& uri) = 0; + virtual void unregister_client(const Raul::URI& uri) = 0; // Engine commands virtual void load_plugins() = 0; @@ -56,30 +55,30 @@ public: // Object commands - virtual void disconnect_all(const std::string& parent_patch_path, - const std::string& path) = 0; + virtual void disconnect_all(const Raul::Path& parent_patch_path, + const Raul::Path& path) = 0; - virtual void set_program(const std::string& node_path, - uint32_t bank, - uint32_t program) = 0; + virtual void set_program(const Raul::Path& node_path, + uint32_t bank, + uint32_t program) = 0; - virtual void midi_learn(const std::string& node_path) = 0; + virtual void midi_learn(const Raul::Path& node_path) = 0; // Requests virtual void ping() = 0; - virtual void request_plugin(const std::string& uri) = 0; + virtual void request_plugin(const Raul::URI& uri) = 0; - virtual void request_object(const std::string& path) = 0; + virtual void request_object(const Raul::Path& path) = 0; - virtual void request_port_value(const std::string& port_path) = 0; + virtual void request_port_value(const Raul::Path& port_path) = 0; - virtual void request_variable(const std::string& path, - const std::string& key) = 0; + virtual void request_variable(const Raul::Path& path, + const Raul::URI& key) = 0; - virtual void request_property(const std::string& path, - const std::string& key) = 0; + virtual void request_property(const Raul::Path& path, + const Raul::URI& key) = 0; virtual void request_plugins() = 0; diff --git a/src/common/interface/Resource.hpp b/src/common/interface/Resource.hpp index 109e1021..d22f0a59 100644 --- a/src/common/interface/Resource.hpp +++ b/src/common/interface/Resource.hpp @@ -21,7 +21,7 @@ #include <string> #include <map> -namespace Raul { class Atom; } +namespace Raul { class Atom; class URI; } namespace Ingen { namespace Shared { @@ -30,16 +30,16 @@ namespace Shared { class Resource { public: - typedef std::map<std::string, Raul::Atom> Properties; + typedef std::map<Raul::URI, Raul::Atom> Properties; - virtual const std::string uri() const = 0; + virtual const Raul::URI uri() const = 0; virtual const Properties& properties() const = 0; virtual Properties& properties() = 0; - virtual void set_property(const std::string& uri, - const Raul::Atom& value) = 0; + virtual void set_property(const Raul::URI& uri, + const Raul::Atom& value) = 0; - virtual const Raul::Atom& get_property(const std::string& uri) const = 0; + virtual const Raul::Atom& get_property(const Raul::URI& uri) const = 0; }; |