summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/Context.hpp11
-rw-r--r--src/server/ControlBindings.cpp14
-rw-r--r--src/server/Notification.cpp86
-rw-r--r--src/server/Notification.hpp (renamed from src/server/events/SendPortValue.cpp)48
-rw-r--r--src/server/PortImpl.cpp23
-rw-r--r--src/server/PortImpl.hpp7
-rw-r--r--src/server/PostProcessor.cpp16
-rw-r--r--src/server/PostProcessor.hpp2
-rw-r--r--src/server/events/SendBinding.cpp55
-rw-r--r--src/server/events/SendBinding.hpp86
-rw-r--r--src/server/events/SendPortActivity.cpp36
-rw-r--r--src/server/events/SendPortActivity.hpp69
-rw-r--r--src/server/events/SendPortValue.hpp82
-rw-r--r--src/server/internals/Controller.cpp11
-rw-r--r--src/server/wscript4
15 files changed, 168 insertions, 382 deletions
diff --git a/src/server/Context.hpp b/src/server/Context.hpp
index d2d1b11f..f30b11d5 100644
--- a/src/server/Context.hpp
+++ b/src/server/Context.hpp
@@ -18,6 +18,8 @@
#ifndef INGEN_ENGINE_CONTEXT_HPP
#define INGEN_ENGINE_CONTEXT_HPP
+#include "raul/RingBuffer.hpp"
+
#include "shared/World.hpp"
#include "Engine.hpp"
@@ -52,7 +54,7 @@ public:
Context(Engine& engine, ID id)
: _engine(engine)
, _id(id)
- , _event_sink(engine, engine.event_queue_size())
+ , _event_sink(engine.event_queue_size())
, _start(0)
, _end(0)
, _nframes(0)
@@ -85,14 +87,15 @@ public:
inline SampleCount offset() const { return _offset; }
inline bool realtime() const { return _realtime; }
- inline const EventSink& event_sink() const { return _event_sink; }
- inline EventSink& event_sink() { return _event_sink; }
+ inline const Raul::RingBuffer & event_sink() const { return _event_sink; }
+ inline Raul::RingBuffer& event_sink() { return _event_sink; }
protected:
Engine& _engine; ///< Engine we're running in
ID _id; ///< Fast ID for this context
- EventSink _event_sink; ///< Sink for events generated in a realtime context
+ Raul::RingBuffer _event_sink; ///< Port updates from process context
+
FrameTime _start; ///< Start frame of this cycle, timeline relative
FrameTime _end; ///< End frame of this cycle, timeline relative
SampleCount _nframes; ///< Length of this cycle in frames
diff --git a/src/server/ControlBindings.cpp b/src/server/ControlBindings.cpp
index 6c2cf09c..44a22f98 100644
--- a/src/server/ControlBindings.cpp
+++ b/src/server/ControlBindings.cpp
@@ -20,12 +20,12 @@
#include "raul/midi_events.h"
#include "shared/LV2URIMap.hpp"
#include "shared/World.hpp"
-#include "events/SendPortValue.hpp"
-#include "events/SendBinding.hpp"
+
#include "AudioBuffer.hpp"
#include "ControlBindings.hpp"
#include "Engine.hpp"
#include "EventBuffer.hpp"
+#include "Notification.hpp"
#include "PortImpl.hpp"
#include "ProcessContext.hpp"
#include "ThreadManager.hpp"
@@ -247,8 +247,9 @@ ControlBindings::set_port_value(ProcessContext& context, PortImpl* port, Type ty
reinterpret_cast<AudioBuffer*>(port->buffer(v).get())->set_value(
port_value.get_float(), context.start(), context.start());
- const Events::SendPortValue ev(context.engine(), context.start(), port, true, 0, port_value);
- context.event_sink().write(sizeof(ev), &ev);
+ const Notification note(Notification::PORT_VALUE,
+ context.start(), port, port_value);
+ context.event_sink().write(sizeof(note), &note);
}
bool
@@ -264,8 +265,9 @@ ControlBindings::bind(ProcessContext& context, Key key)
_bindings->insert(make_pair(key, _learn_port));
- const Events::SendBinding ev(context.engine(), context.start(), _learn_port, key.type, key.num);
- context.event_sink().write(sizeof(ev), &ev);
+ // FIXME
+ //const Events::SendBinding ev(context.engine(), context.start(), _learn_port, key.type, key.num);
+ //context.event_sink().write(sizeof(ev), &ev);
_learn_port = NULL;
return true;
diff --git a/src/server/Notification.cpp b/src/server/Notification.cpp
new file mode 100644
index 00000000..652662f2
--- /dev/null
+++ b/src/server/Notification.cpp
@@ -0,0 +1,86 @@
+/* This file is part of Ingen.
+ * Copyright 2011 David Robillard <http://drobilla.net>
+ *
+ * Ingen is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the License, or (at your option) any later
+ * version.
+ *
+ * Ingen is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "shared/LV2URIMap.hpp"
+
+#include "ClientBroadcaster.hpp"
+#include "Notification.hpp"
+#include "PortImpl.hpp"
+
+namespace Ingen {
+namespace Server {
+
+Notification::Notification(Type y,
+ FrameTime t,
+ PortImpl* p,
+ const Raul::Atom& v,
+ const ControlBindings::Type bt)
+ : type(y)
+ , binding_type(bt)
+ , time(t)
+ , port(p)
+ , value(v)
+{}
+
+void
+Notification::post_process(Engine& engine)
+{
+ switch (type) {
+ case PORT_VALUE:
+ engine.broadcaster()->set_property(
+ port->path(),
+ engine.world()->uris()->ingen_value, value);
+ break;
+ case PORT_ACTIVITY:
+ engine.broadcaster()->activity(port->path());
+ break;
+ case PORT_BINDING: {
+ const Ingen::Shared::LV2URIMap& uris = *engine.world()->uris().get();
+ Raul::Atom::DictValue dict;
+ switch (binding_type) {
+ case ControlBindings::MIDI_CC:
+ dict[uris.rdf_type] = uris.midi_Controller;
+ dict[uris.midi_controllerNumber] = value.get_int32();
+ break;
+ case ControlBindings::MIDI_BENDER:
+ dict[uris.rdf_type] = uris.midi_Bender;
+ break;
+ case ControlBindings::MIDI_CHANNEL_PRESSURE:
+ dict[uris.rdf_type] = uris.midi_ChannelPressure;
+ break;
+ case ControlBindings::MIDI_NOTE:
+ dict[uris.rdf_type] = uris.midi_Note;
+ dict[uris.midi_noteNumber] = value.get_int32();
+ break;
+ case ControlBindings::MIDI_RPN: // TODO
+ case ControlBindings::MIDI_NRPN: // TODO
+ case ControlBindings::NULL_CONTROL:
+ break;
+ }
+ port->set_property(uris.ingen_controlBinding, dict); // FIXME: thread unsafe
+ engine.broadcaster()->set_property(port->path(),
+ uris.ingen_controlBinding,
+ dict);
+ break;
+ }
+ case NIL:
+ break;
+ }
+}
+
+} // namespace Server
+} // namespace Ingen
diff --git a/src/server/events/SendPortValue.cpp b/src/server/Notification.hpp
index 1364b692..f6824318 100644
--- a/src/server/events/SendPortValue.cpp
+++ b/src/server/Notification.hpp
@@ -15,28 +15,46 @@
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <sstream>
-#include "events/SendPortValue.hpp"
-#include "shared/LV2URIMap.hpp"
-#include "Engine.hpp"
-#include "PortImpl.hpp"
-#include "ClientBroadcaster.hpp"
+#ifndef INGEN_ENGINE_NOTIFICATION_HPP
+#define INGEN_ENGINE_NOTIFICATION_HPP
-using namespace std;
+#include "raul/Atom.hpp"
+
+#include "ControlBindings.hpp"
+#include "types.hpp"
namespace Ingen {
namespace Server {
-namespace Events {
-void
-SendPortValue::post_process()
+class Engine;
+class PortImpl;
+
+struct Notification
{
- _engine.broadcaster()->set_property(
- _port->path(),
- _engine.world()->uris()->ingen_value, _value);
-}
+ enum Type {
+ NIL,
+ PORT_VALUE,
+ PORT_ACTIVITY,
+ PORT_BINDING
+ };
+
+ Notification(
+ Type type = NIL,
+ FrameTime time = 0,
+ PortImpl* port = 0,
+ const Raul::Atom& value = Raul::Atom(),
+ const ControlBindings::Type btype = ControlBindings::NULL_CONTROL);
+
+ void post_process(Engine& engine);
+
+ Type type;
+ const ControlBindings::Type binding_type;
+ FrameTime time;
+ PortImpl* port;
+ const Raul::Atom value;
+};
} // namespace Server
} // namespace Ingen
-} // namespace Events
+#endif // INGEN_ENGINE_NOTIFICATION_HPP
diff --git a/src/server/PortImpl.cpp b/src/server/PortImpl.cpp
index a448916e..d7b7e569 100644
--- a/src/server/PortImpl.cpp
+++ b/src/server/PortImpl.cpp
@@ -15,19 +15,22 @@
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "lv2/lv2plug.in/ns/ext/contexts/contexts.h"
+
#include "raul/Array.hpp"
#include "raul/Maid.hpp"
+
#include "shared/LV2URIMap.hpp"
-#include "lv2/lv2plug.in/ns/ext/contexts/contexts.h"
+
#include "ingen/PortType.hpp"
-#include "events/SendPortValue.hpp"
-#include "events/SendPortActivity.hpp"
+
#include "AudioBuffer.hpp"
#include "BufferFactory.hpp"
#include "Engine.hpp"
#include "EventBuffer.hpp"
#include "LV2Atom.hpp"
#include "NodeImpl.hpp"
+#include "Notification.hpp"
#include "ObjectBuffer.hpp"
#include "PortImpl.hpp"
#include "ThreadManager.hpp"
@@ -208,20 +211,24 @@ PortImpl::broadcast_value(Context& context, bool force)
break;
case PortType::EVENTS:
if (((EventBuffer*)buffer(0).get())->event_count() > 0) {
- const Events::SendPortActivity ev(context.engine(), context.start(), this);
- context.event_sink().write(sizeof(ev), &ev);
+ const Notification note(Notification::PORT_ACTIVITY,
+ context.start(), this, Atom(true));
+ context.event_sink().write(sizeof(note), &note);
}
break;
case PortType::VALUE:
case PortType::MESSAGE:
- Ingen::Shared::LV2Atom::to_atom(_bufs.uris(), ((ObjectBuffer*)buffer(0).get())->atom(), val);
+ Ingen::Shared::LV2Atom::to_atom(_bufs.uris(),
+ ((ObjectBuffer*)buffer(0).get())->atom(),
+ val);
break;
}
if (val.is_valid() && (force || val != _last_broadcasted_value)) {
_last_broadcasted_value = val;
- const Events::SendPortValue ev(context.engine(), context.start(), this, true, 0, val);
- context.event_sink().write(sizeof(ev), &ev);
+ const Notification note(Notification::PORT_VALUE,
+ context.start(), this, val);
+ context.event_sink().write(sizeof(note), &note);
}
}
diff --git a/src/server/PortImpl.hpp b/src/server/PortImpl.hpp
index b3621f13..4bd52d88 100644
--- a/src/server/PortImpl.hpp
+++ b/src/server/PortImpl.hpp
@@ -21,14 +21,17 @@
#include <cstdlib>
#include <string>
#include <set>
+
#include "raul/Array.hpp"
#include "raul/Atom.hpp"
+
#include "ingen/Port.hpp"
-#include "types.hpp"
-#include "GraphObjectImpl.hpp"
#include "ingen/PortType.hpp"
+
#include "Buffer.hpp"
#include "Context.hpp"
+#include "GraphObjectImpl.hpp"
+#include "types.hpp"
namespace Raul { class Maid; }
diff --git a/src/server/PostProcessor.cpp b/src/server/PostProcessor.cpp
index 3364322a..7c756812 100644
--- a/src/server/PostProcessor.cpp
+++ b/src/server/PostProcessor.cpp
@@ -21,10 +21,10 @@
#include "Driver.hpp"
#include "Engine.hpp"
+#include "Notification.hpp"
#include "PostProcessor.hpp"
#include "ProcessContext.hpp"
#include "QueuedEvent.hpp"
-#include "events/SendPortValue.hpp"
using namespace std;
using namespace Raul;
@@ -35,14 +35,11 @@ namespace Server {
PostProcessor::PostProcessor(Engine& engine)
: _engine(engine)
, _max_time(0)
- , _event_buffer_size(sizeof(Events::SendPortValue)) // FIXME: make generic
- , _event_buffer((uint8_t*)malloc(_event_buffer_size))
{
}
PostProcessor::~PostProcessor()
{
- free(_event_buffer);
}
void
@@ -76,13 +73,14 @@ PostProcessor::process()
/* Process audio thread generated events */
while (true) {
Driver* driver = _engine.driver();
- if (driver && driver->context().event_sink().read(_event_buffer_size, _event_buffer)) {
- if (((Event*)_event_buffer)->time() > end_time) {
- warn << "Lost event with time "
- << ((Event*)_event_buffer)->time() << " > " << end_time << endl;
+ Notification note;
+ if (driver && driver->context().event_sink().peek(sizeof(note), &note)) {
+ if (note.time > end_time) {
break;
}
- ((Event*)_event_buffer)->post_process();
+
+ note.post_process(_engine);
+ driver->context().event_sink().skip(sizeof(note));
} else {
break;
}
diff --git a/src/server/PostProcessor.hpp b/src/server/PostProcessor.hpp
index 9cf8ea06..9b2ca037 100644
--- a/src/server/PostProcessor.hpp
+++ b/src/server/PostProcessor.hpp
@@ -62,8 +62,6 @@ private:
Raul::AtomicPtr<QueuedEvent> _head;
Raul::AtomicPtr<QueuedEvent> _tail;
Raul::AtomicInt _max_time;
- uint32_t _event_buffer_size;
- uint8_t* _event_buffer;
};
} // namespace Server
diff --git a/src/server/events/SendBinding.cpp b/src/server/events/SendBinding.cpp
deleted file mode 100644
index ebfa21dd..00000000
--- a/src/server/events/SendBinding.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-/* This file is part of Ingen.
- * Copyright 2007-2011 David Robillard <http://drobilla.net>
- *
- * Ingen is free software; you can redistribute it and/or modify it under the
- * terms of the GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the License, or (at your option) any later
- * version.
- *
- * Ingen is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <sstream>
-#include "events/SendBinding.hpp"
-#include "shared/LV2URIMap.hpp"
-#include "Engine.hpp"
-#include "PortImpl.hpp"
-#include "ClientBroadcaster.hpp"
-
-using namespace std;
-
-namespace Ingen {
-namespace Server {
-namespace Events {
-
-void
-SendBinding::post_process()
-{
- const Ingen::Shared::LV2URIMap& uris = *_engine.world()->uris().get();
- Raul::Atom::DictValue dict;
- if (_type == ControlBindings::MIDI_CC) {
- dict[uris.rdf_type] = uris.midi_Controller;
- dict[uris.midi_controllerNumber] = _num;
- } else if (_type == ControlBindings::MIDI_BENDER) {
- dict[uris.rdf_type] = uris.midi_Bender;
- } else if (_type == ControlBindings::MIDI_CHANNEL_PRESSURE) {
- dict[uris.rdf_type] = uris.midi_ChannelPressure;
- } else if (_type == ControlBindings::MIDI_NOTE) {
- dict[uris.rdf_type] = uris.midi_Note;
- dict[uris.midi_noteNumber] = _num;
- }
- // TODO: other event types
- _port->set_property(uris.ingen_controlBinding, dict); // FIXME: thread unsafe
- _engine.broadcaster()->set_property(_port->path(), uris.ingen_controlBinding, dict);
-}
-
-} // namespace Server
-} // namespace Ingen
-} // namespace Events
-
diff --git a/src/server/events/SendBinding.hpp b/src/server/events/SendBinding.hpp
deleted file mode 100644
index f3727ece..00000000
--- a/src/server/events/SendBinding.hpp
+++ /dev/null
@@ -1,86 +0,0 @@
-/* This file is part of Ingen.
- * Copyright 2007-2011 David Robillard <http://drobilla.net>
- *
- * Ingen is free software; you can redistribute it and/or modify it under the
- * terms of the GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the License, or (at your option) any later
- * version.
- *
- * Ingen is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef INGEN_EVENTS_SENDBINDING_HPP
-#define INGEN_EVENTS_SENDBINDING_HPP
-
-#include "server/Event.hpp"
-#include "server/ControlBindings.hpp"
-#include "server/types.hpp"
-
-namespace Ingen {
-namespace Server {
-
-class PortImpl;
-
-namespace Events {
-
-/** A special event used internally to send control bindings from the audio thread.
- *
- * See SendPortValue documentation for details.
- *
- * \ingroup engine
- */
-class SendBinding : public Event
-{
-public:
- inline SendBinding(
- Engine& engine,
- SampleCount timestamp,
- PortImpl* port,
- ControlBindings::Type type,
- int16_t num)
- : Event(engine, SharedPtr<Request>(), timestamp)
- , _port(port)
- , _type(type)
- , _num(num)
- {
- assert(_port);
- switch (type) {
- case ControlBindings::MIDI_CC:
- assert(num >= 0 && num < 128);
- break;
- case ControlBindings::MIDI_RPN:
- assert(num >= 0 && num < 16384);
- break;
- case ControlBindings::MIDI_NRPN:
- assert(num >= 0 && num < 16384);
- default:
- break;
- }
- }
-
- inline SendBinding& operator=(const SendBinding& ev) {
- _port = ev._port;
- _type = ev._type;
- _num = ev._num;
- return *this;
- }
-
- void post_process();
-
-private:
- PortImpl* _port;
- ControlBindings::Type _type;
- int16_t _num;
-};
-
-} // namespace Server
-} // namespace Ingen
-} // namespace Events
-
-#endif // INGEN_EVENTS_SENDBINDING_HPP
diff --git a/src/server/events/SendPortActivity.cpp b/src/server/events/SendPortActivity.cpp
deleted file mode 100644
index 8ff960e2..00000000
--- a/src/server/events/SendPortActivity.cpp
+++ /dev/null
@@ -1,36 +0,0 @@
-/* This file is part of Ingen.
- * Copyright 2007-2011 David Robillard <http://drobilla.net>
- *
- * Ingen is free software; you can redistribute it and/or modify it under the
- * terms of the GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the License, or (at your option) any later
- * version.
- *
- * Ingen is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "events/SendPortActivity.hpp"
-#include "Engine.hpp"
-#include "PortImpl.hpp"
-#include "ClientBroadcaster.hpp"
-
-namespace Ingen {
-namespace Server {
-namespace Events {
-
-void
-SendPortActivity::post_process()
-{
- _engine.broadcaster()->activity(_port->path());
-}
-
-} // namespace Server
-} // namespace Ingen
-} // namespace Events
-
diff --git a/src/server/events/SendPortActivity.hpp b/src/server/events/SendPortActivity.hpp
deleted file mode 100644
index dd74a68a..00000000
--- a/src/server/events/SendPortActivity.hpp
+++ /dev/null
@@ -1,69 +0,0 @@
-/* This file is part of Ingen.
- * Copyright 2007-2011 David Robillard <http://drobilla.net>
- *
- * Ingen is free software; you can redistribute it and/or modify it under the
- * terms of the GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the License, or (at your option) any later
- * version.
- *
- * Ingen is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef INGEN_EVENTS_SENDPORTACTIVITY_HPP
-#define INGEN_EVENTS_SENDPORTACTIVITY_HPP
-
-#include "Event.hpp"
-#include "types.hpp"
-
-namespace Ingen {
-namespace Server {
-
-class PortImpl;
-
-namespace Events {
-
-/** A special event used internally to send port activity notification (e.g.
- * MIDI event activity) from the audio thread.
- *
- * This is created in the audio thread (directly in a ringbuffer, not new'd)
- * for processing in the post processing thread (unlike normal events which
- * are created in the pre-processor thread then run through the audio
- * thread). This event's job is done entirely in post_process.
- *
- * This only really makes sense for message ports.
- *
- * \ingroup engine
- */
-class SendPortActivity : public Event
-{
-public:
- inline SendPortActivity(Engine& engine,
- SampleCount timestamp,
- PortImpl* port)
- : Event(engine, SharedPtr<Request>(), timestamp)
- , _port(port)
- {
- }
-
- inline SendPortActivity& operator=(const SendPortActivity& ev) {
- _port = ev._port;
- return *this;
- }
-
- void post_process();
-
-private:
- PortImpl* _port;
-};
-
-} // namespace Server
-} // namespace Ingen
-} // namespace Events
-
-#endif // INGEN_EVENTS_SENDPORTACTIVITY_HPP
diff --git a/src/server/events/SendPortValue.hpp b/src/server/events/SendPortValue.hpp
deleted file mode 100644
index 4465ef00..00000000
--- a/src/server/events/SendPortValue.hpp
+++ /dev/null
@@ -1,82 +0,0 @@
-/* This file is part of Ingen.
- * Copyright 2007-2011 David Robillard <http://drobilla.net>
- *
- * Ingen is free software; you can redistribute it and/or modify it under the
- * terms of the GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the License, or (at your option) any later
- * version.
- *
- * Ingen is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef INGEN_EVENTS_SENDPORTVALUE_HPP
-#define INGEN_EVENTS_SENDPORTVALUE_HPP
-
-#include "raul/Atom.hpp"
-#include "server/Event.hpp"
-#include "server/types.hpp"
-
-namespace Ingen {
-namespace Server {
-
-class PortImpl;
-
-namespace Events {
-
-/** A special event used internally to send port values from the audio thread.
- *
- * This is created in the audio thread (using in-place new on a preallocated
- * buffer) for processing in the post processing thread (unlike normal events
- * which are created in the pre-processor thread then run through the audio
- * thread). This event's job is done entirely in post_process.
- *
- * This only works for control ports right now.
- *
- * \ingroup engine
- */
-class SendPortValue : public Event
-{
-public:
- inline SendPortValue(
- Engine& engine,
- SampleCount timestamp,
- PortImpl* port,
- bool omni,
- uint32_t voice_num,
- const Raul::Atom& value)
- : Event(engine, SharedPtr<Request>(), timestamp)
- , _port(port)
- , _omni(omni)
- , _voice_num(voice_num)
- , _value(value)
- {
- }
-
- inline SendPortValue& operator=(const SendPortValue& ev) {
- _port = ev._port;
- _omni = ev._omni;
- _voice_num = ev._voice_num;
- _value = ev._value;
- return *this;
- }
-
- void post_process();
-
-private:
- PortImpl* _port;
- bool _omni;
- uint32_t _voice_num;
- Raul::Atom _value;
-};
-
-} // namespace Server
-} // namespace Ingen
-} // namespace Events
-
-#endif // INGEN_EVENTS_SENDPORTVALUE_HPP
diff --git a/src/server/internals/Controller.cpp b/src/server/internals/Controller.cpp
index 3d477de6..bdf8e607 100644
--- a/src/server/internals/Controller.cpp
+++ b/src/server/internals/Controller.cpp
@@ -19,14 +19,15 @@
#include "raul/midi_events.h"
#include "shared/LV2URIMap.hpp"
#include "internals/Controller.hpp"
-#include "PostProcessor.hpp"
-#include "events/SendPortValue.hpp"
+
+#include "AudioBuffer.hpp"
+#include "EventBuffer.hpp"
#include "InputPort.hpp"
-#include "OutputPort.hpp"
#include "InternalPlugin.hpp"
-#include "AudioBuffer.hpp"
+#include "Notification.hpp"
+#include "OutputPort.hpp"
+#include "PostProcessor.hpp"
#include "ProcessContext.hpp"
-#include "EventBuffer.hpp"
#include "util.hpp"
using namespace std;
diff --git a/src/server/wscript b/src/server/wscript
index 79a3e6e7..287debaf 100644
--- a/src/server/wscript
+++ b/src/server/wscript
@@ -24,6 +24,7 @@ def build(bld):
MessageContext.cpp
NodeFactory.cpp
NodeImpl.cpp
+ Notification.cpp
ObjectBuffer.cpp
ObjectSender.cpp
OutputPort.cpp
@@ -46,9 +47,6 @@ def build(bld):
events/Move.cpp
events/RegisterClient.cpp
events/RequestMetadata.cpp
- events/SendBinding.cpp
- events/SendPortActivity.cpp
- events/SendPortValue.cpp
events/SetMetadata.cpp
events/SetPortValue.cpp
events/UnregisterClient.cpp