summaryrefslogtreecommitdiffstats
path: root/src/common/interface
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-08-16 22:45:35 +0000
committerDavid Robillard <d@drobilla.net>2008-08-16 22:45:35 +0000
commite9ea28e1efb241619606b937ecd2e97f7e23d897 (patch)
tree88ead187b63945d61837d075e10be9b105b870cd /src/common/interface
parent491762bb487e1007f11cdc4dc7c01b03e3bd0d9d (diff)
downloadingen-e9ea28e1efb241619606b937ecd2e97f7e23d897.tar.gz
ingen-e9ea28e1efb241619606b937ecd2e97f7e23d897.tar.bz2
ingen-e9ea28e1efb241619606b937ecd2e97f7e23d897.zip
Begin factoring out common elements of EngineInterface and ClientInterface.
git-svn-id: http://svn.drobilla.net/lad/ingen@1406 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/common/interface')
-rw-r--r--src/common/interface/ClientInterface.hpp9
-rw-r--r--src/common/interface/CommonInterface.hpp65
-rw-r--r--src/common/interface/EngineInterface.hpp126
3 files changed, 131 insertions, 69 deletions
diff --git a/src/common/interface/ClientInterface.hpp b/src/common/interface/ClientInterface.hpp
index 931e267b..9b0cbffb 100644
--- a/src/common/interface/ClientInterface.hpp
+++ b/src/common/interface/ClientInterface.hpp
@@ -30,7 +30,6 @@ class EngineInterface;
/** The (only) interface the engine uses to communicate with clients.
- *
* Purely virtual (except for the destructor).
*
* \ingroup interface
@@ -106,11 +105,11 @@ public:
virtual void object_destroyed(const std::string& path) = 0;
- virtual void connection(const std::string& src_port_path,
- const std::string& dst_port_path) = 0;
+ virtual void connect(const std::string& src_port_path,
+ const std::string& dst_port_path) = 0;
- virtual void disconnection(const std::string& src_port_path,
- const std::string& dst_port_path) = 0;
+ virtual void disconnect(const std::string& src_port_path,
+ const std::string& dst_port_path) = 0;
virtual void variable_change(const std::string& subject_path,
const std::string& predicate,
diff --git a/src/common/interface/CommonInterface.hpp b/src/common/interface/CommonInterface.hpp
new file mode 100644
index 00000000..da147e9f
--- /dev/null
+++ b/src/common/interface/CommonInterface.hpp
@@ -0,0 +1,65 @@
+/* This file is part of Ingen.
+ * Copyright (C) 2008 Dave Robillard <http://drobilla.net>
+ *
+ * Ingen is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the License, or (at your option) any later
+ * version.
+ *
+ * Ingen is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef COMMONINTERFACE_H
+#define COMMONINTERFACE_H
+
+#include <inttypes.h>
+#include <string>
+#include <raul/SharedPtr.hpp>
+#include "interface/ClientInterface.hpp"
+#include "interface/CommonInterface.hpp"
+
+namespace Ingen {
+namespace Shared {
+
+
+/** Abstract interface common to both engine and clients.
+ * Purely virtual (except for the destructor).
+ *
+ * \ingroup interface
+ */
+class CommonInterface
+{
+public:
+ virtual ~CommonInterface() {}
+
+ // Bundles
+ virtual void bundle_begin() = 0;
+ virtual void bundle_end() = 0;
+
+ // Object commands
+
+ virtual void new_patch(const std::string& path,
+ uint32_t poly) = 0;
+
+ virtual void connect(const std::string& src_port_path,
+ const std::string& dst_port_path) = 0;
+
+ virtual void disconnect(const std::string& src_port_path,
+ const std::string& dst_port_path) = 0;
+
+protected:
+ CommonInterface() {}
+};
+
+
+} // namespace Shared
+} // namespace Ingen
+
+#endif // COMMONINTERFACE_H
+
diff --git a/src/common/interface/EngineInterface.hpp b/src/common/interface/EngineInterface.hpp
index 08fb9c1a..a6481a7d 100644
--- a/src/common/interface/EngineInterface.hpp
+++ b/src/common/interface/EngineInterface.hpp
@@ -22,21 +22,18 @@
#include <string>
#include <raul/SharedPtr.hpp>
#include "interface/ClientInterface.hpp"
-using std::string;
-using Ingen::Shared::ClientInterface;
+#include "interface/CommonInterface.hpp"
namespace Ingen {
-/** Shared code used on both client side and engine side (abstract interfaces). */
namespace Shared {
/** The (only) interface clients use to communicate with the engine.
- *
* Purely virtual (except for the destructor).
*
* \ingroup interface
*/
-class EngineInterface
+class EngineInterface : public CommonInterface
{
public:
virtual ~EngineInterface() {}
@@ -47,7 +44,7 @@ public:
// Client registration
virtual void register_client(ClientInterface* client) = 0;
- virtual void unregister_client(const string& uri) = 0;
+ virtual void unregister_client(const std::string& uri) = 0;
// Engine commands
virtual void load_plugins() = 0;
@@ -61,95 +58,96 @@ public:
// Object commands
- virtual void create_patch(const string& path,
- uint32_t poly) = 0;
+ virtual void new_patch(const std::string& path,
+ uint32_t poly) = 0;
- virtual void create_port(const string& path,
- const string& data_type,
- bool is_output) = 0;
+ virtual void create_port(const std::string& path,
+ const std::string& data_type,
+ bool is_output) = 0;
- virtual void create_node(const string& path,
- const string& plugin_uri,
- bool polyphonic) = 0;
+ virtual void create_node(const std::string& path,
+ const std::string& plugin_uri,
+ bool polyphonic) = 0;
/** DEPRECATED */
- virtual void create_node(const string& path,
- const string& plugin_type,
- const string& library_name,
- const string& plugin_label,
- bool polyphonic) = 0;
+ virtual void create_node(const std::string& path,
+ const std::string& plugin_type,
+ const std::string& library_name,
+ const std::string& plugin_label,
+ bool polyphonic) = 0;
- virtual void rename(const string& old_path,
- const string& new_symbol) = 0;
+ virtual void rename(const std::string& old_path,
+ const std::string& new_symbol) = 0;
- virtual void destroy(const string& path) = 0;
+ virtual void destroy(const std::string& path) = 0;
- virtual void clear_patch(const string& patch_path) = 0;
+ virtual void clear_patch(const std::string& patch_path) = 0;
- virtual void set_polyphony(const string& patch_path, uint32_t poly) = 0;
+ virtual void set_polyphony(const std::string& patch_path, uint32_t poly) = 0;
- virtual void set_polyphonic(const string& path, bool poly) = 0;
+ virtual void set_polyphonic(const std::string& path, bool poly) = 0;
- virtual void enable_patch(const string& patch_path) = 0;
+ virtual void enable_patch(const std::string& patch_path) = 0;
- virtual void disable_patch(const string& patch_path) = 0;
+ virtual void disable_patch(const std::string& patch_path) = 0;
- virtual void connect(const string& src_port_path,
- const string& dst_port_path) = 0;
+ virtual void connect(const std::string& src_port_path,
+ const std::string& dst_port_path) = 0;
- virtual void disconnect(const string& src_port_path,
- const string& dst_port_path) = 0;
+ virtual void disconnect(const std::string& src_port_path,
+ const std::string& dst_port_path) = 0;
- virtual void disconnect_all(const string& parent_patch_path,
- const string& path) = 0;
+ virtual void disconnect_all(const std::string& parent_patch_path,
+ const std::string& path) = 0;
- virtual void set_port_value(const string& port_path,
- const string& type_uri,
- uint32_t data_size,
- const void* data) = 0;
+ virtual void set_port_value(const std::string& port_path,
+ const std::string& type_uri,
+ uint32_t data_size,
+ const void* data) = 0;
- virtual void set_port_value(const string& port_path,
- const string& type_uri,
- uint32_t voice,
- uint32_t data_size,
- const void* data) = 0;
+ virtual void set_port_value(const std::string& port_path,
+ const std::string& type_uri,
+ uint32_t voice,
+ uint32_t data_size,
+ const void* data) = 0;
- virtual void set_port_value_immediate(const string& port_path,
- const string& type_uri,
- uint32_t data_size,
- const void* data) = 0;
+ virtual void set_port_value_immediate(const std::string& port_path,
+ const std::string& type_uri,
+ uint32_t data_size,
+ const void* data) = 0;
- virtual void set_port_value_immediate(const string& port_path,
- const string& type_uri,
- uint32_t voice,
- uint32_t data_size,
- const void* data) = 0;
+ virtual void set_port_value_immediate(const std::string& port_path,
+ const std::string& type_uri,
+ uint32_t voice,
+ uint32_t data_size,
+ const void* data) = 0;
- virtual void enable_port_broadcasting(const string& port_path) = 0;
+ virtual void enable_port_broadcasting(const std::string& port_path) = 0;
- virtual void disable_port_broadcasting(const string& port_path) = 0;
+ virtual void disable_port_broadcasting(const std::string& port_path) = 0;
- virtual void set_program(const string& node_path,
- uint32_t bank,
- uint32_t program) = 0;
+ virtual void set_program(const std::string& node_path,
+ uint32_t bank,
+ uint32_t program) = 0;
- virtual void midi_learn(const string& node_path) = 0;
+ virtual void midi_learn(const std::string& node_path) = 0;
- virtual void set_variable(const string& path,
- const string& predicate,
- const Raul::Atom& value) = 0;
+ virtual void set_variable(const std::string& subject_path,
+ const std::string& predicate,
+ const Raul::Atom& value) = 0;
// Requests
virtual void ping() = 0;
- virtual void request_plugin(const string& uri) = 0;
+ virtual void request_plugin(const std::string& uri) = 0;
- virtual void request_object(const string& path) = 0;
+ virtual void request_object(const std::string& path) = 0;
- virtual void request_port_value(const string& port_path) = 0;
+ virtual void request_port_value(const std::string& port_path) = 0;
- virtual void request_variable(const string& path, const string& key) = 0;
+ virtual void request_variable(const std::string& path,
+ const std::string& key) = 0;
virtual void request_plugins() = 0;