summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-05-02 23:56:42 +0000
committerDavid Robillard <d@drobilla.net>2012-05-02 23:56:42 +0000
commite6fa87193fb9ed9672fb346d34bbe093ddcfe814 (patch)
treec591a04a1a69558e384f0a15da8870ac2ec05799 /src
parente7b828c884b82f58d2abb5babd55b6d322e9bac2 (diff)
downloadingen-e6fa87193fb9ed9672fb346d34bbe093ddcfe814.tar.gz
ingen-e6fa87193fb9ed9672fb346d34bbe093ddcfe814.tar.bz2
ingen-e6fa87193fb9ed9672fb346d34bbe093ddcfe814.zip
Separate EventSource interface from EventQueue implementation.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4316 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r--src/server/EventQueue.cpp (renamed from src/server/EventSource.cpp)16
-rw-r--r--src/server/EventQueue.hpp (renamed from src/server/EventSource.hpp)22
-rw-r--r--src/server/JackDriver.cpp1
-rw-r--r--src/server/ServerInterfaceImpl.cpp4
-rw-r--r--src/server/ServerInterfaceImpl.hpp8
-rw-r--r--src/server/wscript2
6 files changed, 25 insertions, 28 deletions
diff --git a/src/server/EventSource.cpp b/src/server/EventQueue.cpp
index a8eb3ec4..ffafe17a 100644
--- a/src/server/EventSource.cpp
+++ b/src/server/EventQueue.cpp
@@ -14,10 +14,10 @@
along with Ingen. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "EventSource.hpp"
+#include "Event.hpp"
+#include "EventQueue.hpp"
#include "PostProcessor.hpp"
#include "ProcessContext.hpp"
-#include "Event.hpp"
#include "ThreadManager.hpp"
using namespace std;
@@ -25,13 +25,13 @@ using namespace std;
namespace Ingen {
namespace Server {
-EventSource::EventSource()
+EventQueue::EventQueue()
{
Thread::set_context(THREAD_PRE_PROCESS);
- set_name("EventSource");
+ set_name("EventQueue");
}
-EventSource::~EventSource()
+EventQueue::~EventQueue()
{
Thread::stop();
}
@@ -39,7 +39,7 @@ EventSource::~EventSource()
/** Push an unprepared event onto the queue.
*/
void
-EventSource::push_queued(Event* const ev)
+EventQueue::push_queued(Event* const ev)
{
assert(!ev->is_prepared());
assert(!ev->next());
@@ -67,7 +67,7 @@ EventSource::push_queued(Event* const ev)
* Executed events will be pushed to @a dest.
*/
void
-EventSource::process(PostProcessor& dest, ProcessContext& context, bool limit)
+EventQueue::process(PostProcessor& dest, ProcessContext& context, bool limit)
{
ThreadManager::assert_thread(THREAD_PROCESS);
@@ -108,7 +108,7 @@ EventSource::process(PostProcessor& dest, ProcessContext& context, bool limit)
/** Pre-process a single event */
void
-EventSource::_whipped()
+EventQueue::_whipped()
{
Event* ev = _prepared_back.get();
if (!ev)
diff --git a/src/server/EventSource.hpp b/src/server/EventQueue.hpp
index e8619786..e1adbd6b 100644
--- a/src/server/EventSource.hpp
+++ b/src/server/EventQueue.hpp
@@ -14,31 +14,29 @@
along with Ingen. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef INGEN_ENGINE_EVENTSOURCE_HPP
-#define INGEN_ENGINE_EVENTSOURCE_HPP
+#ifndef INGEN_ENGINE_EVENTQUEUE_HPP
+#define INGEN_ENGINE_EVENTQUEUE_HPP
#include "raul/AtomicPtr.hpp"
#include "raul/Slave.hpp"
+#include "EventSource.hpp"
+
namespace Ingen {
namespace Server {
class Event;
-class Event;
class PostProcessor;
class ProcessContext;
-/** Source for events to run in the audio thread.
- *
- * The Driver gets events from an EventSource in the process callback
- * (realtime audio thread) and executes them, then they are sent to the
- * PostProcessor and finalised (post-processing thread).
+/** An EventSource which prepares events in its own thread.
*/
-class EventSource : public Raul::Slave
+class EventQueue : public EventSource
+ , public Raul::Slave
{
public:
- explicit EventSource();
- virtual ~EventSource();
+ explicit EventQueue();
+ virtual ~EventQueue();
void process(PostProcessor& dest, ProcessContext& context, bool limit=true);
@@ -59,5 +57,5 @@ private:
} // namespace Server
} // namespace Ingen
-#endif // INGEN_ENGINE_EVENTSOURCE_HPP
+#endif // INGEN_ENGINE_EVENTQUEUE_HPP
diff --git a/src/server/JackDriver.cpp b/src/server/JackDriver.cpp
index 68a2d683..cccaadf1 100644
--- a/src/server/JackDriver.cpp
+++ b/src/server/JackDriver.cpp
@@ -36,7 +36,6 @@
#include "Engine.hpp"
#include "Event.hpp"
#include "Event.hpp"
-#include "EventSource.hpp"
#include "JackDriver.hpp"
#include "MessageContext.hpp"
#include "PatchImpl.hpp"
diff --git a/src/server/ServerInterfaceImpl.cpp b/src/server/ServerInterfaceImpl.cpp
index 4c7ed140..492139ed 100644
--- a/src/server/ServerInterfaceImpl.cpp
+++ b/src/server/ServerInterfaceImpl.cpp
@@ -23,7 +23,7 @@
#include "ClientBroadcaster.hpp"
#include "Driver.hpp"
#include "Engine.hpp"
-#include "EventSource.hpp"
+#include "EventQueue.hpp"
#include "ServerInterfaceImpl.hpp"
#include "events.hpp"
@@ -36,7 +36,7 @@ namespace Ingen {
namespace Server {
ServerInterfaceImpl::ServerInterfaceImpl(Engine& engine)
- : EventSource()
+ : EventQueue()
, _request_client(NULL)
, _request_id(-1)
, _engine(engine)
diff --git a/src/server/ServerInterfaceImpl.hpp b/src/server/ServerInterfaceImpl.hpp
index 56aea0a3..f34afaae 100644
--- a/src/server/ServerInterfaceImpl.hpp
+++ b/src/server/ServerInterfaceImpl.hpp
@@ -23,7 +23,7 @@
#include "raul/SharedPtr.hpp"
#include "ingen/Interface.hpp"
#include "ingen/Resource.hpp"
-#include "EventSource.hpp"
+#include "EventQueue.hpp"
#include "types.hpp"
namespace Ingen {
@@ -33,15 +33,15 @@ class Engine;
/** A queued (preprocessed) event source / interface.
*
- * This is the bridge between the Interface presented to the client, and
- * the EventSource that needs to be presented to the Driver.
+ * This is both an Interface and an EventSource, calling Interface methods
+ * will result in events in the EventSource.
*
* Responses occur through the event mechanism (which notified clients in
* event post_process methods) and are related to an event by an integer ID.
* If you do not register a request, you have no way of knowing if your calls
* are successful.
*/
-class ServerInterfaceImpl : public EventSource,
+class ServerInterfaceImpl : public EventQueue,
public Interface
{
public:
diff --git a/src/server/wscript b/src/server/wscript
index a5ecbc0f..faaeb38a 100644
--- a/src/server/wscript
+++ b/src/server/wscript
@@ -13,7 +13,7 @@ def build(bld):
Engine.cpp
EngineStore.cpp
Event.cpp
- EventSource.cpp
+ EventQueue.cpp
GraphObjectImpl.cpp
InputPort.cpp
InternalPlugin.cpp