summaryrefslogtreecommitdiffstats
path: root/ingen/client
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-07-30 23:00:13 +0000
committerDavid Robillard <d@drobilla.net>2012-07-30 23:00:13 +0000
commit0e1bf6ddfc77866ff6477a3f394c030c2a5e1b39 (patch)
treeafcba1a0ba16837f7b6f1a4822b7164deccb61e7 /ingen/client
parent921881813d7fb2e46a0e65d1e888f6cd9a928945 (diff)
downloadingen-0e1bf6ddfc77866ff6477a3f394c030c2a5e1b39.tar.gz
ingen-0e1bf6ddfc77866ff6477a3f394c030c2a5e1b39.tar.bz2
ingen-0e1bf6ddfc77866ff6477a3f394c030c2a5e1b39.zip
Eliminate pure virtual base classes Patch, Node, and Port, and the virtual inheritance they imposed.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4576 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'ingen/client')
-rw-r--r--ingen/client/NodeModel.hpp11
-rw-r--r--ingen/client/PatchModel.hpp22
-rw-r--r--ingen/client/PortModel.hpp5
3 files changed, 15 insertions, 23 deletions
diff --git a/ingen/client/NodeModel.hpp b/ingen/client/NodeModel.hpp
index cc41070c..07810eed 100644
--- a/ingen/client/NodeModel.hpp
+++ b/ingen/client/NodeModel.hpp
@@ -22,9 +22,7 @@
#include <vector>
#include "raul/SharedPtr.hpp"
-
-#include "ingen/Node.hpp"
-#include "ingen/Port.hpp"
+#include "ingen/GraphObject.hpp"
#include "ingen/client/ObjectModel.hpp"
#include "ingen/client/PortModel.hpp"
#include "ingen/client/PluginModel.hpp"
@@ -44,18 +42,19 @@ class ClientStore;
*
* @ingroup IngenClient
*/
-class NodeModel : public ObjectModel,
- virtual public Ingen::Node
+class NodeModel : public ObjectModel
{
public:
NodeModel(const NodeModel& copy);
virtual ~NodeModel();
+ GraphType graph_type() const { return GraphObject::PATCH; }
+
typedef std::vector< SharedPtr<const PortModel> > Ports;
SharedPtr<const PortModel> get_port(const Raul::Symbol& symbol) const;
- Port* port(uint32_t index) const;
+ GraphObject* port(uint32_t index) const;
const Raul::URI& plugin_uri() const { return _plugin_uri; }
const Plugin* plugin() const { return _plugin.get(); }
diff --git a/ingen/client/PatchModel.hpp b/ingen/client/PatchModel.hpp
index 9d4e7752..1ad55c78 100644
--- a/ingen/client/PatchModel.hpp
+++ b/ingen/client/PatchModel.hpp
@@ -17,15 +17,10 @@
#ifndef INGEN_CLIENT_PATCHMODEL_HPP
#define INGEN_CLIENT_PATCHMODEL_HPP
-#include "raul/SharedPtr.hpp"
-
-#include "ingen/Patch.hpp"
#include "ingen/client/NodeModel.hpp"
+#include "raul/SharedPtr.hpp"
namespace Ingen {
-
-class Port;
-
namespace Client {
class ClientStore;
@@ -35,15 +30,15 @@ class EdgeModel;
*
* @ingroup IngenClient
*/
-class PatchModel : public NodeModel, public Ingen::Patch
+class PatchModel : public NodeModel
{
public:
/* WARNING: Copy constructor creates a shallow copy WRT connections */
- const Edges& edges() const { return *_edges.get(); }
+ GraphType graph_type() const { return GraphObject::PATCH; }
- SharedPtr<EdgeModel> get_edge(const Ingen::Port* tail,
- const Ingen::Port* head);
+ SharedPtr<EdgeModel> get_edge(const Ingen::GraphObject* tail,
+ const Ingen::GraphObject* head);
bool enabled() const;
bool polyphonic() const;
@@ -60,7 +55,6 @@ private:
PatchModel(Shared::URIs& uris, const Raul::Path& patch_path)
: NodeModel(uris, "http://drobilla.net/ns/ingen#Patch", patch_path)
- , _edges(new Edges())
{
}
@@ -69,10 +63,8 @@ private:
bool remove_child(SharedPtr<ObjectModel> c);
void add_edge(SharedPtr<EdgeModel> cm);
- void remove_edge(const Ingen::Port* tail,
- const Ingen::Port* head);
-
- SharedPtr<Edges> _edges;
+ void remove_edge(const Ingen::GraphObject* tail,
+ const Ingen::GraphObject* head);
};
} // namespace Client
diff --git a/ingen/client/PortModel.hpp b/ingen/client/PortModel.hpp
index 477186fb..99cd85be 100644
--- a/ingen/client/PortModel.hpp
+++ b/ingen/client/PortModel.hpp
@@ -26,7 +26,6 @@
#include "lv2/lv2plug.in/ns/ext/port-props/port-props.h"
#include "lv2/lv2plug.in/ns/lv2core/lv2.h"
-#include "ingen/Port.hpp"
#include "ingen/client/ObjectModel.hpp"
namespace Raul { class Path; }
@@ -38,11 +37,13 @@ namespace Client {
*
* @ingroup IngenClient
*/
-class PortModel : public ObjectModel, public Ingen::Port
+class PortModel : public ObjectModel
{
public:
enum Direction { INPUT, OUTPUT };
+ GraphType graph_type() const { return GraphObject::PORT; }
+
bool supports(const Raul::URI& value_type) const;
inline uint32_t index() const { return _index; }