summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/engine/LV2Plugin.h12
-rw-r--r--src/engine/Makefile.am153
-rw-r--r--src/engine/OSCClient.cpp2
-rw-r--r--src/engine/OSCClient.h2
-rw-r--r--src/engine/bak/OSCSender.cpp736
-rw-r--r--src/engine/bak/OSCSender.h105
-rw-r--r--src/engine/bak/Responder.cpp60
-rw-r--r--src/engine/events/ActivateEvent.cpp (renamed from src/engine/ActivateEvent.cpp)0
-rw-r--r--src/engine/events/ActivateEvent.h (renamed from src/engine/ActivateEvent.h)0
-rw-r--r--src/engine/events/AddNodeEvent.cpp (renamed from src/engine/AddNodeEvent.cpp)0
-rw-r--r--src/engine/events/AddNodeEvent.h (renamed from src/engine/AddNodeEvent.h)0
-rw-r--r--src/engine/events/AllNotesOffEvent.cpp (renamed from src/engine/AllNotesOffEvent.cpp)0
-rw-r--r--src/engine/events/AllNotesOffEvent.h (renamed from src/engine/AllNotesOffEvent.h)0
-rw-r--r--src/engine/events/ClearPatchEvent.cpp (renamed from src/engine/ClearPatchEvent.cpp)0
-rw-r--r--src/engine/events/ClearPatchEvent.h (renamed from src/engine/ClearPatchEvent.h)0
-rw-r--r--src/engine/events/ConnectionEvent.cpp (renamed from src/engine/ConnectionEvent.cpp)0
-rw-r--r--src/engine/events/ConnectionEvent.h (renamed from src/engine/ConnectionEvent.h)0
-rw-r--r--src/engine/events/CreatePatchEvent.cpp (renamed from src/engine/CreatePatchEvent.cpp)0
-rw-r--r--src/engine/events/CreatePatchEvent.h (renamed from src/engine/CreatePatchEvent.h)0
-rw-r--r--src/engine/events/DSSIConfigureEvent.cpp (renamed from src/engine/DSSIConfigureEvent.cpp)0
-rw-r--r--src/engine/events/DSSIConfigureEvent.h (renamed from src/engine/DSSIConfigureEvent.h)0
-rw-r--r--src/engine/events/DSSIControlEvent.cpp (renamed from src/engine/DSSIControlEvent.cpp)0
-rw-r--r--src/engine/events/DSSIControlEvent.h (renamed from src/engine/DSSIControlEvent.h)0
-rw-r--r--src/engine/events/DSSIProgramEvent.cpp (renamed from src/engine/DSSIProgramEvent.cpp)0
-rw-r--r--src/engine/events/DSSIProgramEvent.h (renamed from src/engine/DSSIProgramEvent.h)0
-rw-r--r--src/engine/events/DSSIUpdateEvent.cpp (renamed from src/engine/DSSIUpdateEvent.cpp)0
-rw-r--r--src/engine/events/DSSIUpdateEvent.h (renamed from src/engine/DSSIUpdateEvent.h)0
-rw-r--r--src/engine/events/DeactivateEvent.cpp (renamed from src/engine/DeactivateEvent.cpp)0
-rw-r--r--src/engine/events/DeactivateEvent.h (renamed from src/engine/DeactivateEvent.h)0
-rw-r--r--src/engine/events/DestroyEvent.cpp (renamed from src/engine/DestroyEvent.cpp)0
-rw-r--r--src/engine/events/DestroyEvent.h (renamed from src/engine/DestroyEvent.h)0
-rw-r--r--src/engine/events/DisablePatchEvent.cpp (renamed from src/engine/DisablePatchEvent.cpp)0
-rw-r--r--src/engine/events/DisablePatchEvent.h (renamed from src/engine/DisablePatchEvent.h)0
-rw-r--r--src/engine/events/DisconnectNodeEvent.cpp (renamed from src/engine/DisconnectNodeEvent.cpp)0
-rw-r--r--src/engine/events/DisconnectNodeEvent.h (renamed from src/engine/DisconnectNodeEvent.h)0
-rw-r--r--src/engine/events/DisconnectPortEvent.cpp (renamed from src/engine/DisconnectPortEvent.cpp)0
-rw-r--r--src/engine/events/DisconnectPortEvent.h (renamed from src/engine/DisconnectPortEvent.h)0
-rw-r--r--src/engine/events/DisconnectionEvent.cpp (renamed from src/engine/DisconnectionEvent.cpp)0
-rw-r--r--src/engine/events/DisconnectionEvent.h (renamed from src/engine/DisconnectionEvent.h)0
-rw-r--r--src/engine/events/EnablePatchEvent.cpp (renamed from src/engine/EnablePatchEvent.cpp)0
-rw-r--r--src/engine/events/EnablePatchEvent.h (renamed from src/engine/EnablePatchEvent.h)0
-rw-r--r--src/engine/events/Event.cpp (renamed from src/engine/Event.cpp)0
-rw-r--r--src/engine/events/Event.h (renamed from src/engine/Event.h)0
-rw-r--r--src/engine/events/LashRestoreDoneEvent.h (renamed from src/engine/LashRestoreDoneEvent.h)0
-rw-r--r--src/engine/events/LoadPluginsEvent.cpp (renamed from src/engine/LoadPluginsEvent.cpp)0
-rw-r--r--src/engine/events/LoadPluginsEvent.h (renamed from src/engine/LoadPluginsEvent.h)0
-rw-r--r--src/engine/events/Makefile.am65
-rw-r--r--src/engine/events/MidiLearnEvent.cpp (renamed from src/engine/MidiLearnEvent.cpp)0
-rw-r--r--src/engine/events/MidiLearnEvent.h (renamed from src/engine/MidiLearnEvent.h)0
-rw-r--r--src/engine/events/NoteOffEvent.cpp (renamed from src/engine/NoteOffEvent.cpp)0
-rw-r--r--src/engine/events/NoteOffEvent.h (renamed from src/engine/NoteOffEvent.h)0
-rw-r--r--src/engine/events/NoteOnEvent.cpp (renamed from src/engine/NoteOnEvent.cpp)0
-rw-r--r--src/engine/events/NoteOnEvent.h (renamed from src/engine/NoteOnEvent.h)0
-rw-r--r--src/engine/events/PingQueuedEvent.h (renamed from src/engine/PingQueuedEvent.h)0
-rw-r--r--src/engine/events/QueuedEvent.h (renamed from src/engine/QueuedEvent.h)0
-rw-r--r--src/engine/events/RegisterClientEvent.cpp (renamed from src/engine/RegisterClientEvent.cpp)0
-rw-r--r--src/engine/events/RegisterClientEvent.h (renamed from src/engine/RegisterClientEvent.h)0
-rw-r--r--src/engine/events/RenameEvent.cpp (renamed from src/engine/RenameEvent.cpp)0
-rw-r--r--src/engine/events/RenameEvent.h (renamed from src/engine/RenameEvent.h)0
-rw-r--r--src/engine/events/RequestAllObjectsEvent.cpp (renamed from src/engine/RequestAllObjectsEvent.cpp)0
-rw-r--r--src/engine/events/RequestAllObjectsEvent.h (renamed from src/engine/RequestAllObjectsEvent.h)0
-rw-r--r--src/engine/events/RequestMetadataEvent.cpp (renamed from src/engine/RequestMetadataEvent.cpp)0
-rw-r--r--src/engine/events/RequestMetadataEvent.h (renamed from src/engine/RequestMetadataEvent.h)0
-rw-r--r--src/engine/events/RequestPluginsEvent.cpp (renamed from src/engine/RequestPluginsEvent.cpp)0
-rw-r--r--src/engine/events/RequestPluginsEvent.h (renamed from src/engine/RequestPluginsEvent.h)0
-rw-r--r--src/engine/events/RequestPortValueEvent.cpp (renamed from src/engine/RequestPortValueEvent.cpp)0
-rw-r--r--src/engine/events/RequestPortValueEvent.h (renamed from src/engine/RequestPortValueEvent.h)0
-rw-r--r--src/engine/events/SetMetadataEvent.cpp (renamed from src/engine/SetMetadataEvent.cpp)0
-rw-r--r--src/engine/events/SetMetadataEvent.h (renamed from src/engine/SetMetadataEvent.h)0
-rw-r--r--src/engine/events/SetPortValueEvent.cpp (renamed from src/engine/SetPortValueEvent.cpp)0
-rw-r--r--src/engine/events/SetPortValueEvent.h (renamed from src/engine/SetPortValueEvent.h)0
-rw-r--r--src/engine/events/SetPortValueQueuedEvent.cpp (renamed from src/engine/SetPortValueQueuedEvent.cpp)0
-rw-r--r--src/engine/events/SetPortValueQueuedEvent.h (renamed from src/engine/SetPortValueQueuedEvent.h)0
-rw-r--r--src/engine/events/UnregisterClientEvent.cpp (renamed from src/engine/UnregisterClientEvent.cpp)0
-rw-r--r--src/engine/events/UnregisterClientEvent.h (renamed from src/engine/UnregisterClientEvent.h)0
75 files changed, 154 insertions, 981 deletions
diff --git a/src/engine/LV2Plugin.h b/src/engine/LV2Plugin.h
index 0701270d..c3d3038a 100644
--- a/src/engine/LV2Plugin.h
+++ b/src/engine/LV2Plugin.h
@@ -35,12 +35,12 @@ class PortInfo;
class LV2Plugin : public NodeBase
{
public:
- LV2Plugin::LV2Plugin(const string& name,
- size_t poly,
- Patch* parent,
- const SLV2Plugin* plugin,
- samplerate srate,
- size_t buffer_size);
+ LV2Plugin(const string& name,
+ size_t poly,
+ Patch* parent,
+ const SLV2Plugin* plugin,
+ samplerate srate,
+ size_t buffer_size);
virtual ~LV2Plugin();
diff --git a/src/engine/Makefile.am b/src/engine/Makefile.am
index e09b7368..4317674f 100644
--- a/src/engine/Makefile.am
+++ b/src/engine/Makefile.am
@@ -1,6 +1,7 @@
SUBDIRS = tests
+DIST_SUBDIRS = events
-AM_CXXFLAGS = @JACK_CFLAGS@ @LOSC_CFLAGS@ @ALSA_CFLAGS@ @LASH_CFLAGS@ @SLV2_CFLAGS@ -I$(top_srcdir)/src/common -fno-exceptions -fno-rtti
+AM_CXXFLAGS = @JACK_CFLAGS@ @LOSC_CFLAGS@ @ALSA_CFLAGS@ @LASH_CFLAGS@ @SLV2_CFLAGS@ -I$(top_srcdir)/src/common -I$(top_srcdir)/src/engine/events -fno-exceptions -fno-rtti
common_SOURCES = \
util.h \
@@ -48,10 +49,6 @@ common_SOURCES = \
MidiTriggerNode.cpp \
MidiControlNode.h \
MidiControlNode.cpp \
- RegisterClientEvent.h \
- RegisterClientEvent.cpp \
- UnregisterClientEvent.h \
- UnregisterClientEvent.cpp \
BridgeNode.h \
BridgeNode.cpp \
ControlInputNode.h \
@@ -69,31 +66,6 @@ common_SOURCES = \
Event.h \
Event.cpp \
QueuedEvent.h \
- PingQueuedEvent.h \
- ActivateEvent.h \
- ActivateEvent.cpp \
- DeactivateEvent.h \
- DeactivateEvent.cpp \
- SetPortValueEvent.h \
- SetPortValueEvent.cpp \
- SetPortValueQueuedEvent.h \
- SetPortValueQueuedEvent.cpp \
- NoteOnEvent.h \
- NoteOnEvent.cpp \
- NoteOffEvent.h \
- NoteOffEvent.cpp \
- AllNotesOffEvent.h \
- AllNotesOffEvent.cpp \
- ConnectionEvent.h \
- ConnectionEvent.cpp \
- DisconnectionEvent.h \
- DisconnectionEvent.cpp \
- DisconnectNodeEvent.h \
- DisconnectNodeEvent.cpp \
- DisconnectPortEvent.h \
- DisconnectPortEvent.cpp \
- DestroyEvent.h \
- DestroyEvent.cpp \
EventSource.h \
QueuedEventSource.h \
QueuedEventSource.cpp \
@@ -104,20 +76,6 @@ common_SOURCES = \
Maid.cpp \
MaidObject.h \
Tree.h \
- AddNodeEvent.h \
- AddNodeEvent.cpp \
- SetMetadataEvent.h \
- SetMetadataEvent.cpp \
- RequestMetadataEvent.h \
- RequestMetadataEvent.cpp \
- RequestPortValueEvent.h \
- RequestPortValueEvent.cpp \
- RequestAllObjectsEvent.h \
- RequestAllObjectsEvent.cpp \
- RequestPluginsEvent.h \
- RequestPluginsEvent.cpp \
- CreatePatchEvent.h \
- CreatePatchEvent.cpp \
ClientRecord.h \
PortInfo.h \
PluginLibrary.h \
@@ -132,20 +90,8 @@ common_SOURCES = \
ConnectionBase.cpp \
ObjectStore.h \
ObjectStore.cpp \
- LoadPluginsEvent.h \
- LoadPluginsEvent.cpp \
- EnablePatchEvent.h \
- EnablePatchEvent.cpp \
- DisablePatchEvent.h \
- DisablePatchEvent.cpp \
- ClearPatchEvent.h \
- ClearPatchEvent.cpp \
TransportNode.h \
TransportNode.cpp \
- RenameEvent.h \
- RenameEvent.cpp \
- MidiLearnEvent.h \
- MidiLearnEvent.cpp \
Driver.h \
AudioDriver.h \
MidiDriver.h \
@@ -158,6 +104,64 @@ common_SOURCES = \
../common/interface/EngineInterface.h \
instantiations.cpp
+# Events
+common_SOURCES += \
+ events/RegisterClientEvent.h \
+ events/RegisterClientEvent.cpp \
+ events/UnregisterClientEvent.h \
+ events/UnregisterClientEvent.cpp \
+ events/PingQueuedEvent.h \
+ events/ActivateEvent.h \
+ events/ActivateEvent.cpp \
+ events/DeactivateEvent.h \
+ events/DeactivateEvent.cpp \
+ events/SetPortValueEvent.h \
+ events/SetPortValueEvent.cpp \
+ events/SetPortValueQueuedEvent.h \
+ events/SetPortValueQueuedEvent.cpp \
+ events/NoteOnEvent.h \
+ events/NoteOnEvent.cpp \
+ events/NoteOffEvent.h \
+ events/NoteOffEvent.cpp \
+ events/AllNotesOffEvent.h \
+ events/AllNotesOffEvent.cpp \
+ events/ConnectionEvent.h \
+ events/ConnectionEvent.cpp \
+ events/DisconnectionEvent.h \
+ events/DisconnectionEvent.cpp \
+ events/DisconnectNodeEvent.h \
+ events/DisconnectNodeEvent.cpp \
+ events/DisconnectPortEvent.h \
+ events/DisconnectPortEvent.cpp \
+ events/DestroyEvent.h \
+ events/DestroyEvent.cpp \
+ events/AddNodeEvent.h \
+ events/AddNodeEvent.cpp \
+ events/SetMetadataEvent.h \
+ events/SetMetadataEvent.cpp \
+ events/RequestMetadataEvent.h \
+ events/RequestMetadataEvent.cpp \
+ events/RequestPortValueEvent.h \
+ events/RequestPortValueEvent.cpp \
+ events/RequestAllObjectsEvent.h \
+ events/RequestAllObjectsEvent.cpp \
+ events/RequestPluginsEvent.h \
+ events/RequestPluginsEvent.cpp \
+ events/CreatePatchEvent.h \
+ events/CreatePatchEvent.cpp \
+ events/LoadPluginsEvent.h \
+ events/LoadPluginsEvent.cpp \
+ events/EnablePatchEvent.h \
+ events/EnablePatchEvent.cpp \
+ events/DisablePatchEvent.h \
+ events/DisablePatchEvent.cpp \
+ events/ClearPatchEvent.h \
+ events/ClearPatchEvent.cpp \
+ events/RenameEvent.h \
+ events/RenameEvent.cpp \
+ events/MidiLearnEvent.h \
+ events/MidiLearnEvent.cpp
+
if WITH_JACK_MIDI
common_SOURCES += \
JackMidiDriver.h \
@@ -180,14 +184,14 @@ if WITH_DSSI
common_SOURCES += \
DSSIPlugin.h \
DSSIPlugin.cpp \
- DSSIUpdateEvent.h \
- DSSIUpdateEvent.cpp \
- DSSIControlEvent.h \
- DSSIControlEvent.cpp \
- DSSIConfigureEvent.h \
- DSSIConfigureEvent.cpp \
- DSSIProgramEvent.h \
- DSSIProgramEvent.cpp
+ events/DSSIConfigureEvent.cpp \
+ events/DSSIConfigureEvent.h \
+ events/DSSIControlEvent.cpp \
+ events/DSSIControlEvent.h \
+ events/DSSIProgramEvent.cpp \
+ events/DSSIProgramEvent.h \
+ events/DSSIUpdateEvent.cpp \
+ events/DSSIUpdateEvent.h
endif
if WITH_LV2
@@ -197,7 +201,10 @@ common_SOURCES += \
endif
if WITH_LASH
-common_SOURCES += LashDriver.h LashDriver.cpp LashRestoreDoneEvent.h
+common_SOURCES += \
+ LashDriver.h \
+ LashDriver.cpp \
+ LashRestoreDoneEvent.h
endif
@@ -205,19 +212,19 @@ endif
# Non-installed library to link stand-alone and in-process build against
#
-noinst_LIBRARIES = libom.a
-libom_a_SOURCES = $(common_SOURCES)
+noinst_LTLIBRARIES = libom.la
+libom_la_SOURCES = $(common_SOURCES)
#
-# Stand-alone engine
+# Statically linked stand-alone engine
#
if BUILD_ENGINE
bin_PROGRAMS = om
-om_DEPENDENCIES = libom.a
-om_LDADD = @JACK_LIBS@ @LOSC_LIBS@ @ALSA_LIBS@ @LASH_LIBS@ @SLV2_LIBS@ -lrt libom.a
+om_DEPENDENCIES = libom.la
+om_LDADD = @JACK_LIBS@ @LOSC_LIBS@ @ALSA_LIBS@ @LASH_LIBS@ @SLV2_LIBS@ -lrt libom.la
om_SOURCES = \
main.cpp \
@@ -233,13 +240,15 @@ endif # BUILD_ENGINE
#
if BUILD_IN_PROCESS_ENGINE
+
+# FIXME: broken
+
+
# FIXME: Figure out how to get this properly
omdir = $(prefix)/lib/jack
om_la_CFLAGS = -fPIC
om_LTLIBRARIES = om.la
-om_la_DEPENDENCIES = libom.a
-om_la_LIBADD = libom.a
om_la_LDFLAGS = -module -avoid-version @JACK_LIBS@ @LOSC_LIBS@ @ALSA_LIBS@ @LASH_LIBS@ @SLV2_LIBS@
om_la_SOURCES = OmInProcess.cpp
diff --git a/src/engine/OSCClient.cpp b/src/engine/OSCClient.cpp
index 7b1580d2..332a2144 100644
--- a/src/engine/OSCClient.cpp
+++ b/src/engine/OSCClient.cpp
@@ -440,7 +440,7 @@ OSCClient::new_plugin(const string& type, const string& uri, const string& name)
* \arg \b poly (int) - Polyphony of new patch (\em not a boolean like new_node) </p> \n \n
*/
void
-OSCClient::new_patch(const string& path, size_t poly)
+OSCClient::new_patch(const string& path, uint32_t poly)
{
lo_send(_address, "/om/new_patch", "si", path.c_str(), poly);
diff --git a/src/engine/OSCClient.h b/src/engine/OSCClient.h
index fea2fdc6..db14c696 100644
--- a/src/engine/OSCClient.h
+++ b/src/engine/OSCClient.h
@@ -70,7 +70,7 @@ public:
const string& uri,
const string& name);
- virtual void new_patch(const string& path, size_t poly);
+ virtual void new_patch(const string& path, uint32_t poly);
virtual void new_node(const string& plugin_type,
const string& plugin_uri,
diff --git a/src/engine/bak/OSCSender.cpp b/src/engine/bak/OSCSender.cpp
deleted file mode 100644
index 8347a252..00000000
--- a/src/engine/bak/OSCSender.cpp
+++ /dev/null
@@ -1,736 +0,0 @@
-/* This file is part of Om. Copyright (C) 2005 Dave Robillard.
- *
- * Om 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.
- *
- * Om 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.,
- * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include "OSCSender.h"
-#include <cassert>
-#include <iostream>
-#include <unistd.h>
-#include "Om.h"
-#include "OmApp.h"
-#include "ObjectStore.h"
-#include "NodeFactory.h"
-#include "util.h"
-#include "Patch.h"
-#include "Node.h"
-#include "PortInfo.h"
-#include "Plugin.h"
-#include "PortBase.h"
-#include "Connection.h"
-#include "AudioDriver.h"
-#include "ClientRecord.h"
-#include "OSCResponder.h"
-
-using std::cout; using std::cerr; using std::endl;
-
-namespace Om {
-
-
-/*! \page client_osc_namespace Client OSC Namespace Documentation
- *
- * <p>These are all the messages sent from the engine to the client. Om
- * communication takes place over two distinct bands: control band and
- * notification band.</p>
- * <p>The control band is where clients send commands, and receive a simple
- * response, either OK or an error.</p>
- * <p>All notifications of engine state (ie new nodes) are sent over the
- * notification band <em>which is seperate from the control band</em>. The
- * reasoning behind this is that many clients may be connected at the same
- * time - a client may receive notifications that are not a direct consequence
- * of some message it sent.</p>
- * <p>The notification band can be thought of as a stream of events representing
- * the changing engine state. For example, It is possible for a client to send
- * commands and receive aknowledgements, and not listen to the notification band
- * at all; or (in the near future anyway) for a client to use UDP for the control
- * band (for speed), and TCP for the notification band (for reliability and
- * order guarantees).</p>
- * \n\n
- */
-
-
-/* Documentation for namespace portion implemented in OSCResponder.cpp */
-
-/** \page client_osc_namespace
- * \n
- * <h3>Notification Band</h3>
- */
-
-/** \page client_osc_namespace
- * <p> \b /om/response/ok - Respond successfully to a user command
- * \arg \b responder-id (int) - OSCResponder ID this is a response to
- * </p> \n \n
- */
-
-/** \page client_osc_namespace
- * <p> \b /om/response/error - Respond negatively to a user command
- * \arg \b responder-id (int) - OSCResponder ID this is a response to
- * \arg \b message (string) - Error message (natural language text)
- * </p> \n \n
- */
-
-
-
-/** Register a client to receive messages over the notification band.
- */
-void
-OSCSender::register_client(const string& url)
-{
- bool found = false;
- for (list<ClientRecord*>::iterator i = m_clients.begin(); i != m_clients.end(); ++i)
- if ((*i)->url() == url)
- found = true;
-
- if (!found) {
- ClientRecord* cr = new ClientRecord(url);
- m_clients.push_back(cr);
- cout << "[OSC] Registered client " << url << " (" << m_clients.size() << " clients)" << endl;
- } else {
- cout << "[OSC] Client already registered." << endl;
- }
-}
-
-
-/** Remove a client from the list of registered clients.
- *
- * The removed client is returned (not deleted). It is the caller's
- * responsibility to delete the returned pointer, if it's not NULL.
- *
- * FIXME: Using a "Responder" as the key for client lookups is less than clear.
- */
-ClientRecord*
-OSCSender::unregister_client(const Responder* responder)
-{
- if (responder == NULL)
- return NULL;
-
- // FIXME: remove filthy cast
- const string url = lo_address_get_url(((OSCResponder*)responder)->source());
- ClientRecord* r = NULL;
-
- for (list<ClientRecord*>::iterator i = m_clients.begin(); i != m_clients.end(); ++i) {
- if ((*i)->url() == url) {
- r = *i;
- m_clients.erase(i);
- break;
- }
- }
-
- if (r != NULL)
- cout << "[OSC] Unregistered client " << r->url() << " (" << m_clients.size() << " clients)" << endl;
- else
- cerr << "[OSC] ERROR: Unable to find client to unregister!" << endl;
-
- return r;
-}
-
-
-/** Looks up the client with the given @a source address (which is used as the
- * unique identifier for registered clients).
- *
- * (A responder is passed to remove the dependency on liblo addresses in request
- * events, in anticipation of libom and multiple ways of responding to clients).
- *
- * FIXME: Using a "Responder" as the key for client lookups is less than clear.
- */
-ClientRecord*
-OSCSender::client(const Responder* responder)
-{
- // FIXME: eliminate filthy cast
- const string url = lo_address_get_url(((OSCResponder*)responder)->source());
-
- for (list<ClientRecord*>::iterator i = m_clients.begin(); i != m_clients.end(); ++i)
- if ((*i)->url() == url)
- return (*i);
-
- return NULL;
-}
-
-/** \page client_osc_namespace
- * \n
- * <h3>Notification Band</h3>
- */
-
-/** \page client_osc_namespace
- * <p> \b /om/client_registration - Notification that a new client has registered
- * \arg \b url (string) - URL notifications will be sent to
- * \arg \b client-id (int) - Client ID for new client
- *
- * \li This will be the first message received over the notification band by a newly
- * registered client.</p> \n \n
- */
-/*void
-OSCSender::send_client_registration(const string& url, int client_id)
-{
-// FIXME
-}*/
-
-
-/** \page client_osc_namespace
- * <p> \b /om/error - Notification that an error has occurred
- * \arg \b message (string) - Error message (natural language text)
- *
- * \li This is for notification of errors that aren't a direct response to a
- * user command, ie "unexpected" errors.</p> \n \n
- */
-void
-OSCSender::send_error(const string& msg)
-{
- for (list<ClientRecord*>::const_iterator i = m_clients.begin(); i != m_clients.end(); ++i)
- lo_send((*i)->address(), "/om/error", "s", msg.c_str());
-}
-
-
-/** \page client_osc_namespace
- * <p> \b /om/num_plugins
- * \arg \b num (int) - Number of plugins engine has loaded
- * \li This is sent before sending the list of plugins, so the client is aware
- * of how many plugins (/om/plugin messages) to expect.</p> \n \n
- */
-
-
-/** \page client_osc_namespace
- * <p> \b /om/plugin - Notification of the existance of a plugin
- * FIXME: update docs
- * \arg \b lib-name (string) - Name of shared library plugin resides in (ie "cmt.so")
- * \arg \b plug-label (string) - Label of the plugin (ie "dahdsr_iaoa")
- * \arg \b name (string) - Descriptive human-readable name of plugin (ie "ADSR Envelope")
- * \arg \b type (string) - Type if plugin ("LADSPA", "DSSI", or "Internal")</p> \n \n
- */
-void
-OSCSender::send_plugins_to(ClientRecord* client)
-{
- om->node_factory()->lock_plugin_list();
-
- const list<Plugin*>& plugs = om->node_factory()->plugins();
- const Plugin* plugin;
-
- lo_timetag tt;
- lo_timetag_now(&tt);
- lo_bundle b = lo_bundle_new(tt);
- lo_message m = lo_message_new();
- list<lo_message> msgs;
-
- lo_message_add_int32(m, plugs.size());
- lo_bundle_add_message(b, "/om/num_plugins", m);
- msgs.push_back(m);
-
- for (list<Plugin*>::const_iterator j = plugs.begin(); j != plugs.end(); ++j) {
- plugin = (*j);
- m = lo_message_new();
-
- /*lo_message_add_string(m, plugin->lib_name().c_str());
- lo_message_add_string(m, plugin->plug_label().c_str());*/
- lo_message_add_string(m, plugin->type_string());
- lo_message_add_string(m, plugin->uri().c_str());
- lo_message_add_string(m, plugin->plug_label().c_str());
- lo_message_add_string(m, plugin->name().c_str());
- lo_bundle_add_message(b, "/om/plugin", m);
- msgs.push_back(m);
- if (lo_bundle_length(b) > 1024) {
- lo_send_bundle(client->address(), b);
- lo_bundle_free(b);
- b = lo_bundle_new(tt);
- //usleep(100); // plugins get lost in the ether without this :/ (?)
- }
- }
-
- if (lo_bundle_length(b) > 0) {
- lo_send_bundle(client->address(), b);
- lo_bundle_free(b);
- } else {
- lo_bundle_free(b);
- }
- for (list<lo_bundle>::const_iterator i = msgs.begin(); i != msgs.end(); ++i)
- lo_message_free(*i);
-
- om->node_factory()->unlock_plugin_list();
-}
-
-
-void
-OSCSender::send_node(const Node* const node)
-{
- for (list<ClientRecord*>::const_iterator i = m_clients.begin(); i != m_clients.end(); ++i)
- send_node_to((*i), node);
-}
-
-
-void
-OSCSender::send_new_port(const Port* port)
-{
- for (list<ClientRecord*>::const_iterator i = m_clients.begin(); i != m_clients.end(); ++i)
- send_new_port_to((*i), port);
-}
-
-
-void
-OSCSender::send_destroyed(const string& path)
-{
- assert(path != "/");
- for (list<ClientRecord*>::const_iterator i = m_clients.begin(); i != m_clients.end(); ++i)
- send_destroyed_to((*i), path);
-}
-
-void
-OSCSender::send_patch_cleared(const string& patch_path)
-{
- for (list<ClientRecord*>::const_iterator i = m_clients.begin(); i != m_clients.end(); ++i)
- send_patch_cleared_to((*i), patch_path);
-}
-
-void
-OSCSender::send_connection(const Connection* const c)
-{
- for (list<ClientRecord*>::const_iterator i = m_clients.begin(); i != m_clients.end(); ++i)
- send_connection_to((*i), c);
-}
-
-
-void
-OSCSender::send_disconnection(const string& src_port_path, const string& dst_port_path)
-{
- for (list<ClientRecord*>::const_iterator i = m_clients.begin(); i != m_clients.end(); ++i)
- send_disconnection_to((*i), src_port_path, dst_port_path);
-}
-
-
-void
-OSCSender::send_patch_enable(const string& patch_path)
-{
- for (list<ClientRecord*>::const_iterator i = m_clients.begin(); i != m_clients.end(); ++i)
- send_patch_enable_to((*i), patch_path);
-}
-
-
-void
-OSCSender::send_patch_disable(const string& patch_path)
-{
- for (list<ClientRecord*>::const_iterator i = m_clients.begin(); i != m_clients.end(); ++i)
- send_patch_disable_to((*i), patch_path);
-}
-
-
-/** Send notification of a metadata update.
- *
- * Like control changes, does not send update to client that set the metadata, if applicable.
- */
-void
-OSCSender::send_metadata_update(const string& node_path, const string& key, const string& value)
-{
- for (list<ClientRecord*>::const_iterator i = m_clients.begin(); i != m_clients.end(); ++i)
- send_metadata_update_to((*i), node_path, key, value);
-}
-
-
-/** Send notification of a control change.
- *
- * If responder is specified, the notification will not be send to the address of
- * that responder (to avoid sending redundant information back to clients and
- * forcing clients to ignore things to avoid feedback loops etc).
- */
-void
-OSCSender::send_control_change(const string& port_path, float value)
-{
- for (list<ClientRecord*>::const_iterator i = m_clients.begin(); i != m_clients.end(); ++i)
- send_control_change_to((*i), port_path, value);
-}
-
-
-void
-OSCSender::send_program_add(const string& node_path, int bank, int program, const string& name)
-{
- for (list<ClientRecord*>::const_iterator i = m_clients.begin(); i != m_clients.end(); ++i)
- send_program_add_to((*i), node_path, bank, program, name);
-}
-
-
-void
-OSCSender::send_program_remove(const string& node_path, int bank, int program)
-{
- for (list<ClientRecord*>::const_iterator i = m_clients.begin(); i != m_clients.end(); ++i)
- send_program_remove_to((*i), node_path, bank, program);
-}
-
-
-/** Send a patch.
- *
- * Sends all objects underneath Patch - contained Nodes, etc.
- */
-void
-OSCSender::send_patch(const Patch* const p)
-{
- for (list<ClientRecord*>::const_iterator i = m_clients.begin(); i != m_clients.end(); ++i)
- send_patch_to((*i), p);
-}
-
-
-/** Sends notification of an OmObject's renaming
- */
-void
-OSCSender::send_rename(const string& old_path, const string& new_path)
-{
- for (list<ClientRecord*>::const_iterator i = m_clients.begin(); i != m_clients.end(); ++i)
- send_rename_to((*i), old_path, new_path);
-}
-
-
-/** Sends all OmObjects known to the engine.
- */
-void
-OSCSender::send_all_objects()
-{
- for (list<ClientRecord*>::const_iterator i = m_clients.begin(); i != m_clients.end(); ++i)
- send_all_objects_to((*i));
-}
-
-
-void
-OSCSender::send_node_creation_messages(const Node* const node)
-{
- // This is pretty stupid :/ in and out and back again!
- for (list<ClientRecord*>::const_iterator i = m_clients.begin(); i != m_clients.end(); ++i)
- node->send_creation_messages((*i));
-}
-
-
-//
-// SINGLE DESTINATION VERSIONS
-//
-
-
-/** \page client_osc_namespace
- * <p> \b /om/new_node - Notification of a new node's creation.
- * \arg \b path (string) - Path of the new node
- * \arg \b polyphonic (integer-boolean) - Node is polyphonic (1 = yes, 0 = no)
- * \arg \b type (string) - Type of plugin (LADSPA, DSSI, Internal, Patch)
- * \arg \b lib-name (string) - Name of library if a plugin (ie cmt.so)
- * \arg \b plug-label (string) - Label of plugin in library (ie adsr_env)
- *
- * \li New nodes are sent as a bundle. The first message in the bundle will be
- * this one (/om/new_node), followed by a series of /om/new_port commands,
- * followed by /om/new_node_end. </p> \n \n
- */
-void
-OSCSender::send_node_to(ClientRecord* client, const Node* const node)
-{
- assert(client != NULL);
-
- lo_timetag tt;
- lo_timetag_now(&tt);
- lo_bundle b = lo_bundle_new(tt);
- lo_message m = lo_message_new();
- list<lo_message> msgs;
-
- lo_message_add_string(m, node->path().c_str());
- lo_message_add_int32(m,
- (node->poly() > 1
- && node->poly() == node->parent_patch()->internal_poly()
- ? 1 : 0));
-
- lo_message_add_string(m, node->plugin()->type_string());
- lo_message_add_string(m, node->plugin()->uri().c_str());
- /*lo_message_add_string(m, node->plugin()->lib_name().c_str());
- lo_message_add_string(m, node->plugin()->plug_label().c_str());*/
- lo_bundle_add_message(b, "/om/new_node", m);
- msgs.push_back(m);
-
- const Array<Port*>& ports = node->ports();
- Port* port;
- PortInfo* info;
- for (size_t j=0; j < ports.size(); ++j) {
- port = ports.at(j);
- info = port->port_info();
-
- assert(port != NULL);
- assert(info != NULL);
-
- m = lo_message_new();
- lo_message_add_string(m, port->path().c_str());
- lo_message_add_string(m, info->type_string().c_str());
- lo_message_add_string(m, info->direction_string().c_str());
- lo_message_add_string(m, info->hint_string().c_str());
- lo_message_add_float(m, info->default_val());
- lo_message_add_float(m, info->min_val());
- lo_message_add_float(m, info->max_val());
- lo_bundle_add_message(b, "/om/new_port", m);
- msgs.push_back(m);
-
- // If the bundle is getting very large, send it and start
- // a new one
- if (lo_bundle_length(b) > 1024) {
- lo_send_bundle(client->address(), b);
- lo_bundle_free(b);
- b = lo_bundle_new(tt);
- }
- }
-
- m = lo_message_new();
- lo_bundle_add_message(b, "/om/new_node_end", m);
- msgs.push_back(m);
-
- lo_send_bundle(client->address(), b);
- lo_bundle_free(b);
-
- for (list<lo_bundle>::const_iterator i = msgs.begin(); i != msgs.end(); ++i)
- lo_message_free(*i);
-
- usleep(100);
-
- const map<string, string>& data = node->metadata();
- // Send node metadata
- for (map<string, string>::const_iterator i = data.begin(); i != data.end(); ++i)
- send_metadata_update_to(client, node->path(), (*i).first, (*i).second);
-
- // Send port metadata
- for (size_t j=0; j < ports.size(); ++j) {
- port = ports.at(j);
- const map<string, string>& data = port->metadata();
- for (map<string, string>::const_iterator i = data.begin(); i != data.end(); ++i)
- send_metadata_update_to(client, port->path(), (*i).first, (*i).second);
- }
-
- // Send control values
- for (size_t i=0; i < node->ports().size(); ++i) {
- PortBase<sample>* port = (PortBase<sample>*)node->ports().at(i);
- if (port->port_info()->is_input() && port->port_info()->is_control())
- send_control_change_to(client, port->path(), port->buffer(0)->value_at(0));
- }
-}
-
-
-
-/** \page client_osc_namespace
- * <p> \b /om/new_port - Notification of a new port's creation.
- * \arg \b path (string) - Path of new port
- * \arg \b data-type (string) - Type of port (CONTROL or AUDIO)
- * \arg \b direction (string) - Direction of data flow (INPUT or OUTPUT)
- * \arg \b hint (string) - Hint (INTEGER, LOGARITHMIC, TOGGLE, or NONE)
- * \arg \b default-value (float) - Default (initial) value
- * \arg \b min-value (float) - Suggested minimum value
- * \arg \b min-value (float) - Suggested maximum value
- *
- * \li Note that in the event of loading a patch, this message could be
- * followed immediately by a control change, meaning the default-value is
- * not actually the current value of the port.
- * \li The minimum and maximum values are suggestions only, they are not
- * enforced in any way, and going outside them is perfectly fine. Also note
- * that the port ranges in om_gtk are not these ones! Those ranges are set
- * as metadata.</p> \n \n
- */
-void
-OSCSender::send_new_port_to(ClientRecord* client, const Port* port)
-{
- assert(client != NULL);
-
- PortInfo* info = port->port_info();
-
- lo_send(client->address(), "/om/new_port", "ssssfff",
- port->path().c_str(), info->type_string().c_str(), info->direction_string().c_str(),
- info->hint_string().c_str(), info->default_val(), info->min_val(), info->max_val());
-
- // Send metadata
- const map<string, string>& data = port->metadata();
- for (map<string, string>::const_iterator i = data.begin(); i != data.end(); ++i)
- send_metadata_update_to(client, port->path(), (*i).first, (*i).second);
-}
-
-
-/** \page client_osc_namespace
- * <p> \b /om/destroyed - Notification an object has been destroyed
- * \arg \b path (string) - Path of object (which no longer exists) </p> \n \n
- */
-void
-OSCSender::send_destroyed_to(ClientRecord* client, const string& path)
-{
- assert(client != NULL);
- assert(path != "/");
-
- lo_send(client->address(), "/om/destroyed", "s", path.c_str());
-}
-
-
-/** \page client_osc_namespace
- * <p> \b /om/patch_cleared - Notification a patch has been cleared (all children destroyed)
- * \arg \b path (string) - Path of patch (which is now empty)</p> \n \n
- */
-void
-OSCSender::send_patch_cleared_to(ClientRecord* client, const string& patch_path)
-{
- assert(client != NULL);
-
- lo_send(client->address(), "/om/patch_cleared", "s", patch_path.c_str());
-}
-
-
-/** \page client_osc_namespace
- * <p> \b /om/patch_enabled - Notification a patch's DSP processing has been enabled.
- * \arg \b path (string) - Path of enabled patch</p> \n \n
- */
-void
-OSCSender::send_patch_enable_to(ClientRecord* client, const string& patch_path)
-{
- assert(client != NULL);
-
- lo_send(client->address(), "/om/patch_enabled", "s", patch_path.c_str());
-}
-
-
-/** \page client_osc_namespace
- * <p> \b /om/patch_disabled - Notification a patch's DSP processing has been disabled.
- * \arg \b path (string) - Path of disabled patch</p> \n \n
- */
-void
-OSCSender::send_patch_disable_to(ClientRecord* client, const string& patch_path)
-{
- assert(client != NULL);
-
- lo_send(client->address(), "/om/patch_disabled", "s", patch_path.c_str());
-}
-
-
-/** \page client_osc_namespace
- * <p> \b /om/new_connection - Notification a new connection has been made.
- * \arg \b src-path (string) - Path of the source port
- * \arg \b dst-path (string) - Path of the destination port</p> \n \n
- */
-void
-OSCSender::send_connection_to(ClientRecord* client, const Connection* const c)
-{
- assert(client != NULL);
-
- lo_send(client->address(), "/om/new_connection", "ss", c->src_port()->path().c_str(), c->dst_port()->path().c_str());
-}
-
-
-/** \page client_osc_namespace
- * <p> \b /om/disconnection - Notification a connection has been unmade.
- * \arg \b src-path (string) - Path of the source port
- * \arg \b dst-path (string) - Path of the destination port</p> \n \n
- */
-void
-OSCSender::send_disconnection_to(ClientRecord* client, const string& src_port_path, const string& dst_port_path)
-{
- assert(client != NULL);
-
- lo_send(client->address(), "/om/disconnection", "ss", src_port_path.c_str(), dst_port_path.c_str());
-}
-
-
-/** \page client_osc_namespace
- * <p> \b /om/metadata/update - Notification of a piece of metadata.
- * \arg \b path (string) - Path of the object associated with metadata (can be a node, patch, or port)
- * \arg \b key (string)
- * \arg \b value (string)</p> \n \n
- */
-void
-OSCSender::send_metadata_update_to(ClientRecord* client, const string& path, const string& key, const string& value)
-{
- assert(client != NULL);
-
- lo_send(client->address(), "/om/metadata/update", "sss", path.c_str(), key.c_str(), value.c_str());
-}
-
-
-/** \page client_osc_namespace
- * <p> \b /om/control_change - Notification the value of a port has changed
- * \arg \b path (string) - Path of port
- * \arg \b value (float) - New value of port
- *
- * \li This will only send updates for values set by clients of course - not values
- * changing because of connections to other ports!</p> \n \n
- */
-void
-OSCSender::send_control_change_to(ClientRecord* client, const string& port_path, float value)
-{
- assert(client != NULL);
-
- lo_send(client->address(), "/om/control_change", "sf", port_path.c_str(), value);
-}
-
-
-/** \page client_osc_namespace
- * <p> \b /om/new_patch - Notification of a new patch
- * \arg \b path (string) - Path of new patch
- * \arg \b poly (int) - Polyphony of new patch (\em not a boolean like new_node) </p> \n \n
- */
-void
-OSCSender::send_patch_to(ClientRecord* client, const Patch* const p)
-{
- assert(client != NULL);
-
- lo_send(client->address(), "/om/new_patch", "si", p->path().c_str(), p->internal_poly());
-
- if (p->process())
- send_patch_enable_to(client, p->path());
-
- // Send metadata
- const map<string, string>& data = p->metadata();
- for (map<string, string>::const_iterator i = data.begin(); i != data.end(); ++i) {
- send_metadata_update_to(client, p->path(), (*i).first, (*i).second);
- }
-}
-
-
-/** \page client_osc_namespace
- * <p> \b /om/object_renamed - Notification of an object's renaming
- * \arg \b old-path (string) - Old path of object
- * \arg \b new-path (string) - New path of object </p> \n \n
- */
-void
-OSCSender::send_rename_to(ClientRecord* client, const string& old_path, const string& new_path)
-{
- assert(client != NULL);
-
- lo_send(client->address(), "/om/object_renamed", "ss", old_path.c_str(), new_path.c_str());
-}
-
-
-/** Sends all OmObjects known to the engine.
- */
-void
-OSCSender::send_all_objects_to(ClientRecord* client)
-{
- assert(client != NULL);
-
- for (Tree<OmObject*>::iterator i = om->object_store()->objects().begin();
- i != om->object_store()->objects().end(); ++i)
- if ((*i)->as_node() != NULL && (*i)->parent() == NULL)
- (*i)->as_node()->send_creation_messages(client);
-}
-
-
-/** Sends information about a program associated with a DSSI plugin node.
- */
-void
-OSCSender::send_program_add_to(ClientRecord* client, const string& node_path, int bank, int program, const string& name)
-{
- assert(client != NULL);
-
- lo_send(client->address(), "/om/program_add", "siis",
- node_path.c_str(), bank, program, name.c_str());
-}
-
-
-void
-OSCSender::send_program_remove_to(ClientRecord* client, const string& node_path, int bank, int program)
-{
- assert(client != NULL);
-
- lo_send(client->address(), "/om/program_remove", "sii",
- node_path.c_str(), bank, program);
-}
-
-
-} // namespace Om
diff --git a/src/engine/bak/OSCSender.h b/src/engine/bak/OSCSender.h
deleted file mode 100644
index 1410bfa4..00000000
--- a/src/engine/bak/OSCSender.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/* This file is part of Om. Copyright (C) 2005 Dave Robillard.
- *
- * Om 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.
- *
- * Om 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.,
- * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef OSCSENDER_H
-#define OSCSENDER_H
-
-#include <string>
-#include <iostream>
-#include <list>
-#include <lo/lo.h>
-#include <pthread.h>
-#include "util/types.h"
-
-using std::list; using std::string;
-
-namespace Om {
-
-class Node;
-class Port;
-class PortInfo;
-class Plugin;
-class Patch;
-class Connection;
-class ClientRecord;
-class Responder;
-
-
-/** Sends OSC messages (for two-way communication with client)
- *
- * \ingroup engine
- */
-class OSCSender
-{
-public:
- void register_client(const string& url);
- ClientRecord* unregister_client(const Responder* responder);
- ClientRecord* client(const Responder* responder);
-
- // Notification band:
-
- //void send_client_registration(const string& url, int client_id);
-
- // Error that isn't the direct result of a request
- void send_error(const string& msg);
-
- void send_plugins_to(ClientRecord* client);
-
- void send_node_creation_messages(const Node* const node);
-
- // These versions send to all clients, using single client versions below
- void send_patch(const Patch* const p);
- void send_new_port(const Port* port);
- void send_node(const Node* const node);
- void send_destroyed(const string& path);
- void send_patch_cleared(const string& patch_path);
- void send_connection(const Connection* const connection);
- void send_disconnection(const string& src_port_path, const string& dst_port_path);
- void send_rename(const string& old_path, const string& new_path);
- void send_all_objects();
- void send_patch_enable(const string& patch_path);
- void send_patch_disable(const string& patch_path);
- void send_metadata_update(const string& node_path, const string& key, const string& value);
- void send_control_change(const string& port_path, float value);
- void send_program_add(const string& node_path, int bank, int program, const string& name);
- void send_program_remove(const string& node_path, int bank, int program);
-
-
- // These versions send to passed address
- void send_patch_to(ClientRecord* client, const Patch* const p);
- void send_new_port_to(ClientRecord* client, const Port* port);
- void send_node_to(ClientRecord* client, const Node* const node);
- void send_destroyed_to(ClientRecord* client, const string& path);
- void send_patch_cleared_to(ClientRecord* client, const string& patch_path);
- void send_connection_to(ClientRecord* client, const Connection* const connection);
- void send_disconnection_to(ClientRecord* client, const string& src_port_path, const string& dst_port_path);
- void send_rename_to(ClientRecord* client, const string& old_path, const string& new_path);
- void send_all_objects_to(ClientRecord* client);
- void send_patch_enable_to(ClientRecord* client, const string& patch_path);
- void send_patch_disable_to(ClientRecord* client, const string& patch_path);
- void send_metadata_update_to(ClientRecord* client, const string& node_path, const string& key, const string& value);
- void send_control_change_to(ClientRecord* client, const string& port_path, float value);
- void send_program_add_to(ClientRecord* client, const string& node_path, int bank, int program, const string& name);
- void send_program_remove_to(ClientRecord* client, const string& node_path, int bank, int program);
-
-private:
- list<ClientRecord*> m_clients;
-};
-
-
-} // namespace Om
-
-#endif // OSCSENDER_H
diff --git a/src/engine/bak/Responder.cpp b/src/engine/bak/Responder.cpp
deleted file mode 100644
index a01c0790..00000000
--- a/src/engine/bak/Responder.cpp
+++ /dev/null
@@ -1,60 +0,0 @@
-/* This file is part of Om. Copyright (C) 2006 Dave Robillard.
- *
- * Om 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.
- *
- * Om 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.,
- * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include "Responder.h"
-#include <lo/lo.h>
-#include "ClientBroadcaster.h"
-
-namespace Om {
-
-// FIXME FIXME FIXME this is all reeeeally baaaaaadddd
-// Need an abstract interface for control band
-
-
-void
-Responder::respond_ok()
-{
- assert(_key.type() == ClientKey::OSC);
- lo_address source = lo_address_new_from_url(_key.source_url());
-
- if (source != NULL) {
- if (lo_send(source, "/om/response/ok", "i", _id) < 0) {
- cerr << "Unable to send response " << _id << "! ("
- << lo_address_errstr(source) << ")" << endl;
- }
- }
-
- lo_address_free(source);
-}
-
-
-void
-Responder::respond_error(const string& msg)
-{
- assert(_key.type() == ClientKey::OSC);
- lo_address source = lo_address_new_from_url(_key.source_url());
-
- if (source != NULL) {
- if (lo_send(source, "/om/response/error", "is",_id, msg.c_str()) < 0) {
- cerr << "Unable to send response " << _id << "! ("
- << lo_address_errstr(source) << endl;
- }
- }
- lo_address_free(source);
-}
-
-} // namespace OM
-
diff --git a/src/engine/ActivateEvent.cpp b/src/engine/events/ActivateEvent.cpp
index 671b26d5..671b26d5 100644
--- a/src/engine/ActivateEvent.cpp
+++ b/src/engine/events/ActivateEvent.cpp
diff --git a/src/engine/ActivateEvent.h b/src/engine/events/ActivateEvent.h
index 280b5523..280b5523 100644
--- a/src/engine/ActivateEvent.h
+++ b/src/engine/events/ActivateEvent.h
diff --git a/src/engine/AddNodeEvent.cpp b/src/engine/events/AddNodeEvent.cpp
index 2b31ef4a..2b31ef4a 100644
--- a/src/engine/AddNodeEvent.cpp
+++ b/src/engine/events/AddNodeEvent.cpp
diff --git a/src/engine/AddNodeEvent.h b/src/engine/events/AddNodeEvent.h
index fe0236ba..fe0236ba 100644
--- a/src/engine/AddNodeEvent.h
+++ b/src/engine/events/AddNodeEvent.h
diff --git a/src/engine/AllNotesOffEvent.cpp b/src/engine/events/AllNotesOffEvent.cpp
index aa3a00f1..aa3a00f1 100644
--- a/src/engine/AllNotesOffEvent.cpp
+++ b/src/engine/events/AllNotesOffEvent.cpp
diff --git a/src/engine/AllNotesOffEvent.h b/src/engine/events/AllNotesOffEvent.h
index ea23301b..ea23301b 100644
--- a/src/engine/AllNotesOffEvent.h
+++ b/src/engine/events/AllNotesOffEvent.h
diff --git a/src/engine/ClearPatchEvent.cpp b/src/engine/events/ClearPatchEvent.cpp
index 8b8fc223..8b8fc223 100644
--- a/src/engine/ClearPatchEvent.cpp
+++ b/src/engine/events/ClearPatchEvent.cpp
diff --git a/src/engine/ClearPatchEvent.h b/src/engine/events/ClearPatchEvent.h
index c6e531a8..c6e531a8 100644
--- a/src/engine/ClearPatchEvent.h
+++ b/src/engine/events/ClearPatchEvent.h
diff --git a/src/engine/ConnectionEvent.cpp b/src/engine/events/ConnectionEvent.cpp
index fe3b991e..fe3b991e 100644
--- a/src/engine/ConnectionEvent.cpp
+++ b/src/engine/events/ConnectionEvent.cpp
diff --git a/src/engine/ConnectionEvent.h b/src/engine/events/ConnectionEvent.h
index 8aaf2292..8aaf2292 100644
--- a/src/engine/ConnectionEvent.h
+++ b/src/engine/events/ConnectionEvent.h
diff --git a/src/engine/CreatePatchEvent.cpp b/src/engine/events/CreatePatchEvent.cpp
index 9f0ae7f2..9f0ae7f2 100644
--- a/src/engine/CreatePatchEvent.cpp
+++ b/src/engine/events/CreatePatchEvent.cpp
diff --git a/src/engine/CreatePatchEvent.h b/src/engine/events/CreatePatchEvent.h
index 507d03c7..507d03c7 100644
--- a/src/engine/CreatePatchEvent.h
+++ b/src/engine/events/CreatePatchEvent.h
diff --git a/src/engine/DSSIConfigureEvent.cpp b/src/engine/events/DSSIConfigureEvent.cpp
index 2ade4671..2ade4671 100644
--- a/src/engine/DSSIConfigureEvent.cpp
+++ b/src/engine/events/DSSIConfigureEvent.cpp
diff --git a/src/engine/DSSIConfigureEvent.h b/src/engine/events/DSSIConfigureEvent.h
index 00b4a134..00b4a134 100644
--- a/src/engine/DSSIConfigureEvent.h
+++ b/src/engine/events/DSSIConfigureEvent.h
diff --git a/src/engine/DSSIControlEvent.cpp b/src/engine/events/DSSIControlEvent.cpp
index ea3e70ac..ea3e70ac 100644
--- a/src/engine/DSSIControlEvent.cpp
+++ b/src/engine/events/DSSIControlEvent.cpp
diff --git a/src/engine/DSSIControlEvent.h b/src/engine/events/DSSIControlEvent.h
index 30a5279e..30a5279e 100644
--- a/src/engine/DSSIControlEvent.h
+++ b/src/engine/events/DSSIControlEvent.h
diff --git a/src/engine/DSSIProgramEvent.cpp b/src/engine/events/DSSIProgramEvent.cpp
index eb68ef77..eb68ef77 100644
--- a/src/engine/DSSIProgramEvent.cpp
+++ b/src/engine/events/DSSIProgramEvent.cpp
diff --git a/src/engine/DSSIProgramEvent.h b/src/engine/events/DSSIProgramEvent.h
index 152f3cb1..152f3cb1 100644
--- a/src/engine/DSSIProgramEvent.h
+++ b/src/engine/events/DSSIProgramEvent.h
diff --git a/src/engine/DSSIUpdateEvent.cpp b/src/engine/events/DSSIUpdateEvent.cpp
index 5650dd63..5650dd63 100644
--- a/src/engine/DSSIUpdateEvent.cpp
+++ b/src/engine/events/DSSIUpdateEvent.cpp
diff --git a/src/engine/DSSIUpdateEvent.h b/src/engine/events/DSSIUpdateEvent.h
index cdd8851e..cdd8851e 100644
--- a/src/engine/DSSIUpdateEvent.h
+++ b/src/engine/events/DSSIUpdateEvent.h
diff --git a/src/engine/DeactivateEvent.cpp b/src/engine/events/DeactivateEvent.cpp
index 48bff55a..48bff55a 100644
--- a/src/engine/DeactivateEvent.cpp
+++ b/src/engine/events/DeactivateEvent.cpp
diff --git a/src/engine/DeactivateEvent.h b/src/engine/events/DeactivateEvent.h
index 8401f332..8401f332 100644
--- a/src/engine/DeactivateEvent.h
+++ b/src/engine/events/DeactivateEvent.h
diff --git a/src/engine/DestroyEvent.cpp b/src/engine/events/DestroyEvent.cpp
index 3988195a..3988195a 100644
--- a/src/engine/DestroyEvent.cpp
+++ b/src/engine/events/DestroyEvent.cpp
diff --git a/src/engine/DestroyEvent.h b/src/engine/events/DestroyEvent.h
index fc579bf4..fc579bf4 100644
--- a/src/engine/DestroyEvent.h
+++ b/src/engine/events/DestroyEvent.h
diff --git a/src/engine/DisablePatchEvent.cpp b/src/engine/events/DisablePatchEvent.cpp
index a772e6e9..a772e6e9 100644
--- a/src/engine/DisablePatchEvent.cpp
+++ b/src/engine/events/DisablePatchEvent.cpp
diff --git a/src/engine/DisablePatchEvent.h b/src/engine/events/DisablePatchEvent.h
index f38f14af..f38f14af 100644
--- a/src/engine/DisablePatchEvent.h
+++ b/src/engine/events/DisablePatchEvent.h
diff --git a/src/engine/DisconnectNodeEvent.cpp b/src/engine/events/DisconnectNodeEvent.cpp
index 17367dd4..17367dd4 100644
--- a/src/engine/DisconnectNodeEvent.cpp
+++ b/src/engine/events/DisconnectNodeEvent.cpp
diff --git a/src/engine/DisconnectNodeEvent.h b/src/engine/events/DisconnectNodeEvent.h
index a82fbaec..a82fbaec 100644
--- a/src/engine/DisconnectNodeEvent.h
+++ b/src/engine/events/DisconnectNodeEvent.h
diff --git a/src/engine/DisconnectPortEvent.cpp b/src/engine/events/DisconnectPortEvent.cpp
index a4c213d5..a4c213d5 100644
--- a/src/engine/DisconnectPortEvent.cpp
+++ b/src/engine/events/DisconnectPortEvent.cpp
diff --git a/src/engine/DisconnectPortEvent.h b/src/engine/events/DisconnectPortEvent.h
index e8de4120..e8de4120 100644
--- a/src/engine/DisconnectPortEvent.h
+++ b/src/engine/events/DisconnectPortEvent.h
diff --git a/src/engine/DisconnectionEvent.cpp b/src/engine/events/DisconnectionEvent.cpp
index e7d06eab..e7d06eab 100644
--- a/src/engine/DisconnectionEvent.cpp
+++ b/src/engine/events/DisconnectionEvent.cpp
diff --git a/src/engine/DisconnectionEvent.h b/src/engine/events/DisconnectionEvent.h
index bbb70f3c..bbb70f3c 100644
--- a/src/engine/DisconnectionEvent.h
+++ b/src/engine/events/DisconnectionEvent.h
diff --git a/src/engine/EnablePatchEvent.cpp b/src/engine/events/EnablePatchEvent.cpp
index 6af3b844..6af3b844 100644
--- a/src/engine/EnablePatchEvent.cpp
+++ b/src/engine/events/EnablePatchEvent.cpp
diff --git a/src/engine/EnablePatchEvent.h b/src/engine/events/EnablePatchEvent.h
index f3d22e69..f3d22e69 100644
--- a/src/engine/EnablePatchEvent.h
+++ b/src/engine/events/EnablePatchEvent.h
diff --git a/src/engine/Event.cpp b/src/engine/events/Event.cpp
index 7d590e76..7d590e76 100644
--- a/src/engine/Event.cpp
+++ b/src/engine/events/Event.cpp
diff --git a/src/engine/Event.h b/src/engine/events/Event.h
index a6d06f83..a6d06f83 100644
--- a/src/engine/Event.h
+++ b/src/engine/events/Event.h
diff --git a/src/engine/LashRestoreDoneEvent.h b/src/engine/events/LashRestoreDoneEvent.h
index dfc5b120..dfc5b120 100644
--- a/src/engine/LashRestoreDoneEvent.h
+++ b/src/engine/events/LashRestoreDoneEvent.h
diff --git a/src/engine/LoadPluginsEvent.cpp b/src/engine/events/LoadPluginsEvent.cpp
index 656e9010..656e9010 100644
--- a/src/engine/LoadPluginsEvent.cpp
+++ b/src/engine/events/LoadPluginsEvent.cpp
diff --git a/src/engine/LoadPluginsEvent.h b/src/engine/events/LoadPluginsEvent.h
index b69dbb38..b69dbb38 100644
--- a/src/engine/LoadPluginsEvent.h
+++ b/src/engine/events/LoadPluginsEvent.h
diff --git a/src/engine/events/Makefile.am b/src/engine/events/Makefile.am
new file mode 100644
index 00000000..9a882a4f
--- /dev/null
+++ b/src/engine/events/Makefile.am
@@ -0,0 +1,65 @@
+EXTRA_DIST = \
+ events/RegisterClientEvent.h \
+ events/RegisterClientEvent.cpp \
+ events/UnregisterClientEvent.h \
+ events/UnregisterClientEvent.cpp \
+ events/PingQueuedEvent.h \
+ events/ActivateEvent.h \
+ events/ActivateEvent.cpp \
+ events/DeactivateEvent.h \
+ events/DeactivateEvent.cpp \
+ events/SetPortValueEvent.h \
+ events/SetPortValueEvent.cpp \
+ events/SetPortValueQueuedEvent.h \
+ events/SetPortValueQueuedEvent.cpp \
+ events/NoteOnEvent.h \
+ events/NoteOnEvent.cpp \
+ events/NoteOffEvent.h \
+ events/NoteOffEvent.cpp \
+ events/AllNotesOffEvent.h \
+ events/AllNotesOffEvent.cpp \
+ events/ConnectionEvent.h \
+ events/ConnectionEvent.cpp \
+ events/DisconnectionEvent.h \
+ events/DisconnectionEvent.cpp \
+ events/DisconnectNodeEvent.h \
+ events/DisconnectNodeEvent.cpp \
+ events/DisconnectPortEvent.h \
+ events/DisconnectPortEvent.cpp \
+ events/DestroyEvent.h \
+ events/DestroyEvent.cpp \
+ events/AddNodeEvent.h \
+ events/AddNodeEvent.cpp \
+ events/SetMetadataEvent.h \
+ events/SetMetadataEvent.cpp \
+ events/RequestMetadataEvent.h \
+ events/RequestMetadataEvent.cpp \
+ events/RequestPortValueEvent.h \
+ events/RequestPortValueEvent.cpp \
+ events/RequestAllObjectsEvent.h \
+ events/RequestAllObjectsEvent.cpp \
+ events/RequestPluginsEvent.h \
+ events/RequestPluginsEvent.cpp \
+ events/CreatePatchEvent.h \
+ events/CreatePatchEvent.cpp \
+ events/LoadPluginsEvent.h \
+ events/LoadPluginsEvent.cpp \
+ events/EnablePatchEvent.h \
+ events/EnablePatchEvent.cpp \
+ events/DisablePatchEvent.h \
+ events/DisablePatchEvent.cpp \
+ events/ClearPatchEvent.h \
+ events/ClearPatchEvent.cpp \
+ events/RenameEvent.h \
+ events/RenameEvent.cpp \
+ events/MidiLearnEvent.h \
+ events/MidiLearnEvent.cpp \
+ DSSIConfigureEvent.cpp \
+ DSSIConfigureEvent.h \
+ DSSIControlEvent.cpp \
+ DSSIControlEvent.h \
+ DSSIProgramEvent.cpp \
+ DSSIProgramEvent.h \
+ DSSIUpdateEvent.cpp \
+ DSSIUpdateEvent.h
+
diff --git a/src/engine/MidiLearnEvent.cpp b/src/engine/events/MidiLearnEvent.cpp
index 63ad82fc..63ad82fc 100644
--- a/src/engine/MidiLearnEvent.cpp
+++ b/src/engine/events/MidiLearnEvent.cpp
diff --git a/src/engine/MidiLearnEvent.h b/src/engine/events/MidiLearnEvent.h
index 793e675a..793e675a 100644
--- a/src/engine/MidiLearnEvent.h
+++ b/src/engine/events/MidiLearnEvent.h
diff --git a/src/engine/NoteOffEvent.cpp b/src/engine/events/NoteOffEvent.cpp
index fde2e520..fde2e520 100644
--- a/src/engine/NoteOffEvent.cpp
+++ b/src/engine/events/NoteOffEvent.cpp
diff --git a/src/engine/NoteOffEvent.h b/src/engine/events/NoteOffEvent.h
index edd0b373..edd0b373 100644
--- a/src/engine/NoteOffEvent.h
+++ b/src/engine/events/NoteOffEvent.h
diff --git a/src/engine/NoteOnEvent.cpp b/src/engine/events/NoteOnEvent.cpp
index 9688af79..9688af79 100644
--- a/src/engine/NoteOnEvent.cpp
+++ b/src/engine/events/NoteOnEvent.cpp
diff --git a/src/engine/NoteOnEvent.h b/src/engine/events/NoteOnEvent.h
index 1e09e450..1e09e450 100644
--- a/src/engine/NoteOnEvent.h
+++ b/src/engine/events/NoteOnEvent.h
diff --git a/src/engine/PingQueuedEvent.h b/src/engine/events/PingQueuedEvent.h
index cfba7058..cfba7058 100644
--- a/src/engine/PingQueuedEvent.h
+++ b/src/engine/events/PingQueuedEvent.h
diff --git a/src/engine/QueuedEvent.h b/src/engine/events/QueuedEvent.h
index 16560aaa..16560aaa 100644
--- a/src/engine/QueuedEvent.h
+++ b/src/engine/events/QueuedEvent.h
diff --git a/src/engine/RegisterClientEvent.cpp b/src/engine/events/RegisterClientEvent.cpp
index ca7dd1f6..ca7dd1f6 100644
--- a/src/engine/RegisterClientEvent.cpp
+++ b/src/engine/events/RegisterClientEvent.cpp
diff --git a/src/engine/RegisterClientEvent.h b/src/engine/events/RegisterClientEvent.h
index f4b6b60f..f4b6b60f 100644
--- a/src/engine/RegisterClientEvent.h
+++ b/src/engine/events/RegisterClientEvent.h
diff --git a/src/engine/RenameEvent.cpp b/src/engine/events/RenameEvent.cpp
index e2e98dd0..e2e98dd0 100644
--- a/src/engine/RenameEvent.cpp
+++ b/src/engine/events/RenameEvent.cpp
diff --git a/src/engine/RenameEvent.h b/src/engine/events/RenameEvent.h
index c1c9fe91..c1c9fe91 100644
--- a/src/engine/RenameEvent.h
+++ b/src/engine/events/RenameEvent.h
diff --git a/src/engine/RequestAllObjectsEvent.cpp b/src/engine/events/RequestAllObjectsEvent.cpp
index ef40a0de..ef40a0de 100644
--- a/src/engine/RequestAllObjectsEvent.cpp
+++ b/src/engine/events/RequestAllObjectsEvent.cpp
diff --git a/src/engine/RequestAllObjectsEvent.h b/src/engine/events/RequestAllObjectsEvent.h
index df63a577..df63a577 100644
--- a/src/engine/RequestAllObjectsEvent.h
+++ b/src/engine/events/RequestAllObjectsEvent.h
diff --git a/src/engine/RequestMetadataEvent.cpp b/src/engine/events/RequestMetadataEvent.cpp
index 10e1007c..10e1007c 100644
--- a/src/engine/RequestMetadataEvent.cpp
+++ b/src/engine/events/RequestMetadataEvent.cpp
diff --git a/src/engine/RequestMetadataEvent.h b/src/engine/events/RequestMetadataEvent.h
index e4243eb3..e4243eb3 100644
--- a/src/engine/RequestMetadataEvent.h
+++ b/src/engine/events/RequestMetadataEvent.h
diff --git a/src/engine/RequestPluginsEvent.cpp b/src/engine/events/RequestPluginsEvent.cpp
index 89dbefd5..89dbefd5 100644
--- a/src/engine/RequestPluginsEvent.cpp
+++ b/src/engine/events/RequestPluginsEvent.cpp
diff --git a/src/engine/RequestPluginsEvent.h b/src/engine/events/RequestPluginsEvent.h
index 83447fb3..83447fb3 100644
--- a/src/engine/RequestPluginsEvent.h
+++ b/src/engine/events/RequestPluginsEvent.h
diff --git a/src/engine/RequestPortValueEvent.cpp b/src/engine/events/RequestPortValueEvent.cpp
index e4d3985e..e4d3985e 100644
--- a/src/engine/RequestPortValueEvent.cpp
+++ b/src/engine/events/RequestPortValueEvent.cpp
diff --git a/src/engine/RequestPortValueEvent.h b/src/engine/events/RequestPortValueEvent.h
index d970ee9c..d970ee9c 100644
--- a/src/engine/RequestPortValueEvent.h
+++ b/src/engine/events/RequestPortValueEvent.h
diff --git a/src/engine/SetMetadataEvent.cpp b/src/engine/events/SetMetadataEvent.cpp
index 614f7ca9..614f7ca9 100644
--- a/src/engine/SetMetadataEvent.cpp
+++ b/src/engine/events/SetMetadataEvent.cpp
diff --git a/src/engine/SetMetadataEvent.h b/src/engine/events/SetMetadataEvent.h
index ef471033..ef471033 100644
--- a/src/engine/SetMetadataEvent.h
+++ b/src/engine/events/SetMetadataEvent.h
diff --git a/src/engine/SetPortValueEvent.cpp b/src/engine/events/SetPortValueEvent.cpp
index 964cd9ca..964cd9ca 100644
--- a/src/engine/SetPortValueEvent.cpp
+++ b/src/engine/events/SetPortValueEvent.cpp
diff --git a/src/engine/SetPortValueEvent.h b/src/engine/events/SetPortValueEvent.h
index 0a9614b9..0a9614b9 100644
--- a/src/engine/SetPortValueEvent.h
+++ b/src/engine/events/SetPortValueEvent.h
diff --git a/src/engine/SetPortValueQueuedEvent.cpp b/src/engine/events/SetPortValueQueuedEvent.cpp
index e73c0486..e73c0486 100644
--- a/src/engine/SetPortValueQueuedEvent.cpp
+++ b/src/engine/events/SetPortValueQueuedEvent.cpp
diff --git a/src/engine/SetPortValueQueuedEvent.h b/src/engine/events/SetPortValueQueuedEvent.h
index b92beacf..b92beacf 100644
--- a/src/engine/SetPortValueQueuedEvent.h
+++ b/src/engine/events/SetPortValueQueuedEvent.h
diff --git a/src/engine/UnregisterClientEvent.cpp b/src/engine/events/UnregisterClientEvent.cpp
index ef5a9979..ef5a9979 100644
--- a/src/engine/UnregisterClientEvent.cpp
+++ b/src/engine/events/UnregisterClientEvent.cpp
diff --git a/src/engine/UnregisterClientEvent.h b/src/engine/events/UnregisterClientEvent.h
index fdbdb314..fdbdb314 100644
--- a/src/engine/UnregisterClientEvent.h
+++ b/src/engine/events/UnregisterClientEvent.h