summaryrefslogtreecommitdiffstats
path: root/src/server
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-05-14 04:30:00 +0000
committerDavid Robillard <d@drobilla.net>2012-05-14 04:30:00 +0000
commitf180683d453814dcd4a00eb5f0946fd7fc5677c4 (patch)
treeddd150d207c237c72ebf424acf517ce847bf2674 /src/server
parent121b8a2c33125225e11539b83d87cb9a1d70e537 (diff)
downloadingen-f180683d453814dcd4a00eb5f0946fd7fc5677c4.tar.gz
ingen-f180683d453814dcd4a00eb5f0946fd7fc5677c4.tar.bz2
ingen-f180683d453814dcd4a00eb5f0946fd7fc5677c4.zip
Remove Thread context stuff and add a thread-specific variable class, ThreadVar, which can be used for this and many other things.
ClientBroadcaster => Broadcaster. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4405 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server')
-rw-r--r--src/server/Broadcaster.cpp (renamed from src/server/ClientBroadcaster.cpp)20
-rw-r--r--src/server/Broadcaster.hpp (renamed from src/server/ClientBroadcaster.hpp)2
-rw-r--r--src/server/Engine.cpp8
-rw-r--r--src/server/Engine.hpp38
-rw-r--r--src/server/EventWriter.cpp2
-rw-r--r--src/server/JackDriver.cpp3
-rw-r--r--src/server/MessageContext.cpp4
-rw-r--r--src/server/NodeImpl.cpp1
-rw-r--r--src/server/NodeImpl.hpp8
-rw-r--r--src/server/Notification.cpp2
-rw-r--r--src/server/ObjectSender.cpp2
-rw-r--r--src/server/PatchImpl.cpp10
-rw-r--r--src/server/PatchImpl.hpp2
-rw-r--r--src/server/PreProcessor.cpp3
-rw-r--r--src/server/ProcessSlave.cpp2
-rw-r--r--src/server/ProcessSlave.hpp2
-rw-r--r--src/server/ThreadManager.hpp33
-rw-r--r--src/server/events/Connect.cpp2
-rw-r--r--src/server/events/CreateNode.cpp2
-rw-r--r--src/server/events/CreatePatch.cpp10
-rw-r--r--src/server/events/CreatePort.cpp4
-rw-r--r--src/server/events/Delete.cpp6
-rw-r--r--src/server/events/Disconnect.cpp2
-rw-r--r--src/server/events/DisconnectAll.cpp2
-rw-r--r--src/server/events/Get.cpp2
-rw-r--r--src/server/events/Move.cpp2
-rw-r--r--src/server/events/SetMetadata.cpp2
-rw-r--r--src/server/events/SetPortValue.cpp2
-rw-r--r--src/server/ingen_lv2.cpp6
-rw-r--r--src/server/wscript2
30 files changed, 98 insertions, 88 deletions
diff --git a/src/server/ClientBroadcaster.cpp b/src/server/Broadcaster.cpp
index 6c81e5de..0b4e95d5 100644
--- a/src/server/ClientBroadcaster.cpp
+++ b/src/server/Broadcaster.cpp
@@ -20,14 +20,14 @@
#include "ingen/Interface.hpp"
#include "raul/log.hpp"
-#include "ClientBroadcaster.hpp"
+#include "Broadcaster.hpp"
#include "EdgeImpl.hpp"
#include "EngineStore.hpp"
#include "ObjectSender.hpp"
#include "PluginImpl.hpp"
#include "util.hpp"
-#define LOG(s) (s("[ClientBroadcaster] "))
+#define LOG(s) (s("[Broadcaster] "))
namespace Ingen {
namespace Server {
@@ -35,8 +35,8 @@ namespace Server {
/** Register a client to receive messages over the notification band.
*/
void
-ClientBroadcaster::register_client(const Raul::URI& uri,
- SharedPtr<Interface> client)
+Broadcaster::register_client(const Raul::URI& uri,
+ SharedPtr<Interface> client)
{
Glib::Mutex::Lock lock(_clients_mutex);
LOG(Raul::info)(Raul::fmt("Registered client <%1%>\n") % uri);
@@ -48,7 +48,7 @@ ClientBroadcaster::register_client(const Raul::URI& uri,
* @return true if client was found and removed.
*/
bool
-ClientBroadcaster::unregister_client(const Raul::URI& uri)
+Broadcaster::unregister_client(const Raul::URI& uri)
{
Glib::Mutex::Lock lock(_clients_mutex);
const size_t erased = _clients.erase(uri);
@@ -64,7 +64,7 @@ ClientBroadcaster::unregister_client(const Raul::URI& uri)
* unique identifier for registered clients).
*/
SharedPtr<Interface>
-ClientBroadcaster::client(const Raul::URI& uri)
+Broadcaster::client(const Raul::URI& uri)
{
Glib::Mutex::Lock lock(_clients_mutex);
Clients::iterator i = _clients.find(uri);
@@ -76,7 +76,7 @@ ClientBroadcaster::client(const Raul::URI& uri)
}
void
-ClientBroadcaster::send_plugins(const NodeFactory::Plugins& plugins)
+Broadcaster::send_plugins(const NodeFactory::Plugins& plugins)
{
Glib::Mutex::Lock lock(_clients_mutex);
for (Clients::const_iterator c = _clients.begin(); c != _clients.end(); ++c) {
@@ -85,8 +85,8 @@ ClientBroadcaster::send_plugins(const NodeFactory::Plugins& plugins)
}
void
-ClientBroadcaster::send_plugins_to(Interface* client,
- const NodeFactory::Plugins& plugins)
+Broadcaster::send_plugins_to(Interface* client,
+ const NodeFactory::Plugins& plugins)
{
client->bundle_begin();
@@ -104,7 +104,7 @@ ClientBroadcaster::send_plugins_to(Interface* client,
* @param recursive If true send all children of object
*/
void
-ClientBroadcaster::send_object(const GraphObjectImpl* o, bool recursive)
+Broadcaster::send_object(const GraphObjectImpl* o, bool recursive)
{
Glib::Mutex::Lock lock(_clients_mutex);
for (Clients::const_iterator i = _clients.begin(); i != _clients.end(); ++i) {
diff --git a/src/server/ClientBroadcaster.hpp b/src/server/Broadcaster.hpp
index 88c471c6..6942a578 100644
--- a/src/server/ClientBroadcaster.hpp
+++ b/src/server/Broadcaster.hpp
@@ -41,7 +41,7 @@ class GraphObjectImpl;
*
* \ingroup engine
*/
-class ClientBroadcaster : public Interface
+class Broadcaster : public Interface
{
public:
void register_client(const Raul::URI& uri, SharedPtr<Interface> client);
diff --git a/src/server/Engine.cpp b/src/server/Engine.cpp
index a146743d..69ad435b 100644
--- a/src/server/Engine.cpp
+++ b/src/server/Engine.cpp
@@ -29,8 +29,8 @@
#include "raul/SharedPtr.hpp"
#include "raul/log.hpp"
+#include "Broadcaster.hpp"
#include "BufferFactory.hpp"
-#include "ClientBroadcaster.hpp"
#include "ControlBindings.hpp"
#include "Driver.hpp"
#include "Engine.hpp"
@@ -50,11 +50,12 @@ using namespace std;
namespace Ingen {
namespace Server {
-bool ThreadManager::single_threaded = true;
+Raul::ThreadVar<unsigned> ThreadManager::flags(0);
+bool ThreadManager::single_threaded(true);
Engine::Engine(Ingen::Shared::World* a_world)
: _world(a_world)
- , _broadcaster(new ClientBroadcaster())
+ , _broadcaster(new Broadcaster())
, _control_bindings(NULL)
, _maid(new Raul::Maid(event_queue_size()))
, _node_factory(new NodeFactory(a_world))
@@ -270,7 +271,6 @@ Engine::pending_events()
void
Engine::enqueue_event(Event* ev)
{
- ThreadManager::assert_not_thread(THREAD_PROCESS);
_pre_processor->event(ev);
}
diff --git a/src/server/Engine.hpp b/src/server/Engine.hpp
index cf16a4b1..8fcb5ce6 100644
--- a/src/server/Engine.hpp
+++ b/src/server/Engine.hpp
@@ -34,8 +34,8 @@ namespace Shared { class World; }
namespace Server {
+class Broadcaster;
class BufferFactory;
-class ClientBroadcaster;
class ControlBindings;
class Driver;
class EngineStore;
@@ -91,15 +91,15 @@ public:
Ingen::Shared::World* world() const { return _world; }
- EventWriter* interface() const { return _event_writer; }
- ClientBroadcaster* broadcaster() const { return _broadcaster; }
- BufferFactory* buffer_factory() const { return _buffer_factory; }
- ControlBindings* control_bindings() const { return _control_bindings; }
- Driver* driver() const { return _driver.get(); }
- Raul::Maid* maid() const { return _maid; }
- NodeFactory* node_factory() const { return _node_factory; }
- PostProcessor* post_processor() const { return _post_processor; }
- PatchImpl* root_patch() const { return _root_patch; }
+ EventWriter* interface() const { return _event_writer; }
+ Broadcaster* broadcaster() const { return _broadcaster; }
+ BufferFactory* buffer_factory() const { return _buffer_factory; }
+ ControlBindings* control_bindings() const { return _control_bindings; }
+ Driver* driver() const { return _driver.get(); }
+ Raul::Maid* maid() const { return _maid; }
+ NodeFactory* node_factory() const { return _node_factory; }
+ PostProcessor* post_processor() const { return _post_processor; }
+ PatchImpl* root_patch() const { return _root_patch; }
MessageContext& message_context() { return _message_context; }
ProcessContext& process_context() { return _process_context; }
@@ -111,15 +111,15 @@ public:
private:
Ingen::Shared::World* _world;
- ClientBroadcaster* _broadcaster;
- BufferFactory* _buffer_factory;
- ControlBindings* _control_bindings;
- SharedPtr<Driver> _driver;
- Raul::Maid* _maid;
- NodeFactory* _node_factory;
- PreProcessor* _pre_processor;
- PostProcessor* _post_processor;
- EventWriter* _event_writer;
+ Broadcaster* _broadcaster;
+ BufferFactory* _buffer_factory;
+ ControlBindings* _control_bindings;
+ SharedPtr<Driver> _driver;
+ Raul::Maid* _maid;
+ NodeFactory* _node_factory;
+ PreProcessor* _pre_processor;
+ PostProcessor* _post_processor;
+ EventWriter* _event_writer;
PatchImpl* _root_patch;
diff --git a/src/server/EventWriter.cpp b/src/server/EventWriter.cpp
index c839d65e..6fb682c2 100644
--- a/src/server/EventWriter.cpp
+++ b/src/server/EventWriter.cpp
@@ -20,7 +20,7 @@
#include "ingen/shared/URIs.hpp"
-#include "ClientBroadcaster.hpp"
+#include "Broadcaster.hpp"
#include "Driver.hpp"
#include "Engine.hpp"
#include "EventWriter.hpp"
diff --git a/src/server/JackDriver.cpp b/src/server/JackDriver.cpp
index c5c9abe9..0df49973 100644
--- a/src/server/JackDriver.cpp
+++ b/src/server/JackDriver.cpp
@@ -432,7 +432,8 @@ JackDriver::_thread_init_cb()
{
Raul::Thread* thread = &Raul::Thread::get();
thread->set_name("Jack");
- thread->set_context(THREAD_PROCESS);
+ ThreadManager::set_flag(THREAD_PROCESS);
+ ThreadManager::set_flag(THREAD_IS_REAL_TIME);
_jack_threads.push_back(SharedPtr<Raul::Thread>(thread));
}
diff --git a/src/server/MessageContext.cpp b/src/server/MessageContext.cpp
index f6e16ebf..d67437ca 100644
--- a/src/server/MessageContext.cpp
+++ b/src/server/MessageContext.cpp
@@ -38,7 +38,6 @@ MessageContext::MessageContext(Engine& engine)
, _requests(engine.event_queue_size())
, _end_time(0)
{
- Thread::set_context(THREAD_MESSAGE);
}
void
@@ -60,8 +59,9 @@ MessageContext::run(Context& context, NodeImpl* node, FrameTime time)
void
MessageContext::_run()
{
- Request req;
+ ThreadManager::set_flag(THREAD_MESSAGE);
+ Request req;
while (true) {
_sem.wait();
diff --git a/src/server/NodeImpl.cpp b/src/server/NodeImpl.cpp
index ab0783f4..5e6b203f 100644
--- a/src/server/NodeImpl.cpp
+++ b/src/server/NodeImpl.cpp
@@ -22,7 +22,6 @@
#include "raul/List.hpp"
#include "AudioBuffer.hpp"
-#include "ClientBroadcaster.hpp"
#include "Engine.hpp"
#include "EngineStore.hpp"
#include "NodeImpl.hpp"
diff --git a/src/server/NodeImpl.hpp b/src/server/NodeImpl.hpp
index 7da07dc2..36cc65d3 100644
--- a/src/server/NodeImpl.hpp
+++ b/src/server/NodeImpl.hpp
@@ -185,10 +185,10 @@ public:
/** The Patch this Node belongs to. */
inline PatchImpl* parent_patch() const { return (PatchImpl*)_parent; }
- Context::ID context() const { return _context; }
- SampleRate sample_rate() const { return _srate; }
- virtual uint32_t num_ports() const { return _ports ? _ports->size() : 0; }
- virtual uint32_t polyphony() const { return _polyphony; }
+ Context::ID context() const { return _context; }
+ SampleRate sample_rate() const { return _srate; }
+ uint32_t num_ports() const { return _ports ? _ports->size() : 0; }
+ virtual uint32_t polyphony() const { return _polyphony; }
/** Used by the process order finding algorithm (ie during connections) */
bool traversed() const { return _traversed; }
diff --git a/src/server/Notification.cpp b/src/server/Notification.cpp
index c95311c9..88f67137 100644
--- a/src/server/Notification.cpp
+++ b/src/server/Notification.cpp
@@ -16,7 +16,7 @@
#include "ingen/shared/URIs.hpp"
-#include "ClientBroadcaster.hpp"
+#include "Broadcaster.hpp"
#include "Engine.hpp"
#include "Notification.hpp"
#include "PortImpl.hpp"
diff --git a/src/server/ObjectSender.cpp b/src/server/ObjectSender.cpp
index 7dc8ca39..9ad206dc 100644
--- a/src/server/ObjectSender.cpp
+++ b/src/server/ObjectSender.cpp
@@ -81,7 +81,7 @@ ObjectSender::send_patch(Interface* client,
}
// Send ports
- for (uint32_t i=0; i < patch->num_ports(); ++i) {
+ for (uint32_t i=0; i < patch->num_ports_non_rt(); ++i) {
PortImpl* const port = patch->port_impl(i);
send_port(client, port, false);
}
diff --git a/src/server/PatchImpl.cpp b/src/server/PatchImpl.cpp
index 9a21ee23..9ba7b6cf 100644
--- a/src/server/PatchImpl.cpp
+++ b/src/server/PatchImpl.cpp
@@ -324,12 +324,10 @@ PatchImpl::has_edge(const PortImpl* tail, const PortImpl* dst_port) const
}
uint32_t
-PatchImpl::num_ports() const
+PatchImpl::num_ports_non_rt() const
{
- if (ThreadManager::thread_is(THREAD_PROCESS))
- return NodeImpl::num_ports();
- else
- return _inputs.size() + _outputs.size();
+ ThreadManager::assert_not_thread(THREAD_PROCESS);
+ return _inputs.size() + _outputs.size();
}
/** Create a port. Not realtime safe.
@@ -352,7 +350,7 @@ PatchImpl::create_port(BufferFactory& bufs,
if (type == PortType::CONTROL || type == PortType::CV)
value = bufs.forge().make(0.0f);
- return new DuplexPort(bufs, this, name, num_ports(), polyphonic, _polyphony,
+ return new DuplexPort(bufs, this, name, num_ports_non_rt(), polyphonic, _polyphony,
type, buffer_type, value, buffer_size, is_output);
}
diff --git a/src/server/PatchImpl.hpp b/src/server/PatchImpl.hpp
index 02df6fca..557f0343 100644
--- a/src/server/PatchImpl.hpp
+++ b/src/server/PatchImpl.hpp
@@ -106,7 +106,7 @@ public:
const Nodes& nodes() const { return _nodes; }
const Edges& edges() const { return _edges; }
- uint32_t num_ports() const;
+ uint32_t num_ports_non_rt() const;
PortImpl* create_port(BufferFactory& bufs,
const std::string& name,
diff --git a/src/server/PreProcessor.cpp b/src/server/PreProcessor.cpp
index 435ad77d..9fba676c 100644
--- a/src/server/PreProcessor.cpp
+++ b/src/server/PreProcessor.cpp
@@ -27,7 +27,6 @@ namespace Server {
PreProcessor::PreProcessor()
{
- Thread::set_context(THREAD_PRE_PROCESS);
set_name("PreProcessor");
start();
}
@@ -41,6 +40,7 @@ void
PreProcessor::event(Event* const ev)
{
// TODO: Probably possible to make this lock-free with CAS
+ ThreadManager::assert_not_thread(THREAD_IS_REAL_TIME);
Glib::Mutex::Lock lock(_mutex);
assert(!ev->is_prepared());
@@ -108,6 +108,7 @@ PreProcessor::process(ProcessContext& context, PostProcessor& dest, bool limit)
void
PreProcessor::_whipped()
{
+ ThreadManager::set_flag(THREAD_PRE_PROCESS);
Event* ev = _prepared_back.get();
if (!ev)
return;
diff --git a/src/server/ProcessSlave.cpp b/src/server/ProcessSlave.cpp
index 57f45693..5be40bb5 100644
--- a/src/server/ProcessSlave.cpp
+++ b/src/server/ProcessSlave.cpp
@@ -28,6 +28,8 @@ uint32_t ProcessSlave::_next_id = 0;
void
ProcessSlave::_whipped()
{
+ ThreadManager::set_flag(THREAD_PROCESS);
+
assert(_compiled_patch);
CompiledPatch* const cp = _compiled_patch;
diff --git a/src/server/ProcessSlave.hpp b/src/server/ProcessSlave.hpp
index d15ff5af..0e866f71 100644
--- a/src/server/ProcessSlave.hpp
+++ b/src/server/ProcessSlave.hpp
@@ -53,8 +53,6 @@ public:
if (realtime)
set_scheduling(SCHED_FIFO, 40);
-
- set_context(THREAD_PROCESS);
}
~ProcessSlave() {
diff --git a/src/server/ThreadManager.hpp b/src/server/ThreadManager.hpp
index 23ff126a..445219ae 100644
--- a/src/server/ThreadManager.hpp
+++ b/src/server/ThreadManager.hpp
@@ -19,34 +19,45 @@
#include <cassert>
#include "raul/Thread.hpp"
+#include "raul/ThreadVar.hpp"
namespace Ingen {
namespace Server {
-enum ThreadID {
- THREAD_PRE_PROCESS,
- THREAD_PROCESS,
- THREAD_MESSAGE,
+enum ThreadFlag {
+ THREAD_IS_REAL_TIME = 1,
+ THREAD_PRE_PROCESS = 1 << 1,
+ THREAD_PROCESS = 1 << 2,
+ THREAD_MESSAGE = 1 << 3,
};
class ThreadManager {
public:
- inline static bool thread_is(ThreadID id) {
- return Raul::Thread::get().is_context(id);
+ static inline void set_flag(ThreadFlag f) {
+#ifndef NDEBUG
+ flags = ((unsigned)flags | f);
+#endif
}
- inline static void assert_thread(ThreadID id) {
- assert(single_threaded || Raul::Thread::get().is_context(id));
+ static inline void unset_flag(ThreadFlag f) {
+#ifndef NDEBUG
+ flags = ((unsigned)flags & (~f));
+#endif
}
- inline static void assert_not_thread(ThreadID id) {
- assert(single_threaded || !Raul::Thread::get().is_context(id));
+ static inline void assert_thread(ThreadFlag f) {
+ assert(single_threaded || (flags & f));
+ }
+
+ static inline void assert_not_thread(ThreadFlag f) {
+ assert(single_threaded || !(flags & f));
}
/** Set to true during initialisation so ensure_thread doesn't fail.
* Defined in Engine.cpp
*/
- static bool single_threaded;
+ static bool single_threaded;
+ static Raul::ThreadVar<unsigned> flags;
};
} // namespace Server
diff --git a/src/server/events/Connect.cpp b/src/server/events/Connect.cpp
index e2d6cae7..edea8f15 100644
--- a/src/server/events/Connect.cpp
+++ b/src/server/events/Connect.cpp
@@ -22,7 +22,7 @@
#include "raul/Maid.hpp"
#include "raul/Path.hpp"
-#include "ClientBroadcaster.hpp"
+#include "Broadcaster.hpp"
#include "Connect.hpp"
#include "EdgeImpl.hpp"
#include "DuplexPort.hpp"
diff --git a/src/server/events/CreateNode.cpp b/src/server/events/CreateNode.cpp
index a90979ff..414003d8 100644
--- a/src/server/events/CreateNode.cpp
+++ b/src/server/events/CreateNode.cpp
@@ -20,7 +20,7 @@
#include "raul/log.hpp"
#include "sord/sordmm.hpp"
-#include "ClientBroadcaster.hpp"
+#include "Broadcaster.hpp"
#include "CreateNode.hpp"
#include "Driver.hpp"
#include "Engine.hpp"
diff --git a/src/server/events/CreatePatch.cpp b/src/server/events/CreatePatch.cpp
index 22c4a817..465dbe86 100644
--- a/src/server/events/CreatePatch.cpp
+++ b/src/server/events/CreatePatch.cpp
@@ -19,13 +19,13 @@
#include "raul/Path.hpp"
#include "events/CreatePatch.hpp"
-#include "PatchImpl.hpp"
-#include "NodeImpl.hpp"
-#include "PluginImpl.hpp"
-#include "Engine.hpp"
-#include "ClientBroadcaster.hpp"
+#include "Broadcaster.hpp"
#include "Driver.hpp"
+#include "Engine.hpp"
#include "EngineStore.hpp"
+#include "NodeImpl.hpp"
+#include "PatchImpl.hpp"
+#include "PluginImpl.hpp"
namespace Ingen {
namespace Server {
diff --git a/src/server/events/CreatePort.cpp b/src/server/events/CreatePort.cpp
index 0098ae6a..1cb172d2 100644
--- a/src/server/events/CreatePort.cpp
+++ b/src/server/events/CreatePort.cpp
@@ -23,7 +23,7 @@
#include "raul/Maid.hpp"
#include "raul/Path.hpp"
-#include "ClientBroadcaster.hpp"
+#include "Broadcaster.hpp"
#include "ControlBindings.hpp"
#include "CreatePort.hpp"
#include "Driver.hpp"
@@ -152,7 +152,7 @@ CreatePort::pre_process()
dynamic_cast<DuplexPort*>(_patch_port));
}
- assert(_ports_array->size() == _patch->num_ports());
+ assert(_ports_array->size() == _patch->num_ports_non_rt());
} else {
_status = CREATION_FAILED;
diff --git a/src/server/events/Delete.cpp b/src/server/events/Delete.cpp
index 4df6efb6..95e63d4d 100644
--- a/src/server/events/Delete.cpp
+++ b/src/server/events/Delete.cpp
@@ -17,7 +17,7 @@
#include "raul/Maid.hpp"
#include "raul/Path.hpp"
-#include "ClientBroadcaster.hpp"
+#include "Broadcaster.hpp"
#include "ControlBindings.hpp"
#include "Delete.hpp"
#include "DisconnectAll.hpp"
@@ -118,8 +118,8 @@ Delete::pre_process()
if (_port->parent_patch()->enabled()) {
// FIXME: is this called multiple times?
_compiled_patch = _port->parent_patch()->compile();
- _ports_array = _port->parent_patch()->build_ports_array();
- assert(_ports_array->size() == _port->parent_patch()->num_ports());
+ _ports_array = _port->parent_patch()->build_ports_array();
+ assert(_ports_array->size() == _port->parent_patch()->num_ports_non_rt());
}
}
diff --git a/src/server/events/Disconnect.cpp b/src/server/events/Disconnect.cpp
index 035a6f87..e1a86b13 100644
--- a/src/server/events/Disconnect.cpp
+++ b/src/server/events/Disconnect.cpp
@@ -23,7 +23,7 @@
#include "raul/log.hpp"
#include "AudioBuffer.hpp"
-#include "ClientBroadcaster.hpp"
+#include "Broadcaster.hpp"
#include "EdgeImpl.hpp"
#include "DuplexPort.hpp"
#include "Engine.hpp"
diff --git a/src/server/events/DisconnectAll.cpp b/src/server/events/DisconnectAll.cpp
index 04527212..0a4c2ef1 100644
--- a/src/server/events/DisconnectAll.cpp
+++ b/src/server/events/DisconnectAll.cpp
@@ -23,7 +23,7 @@
#include "raul/Maid.hpp"
#include "raul/Path.hpp"
-#include "ClientBroadcaster.hpp"
+#include "Broadcaster.hpp"
#include "EdgeImpl.hpp"
#include "Engine.hpp"
#include "EngineStore.hpp"
diff --git a/src/server/events/Get.cpp b/src/server/events/Get.cpp
index 503726a3..7e140ae4 100644
--- a/src/server/events/Get.cpp
+++ b/src/server/events/Get.cpp
@@ -16,7 +16,7 @@
#include "ingen/Interface.hpp"
-#include "ClientBroadcaster.hpp"
+#include "Broadcaster.hpp"
#include "Driver.hpp"
#include "Engine.hpp"
#include "EngineStore.hpp"
diff --git a/src/server/events/Move.cpp b/src/server/events/Move.cpp
index ecfe9508..2451c65e 100644
--- a/src/server/events/Move.cpp
+++ b/src/server/events/Move.cpp
@@ -18,7 +18,7 @@
#include "raul/Path.hpp"
-#include "ClientBroadcaster.hpp"
+#include "Broadcaster.hpp"
#include "Driver.hpp"
#include "Engine.hpp"
#include "EnginePort.hpp"
diff --git a/src/server/events/SetMetadata.cpp b/src/server/events/SetMetadata.cpp
index 15ed26cc..fa02f220 100644
--- a/src/server/events/SetMetadata.cpp
+++ b/src/server/events/SetMetadata.cpp
@@ -25,7 +25,7 @@
#include "ingen/shared/URIMap.hpp"
#include "ingen/shared/URIs.hpp"
-#include "ClientBroadcaster.hpp"
+#include "Broadcaster.hpp"
#include "ControlBindings.hpp"
#include "CreateNode.hpp"
#include "CreatePatch.hpp"
diff --git a/src/server/events/SetPortValue.cpp b/src/server/events/SetPortValue.cpp
index 1fb02cc4..1a12dcd4 100644
--- a/src/server/events/SetPortValue.cpp
+++ b/src/server/events/SetPortValue.cpp
@@ -22,7 +22,7 @@
#include "raul/log.hpp"
#include "AudioBuffer.hpp"
-#include "ClientBroadcaster.hpp"
+#include "Broadcaster.hpp"
#include "ControlBindings.hpp"
#include "Driver.hpp"
#include "Engine.hpp"
diff --git a/src/server/ingen_lv2.cpp b/src/server/ingen_lv2.cpp
index 56e9120e..f394e566 100644
--- a/src/server/ingen_lv2.cpp
+++ b/src/server/ingen_lv2.cpp
@@ -491,7 +491,7 @@ ingen_instantiate(const LV2_Descriptor* descriptor,
plugin->world->set_interface(interface);
- Raul::Thread::get().set_context(Server::THREAD_PRE_PROCESS);
+ Server::ThreadManager::set_flag(Server::THREAD_PRE_PROCESS);
Server::ThreadManager::single_threaded = true;
// FIXME: fixed (or at least maximum) buffer size
@@ -559,8 +559,8 @@ ingen_run(LV2_Handle instance, uint32_t sample_count)
Server::Engine* engine = (Server::Engine*)me->world->engine().get();
LV2Driver* driver = (LV2Driver*)engine->driver();
- // FIXME: don't do this every call
- Raul::Thread::get().set_context(Ingen::Server::THREAD_PROCESS);
+ Server::ThreadManager::set_flag(Ingen::Server::THREAD_PROCESS);
+ Server::ThreadManager::set_flag(Ingen::Server::THREAD_IS_REAL_TIME);
driver->run(sample_count);
}
diff --git a/src/server/wscript b/src/server/wscript
index 1d3d8b56..e63b5fa7 100644
--- a/src/server/wscript
+++ b/src/server/wscript
@@ -4,9 +4,9 @@ from waflib.extras import autowaf as autowaf
def build(bld):
core_source = '''
AudioBuffer.cpp
+ Broadcaster.cpp
Buffer.cpp
BufferFactory.cpp
- ClientBroadcaster.cpp
ControlBindings.cpp
DuplexPort.cpp
EdgeImpl.cpp