summaryrefslogtreecommitdiffstats
path: root/src/engine
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-01-03 17:57:22 +0000
committerDavid Robillard <d@drobilla.net>2010-01-03 17:57:22 +0000
commit29b77e922d7fd883795b04eadd528eca21a37a2f (patch)
tree0cc1ce9f6bea85b1fddf45be09d8114ff56ad00b /src/engine
parent10616b98af494614d84eff40d94917be1364988c (diff)
downloadingen-29b77e922d7fd883795b04eadd528eca21a37a2f.tar.gz
ingen-29b77e922d7fd883795b04eadd528eca21a37a2f.tar.bz2
ingen-29b77e922d7fd883795b04eadd528eca21a37a2f.zip
Remove patch clear command (fix ticket #375).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2332 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/ClientBroadcaster.cpp7
-rw-r--r--src/engine/ClientBroadcaster.hpp1
-rw-r--r--src/engine/HTTPClientSender.cpp7
-rw-r--r--src/engine/HTTPClientSender.hpp2
-rw-r--r--src/engine/OSCClientSender.cpp13
-rw-r--r--src/engine/OSCClientSender.hpp2
-rw-r--r--src/engine/OSCEngineReceiver.cpp18
-rw-r--r--src/engine/OSCEngineReceiver.hpp1
-rw-r--r--src/engine/QueuedEngineInterface.cpp7
-rw-r--r--src/engine/QueuedEngineInterface.hpp2
-rw-r--r--src/engine/events.hpp1
-rw-r--r--src/engine/events/ClearPatch.cpp181
-rw-r--r--src/engine/events/ClearPatch.hpp67
-rw-r--r--src/engine/wscript1
14 files changed, 0 insertions, 310 deletions
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