diff options
Diffstat (limited to 'src')
37 files changed, 1 insertions, 449 deletions
diff --git a/src/bindings/Client.hpp b/src/bindings/Client.hpp index cdb6b352..690d2214 100644 --- a/src/bindings/Client.hpp +++ b/src/bindings/Client.hpp @@ -21,7 +21,6 @@ public: void put(const Raul::URI& path, const Ingen::Shared::Resource::Properties& properties) {} void connect(const Raul::Path& src_port_path, const Raul::Path& dst_port_path) {} void del(const Raul::Path& path) {} - void clear_patch(const Raul::Path& path) {} void move(const Raul::Path& old_path, const Raul::Path& new_path) {} void disconnect(const Raul::Path& src_port_path, const Raul::Path& dst_port_path) {} void set_property(const Raul::URI& subject, const Raul::URI& key, const Raul::Atom& value) {} diff --git a/src/client/ClientStore.cpp b/src/client/ClientStore.cpp index 64e84494..5d80af50 100644 --- a/src/client/ClientStore.cpp +++ b/src/client/ClientStore.cpp @@ -44,7 +44,6 @@ ClientStore::ClientStore(SharedPtr<EngineInterface> engine, SharedPtr<SigClientI emitter->signal_object_deleted.connect(sigc::mem_fun(this, &ClientStore::del)); emitter->signal_object_moved.connect(sigc::mem_fun(this, &ClientStore::move)); emitter->signal_put.connect(sigc::mem_fun(this, &ClientStore::put)); - emitter->signal_clear_patch.connect(sigc::mem_fun(this, &ClientStore::clear_patch)); emitter->signal_connection.connect(sigc::mem_fun(this, &ClientStore::connect)); emitter->signal_disconnection.connect(sigc::mem_fun(this, &ClientStore::disconnect)); emitter->signal_property_change.connect(sigc::mem_fun(this, &ClientStore::set_property)); @@ -332,34 +331,6 @@ ClientStore::put(const URI& uri, const Resource::Properties& properties) void -ClientStore::clear_patch(const Path& path) -{ - iterator i = find(path); - if (i != end()) { - assert((*i).second->path() == path); - SharedPtr<PatchModel> patch = PtrCast<PatchModel>(i->second); - - iterator first_descendant = i; - ++first_descendant; - iterator descendants_end = find_descendants_end(i); - SharedPtr< Table<Path, SharedPtr<Shared::GraphObject> > > removed - = yank(first_descendant, descendants_end); - - for (iterator i = removed->begin(); i != removed->end(); ++i) { - SharedPtr<ObjectModel> model = PtrCast<ObjectModel>(i->second); - assert(model); - model->signal_destroyed.emit(); - if (model->parent() == patch) - patch->remove_child(model); - } - - } else { - cerr << "[Store] Unable to find patch " << path << " to clear." << endl; - } -} - - -void ClientStore::set_property(const URI& subject_uri, const URI& predicate, const Atom& value) { SharedPtr<Resource> subject = resource(subject_uri); diff --git a/src/client/ClientStore.hpp b/src/client/ClientStore.hpp index f58f5d16..ba32b362 100644 --- a/src/client/ClientStore.hpp +++ b/src/client/ClientStore.hpp @@ -95,7 +95,6 @@ private: // Slots for SigClientInterface signals void object_moved(const Raul::Path& old_path, const Raul::Path& new_path); - void clear_patch(const Raul::Path& path); void activity(const Raul::Path& path); bool attempt_connection(const Raul::Path& src_port_path, const Raul::Path& dst_port_path); diff --git a/src/client/HTTPEngineSender.cpp b/src/client/HTTPEngineSender.cpp index daeae86e..ab8c7c3f 100644 --- a/src/client/HTTPEngineSender.cpp +++ b/src/client/HTTPEngineSender.cpp @@ -155,12 +155,6 @@ HTTPEngineSender::del(const Path& uri) void -HTTPEngineSender::clear_patch(const Path& patch_path) -{ -} - - -void HTTPEngineSender::connect(const Path& src_port_path, const Path& dst_port_path) { diff --git a/src/client/HTTPEngineSender.hpp b/src/client/HTTPEngineSender.hpp index 60b8345e..b2df7821 100644 --- a/src/client/HTTPEngineSender.hpp +++ b/src/client/HTTPEngineSender.hpp @@ -83,8 +83,6 @@ public: virtual void put(const Raul::URI& path, const Shared::Resource::Properties& properties); - virtual void clear_patch(const Raul::Path& path); - virtual void del(const Raul::Path& path); virtual void move(const Raul::Path& old_path, diff --git a/src/client/OSCClientReceiver.cpp b/src/client/OSCClientReceiver.cpp index 0f39b71b..02585d3a 100644 --- a/src/client/OSCClientReceiver.cpp +++ b/src/client/OSCClientReceiver.cpp @@ -147,7 +147,6 @@ OSCClientReceiver::setup_callbacks() lo_server_thread_add_method(_st, "/ingen/put", NULL, put_cb, this); lo_server_thread_add_method(_st, "/ingen/move", "ss", move_cb, this); lo_server_thread_add_method(_st, "/ingen/delete", "s", del_cb, this); - lo_server_thread_add_method(_st, "/ingen/clear_patch", "s", clear_patch_cb, this); lo_server_thread_add_method(_st, "/ingen/new_connection", "ss", connection_cb, this); lo_server_thread_add_method(_st, "/ingen/disconnection", "ss", disconnection_cb, this); lo_server_thread_add_method(_st, "/ingen/new_port", "sisi", new_port_cb, this); @@ -177,14 +176,6 @@ OSCClientReceiver::_del_cb(const char* path, const char* types, lo_arg** argv, i int -OSCClientReceiver::_clear_patch_cb(const char* path, const char* types, lo_arg** argv, int argc, lo_message msg) -{ - _target->clear_patch((const char*)&argv[0]->s); - return 0; -} - - -int OSCClientReceiver::_put_cb(const char* path, const char* types, lo_arg** argv, int argc, lo_message msg) { const char* obj_path = &argv[0]->s; diff --git a/src/client/OSCClientReceiver.hpp b/src/client/OSCClientReceiver.hpp index 18d2ac4d..d0cc4706 100644 --- a/src/client/OSCClientReceiver.hpp +++ b/src/client/OSCClientReceiver.hpp @@ -86,7 +86,6 @@ private: LO_HANDLER(plugin_list_end); LO_HANDLER(new_patch); LO_HANDLER(del); - LO_HANDLER(clear_patch); LO_HANDLER(move); LO_HANDLER(connection); LO_HANDLER(disconnection); diff --git a/src/client/OSCEngineSender.cpp b/src/client/OSCEngineSender.cpp index 516f6c4a..e2553528 100644 --- a/src/client/OSCEngineSender.cpp +++ b/src/client/OSCEngineSender.cpp @@ -170,16 +170,6 @@ OSCEngineSender::del(const Path& path) void -OSCEngineSender::clear_patch(const Path& patch_path) -{ - send("/ingen/clear_patch", "is", - next_id(), - patch_path.c_str(), - LO_ARGS_END); -} - - -void OSCEngineSender::connect(const Path& src_port_path, const Path& dst_port_path) { diff --git a/src/client/OSCEngineSender.hpp b/src/client/OSCEngineSender.hpp index d7204413..f43c3b18 100644 --- a/src/client/OSCEngineSender.hpp +++ b/src/client/OSCEngineSender.hpp @@ -80,8 +80,6 @@ public: virtual void put(const Raul::URI& path, const Shared::Resource::Properties& properties); - virtual void clear_patch(const Raul::Path& path); - virtual void del(const Raul::Path& path); virtual void move(const Raul::Path& old_path, diff --git a/src/client/SigClientInterface.hpp b/src/client/SigClientInterface.hpp index c262d408..785f6ac8 100644 --- a/src/client/SigClientInterface.hpp +++ b/src/client/SigClientInterface.hpp @@ -51,7 +51,6 @@ public: 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, Shared::Resource::Properties> signal_put; - sigc::signal<void, Raul::Path> signal_clear_patch; sigc::signal<void, Raul::Path, Raul::Path> signal_object_moved; sigc::signal<void, Raul::Path> signal_object_deleted; sigc::signal<void, Raul::Path, Raul::Path> signal_connection; @@ -98,9 +97,6 @@ protected: void del(const Raul::Path& path) { EMIT(object_deleted, path); } - void clear_patch(const Raul::Path& path) - { EMIT(clear_patch, path); } - void move(const Raul::Path& old_path, const Raul::Path& new_path) { EMIT(object_moved, old_path, new_path); } diff --git a/src/client/ThreadedSigClientInterface.hpp b/src/client/ThreadedSigClientInterface.hpp index 34847797..901fd4a6 100644 --- a/src/client/ThreadedSigClientInterface.hpp +++ b/src/client/ThreadedSigClientInterface.hpp @@ -53,7 +53,6 @@ public: , new_port_slot(signal_new_port.make_slot()) , put_slot(signal_put.make_slot()) , connection_slot(signal_connection.make_slot()) - , clear_patch_slot(signal_clear_patch.make_slot()) , object_deleted_slot(signal_object_deleted.make_slot()) , object_moved_slot(signal_object_moved.make_slot()) , disconnection_slot(signal_disconnection.make_slot()) @@ -93,9 +92,6 @@ public: void del(const Raul::Path& path) { push_sig(sigc::bind(object_deleted_slot, path)); } - void clear_patch(const Raul::Path& path) - { push_sig(sigc::bind(clear_patch_slot, path)); } - void move(const Raul::Path& old_path, const Raul::Path& new_path) { push_sig(sigc::bind(object_moved_slot, old_path, new_path)); } @@ -135,7 +131,6 @@ private: sigc::slot<void, Raul::Path, Raul::URI, uint32_t, bool> new_port_slot; sigc::slot<void, Raul::URI, Shared::Resource::Properties> put_slot; sigc::slot<void, Raul::Path, Raul::Path> connection_slot; - sigc::slot<void, Raul::Path> clear_patch_slot; sigc::slot<void, Raul::Path> object_deleted_slot; sigc::slot<void, Raul::Path, Raul::Path> object_moved_slot; sigc::slot<void, Raul::Path, Raul::Path> disconnection_slot; diff --git a/src/common/interface/CommonInterface.hpp b/src/common/interface/CommonInterface.hpp index e3c5998d..d13ef97c 100644 --- a/src/common/interface/CommonInterface.hpp +++ b/src/common/interface/CommonInterface.hpp @@ -69,8 +69,6 @@ public: virtual void set_voice_value(const Raul::Path& port_path, uint32_t voice, const Raul::Atom& value) = 0; - - virtual void clear_patch(const Raul::Path& patch_path) = 0; }; diff --git a/src/engine/ClientBroadcaster.cpp b/src/engine/ClientBroadcaster.cpp index 48281cf3..fa19e2f1 100644 --- a/src/engine/ClientBroadcaster.cpp +++ b/src/engine/ClientBroadcaster.cpp @@ -140,13 +140,6 @@ ClientBroadcaster::send_deleted(const Path& path) void -ClientBroadcaster::send_clear_patch(const Path& patch_path) -{ - for (Clients::const_iterator i = _clients.begin(); i != _clients.end(); ++i) - (*i).second->clear_patch(patch_path); -} - -void ClientBroadcaster::send_connection(const SharedPtr<const ConnectionImpl> c) { for (Clients::const_iterator i = _clients.begin(); i != _clients.end(); ++i) diff --git a/src/engine/ClientBroadcaster.hpp b/src/engine/ClientBroadcaster.hpp index 8d9d5c4d..6ccaceda 100644 --- a/src/engine/ClientBroadcaster.hpp +++ b/src/engine/ClientBroadcaster.hpp @@ -65,7 +65,6 @@ public: void send_plugins(const NodeFactory::Plugins& plugin_list); void send_object(const GraphObjectImpl* p, bool recursive); void send_deleted(const Raul::Path& path); - void send_clear_patch(const Raul::Path& patch_path); void send_connection(const SharedPtr<const ConnectionImpl> connection); void send_disconnection(const Raul::Path& src_port_path, const Raul::Path& dst_port_path); void send_move(const Raul::Path& old_path, const Raul::Path& new_path); diff --git a/src/engine/HTTPClientSender.cpp b/src/engine/HTTPClientSender.cpp index d77f684e..b6645f7d 100644 --- a/src/engine/HTTPClientSender.cpp +++ b/src/engine/HTTPClientSender.cpp @@ -79,13 +79,6 @@ HTTPClientSender::del(const Path& path) void -HTTPClientSender::clear_patch(const Path& patch_path) -{ - send_chunk(string("<").append(patch_path.str()).append("> ingen:empty true .")); -} - - -void HTTPClientSender::connect(const Path& src_path, const Path& dst_path) { const string msg = string( diff --git a/src/engine/HTTPClientSender.hpp b/src/engine/HTTPClientSender.hpp index 5982935c..30031252 100644 --- a/src/engine/HTTPClientSender.hpp +++ b/src/engine/HTTPClientSender.hpp @@ -74,8 +74,6 @@ public: virtual void put(const Raul::URI& path, const Shared::Resource::Properties& properties); - virtual void clear_patch(const Raul::Path& path); - virtual void del(const Raul::Path& path); virtual void move(const Raul::Path& old_path, diff --git a/src/engine/OSCClientSender.cpp b/src/engine/OSCClientSender.cpp index 76ab0459..87382727 100644 --- a/src/engine/OSCClientSender.cpp +++ b/src/engine/OSCClientSender.cpp @@ -149,19 +149,6 @@ OSCClientSender::del(const Path& path) /** \page client_osc_namespace - * <h2>/ingen/clear_patch</h2> - * \arg \b path (string) - Path of patch (which is now empty) - * - * Notification a patch has been cleared (all children deleted). - */ -void -OSCClientSender::clear_patch(const Path& patch_path) -{ - send("/ingen/clear_patch", "s", patch_path.c_str(), LO_ARGS_END); -} - - -/** \page client_osc_namespace * <h2>/ingen/new_connection</h2> * \arg \b src-path (string) - Path of the source port * \arg \b dst-path (string) - Path of the destination port diff --git a/src/engine/OSCClientSender.hpp b/src/engine/OSCClientSender.hpp index 8138e0eb..833ad25e 100644 --- a/src/engine/OSCClientSender.hpp +++ b/src/engine/OSCClientSender.hpp @@ -72,8 +72,6 @@ public: virtual void put(const Raul::URI& path, const Shared::Resource::Properties& properties); - virtual void clear_patch(const Raul::Path& path); - virtual void del(const Raul::Path& path); virtual void move(const Raul::Path& old_path, diff --git a/src/engine/OSCEngineReceiver.cpp b/src/engine/OSCEngineReceiver.cpp index 159397a0..5afddfe9 100644 --- a/src/engine/OSCEngineReceiver.cpp +++ b/src/engine/OSCEngineReceiver.cpp @@ -91,7 +91,6 @@ OSCEngineReceiver::OSCEngineReceiver(Engine& engine, size_t queue_size, uint16_t lo_server_add_method(_server, "/ingen/load_plugins", "i", load_plugins_cb, this); lo_server_add_method(_server, "/ingen/activate", "i", engine_activate_cb, this); lo_server_add_method(_server, "/ingen/deactivate", "i", engine_deactivate_cb, this); - lo_server_add_method(_server, "/ingen/clear_patch", "is", clear_patch_cb, this); lo_server_add_method(_server, "/ingen/put", NULL, put_cb, this); lo_server_add_method(_server, "/ingen/move", "iss", move_cb, this); lo_server_add_method(_server, "/ingen/delete", "is", del_cb, this); @@ -431,23 +430,6 @@ OSCEngineReceiver::_move_cb(const char* path, const char* types, lo_arg** argv, /** \page engine_osc_namespace - * <h2>/ingen/clear_patch</h2> - * \arg \b response-id (integer) - * \arg \b patch-path - Patch's path - * - * Remove all nodes from a patch. - */ -int -OSCEngineReceiver::_clear_patch_cb(const char* path, const char* types, lo_arg** argv, int argc, lo_message msg) -{ - const char* patch_path = &argv[1]->s; - - clear_patch(patch_path); - return 0; -} - - -/** \page engine_osc_namespace * <h2>/ingen/del</h2> * \arg \b response-id (integer) * \arg \b path (string) - Full path of the object diff --git a/src/engine/OSCEngineReceiver.hpp b/src/engine/OSCEngineReceiver.hpp index 8285652b..23764c64 100644 --- a/src/engine/OSCEngineReceiver.hpp +++ b/src/engine/OSCEngineReceiver.hpp @@ -93,7 +93,6 @@ private: LO_HANDLER(put); LO_HANDLER(move); LO_HANDLER(del); - LO_HANDLER(clear_patch); LO_HANDLER(connect); LO_HANDLER(disconnect); LO_HANDLER(disconnect_all); diff --git a/src/engine/QueuedEngineInterface.cpp b/src/engine/QueuedEngineInterface.cpp index f502584e..8adf2325 100644 --- a/src/engine/QueuedEngineInterface.cpp +++ b/src/engine/QueuedEngineInterface.cpp @@ -184,13 +184,6 @@ QueuedEngineInterface::del(const Path& path) void -QueuedEngineInterface::clear_patch(const Path& patch_path) -{ - push_queued(new Events::ClearPatch(_engine, _responder, now(), this, patch_path)); -} - - -void QueuedEngineInterface::connect(const Path& src_port_path, const Path& dst_port_path) { diff --git a/src/engine/QueuedEngineInterface.hpp b/src/engine/QueuedEngineInterface.hpp index 4ba07540..9552f0e7 100644 --- a/src/engine/QueuedEngineInterface.hpp +++ b/src/engine/QueuedEngineInterface.hpp @@ -96,8 +96,6 @@ public: virtual void del(const Raul::Path& path); - virtual void clear_patch(const Raul::Path& patch_path); - // EngineInterface object commands virtual void disconnect_all(const Raul::Path& parent_patch_path, diff --git a/src/engine/events.hpp b/src/engine/events.hpp index 0164bdb3..62a37aba 100644 --- a/src/engine/events.hpp +++ b/src/engine/events.hpp @@ -21,7 +21,6 @@ #include "ingen-config.h" #include "events/AllNotesOff.hpp" -#include "events/ClearPatch.hpp" #include "events/Connect.hpp" #include "events/CreateNode.hpp" #include "events/CreatePatch.hpp" diff --git a/src/engine/events/ClearPatch.cpp b/src/engine/events/ClearPatch.cpp deleted file mode 100644 index 0b5c2127..00000000 --- a/src/engine/events/ClearPatch.cpp +++ /dev/null @@ -1,181 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007-2009 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 - */ - -#include "raul/Maid.hpp" -#include "ClearPatch.hpp" -#include "Responder.hpp" -#include "Engine.hpp" -#include "PatchImpl.hpp" -#include "ClientBroadcaster.hpp" -#include "util.hpp" -#include "EngineStore.hpp" -#include "PortImpl.hpp" -#include "NodeImpl.hpp" -#include "ConnectionImpl.hpp" -#include "QueuedEventSource.hpp" -#include "AudioDriver.hpp" -#include "MidiDriver.hpp" - -using namespace std; -using namespace Raul; - -namespace Ingen { -namespace Events { - -using namespace Shared; - - -ClearPatch::ClearPatch(Engine& engine, SharedPtr<Responder> responder, FrameTime time, QueuedEventSource* source, const Path& patch_path) - : QueuedEvent(engine, responder, time, true, source) - , _patch_path(patch_path) - , _process(false) - , _ports_array(NULL) - , _compiled_patch(NULL) - , _driver_ports(NULL) -{ -} - - -void -ClearPatch::pre_process() -{ - EngineStore::Objects::iterator patch_iterator = _engine.engine_store()->find(_patch_path); - - if (patch_iterator != _engine.engine_store()->end()) { - _patch = PtrCast<PatchImpl>(patch_iterator->second); - if (_patch) { - _process = _patch->enabled(); - _removed_table = _engine.engine_store()->remove_children(patch_iterator); - _patch->nodes().clear(); - _patch->connections().clear(); - _patch->clear_ports(); - _ports_array = _patch->build_ports_array(); - if (_patch->enabled()) - _compiled_patch = _patch->compile(); - - // Remove driver ports - if (_patch->parent() == NULL) { - size_t port_count = 0; - for (EngineStore::Objects::iterator i = _removed_table->begin(); - i != _removed_table->end(); ++i) { - SharedPtr<PortImpl> port = PtrCast<PortImpl>(i->second); - if (port) - ++port_count; - - SharedPtr<NodeImpl> node = PtrCast<NodeImpl>(i->second); - if (node) - node->deactivate(); - } - - _driver_ports = new DriverPorts(port_count, NULL); - } - } - } - - QueuedEvent::pre_process(); -} - - -void -ClearPatch::execute(ProcessContext& context) -{ - QueuedEvent::execute(context); - - if (_patch && _removed_table) { - _patch->disable(); - - if (_patch->compiled_patch() != NULL) { - _engine.maid()->push(_patch->compiled_patch()); - _patch->compiled_patch(NULL); - } - - _patch->connections().clear(); - _patch->compiled_patch(_compiled_patch); - Raul::Array<PortImpl*>* old_ports = _patch->external_ports(); - _patch->external_ports(_ports_array); - _ports_array = old_ports; - - // Remove driver ports - if (_patch->parent() == NULL) { - for (EngineStore::Objects::iterator i = _removed_table->begin(); - i != _removed_table->end(); ++i) { - SharedPtr<PortImpl> port = PtrCast<PortImpl>(i->second); - if (port && port->type() == PortType::AUDIO) { - _driver_ports->push_back( - _engine.audio_driver()->remove_port(port->path())); - } else if (port && port->type() == PortType::EVENTS) { - _driver_ports->push_back( - _engine.midi_driver()->remove_port(port->path())); - } - } - } - } -} - - -void -ClearPatch::post_process() -{ - if (_patch != NULL) { - delete _ports_array; - - // Restore patch's run state - if (_process) - _patch->enable(); - else - _patch->disable(); - - // Make sure everything's sane - assert(_patch->nodes().size() == 0); - assert(_patch->num_ports() == 0); - assert(_patch->connections().size() == 0); - - // Deactivate nodes - for (EngineStore::Objects::iterator i = _removed_table->begin(); - i != _removed_table->end(); ++i) { - SharedPtr<NodeImpl> node = PtrCast<NodeImpl>(i->second); - if (node) - node->deactivate(); - } - - // Unregister and destroy driver ports - if (_driver_ports) { - for (size_t i = 0; i < _driver_ports->size(); ++i) { - Raul::List<DriverPort*>::Node* ln = _driver_ports->at(i); - if (ln) { - ln->elem()->destroy(); - _engine.maid()->push(ln); - } - } - delete _driver_ports; - } - - // Reply - _responder->respond_ok(); - _engine.broadcaster()->send_clear_patch(_patch_path); - - } else { - _responder->respond_error(string("Patch ") + _patch_path.str() + " not found"); - } - - _source->unblock(); // FIXME: can be done earlier in execute? -} - - -} // namespace Ingen -} // namespace Events - diff --git a/src/engine/events/ClearPatch.hpp b/src/engine/events/ClearPatch.hpp deleted file mode 100644 index 9fd4cad3..00000000 --- a/src/engine/events/ClearPatch.hpp +++ /dev/null @@ -1,67 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007-2009 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 CLEARPATCHEVENT_H -#define CLEARPATCHEVENT_H - -#include "raul/Array.hpp" -#include "raul/Table.hpp" -#include "raul/Path.hpp" -#include "QueuedEvent.hpp" -#include "EngineStore.hpp" -#include "PatchImpl.hpp" - -namespace Ingen { - -class PatchImpl; -class DriverPort; - -namespace Events { - - -/** Delete all nodes from a patch. - * - * \ingroup engine - */ -class ClearPatch : public QueuedEvent -{ -public: - ClearPatch(Engine& engine, SharedPtr<Responder> responder, FrameTime time, QueuedEventSource* source, const Raul::Path& patch_path); - - void pre_process(); - void execute(ProcessContext& context); - void post_process(); - -private: - const Raul::Path _patch_path; - SharedPtr<PatchImpl> _patch; - bool _process; - Raul::Array<PortImpl*>* _ports_array; ///< New (external) ports for Patch - CompiledPatch* _compiled_patch; ///< Patch's new process order - - typedef Raul::Array<Raul::List<DriverPort*>::Node*> DriverPorts; - DriverPorts* _driver_ports; - - SharedPtr<EngineStore::Objects> _removed_table; -}; - - -} // namespace Ingen -} // namespace Events - - -#endif // CLEARPATCHEVENT_H diff --git a/src/engine/wscript b/src/engine/wscript index 10478637..f619d687 100644 --- a/src/engine/wscript +++ b/src/engine/wscript @@ -35,7 +35,6 @@ def build(bld): QueuedEvent.cpp QueuedEventSource.cpp events/AllNotesOff.cpp - events/ClearPatch.cpp events/Connect.cpp events/CreateNode.cpp events/CreatePatch.cpp diff --git a/src/gui/LoadPatchWindow.cpp b/src/gui/LoadPatchWindow.cpp index ebe437f2..86e0d448 100644 --- a/src/gui/LoadPatchWindow.cpp +++ b/src/gui/LoadPatchWindow.cpp @@ -136,9 +136,6 @@ LoadPatchWindow::ok_clicked() if (_poly_from_user_radio->get_active()) _initial_data.insert(make_pair("ingen:polyphony", _poly_spinbutton->get_value_as_int())); - if (_replace) - App::instance().engine()->clear_patch(_patch->path()); - if (!_patch->path().is_root()) { parent = _patch->path().parent(); symbol = _patch->symbol(); diff --git a/src/gui/LoadRemotePatchWindow.cpp b/src/gui/LoadRemotePatchWindow.cpp index b992cdd5..0359b34c 100644 --- a/src/gui/LoadRemotePatchWindow.cpp +++ b/src/gui/LoadRemotePatchWindow.cpp @@ -37,7 +37,6 @@ namespace GUI { LoadRemotePatchWindow::LoadRemotePatchWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& xml) : Dialog(cobject) - , _replace(true) { xml->get_widget("load_remote_patch_treeview", _treeview); xml->get_widget("load_remote_patch_uri_entry", _uri_entry); @@ -137,9 +136,6 @@ LoadRemotePatchWindow::open_clicked() optional<Path> parent; optional<Symbol> symbol; - if (_replace) - App::instance().engine()->clear_patch(_patch->path()); - if (!_patch->path().is_root()) parent = _patch->path().parent(); diff --git a/src/gui/LoadRemotePatchWindow.hpp b/src/gui/LoadRemotePatchWindow.hpp index 3043db73..ded08e6b 100644 --- a/src/gui/LoadRemotePatchWindow.hpp +++ b/src/gui/LoadRemotePatchWindow.hpp @@ -62,9 +62,6 @@ public: void set_patch(SharedPtr<PatchModel> patch); - void set_replace() { _replace = true; } - void set_merge() { _replace = false; } - void present(SharedPtr<PatchModel> patch, GraphObject::Properties data); private: @@ -77,7 +74,6 @@ private: GraphObject::Properties _initial_data; SharedPtr<PatchModel> _patch; - bool _replace; Glib::RefPtr<Gtk::TreeSelection> _selection; Glib::RefPtr<Gtk::ListStore> _liststore; diff --git a/src/gui/PatchView.cpp b/src/gui/PatchView.cpp index 57a4f46c..c59f787c 100644 --- a/src/gui/PatchView.cpp +++ b/src/gui/PatchView.cpp @@ -49,7 +49,6 @@ PatchView::PatchView(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::X xml->get_widget("patch_view_toolbar", _toolbar); xml->get_widget("patch_view_process_but", _process_but); xml->get_widget("patch_view_poly_spin", _poly_spin); - xml->get_widget("patch_view_clear_but", _clear_but); xml->get_widget("patch_view_refresh_but", _refresh_but); xml->get_widget("patch_view_save_but", _save_but); xml->get_widget("patch_view_zoom_full_but", _zoom_full_but); @@ -94,7 +93,6 @@ PatchView::set_patch(SharedPtr<PatchModel> patch) // Connect widget signals to do things _process_but->signal_toggled().connect(sigc::mem_fun(this, &PatchView::process_toggled)); - _clear_but->signal_clicked().connect(sigc::mem_fun(this, &PatchView::clear_clicked)); _refresh_but->signal_clicked().connect(sigc::mem_fun(this, &PatchView::refresh_clicked)); _zoom_normal_but->signal_clicked().connect(sigc::bind(sigc::mem_fun( @@ -214,13 +212,6 @@ PatchView::poly_changed() void -PatchView::clear_clicked() -{ - App::instance().engine()->clear_patch(_patch->path()); -} - - -void PatchView::refresh_clicked() { App::instance().engine()->get(_patch->path()); diff --git a/src/gui/PatchView.hpp b/src/gui/PatchView.hpp index 15fcc0e4..82a2a1b0 100644 --- a/src/gui/PatchView.hpp +++ b/src/gui/PatchView.hpp @@ -96,7 +96,6 @@ private: Gtk::Toolbar* _toolbar; Gtk::ToggleToolButton* _process_but; Gtk::SpinButton* _poly_spin; - Gtk::ToolButton* _clear_but; Gtk::ToolButton* _refresh_but; Gtk::ToolButton* _save_but; Gtk::ToolButton* _zoom_normal_but; diff --git a/src/gui/PatchWindow.cpp b/src/gui/PatchWindow.cpp index 2638cbbe..8c9d8c42 100644 --- a/src/gui/PatchWindow.cpp +++ b/src/gui/PatchWindow.cpp @@ -89,7 +89,6 @@ PatchWindow::PatchWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glad xml->get_widget("patch_show_port_names_menuitem", _menu_show_port_names); xml->get_widget("patch_status_bar_menuitem", _menu_show_status_bar); xml->get_widget("patch_arrange_menuitem", _menu_arrange); - xml->get_widget("patch_clear_menuitem", _menu_clear); xml->get_widget("patch_view_messages_window_menuitem", _menu_view_messages_window); xml->get_widget("patch_view_patch_tree_window_menuitem", _menu_view_patch_tree_window); xml->get_widget("patch_help_about_menuitem", _menu_help_about); @@ -142,8 +141,6 @@ PatchWindow::PatchWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glad sigc::mem_fun(this, &PatchWindow::event_show_controls)); _menu_view_patch_properties->signal_activate().connect( sigc::mem_fun(this, &PatchWindow::event_show_properties)); - _menu_clear->signal_activate().connect( - sigc::mem_fun(this, &PatchWindow::event_clear)); _menu_view_messages_window->signal_activate().connect( sigc::mem_fun<void>(App::instance().messages_dialog(), &MessagesWindow::present)); _menu_view_patch_tree_window->signal_activate().connect( @@ -689,13 +686,6 @@ PatchWindow::event_quit() void -PatchWindow::event_clear() -{ - App::instance().engine()->clear_patch(_patch->path()); -} - - -void PatchWindow::event_arrange() { _view->canvas()->arrange(false); diff --git a/src/gui/PatchWindow.hpp b/src/gui/PatchWindow.hpp index 82afa7ad..0f10cd84 100644 --- a/src/gui/PatchWindow.hpp +++ b/src/gui/PatchWindow.hpp @@ -96,7 +96,6 @@ private: void event_select_all(); void event_close(); void event_quit(); - void event_clear(); void event_fullscreen_toggled(); void event_status_bar_toggled(); void event_human_names_toggled(); @@ -137,7 +136,6 @@ private: Gtk::CheckMenuItem* _menu_show_port_names; Gtk::CheckMenuItem* _menu_show_status_bar; Gtk::MenuItem* _menu_fullscreen; - Gtk::MenuItem* _menu_clear; Gtk::MenuItem* _menu_arrange; Gtk::MenuItem* _menu_view_engine_window; Gtk::MenuItem* _menu_view_control_window; diff --git a/src/gui/WindowFactory.cpp b/src/gui/WindowFactory.cpp index 91abccaf..83173325 100644 --- a/src/gui/WindowFactory.cpp +++ b/src/gui/WindowFactory.cpp @@ -301,8 +301,6 @@ WindowFactory::present_load_remote_patch(SharedPtr<PatchModel> patch, GraphObjec if (w != _patch_windows.end()) _load_remote_patch_win->set_transient_for(*w->second); - _load_remote_patch_win->set_merge(); // Import is the only choice - _load_remote_patch_win->present(patch, data); } diff --git a/src/gui/ingen_gui.glade b/src/gui/ingen_gui.glade index 3d42a76d..a834af3a 100644 --- a/src/gui/ingen_gui.glade +++ b/src/gui/ingen_gui.glade @@ -226,16 +226,6 @@ </widget> </child> <child> - <widget class="GtkImageMenuItem" id="patch_clear_menuitem"> - <property name="label">gtk-clear</property> - <property name="visible">True</property> - <property name="tooltip" translatable="yes">Remove all objects from patch</property> - <property name="use_underline">True</property> - <property name="use_stock">True</property> - <signal name="activate" handler="on_patch_clear_menuitem_activate"/> - </widget> - </child> - <child> <widget class="GtkSeparatorMenuItem" id="menuitem2"> <property name="visible">True</property> </widget> @@ -1512,18 +1502,6 @@ </packing> </child> <child> - <widget class="GtkToolButton" id="patch_view_clear_but"> - <property name="visible">True</property> - <property name="tooltip" translatable="yes">Clear patch contents</property> - <property name="use_underline">True</property> - <property name="stock_id">gtk-clear</property> - </widget> - <packing> - <property name="expand">False</property> - <property name="homogeneous">True</property> - </packing> - </child> - <child> <widget class="GtkSeparatorToolItem" id="separatortoolitem22"> <property name="visible">True</property> </widget> @@ -2178,7 +2156,7 @@ </packing> </child> <child> - <widget class="GtkLabel" id="label95"> + <widget class="GtkLabel" id="label1"> <property name="visible">True</property> <property name="label" translatable="yes">Label: </property> </widget> diff --git a/src/shared/ClashAvoider.cpp b/src/shared/ClashAvoider.cpp index 18ee7d99..37b1cc9b 100644 --- a/src/shared/ClashAvoider.cpp +++ b/src/shared/ClashAvoider.cpp @@ -208,12 +208,5 @@ ClashAvoider::del(const Raul::Path& path) } -void -ClashAvoider::clear_patch(const Raul::Path& path) -{ - _target.clear_patch(map_path(path)); -} - - } // namespace Shared } // namespace Ingen diff --git a/src/shared/ClashAvoider.hpp b/src/shared/ClashAvoider.hpp index 81c21f45..d99b5525 100644 --- a/src/shared/ClashAvoider.hpp +++ b/src/shared/ClashAvoider.hpp @@ -73,8 +73,6 @@ public: virtual void del(const Raul::Path& path); - virtual void clear_patch(const Raul::Path& patch_path); - private: const Raul::URI map_uri(const Raul::URI& in); const Raul::Path map_path(const Raul::Path& in); |