summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-08-19 01:41:42 +0000
committerDavid Robillard <d@drobilla.net>2008-08-19 01:41:42 +0000
commit1b8f06504a155e75a9419dfa5c9bf9df1866e01d (patch)
tree8e9ce0ddaee84c76af66b2fa58cd41f73d8434eb
parenta7e39b85d7c35ec44c613e593c57ff27de0d06bc (diff)
downloadingen-1b8f06504a155e75a9419dfa5c9bf9df1866e01d.tar.gz
ingen-1b8f06504a155e75a9419dfa5c9bf9df1866e01d.tar.bz2
ingen-1b8f06504a155e75a9419dfa5c9bf9df1866e01d.zip
Factor out destroy (and object_destroyed) to common interface.
git-svn-id: http://svn.drobilla.net/lad/ingen@1443 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--src/bindings/Client.hpp2
-rw-r--r--src/common/interface/ClientInterface.hpp2
-rw-r--r--src/common/interface/CommonInterface.hpp2
-rw-r--r--src/common/interface/EngineInterface.hpp2
-rw-r--r--src/libs/client/ClientStore.cpp10
-rw-r--r--src/libs/client/ClientStore.hpp2
-rw-r--r--src/libs/client/OSCClientReceiver.cpp2
-rw-r--r--src/libs/client/SigClientInterface.hpp2
-rw-r--r--src/libs/client/ThreadedSigClientInterface.hpp2
-rw-r--r--src/libs/engine/ClientBroadcaster.cpp2
-rw-r--r--src/libs/engine/OSCClientSender.cpp2
-rw-r--r--src/libs/engine/OSCClientSender.hpp2
-rw-r--r--src/libs/engine/events/SetMetadataEvent.cpp3
-rw-r--r--src/libs/engine/events/SetPolyphonicEvent.cpp2
-rw-r--r--src/libs/gui/App.hpp4
-rw-r--r--src/libs/shared/ClashAvoider.cpp7
-rw-r--r--src/libs/shared/ClashAvoider.hpp2
17 files changed, 25 insertions, 25 deletions
diff --git a/src/bindings/Client.hpp b/src/bindings/Client.hpp
index 8a5fc66c..e098e4ef 100644
--- a/src/bindings/Client.hpp
+++ b/src/bindings/Client.hpp
@@ -60,8 +60,6 @@ public:
virtual void object_renamed(const std::string& old_path,
const std::string& new_path) {}
- virtual void object_destroyed(const std::string& path) {}
-
virtual void connect(const std::string& src_port_path,
const std::string& dst_port_path) {}
diff --git a/src/common/interface/ClientInterface.hpp b/src/common/interface/ClientInterface.hpp
index ee45052a..d77391f8 100644
--- a/src/common/interface/ClientInterface.hpp
+++ b/src/common/interface/ClientInterface.hpp
@@ -77,8 +77,6 @@ public:
virtual void object_renamed(const std::string& old_path,
const std::string& new_path) = 0;
- virtual void object_destroyed(const std::string& path) = 0;
-
virtual void port_activity(const std::string& port_path) = 0;
virtual void program_add(const std::string& node_path,
diff --git a/src/common/interface/CommonInterface.hpp b/src/common/interface/CommonInterface.hpp
index e76d0ce7..a0d52791 100644
--- a/src/common/interface/CommonInterface.hpp
+++ b/src/common/interface/CommonInterface.hpp
@@ -75,6 +75,8 @@ public:
virtual void set_voice_value(const std::string& port_path,
uint32_t voice,
const Raul::Atom& value) = 0;
+
+ virtual void destroy(const std::string& path) = 0;
};
diff --git a/src/common/interface/EngineInterface.hpp b/src/common/interface/EngineInterface.hpp
index e005502e..b82bf8c2 100644
--- a/src/common/interface/EngineInterface.hpp
+++ b/src/common/interface/EngineInterface.hpp
@@ -68,8 +68,6 @@ public:
virtual void rename(const std::string& old_path,
const std::string& new_symbol) = 0;
- virtual void destroy(const std::string& path) = 0;
-
virtual void clear_patch(const std::string& patch_path) = 0;
virtual void disconnect_all(const std::string& parent_patch_path,
diff --git a/src/libs/client/ClientStore.cpp b/src/libs/client/ClientStore.cpp
index b6477b1f..0597aa21 100644
--- a/src/libs/client/ClientStore.cpp
+++ b/src/libs/client/ClientStore.cpp
@@ -42,7 +42,7 @@ ClientStore::ClientStore(SharedPtr<EngineInterface> engine, SharedPtr<SigClientI
if (!emitter)
return;
- emitter->signal_object_destroyed.connect(sigc::mem_fun(this, &ClientStore::destruction));
+ emitter->signal_object_destroyed.connect(sigc::mem_fun(this, &ClientStore::destroy));
emitter->signal_object_renamed.connect(sigc::mem_fun(this, &ClientStore::rename));
emitter->signal_new_plugin.connect(sigc::mem_fun(this, &ClientStore::new_plugin));
emitter->signal_new_patch.connect(sigc::mem_fun(this, &ClientStore::new_patch));
@@ -324,7 +324,6 @@ ClientStore::remove_object(const Path& path)
return result;
} else {
- cerr << "[Store] Unable to find object " << path << " to remove." << endl;
return SharedPtr<ObjectModel>();
}
}
@@ -372,14 +371,11 @@ ClientStore::add_plugin(SharedPtr<PluginModel> pm)
void
-ClientStore::destruction(const Path& path)
+ClientStore::destroy(const std::string& path)
{
SharedPtr<ObjectModel> removed = remove_object(path);
-
removed.reset();
-
- /*cerr << "Store removed object " << path
- << ", count: " << removed.use_count();*/
+ //cerr << "[ClientStore] removed object " << path << ", count: " << removed.use_count();
}
void
diff --git a/src/libs/client/ClientStore.hpp b/src/libs/client/ClientStore.hpp
index d904a3e3..954dcc04 100644
--- a/src/libs/client/ClientStore.hpp
+++ b/src/libs/client/ClientStore.hpp
@@ -79,6 +79,7 @@ public:
void set_voice_value(const string& port_path, uint32_t voice, const Raul::Atom& value);
void connect(const string& src_port_path, const string& dst_port_path);
void disconnect(const string& src_port_path, const string& dst_port_path);
+ void destroy(const string& path);
typedef list< std::pair<Path, Path> > ConnectionRecords;
const ConnectionRecords& connection_records() { return _connection_orphans; }
@@ -115,7 +116,6 @@ private:
void bundle_end() {}
// Slots for SigClientInterface signals
- void destruction(const Path& path);
void rename(const Path& old_path, const Path& new_path);
void patch_cleared(const Path& path);
void port_activity(const Path& port_path);
diff --git a/src/libs/client/OSCClientReceiver.cpp b/src/libs/client/OSCClientReceiver.cpp
index 23fcd871..b2de59e5 100644
--- a/src/libs/client/OSCClientReceiver.cpp
+++ b/src/libs/client/OSCClientReceiver.cpp
@@ -181,7 +181,7 @@ OSCClientReceiver::_new_patch_cb(const char* path, const char* types, lo_arg** a
int
OSCClientReceiver::_destroyed_cb(const char* path, const char* types, lo_arg** argv, int argc, lo_message msg)
{
- object_destroyed((const char*)&argv[0]->s);
+ destroy((const char*)&argv[0]->s);
return 0;
}
diff --git a/src/libs/client/SigClientInterface.hpp b/src/libs/client/SigClientInterface.hpp
index a272fdee..ee626042 100644
--- a/src/libs/client/SigClientInterface.hpp
+++ b/src/libs/client/SigClientInterface.hpp
@@ -113,7 +113,7 @@ protected:
void connect(const string& src_port_path, const string& dst_port_path)
{ if (_enabled) signal_connection.emit(src_port_path, dst_port_path); }
- void object_destroyed(const string& path)
+ void destroy(const string& path)
{ if (_enabled) signal_object_destroyed.emit(path); }
void patch_cleared(const string& path)
diff --git a/src/libs/client/ThreadedSigClientInterface.hpp b/src/libs/client/ThreadedSigClientInterface.hpp
index 7cbb2bfe..b3a1b72c 100644
--- a/src/libs/client/ThreadedSigClientInterface.hpp
+++ b/src/libs/client/ThreadedSigClientInterface.hpp
@@ -104,7 +104,7 @@ public:
void connect(const string& src_port_path, const string& dst_port_path)
{ push_sig(sigc::bind(connection_slot, src_port_path, dst_port_path)); }
- void object_destroyed(const string& path)
+ void destroy(const string& path)
{ push_sig(sigc::bind(object_destroyed_slot, path)); }
void patch_cleared(const string& path)
diff --git a/src/libs/engine/ClientBroadcaster.cpp b/src/libs/engine/ClientBroadcaster.cpp
index ff880433..d754f072 100644
--- a/src/libs/engine/ClientBroadcaster.cpp
+++ b/src/libs/engine/ClientBroadcaster.cpp
@@ -157,7 +157,7 @@ ClientBroadcaster::send_destroyed(const string& path)
{
assert(path != "/");
for (Clients::const_iterator i = _clients.begin(); i != _clients.end(); ++i)
- (*i).second->object_destroyed(path);
+ (*i).second->destroy(path);
}
diff --git a/src/libs/engine/OSCClientSender.cpp b/src/libs/engine/OSCClientSender.cpp
index 4518bfdf..0f05e1ed 100644
--- a/src/libs/engine/OSCClientSender.cpp
+++ b/src/libs/engine/OSCClientSender.cpp
@@ -169,7 +169,7 @@ OSCClientSender::new_port(const std::string& path,
* \arg \b path (string) - Path of object (which no longer exists) </p> \n \n
*/
void
-OSCClientSender::object_destroyed(const std::string& path)
+OSCClientSender::destroy(const std::string& path)
{
assert(path != "/");
diff --git a/src/libs/engine/OSCClientSender.hpp b/src/libs/engine/OSCClientSender.hpp
index 1b890ddd..d62dd1d3 100644
--- a/src/libs/engine/OSCClientSender.hpp
+++ b/src/libs/engine/OSCClientSender.hpp
@@ -86,7 +86,7 @@ public:
virtual void patch_cleared(const std::string& path);
- virtual void object_destroyed(const std::string& path);
+ virtual void destroy(const std::string& path);
virtual void object_renamed(const std::string& old_path,
const std::string& new_path);
diff --git a/src/libs/engine/events/SetMetadataEvent.cpp b/src/libs/engine/events/SetMetadataEvent.cpp
index 6e72d57b..db4bbc30 100644
--- a/src/libs/engine/events/SetMetadataEvent.cpp
+++ b/src/libs/engine/events/SetMetadataEvent.cpp
@@ -99,8 +99,7 @@ SetMetadataEvent::post_process()
if (_error == INVALID_PATH) {
_responder->respond_error((boost::format("Invalid path %1% setting %2%") % _path % _key).str());
} else if (_object == NULL) {
- string msg = "Unable to find object ";
- msg += _path;
+ string msg = (boost::format("Unable to find object %1% to set %2%") % _path % _key).str();
_responder->respond_error(msg);
} else {
_responder->respond_ok();
diff --git a/src/libs/engine/events/SetPolyphonicEvent.cpp b/src/libs/engine/events/SetPolyphonicEvent.cpp
index 9b7fd980..d1fc6a7c 100644
--- a/src/libs/engine/events/SetPolyphonicEvent.cpp
+++ b/src/libs/engine/events/SetPolyphonicEvent.cpp
@@ -73,7 +73,7 @@ SetPolyphonicEvent::post_process()
_responder->respond_error("Unable to set object as polyphonic");
}
} else {
- _responder->respond_error("Unable to find object");
+ _responder->respond_error("Unable to find object to set polyphonic");
}
}
diff --git a/src/libs/gui/App.hpp b/src/libs/gui/App.hpp
index 04666285..d4caef21 100644
--- a/src/libs/gui/App.hpp
+++ b/src/libs/gui/App.hpp
@@ -95,8 +95,8 @@ public:
void port_activity(Port* port);
bool signal() const { return _enable_signal; }
- void enable_signals() { _enable_signal = true; }
- void disable_signals() { _enable_signal = false; }
+ bool disable_signals() { bool old = _enable_signal; _enable_signal = false; return old; }
+ void enable_signals(bool b) { _enable_signal = b; }
ConnectWindow* connect_window() const { return _connect_window; }
MessagesWindow* messages_dialog() const { return _messages_window; }
diff --git a/src/libs/shared/ClashAvoider.cpp b/src/libs/shared/ClashAvoider.cpp
index de4fb4c9..d5d1d245 100644
--- a/src/libs/shared/ClashAvoider.cpp
+++ b/src/libs/shared/ClashAvoider.cpp
@@ -203,5 +203,12 @@ ClashAvoider::set_voice_value(const std::string& port_path,
}
+void
+ClashAvoider::destroy(const std::string& path)
+{
+ _target.destroy(map_path(path));
+}
+
+
} // namespace Shared
} // namespace Ingen
diff --git a/src/libs/shared/ClashAvoider.hpp b/src/libs/shared/ClashAvoider.hpp
index 9f205ff5..f7016e4e 100644
--- a/src/libs/shared/ClashAvoider.hpp
+++ b/src/libs/shared/ClashAvoider.hpp
@@ -80,6 +80,8 @@ public:
void set_voice_value(const std::string& port_path,
uint32_t voice,
const Raul::Atom& value);
+
+ void destroy(const std::string& path);
private:
const Raul::Path map_path(const Raul::Path& in);