summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-05-13 01:22:29 +0000
committerDavid Robillard <d@drobilla.net>2011-05-13 01:22:29 +0000
commit981c7950a6f5fc9f22decaee261556d20b641d5c (patch)
tree326c2256d5876e3c55ec2fb9ea13c4a04f29bf0b
parenteae8f927dbf4913c7cb72605af5da0763f7be422 (diff)
downloadingen-981c7950a6f5fc9f22decaee261556d20b641d5c.tar.gz
ingen-981c7950a6f5fc9f22decaee261556d20b641d5c.tar.bz2
ingen-981c7950a6f5fc9f22decaee261556d20b641d5c.zip
Make signals private with accessors, and localise dependency on sigc::signal.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3258 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--src/client/ClientStore.cpp22
-rw-r--r--src/client/ClientStore.hpp5
-rw-r--r--src/client/NodeModel.cpp4
-rw-r--r--src/client/NodeModel.hpp5
-rw-r--r--src/client/ObjectModel.cpp8
-rw-r--r--src/client/ObjectModel.hpp13
-rw-r--r--src/client/PatchModel.cpp10
-rw-r--r--src/client/PatchModel.hpp13
-rw-r--r--src/client/PluginModel.cpp4
-rw-r--r--src/client/PluginModel.hpp7
-rw-r--r--src/client/PortModel.cpp2
-rw-r--r--src/client/PortModel.hpp19
-rw-r--r--src/client/SigClientInterface.hpp47
-rw-r--r--src/client/ThreadedSigClientInterface.hpp33
-rw-r--r--src/client/signal.hpp30
-rw-r--r--src/gui/App.cpp6
-rw-r--r--src/gui/BreadCrumbs.cpp2
-rw-r--r--src/gui/ConnectWindow.cpp4
-rw-r--r--src/gui/Controls.cpp6
-rw-r--r--src/gui/LoadPluginWindow.cpp8
-rw-r--r--src/gui/NodeModule.cpp16
-rw-r--r--src/gui/ObjectMenu.cpp2
-rw-r--r--src/gui/PatchCanvas.cpp16
-rw-r--r--src/gui/PatchPortModule.cpp3
-rw-r--r--src/gui/PatchTreeWindow.cpp21
-rw-r--r--src/gui/PatchView.cpp11
-rw-r--r--src/gui/PatchWindow.cpp12
-rw-r--r--src/gui/Port.cpp10
-rw-r--r--src/gui/PortPropertiesWindow.cpp13
-rw-r--r--src/gui/PropertiesWindow.cpp2
30 files changed, 196 insertions, 158 deletions
diff --git a/src/client/ClientStore.cpp b/src/client/ClientStore.cpp
index e647c130..52d05622 100644
--- a/src/client/ClientStore.cpp
+++ b/src/client/ClientStore.cpp
@@ -42,9 +42,9 @@ using namespace Shared;
namespace Client {
-ClientStore::ClientStore(SharedPtr<Shared::LV2URIMap> uris,
- SharedPtr<ServerInterface> engine,
- SharedPtr<SigClientInterface> emitter)
+ClientStore::ClientStore(SharedPtr<Shared::LV2URIMap> uris,
+ SharedPtr<ServerInterface> engine,
+ SharedPtr<SigClientInterface> emitter)
: _uris(uris)
, _engine(engine)
, _emitter(emitter)
@@ -54,8 +54,8 @@ ClientStore::ClientStore(SharedPtr<Shared::LV2URIMap> uris,
return;
#define CONNECT(signal, method) \
- emitter->signal_ ## signal .connect( \
- sigc::mem_fun(this, &ClientStore:: method));
+ emitter->signal_##signal().connect( \
+ sigc::mem_fun(this, &ClientStore::method));
CONNECT(object_deleted, del);
CONNECT(object_moved, move);
@@ -93,11 +93,11 @@ ClientStore::add_object(SharedPtr<ObjectModel> object)
assert(parent && (object->parent() == parent));
(*this)[object->path()] = object;
- signal_new_object.emit(object);
+ _signal_new_object.emit(object);
}
} else {
(*this)[object->path()] = object;
- signal_new_object.emit(object);
+ _signal_new_object.emit(object);
}
}
@@ -105,7 +105,7 @@ ClientStore::add_object(SharedPtr<ObjectModel> object)
typedef Resource::Properties::const_iterator Iterator;
for (Iterator i = object->properties().begin();
i != object->properties().end(); ++i)
- object->signal_property(i->first, i->second);
+ object->signal_property().emit(i->first, i->second);
LOG(debug) << "Added " << object->path() << " {" << endl;
for (iterator i = begin(); i != end(); ++i) {
@@ -132,7 +132,7 @@ ClientStore::remove_object(const Path& path)
LOG(debug) << "}" << endl;
if (result)
- result->signal_destroyed.emit();
+ result->signal_destroyed().emit();
if (!result->path().is_root()) {
assert(result->parent());
@@ -195,7 +195,7 @@ ClientStore::add_plugin(SharedPtr<PluginModel> pm)
existing->set(pm);
} else {
_plugins->insert(make_pair(pm->uri(), pm));
- signal_new_plugin(pm);
+ _signal_new_plugin.emit(pm);
}
}
@@ -401,7 +401,7 @@ ClientStore::activity(const Path& path)
{
SharedPtr<PortModel> port = PtrCast<PortModel>(object(path));
if (port)
- port->signal_activity.emit();
+ port->signal_activity().emit();
else
LOG(error) << "Activity for non-existent port " << path << endl;
}
diff --git a/src/client/ClientStore.hpp b/src/client/ClientStore.hpp
index a5a3cbc1..59b112ed 100644
--- a/src/client/ClientStore.hpp
+++ b/src/client/ClientStore.hpp
@@ -31,6 +31,7 @@
#include "raul/PathTable.hpp"
#include "raul/TableImpl.hpp"
#include "shared/Store.hpp"
+#include "client/signal.hpp"
namespace Raul { class Atom; }
@@ -102,8 +103,8 @@ public:
void del(const Raul::URI& uri);
- sigc::signal< void, SharedPtr<ObjectModel> > signal_new_object;
- sigc::signal< void, SharedPtr<PluginModel> > signal_new_plugin;
+ INGEN_SIGNAL(new_object, void, SharedPtr<ObjectModel>);
+ INGEN_SIGNAL(new_plugin, void, SharedPtr<PluginModel>);
private:
void add(GraphObject* o) { throw; }
diff --git a/src/client/NodeModel.cpp b/src/client/NodeModel.cpp
index ce96e775..7847afb40 100644
--- a/src/client/NodeModel.cpp
+++ b/src/client/NodeModel.cpp
@@ -76,7 +76,7 @@ NodeModel::remove_port(SharedPtr<PortModel> port)
break;
}
}
- signal_removed_port.emit(port);
+ _signal_removed_port.emit(port);
}
void
@@ -142,7 +142,7 @@ NodeModel::add_port(SharedPtr<PortModel> pm)
assert(existing == _ports.end());
_ports.push_back(pm);
- signal_new_port.emit(pm);
+ _signal_new_port.emit(pm);
}
SharedPtr<PortModel>
diff --git a/src/client/NodeModel.hpp b/src/client/NodeModel.hpp
index 2a47bc04..314ed1b4 100644
--- a/src/client/NodeModel.hpp
+++ b/src/client/NodeModel.hpp
@@ -21,7 +21,6 @@
#include <cstdlib>
#include <string>
#include <vector>
-#include <sigc++/sigc++.h>
#include "raul/SharedPtr.hpp"
#include "ingen/Node.hpp"
#include "ingen/Port.hpp"
@@ -70,8 +69,8 @@ public:
std::string port_label(SharedPtr<PortModel> port) const;
// Signals
- sigc::signal<void, SharedPtr<PortModel> > signal_new_port;
- sigc::signal<void, SharedPtr<PortModel> > signal_removed_port;
+ INGEN_SIGNAL(new_port, void, SharedPtr<PortModel>);
+ INGEN_SIGNAL(removed_port, void, SharedPtr<PortModel>);
protected:
friend class ClientStore;
diff --git a/src/client/ObjectModel.cpp b/src/client/ObjectModel.cpp
index e85742a9..2478e786 100644
--- a/src/client/ObjectModel.cpp
+++ b/src/client/ObjectModel.cpp
@@ -50,7 +50,7 @@ ObjectModel::~ObjectModel()
Raul::Atom&
ObjectModel::set_property(const Raul::URI& key, const Raul::Atom& value)
{
- signal_property.emit(key, value);
+ _signal_property.emit(key, value);
return ResourceImpl::set_property(key, value);
}
@@ -58,7 +58,7 @@ void
ObjectModel::add_property(const Raul::URI& key, const Raul::Atom& value)
{
ResourceImpl::add_property(key, value);
- signal_property.emit(key, value);
+ _signal_property.emit(key, value);
}
const Atom&
@@ -91,7 +91,7 @@ ObjectModel::set(SharedPtr<ObjectModel> o)
for (Properties::const_iterator v = o->properties().begin();
v != o->properties().end(); ++v) {
ResourceImpl::set_property(v->first, v->second);
- signal_property.emit(v->first, v->second);
+ _signal_property.emit(v->first, v->second);
}
}
@@ -100,7 +100,7 @@ ObjectModel::set_path(const Raul::Path& p)
{
_path = p;
_symbol = p.symbol();
- signal_moved.emit();
+ _signal_moved.emit();
}
void
diff --git a/src/client/ObjectModel.hpp b/src/client/ObjectModel.hpp
index 21cf4b2b..bcba2242 100644
--- a/src/client/ObjectModel.hpp
+++ b/src/client/ObjectModel.hpp
@@ -1,4 +1,3 @@
-
/* This file is part of Ingen.
* Copyright 2007-2011 David Robillard <http://drobilla.net>
*
@@ -23,12 +22,12 @@
#include <algorithm>
#include <cassert>
#include <boost/utility.hpp>
-#include <sigc++/sigc++.h>
#include "raul/Path.hpp"
#include "raul/URI.hpp"
#include "raul/SharedPtr.hpp"
#include "ingen/GraphObject.hpp"
#include "shared/ResourceImpl.hpp"
+#include "client/signal.hpp"
namespace Ingen {
@@ -68,11 +67,11 @@ public:
GraphObject* graph_parent() const { return _parent.get(); }
// Signals
- sigc::signal<void, SharedPtr<ObjectModel> > signal_new_child;
- sigc::signal<void, SharedPtr<ObjectModel> > signal_removed_child;
- sigc::signal<void, const Raul::URI&, const Raul::Atom&> signal_property;
- sigc::signal<void> signal_destroyed;
- sigc::signal<void> signal_moved;
+ INGEN_SIGNAL(new_child, void, SharedPtr<ObjectModel>);
+ INGEN_SIGNAL(removed_child, void, SharedPtr<ObjectModel>);
+ INGEN_SIGNAL(property, void, const Raul::URI&, const Raul::Atom&);
+ INGEN_SIGNAL(destroyed, void);
+ INGEN_SIGNAL(moved, void);
protected:
friend class ClientStore;
diff --git a/src/client/PatchModel.cpp b/src/client/PatchModel.cpp
index 190bc3ba..5dcf4ab0 100644
--- a/src/client/PatchModel.cpp
+++ b/src/client/PatchModel.cpp
@@ -42,7 +42,7 @@ PatchModel::add_child(SharedPtr<ObjectModel> c)
SharedPtr<NodeModel> nm = PtrCast<NodeModel>(c);
if (nm)
- signal_new_node.emit(nm);
+ _signal_new_node.emit(nm);
}
bool
@@ -64,7 +64,7 @@ PatchModel::remove_child(SharedPtr<ObjectModel> o)
|| cm->src_port_path() == o->path()
|| cm->dst_port_path().parent() == o->path()
|| cm->dst_port_path() == o->path()) {
- signal_removed_connection.emit(cm);
+ _signal_removed_connection.emit(cm);
_connections->erase(j); // cuts our reference
}
j = next;
@@ -76,7 +76,7 @@ PatchModel::remove_child(SharedPtr<ObjectModel> o)
SharedPtr<NodeModel> nm = PtrCast<NodeModel>(o);
if (nm)
- signal_removed_node.emit(nm);
+ _signal_removed_node.emit(nm);
return true;
}
@@ -132,7 +132,7 @@ PatchModel::add_connection(SharedPtr<ConnectionModel> cm)
assert(cm->dst_port() == existing->dst_port());
} else {
_connections->insert(make_pair(make_pair(cm->src_port().get(), cm->dst_port().get()), cm));
- signal_new_connection.emit(cm);
+ _signal_new_connection.emit(cm);
}
}
@@ -142,7 +142,7 @@ PatchModel::remove_connection(const Port* src_port, const Ingen::Port* dst_port)
Connections::iterator i = _connections->find(make_pair(src_port, dst_port));
if (i != _connections->end()) {
SharedPtr<ConnectionModel> c = PtrCast<ConnectionModel>(i->second);
- signal_removed_connection.emit(c);
+ _signal_removed_connection.emit(c);
_connections->erase(i);
} else {
warn << "[PatchModel::remove_connection] Failed to find connection " <<
diff --git a/src/client/PatchModel.hpp b/src/client/PatchModel.hpp
index 775cfe29..73930189 100644
--- a/src/client/PatchModel.hpp
+++ b/src/client/PatchModel.hpp
@@ -19,7 +19,6 @@
#define INGEN_CLIENT_PATCHMODEL_HPP
#include <cassert>
-#include <sigc++/sigc++.h>
#include "raul/SharedPtr.hpp"
#include "ingen/Patch.hpp"
#include "NodeModel.hpp"
@@ -61,16 +60,16 @@ public:
void set_editable(bool e) {
if (_editable != e) {
_editable = e;
- signal_editable.emit(e);
+ _signal_editable.emit(e);
}
}
// Signals
- sigc::signal<void, SharedPtr<NodeModel> > signal_new_node;
- sigc::signal<void, SharedPtr<NodeModel> > signal_removed_node;
- sigc::signal<void, SharedPtr<ConnectionModel> > signal_new_connection;
- sigc::signal<void, SharedPtr<ConnectionModel> > signal_removed_connection;
- sigc::signal<void, bool> signal_editable;
+ INGEN_SIGNAL(new_node, void, SharedPtr<NodeModel>);
+ INGEN_SIGNAL(removed_node, void, SharedPtr<NodeModel>);
+ INGEN_SIGNAL(new_connection, void, SharedPtr<ConnectionModel>);
+ INGEN_SIGNAL(removed_connection, void, SharedPtr<ConnectionModel>);
+ INGEN_SIGNAL(editable, void, bool);
private:
friend class ClientStore;
diff --git a/src/client/PluginModel.cpp b/src/client/PluginModel.cpp
index 315214ed..8a644edc 100644
--- a/src/client/PluginModel.cpp
+++ b/src/client/PluginModel.cpp
@@ -142,10 +142,10 @@ PluginModel::set(SharedPtr<PluginModel> p)
for (Properties::const_iterator v = p->properties().begin(); v != p->properties().end(); ++v) {
ResourceImpl::set_property(v->first, v->second);
- signal_property.emit(v->first, v->second);
+ _signal_property.emit(v->first, v->second);
}
- signal_changed.emit();
+ _signal_changed.emit();
}
Symbol
diff --git a/src/client/PluginModel.hpp b/src/client/PluginModel.hpp
index faba8c8b..e301c615 100644
--- a/src/client/PluginModel.hpp
+++ b/src/client/PluginModel.hpp
@@ -18,8 +18,6 @@
#ifndef INGEN_CLIENT_PLUGINMODEL_HPP
#define INGEN_CLIENT_PLUGINMODEL_HPP
-#include <sigc++/sigc++.h>
-
#include "raul/SharedPtr.hpp"
#include "raul/Symbol.hpp"
@@ -34,6 +32,7 @@
#include "ingen/Plugin.hpp"
#include "shared/World.hpp"
#include "shared/ResourceImpl.hpp"
+#include "client/signal.hpp"
namespace Ingen {
@@ -99,8 +98,8 @@ public:
static Sord::World* rdf_world() { return _rdf_world; }
// Signals
- sigc::signal<void> signal_changed;
- sigc::signal<void, const Raul::URI&, const Raul::Atom&> signal_property;
+ INGEN_SIGNAL(changed, void);
+ INGEN_SIGNAL(property, void, const Raul::URI&, const Raul::Atom&);
protected:
friend class ClientStore;
diff --git a/src/client/PortModel.cpp b/src/client/PortModel.cpp
index 94b83ee3..9ca7fe19 100644
--- a/src/client/PortModel.cpp
+++ b/src/client/PortModel.cpp
@@ -54,7 +54,7 @@ PortModel::set(SharedPtr<ObjectModel> model)
_direction = port->_direction;
_current_val = port->_current_val;
_connections = port->_connections;
- signal_value_changed.emit(_current_val);
+ _signal_value_changed.emit(_current_val);
}
ObjectModel::set(model);
diff --git a/src/client/PortModel.hpp b/src/client/PortModel.hpp
index 264f532e..133a2794 100644
--- a/src/client/PortModel.hpp
+++ b/src/client/PortModel.hpp
@@ -20,7 +20,6 @@
#include <cstdlib>
#include <string>
-#include <sigc++/sigc++.h>
#include "raul/log.hpp"
#include "raul/SharedPtr.hpp"
#include "ingen/Port.hpp"
@@ -66,21 +65,21 @@ public:
inline void value(const Raul::Atom& val) {
if (val != _current_val) {
_current_val = val;
- signal_value_changed.emit(val);
+ _signal_value_changed.emit(val);
}
}
inline void value(uint32_t voice, const Raul::Atom& val) {
// FIXME: implement properly
- signal_voice_changed.emit(voice, val);
+ _signal_voice_changed.emit(voice, val);
}
// Signals
- sigc::signal<void, const Raul::Atom&> signal_value_changed; ///< Value ports
- sigc::signal<void, uint32_t, const Raul::Atom&> signal_voice_changed; ///< Polyphonic value ports
- sigc::signal<void> signal_activity; ///< Message ports
- sigc::signal<void, SharedPtr<PortModel> > signal_connection;
- sigc::signal<void, SharedPtr<PortModel> > signal_disconnection;
+ INGEN_SIGNAL(value_changed, void, const Raul::Atom&);
+ INGEN_SIGNAL(voice_changed, void, uint32_t, const Raul::Atom&);
+ INGEN_SIGNAL(activity, void);
+ INGEN_SIGNAL(connection, void, SharedPtr<PortModel>);
+ INGEN_SIGNAL(disconnection, void, SharedPtr<PortModel>);
private:
friend class ClientStore;
@@ -101,8 +100,8 @@ private:
void add_child(SharedPtr<ObjectModel> c) { throw; }
bool remove_child(SharedPtr<ObjectModel> c) { throw; }
- void connected_to(SharedPtr<PortModel> p) { ++_connections; signal_connection.emit(p); }
- void disconnected_from(SharedPtr<PortModel> p) { --_connections; signal_disconnection.emit(p); }
+ void connected_to(SharedPtr<PortModel> p) { ++_connections; _signal_connection.emit(p); }
+ void disconnected_from(SharedPtr<PortModel> p) { --_connections; _signal_disconnection.emit(p); }
void set(SharedPtr<ObjectModel> model);
diff --git a/src/client/SigClientInterface.hpp b/src/client/SigClientInterface.hpp
index fc5201e1..7409688a 100644
--- a/src/client/SigClientInterface.hpp
+++ b/src/client/SigClientInterface.hpp
@@ -19,18 +19,17 @@
#define INGEN_CLIENT_SIGCLIENTINTERFACE_HPP
#include <inttypes.h>
-#include <sigc++/sigc++.h>
#include "raul/Path.hpp"
#include "ingen/ClientInterface.hpp"
+#include "client/signal.hpp"
namespace Ingen {
namespace Client {
/** A LibSigC++ signal emitting interface for clients to use.
*
- * This simply emits an sigc signal for every event (eg OSC message) coming from
- * the engine. Use Store (which extends this) if you want a nice client-side
- * model of the engine.
+ * This simply emits a signal for every event that comes from the engine.
+ * For a higher level model based view of the engine, use ClientStore.
*
* The signals here match the calls to ClientInterface exactly. See the
* documentation for ClientInterface for meanings of signal parameters.
@@ -43,26 +42,24 @@ public:
Raul::URI uri() const { return "http://drobilla.net/ns/ingen#internal"; }
- sigc::signal<void, int32_t> signal_response_ok;
- sigc::signal<void, int32_t, std::string> signal_response_error;
- sigc::signal<void> signal_bundle_begin;
- sigc::signal<void> signal_bundle_end;
- sigc::signal<void, std::string> signal_error;
- sigc::signal<void, Raul::Path, uint32_t> signal_new_patch;
- sigc::signal<void, Raul::Path, Raul::URI, uint32_t, bool> signal_new_port;
- sigc::signal<void, Raul::URI, Resource::Properties,
- Resource::Graph> signal_put;
- sigc::signal<void, Raul::URI, Resource::Properties,
- Resource::Properties> signal_delta;
- sigc::signal<void, Raul::Path, Raul::Path> signal_object_moved;
- sigc::signal<void, Raul::URI> signal_object_deleted;
- sigc::signal<void, Raul::Path, Raul::Path> signal_connection;
- sigc::signal<void, Raul::URI, Raul::URI> signal_disconnection;
- sigc::signal<void, Raul::Path, Raul::Path> signal_disconnect_all;
- sigc::signal<void, Raul::URI, Raul::URI, Raul::Atom> signal_variable_change;
- sigc::signal<void, Raul::URI, Raul::URI, Raul::Atom> signal_property_change;
- sigc::signal<void, Raul::Path, Raul::Atom> signal_port_value;
- sigc::signal<void, Raul::Path> signal_activity;
+ INGEN_SIGNAL(response_ok, void, int32_t)
+ INGEN_SIGNAL(response_error, void, int32_t, std::string)
+ INGEN_SIGNAL(bundle_begin, void)
+ INGEN_SIGNAL(bundle_end, void)
+ INGEN_SIGNAL(error, void, std::string)
+ INGEN_SIGNAL(new_patch, void, Raul::Path, uint32_t)
+ INGEN_SIGNAL(new_port, void, Raul::Path, Raul::URI, uint32_t, bool)
+ INGEN_SIGNAL(put, void, Raul::URI, Resource::Properties, Resource::Graph)
+ INGEN_SIGNAL(delta, void, Raul::URI, Resource::Properties, Resource::Properties)
+ INGEN_SIGNAL(object_moved, void, Raul::Path, Raul::Path)
+ INGEN_SIGNAL(object_deleted, void, Raul::URI)
+ INGEN_SIGNAL(connection, void, Raul::Path, Raul::Path)
+ INGEN_SIGNAL(disconnection, void, Raul::URI, Raul::URI)
+ INGEN_SIGNAL(disconnect_all, void, Raul::Path, Raul::Path)
+ INGEN_SIGNAL(variable_change, void, Raul::URI, Raul::URI, Raul::Atom)
+ INGEN_SIGNAL(property_change, void, Raul::URI, Raul::URI, Raul::Atom)
+ INGEN_SIGNAL(port_value, void, Raul::Path, Raul::Atom)
+ INGEN_SIGNAL(activity, void, Raul::Path)
/** Fire pending signals. Only does anything on derived classes (that may queue) */
virtual bool emit_signals() { return false; }
@@ -71,7 +68,7 @@ protected:
// ClientInterface hooks that fire the above signals
-#define EMIT(name, ...) { signal_ ## name (__VA_ARGS__); }
+#define EMIT(name, ...) { _signal_ ## name (__VA_ARGS__); }
void bundle_begin()
{ EMIT(bundle_begin); }
diff --git a/src/client/ThreadedSigClientInterface.hpp b/src/client/ThreadedSigClientInterface.hpp
index 4fe85209..373fb14d 100644
--- a/src/client/ThreadedSigClientInterface.hpp
+++ b/src/client/ThreadedSigClientInterface.hpp
@@ -47,23 +47,22 @@ class ThreadedSigClientInterface : public SigClientInterface
{
public:
ThreadedSigClientInterface(uint32_t queue_size)
- : _sigs(queue_size)
- , response_ok_slot(signal_response_ok.make_slot())
- , response_error_slot(signal_response_error.make_slot())
- , error_slot(signal_error.make_slot())
- , new_port_slot(signal_new_port.make_slot())
- , put_slot(signal_put.make_slot())
- , connection_slot(signal_connection.make_slot())
- , object_deleted_slot(signal_object_deleted.make_slot())
- , object_moved_slot(signal_object_moved.make_slot())
- , disconnection_slot(signal_disconnection.make_slot())
- , disconnect_all_slot(signal_disconnect_all.make_slot())
- , variable_change_slot(signal_variable_change.make_slot())
- , property_change_slot(signal_property_change.make_slot())
- , port_value_slot(signal_port_value.make_slot())
- , activity_slot(signal_activity.make_slot())
- {
- }
+ : _sigs(queue_size)
+ , response_ok_slot(_signal_response_ok.make_slot())
+ , response_error_slot(_signal_response_error.make_slot())
+ , error_slot(_signal_error.make_slot())
+ , new_port_slot(_signal_new_port.make_slot())
+ , put_slot(_signal_put.make_slot())
+ , connection_slot(_signal_connection.make_slot())
+ , object_deleted_slot(_signal_object_deleted.make_slot())
+ , object_moved_slot(_signal_object_moved.make_slot())
+ , disconnection_slot(_signal_disconnection.make_slot())
+ , disconnect_all_slot(_signal_disconnect_all.make_slot())
+ , variable_change_slot(_signal_variable_change.make_slot())
+ , property_change_slot(_signal_property_change.make_slot())
+ , port_value_slot(_signal_port_value.make_slot())
+ , activity_slot(_signal_activity.make_slot())
+ {}
virtual Raul::URI uri() const { return "http://drobilla.net/ns/ingen#internal"; }
diff --git a/src/client/signal.hpp b/src/client/signal.hpp
new file mode 100644
index 00000000..46718163
--- /dev/null
+++ b/src/client/signal.hpp
@@ -0,0 +1,30 @@
+/* This file is part of Ingen.
+ * Copyright 2007-2011 David 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 INGEN_CLIENT_SIGNAL_HPP
+#define INGEN_CLIENT_SIGNAL_HPP
+
+#include <sigc++/sigc++.h>
+
+#define INGEN_SIGNAL(name, ...) \
+protected: \
+sigc::signal<__VA_ARGS__> _signal_##name; \
+public: \
+sigc::signal<__VA_ARGS__> signal_##name() const { return _signal_##name; } \
+sigc::signal<__VA_ARGS__>& signal_##name() { return _signal_##name; }
+
+#endif // INGEN_CLIENT_SIGNAL_HPP
diff --git a/src/gui/App.cpp b/src/gui/App.cpp
index 7c15701e..9d3fc49a 100644
--- a/src/gui/App.cpp
+++ b/src/gui/App.cpp
@@ -174,8 +174,10 @@ App::attach(SharedPtr<SigClientInterface> client,
_patch_tree_window->init(*_store);
- _client->signal_response_error.connect(sigc::mem_fun(this, &App::error_response));
- _client->signal_error.connect(sigc::mem_fun(this, &App::error_message));
+ _client->signal_response_error().connect(
+ sigc::mem_fun(this, &App::error_response));
+ _client->signal_error().connect(
+ sigc::mem_fun(this, &App::error_message));
}
void
diff --git a/src/gui/BreadCrumbs.cpp b/src/gui/BreadCrumbs.cpp
index e7e7e356..6e7f9b39 100644
--- a/src/gui/BreadCrumbs.cpp
+++ b/src/gui/BreadCrumbs.cpp
@@ -31,7 +31,7 @@ BreadCrumbs::BreadCrumbs()
, _full_path("/")
, _enable_signal(true)
{
- App::instance().client()->signal_object_deleted.connect(
+ App::instance().client()->signal_object_deleted().connect(
sigc::mem_fun(this, &BreadCrumbs::object_destroyed));
}
diff --git a/src/gui/ConnectWindow.cpp b/src/gui/ConnectWindow.cpp
index cc7b6d7c..7741be10 100644
--- a/src/gui/ConnectWindow.cpp
+++ b/src/gui/ConnectWindow.cpp
@@ -397,7 +397,7 @@ ConnectWindow::gtk_callback()
timeval now;
gettimeofday(&now, NULL);
static const timeval start = now;
- static timeval last = now;
+ static timeval last = now;
// Show if attempted connection goes on for a noticeable amount of time
if (!is_visible()) {
@@ -411,7 +411,7 @@ ConnectWindow::gtk_callback()
if (_connect_stage == 0) {
_attached = false;
- App::instance().client()->signal_response_ok.connect(
+ App::instance().client()->signal_response_ok().connect(
sigc::mem_fun(this, &ConnectWindow::on_response));
_ping_id = abs(rand()) / 2 * 2; // avoid -1
diff --git a/src/gui/Controls.cpp b/src/gui/Controls.cpp
index 9322fd77..153f1c26 100644
--- a/src/gui/Controls.cpp
+++ b/src/gui/Controls.cpp
@@ -69,7 +69,8 @@ Control::init(ControlPanel* panel, SharedPtr<PortModel> pm)
assert(panel);
_control_connection.disconnect();
- _control_connection = pm->signal_value_changed.connect(sigc::mem_fun(this, &Control::set_value));
+ _control_connection = pm->signal_value_changed().connect(
+ sigc::mem_fun(this, &Control::set_value));
boost::shared_ptr<NodeModel> parent = PtrCast<NodeModel>(_port_model->parent());
if (parent)
@@ -160,7 +161,8 @@ SliderControl::init(ControlPanel* panel, SharedPtr<PortModel> pm)
_slider->set_increments(0, 0);
}
- pm->signal_property.connect(sigc::mem_fun(this, &SliderControl::port_property_changed));
+ pm->signal_property().connect(
+ sigc::mem_fun(this, &SliderControl::port_property_changed));
_slider->set_range(std::min(min, pm->value().get_float()), std::max(max, pm->value().get_float()));
diff --git a/src/gui/LoadPluginWindow.cpp b/src/gui/LoadPluginWindow.cpp
index d305e4fb..66868f18 100644
--- a/src/gui/LoadPluginWindow.cpp
+++ b/src/gui/LoadPluginWindow.cpp
@@ -174,7 +174,7 @@ void
LoadPluginWindow::on_show()
{
if (!_has_shown) {
- App::instance().store()->signal_new_plugin.connect(
+ App::instance().store()->signal_new_plugin().connect(
sigc::mem_fun(this, &LoadPluginWindow::add_plugin));
_has_shown = true;
}
@@ -253,9 +253,9 @@ LoadPluginWindow::add_plugin(SharedPtr<PluginModel> plugin)
set_row(row, plugin);
- plugin->signal_property.connect(sigc::bind<0>(
- sigc::mem_fun(this, &LoadPluginWindow::plugin_property_changed),
- plugin->uri()));
+ plugin->signal_property().connect(
+ sigc::bind<0>(sigc::mem_fun(this, &LoadPluginWindow::plugin_property_changed),
+ plugin->uri()));
}
///// Event Handlers //////
diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp
index 497d0461..5a6e8b44 100644
--- a/src/gui/NodeModule.cpp
+++ b/src/gui/NodeModule.cpp
@@ -52,18 +52,19 @@ NodeModule::NodeModule(boost::shared_ptr<PatchCanvas> canvas, SharedPtr<NodeMode
{
assert(_node);
- node->signal_new_port.connect(
+ node->signal_new_port().connect(
sigc::bind(sigc::mem_fun(this, &NodeModule::add_port), true));
- node->signal_removed_port.connect(
+ node->signal_removed_port().connect(
sigc::hide_return(sigc::mem_fun(this, &NodeModule::remove_port)));
- node->signal_property.connect(
+ node->signal_property().connect(
sigc::mem_fun(this, &NodeModule::property_changed));
- node->signal_moved.connect(
+ node->signal_moved().connect(
sigc::mem_fun(this, &NodeModule::rename));
PluginModel* plugin = dynamic_cast<PluginModel*>(node->plugin());
if (plugin) {
- plugin->signal_changed.connect(sigc::mem_fun(this, &NodeModule::plugin_changed));
+ plugin->signal_changed().connect(
+ sigc::mem_fun(this, &NodeModule::plugin_changed));
}
}
@@ -256,8 +257,9 @@ NodeModule::add_port(SharedPtr<PortModel> port, bool resize_to_fit)
Module::add_port(Port::create(PtrCast<NodeModule>(shared_from_this()), port,
App::instance().configuration()->name_style() == Configuration::HUMAN));
- port->signal_value_changed.connect(sigc::bind<0>(
- sigc::mem_fun(this, &NodeModule::value_changed), port->index()));
+ port->signal_value_changed().connect(
+ sigc::bind<0>(sigc::mem_fun(this, &NodeModule::value_changed),
+ port->index()));
if (resize_to_fit)
resize();
diff --git a/src/gui/ObjectMenu.cpp b/src/gui/ObjectMenu.cpp
index d8a5e426..82822d57 100644
--- a/src/gui/ObjectMenu.cpp
+++ b/src/gui/ObjectMenu.cpp
@@ -78,7 +78,7 @@ ObjectMenu::init(SharedPtr<ObjectModel> object)
_properties_menuitem->signal_activate().connect(
sigc::mem_fun(this, &ObjectMenu::on_menu_properties));
- object->signal_property.connect(sigc::mem_fun(this, &ObjectMenu::property_changed));
+ object->signal_property().connect(sigc::mem_fun(this, &ObjectMenu::property_changed));
_learn_menuitem->hide();
_unlearn_menuitem->hide();
diff --git a/src/gui/PatchCanvas.cpp b/src/gui/PatchCanvas.cpp
index 91120448..1215b957 100644
--- a/src/gui/PatchCanvas.cpp
+++ b/src/gui/PatchCanvas.cpp
@@ -107,20 +107,20 @@ PatchCanvas::PatchCanvas(SharedPtr<PatchModel> patch, int width, int height)
"event_out", "Event Out", "http://lv2plug.in/ns/ext/event#EventPort", true));
// Connect to model signals to track state
- _patch->signal_new_node.connect(
+ _patch->signal_new_node().connect(
sigc::mem_fun(this, &PatchCanvas::add_node));
- _patch->signal_removed_node.connect(
+ _patch->signal_removed_node().connect(
sigc::mem_fun(this, &PatchCanvas::remove_node));
- _patch->signal_new_port.connect(
+ _patch->signal_new_port().connect(
sigc::mem_fun(this, &PatchCanvas::add_port));
- _patch->signal_removed_port.connect(
+ _patch->signal_removed_port().connect(
sigc::mem_fun(this, &PatchCanvas::remove_port));
- _patch->signal_new_connection.connect(
+ _patch->signal_new_connection().connect(
sigc::mem_fun(this, &PatchCanvas::connection));
- _patch->signal_removed_connection.connect(
+ _patch->signal_removed_connection().connect(
sigc::mem_fun(this, &PatchCanvas::disconnection));
- App::instance().store()->signal_new_plugin.connect(
+ App::instance().store()->signal_new_plugin().connect(
sigc::mem_fun(this, &PatchCanvas::add_plugin));
// Connect widget signals to do things
@@ -133,7 +133,7 @@ PatchCanvas::PatchCanvas(SharedPtr<PatchModel> patch, int width, int height)
_menu_edit->signal_activate().connect(
sigc::mem_fun(this, &PatchCanvas::menu_edit_toggled));
- _patch->signal_editable.connect(
+ _patch->signal_editable().connect(
sigc::mem_fun(this, &PatchCanvas::patch_editable_changed));
}
diff --git a/src/gui/PatchPortModule.cpp b/src/gui/PatchPortModule.cpp
index 51dd064a..998e8a97 100644
--- a/src/gui/PatchPortModule.cpp
+++ b/src/gui/PatchPortModule.cpp
@@ -49,7 +49,8 @@ PatchPortModule::PatchPortModule(boost::shared_ptr<PatchCanvas> canvas, SharedPt
set_stacked_border(model->polyphonic());
- model->signal_property.connect(sigc::mem_fun(this, &PatchPortModule::property_changed));
+ model->signal_property().connect(
+ sigc::mem_fun(this, &PatchPortModule::property_changed));
}
boost::shared_ptr<PatchPortModule>
diff --git a/src/gui/PatchTreeWindow.cpp b/src/gui/PatchTreeWindow.cpp
index adb41a13..f4fb69b6 100644
--- a/src/gui/PatchTreeWindow.cpp
+++ b/src/gui/PatchTreeWindow.cpp
@@ -70,7 +70,8 @@ PatchTreeWindow::PatchTreeWindow(BaseObjectType* cobject,
void
PatchTreeWindow::init(ClientStore& store)
{
- store.signal_new_object.connect(sigc::mem_fun(this, &PatchTreeWindow::new_object));
+ store.signal_new_object().connect(
+ sigc::mem_fun(this, &PatchTreeWindow::new_object));
}
void
@@ -109,17 +110,17 @@ PatchTreeWindow::add_patch(SharedPtr<PatchModel> pm)
}
}
- pm->signal_property.connect(sigc::bind(
- sigc::mem_fun(this, &PatchTreeWindow::patch_property_changed),
- pm));
+ pm->signal_property().connect(
+ sigc::bind(sigc::mem_fun(this, &PatchTreeWindow::patch_property_changed),
+ pm));
- pm->signal_moved.connect(sigc::bind(
- sigc::mem_fun(this, &PatchTreeWindow::patch_moved),
- pm));
+ pm->signal_moved().connect(
+ sigc::bind(sigc::mem_fun(this, &PatchTreeWindow::patch_moved),
+ pm));
- pm->signal_destroyed.connect(sigc::bind(
- sigc::mem_fun(this, &PatchTreeWindow::remove_patch),
- pm));
+ pm->signal_destroyed().connect(
+ sigc::bind(sigc::mem_fun(this, &PatchTreeWindow::remove_patch),
+ pm));
}
void
diff --git a/src/gui/PatchView.cpp b/src/gui/PatchView.cpp
index afe73048..65c3566a 100644
--- a/src/gui/PatchView.cpp
+++ b/src/gui/PatchView.cpp
@@ -80,11 +80,14 @@ PatchView::set_patch(SharedPtr<PatchModel> patch)
property_changed(i->first, i->second);
// Connect model signals to track state
- patch->signal_property.connect(sigc::mem_fun(this, &PatchView::property_changed));
+ patch->signal_property().connect(
+ sigc::mem_fun(this, &PatchView::property_changed));
// Connect widget signals to do things
- _process_but->signal_toggled().connect(sigc::mem_fun(this, &PatchView::process_toggled));
- _refresh_but->signal_clicked().connect(sigc::mem_fun(this, &PatchView::refresh_clicked));
+ _process_but->signal_toggled().connect(
+ sigc::mem_fun(this, &PatchView::process_toggled));
+ _refresh_but->signal_clicked().connect(
+ sigc::mem_fun(this, &PatchView::refresh_clicked));
_zoom_normal_but->signal_clicked().connect(sigc::bind(sigc::mem_fun(
_canvas.get(), &PatchCanvas::set_zoom), 1.0));
@@ -92,7 +95,7 @@ PatchView::set_patch(SharedPtr<PatchModel> patch)
_zoom_full_but->signal_clicked().connect(
sigc::mem_fun(_canvas.get(), &PatchCanvas::zoom_full));
- patch->signal_editable.connect(sigc::mem_fun(
+ patch->signal_editable().connect(sigc::mem_fun(
*this, &PatchView::on_editable_sig));
_edit_mode_but->signal_toggled().connect(sigc::mem_fun(
diff --git a/src/gui/PatchWindow.cpp b/src/gui/PatchWindow.cpp
index cd97e3e3..ab8fcfd9 100644
--- a/src/gui/PatchWindow.cpp
+++ b/src/gui/PatchWindow.cpp
@@ -255,12 +255,12 @@ PatchWindow::set_patch(SharedPtr<PatchModel> patch, SharedPtr<PatchView> view)
set_title(_patch->path().chop_scheme() + " - Ingen");
- new_port_connection = patch->signal_new_port.connect(
- sigc::mem_fun(this, &PatchWindow::patch_port_added));
- removed_port_connection = patch->signal_removed_port.connect(
- sigc::mem_fun(this, &PatchWindow::patch_port_removed));
- removed_port_connection = patch->signal_editable.connect(
- sigc::mem_fun(this, &PatchWindow::editable_changed));
+ new_port_connection = patch->signal_new_port().connect(
+ sigc::mem_fun(this, &PatchWindow::patch_port_added));
+ removed_port_connection = patch->signal_removed_port().connect(
+ sigc::mem_fun(this, &PatchWindow::patch_port_removed));
+ removed_port_connection = patch->signal_editable().connect(
+ sigc::mem_fun(this, &PatchWindow::editable_changed));
show_all();
diff --git a/src/gui/Port.cpp b/src/gui/Port.cpp
index ba28078d..afb46f4d 100644
--- a/src/gui/Port.cpp
+++ b/src/gui/Port.cpp
@@ -85,16 +85,18 @@ Port::Port(
_rect->property_dash() = dash;
set_border_width(dash ? 2.0 : 0.0);
- pm->signal_moved.connect(sigc::mem_fun(this, &Port::moved));
+ pm->signal_moved().connect(sigc::mem_fun(this, &Port::moved));
if (App::instance().can_control(pm.get())) {
set_toggled(pm->is_toggle());
show_control();
- pm->signal_property.connect(sigc::mem_fun(this, &Port::property_changed));
- pm->signal_value_changed.connect(sigc::mem_fun(this, &Port::value_changed));
+ pm->signal_property().connect(
+ sigc::mem_fun(this, &Port::property_changed));
+ pm->signal_value_changed().connect(
+ sigc::mem_fun(this, &Port::value_changed));
}
- pm->signal_activity.connect(sigc::mem_fun(this, &Port::activity));
+ pm->signal_activity().connect(sigc::mem_fun(this, &Port::activity));
update_metadata();
diff --git a/src/gui/PortPropertiesWindow.cpp b/src/gui/PortPropertiesWindow.cpp
index 23d38ac9..3258c480 100644
--- a/src/gui/PortPropertiesWindow.cpp
+++ b/src/gui/PortPropertiesWindow.cpp
@@ -75,14 +75,17 @@ PortPropertiesWindow::present(SharedPtr<PortModel> pm)
_initial_max = max;
_min_spinner->set_value(min);
- _connections.push_back(_min_spinner->signal_value_changed().connect(
- sigc::mem_fun(*this, &PortPropertiesWindow::min_changed)));
+ _connections.push_back(
+ _min_spinner->signal_value_changed().connect(
+ sigc::mem_fun(*this, &PortPropertiesWindow::min_changed)));
_max_spinner->set_value(max);
- _connections.push_back(_max_spinner->signal_value_changed().connect(
- sigc::mem_fun(*this, &PortPropertiesWindow::max_changed)));
+ _connections.push_back(
+ _max_spinner->signal_value_changed().connect(
+ sigc::mem_fun(*this, &PortPropertiesWindow::max_changed)));
- _connections.push_back(pm->signal_property.connect(
+ _connections.push_back(
+ pm->signal_property().connect(
sigc::mem_fun(this, &PortPropertiesWindow::property_changed)));
Gtk::Window::present();
diff --git a/src/gui/PropertiesWindow.cpp b/src/gui/PropertiesWindow.cpp
index 1a1e5fab..491a255e 100644
--- a/src/gui/PropertiesWindow.cpp
+++ b/src/gui/PropertiesWindow.cpp
@@ -122,7 +122,7 @@ PropertiesWindow::set_object(SharedPtr<ObjectModel> model)
_table->show_all();
- _property_connection = model->signal_property.connect(
+ _property_connection = model->signal_property().connect(
sigc::mem_fun(this, &PropertiesWindow::property_changed));
}