summaryrefslogtreecommitdiffstats
path: root/src/JackDriver.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-11-28 22:23:54 +0100
committerDavid Robillard <d@drobilla.net>2020-11-28 22:49:10 +0100
commit924775a79c07a4f5798fcefddb523b189e473080 (patch)
tree6a201df93b109d10cb5c5cab018ee89448c00e00 /src/JackDriver.hpp
parent5128bfab7ddb9504abf17375e910e5bc94af291e (diff)
downloadpatchage-924775a79c07a4f5798fcefddb523b189e473080.tar.gz
patchage-924775a79c07a4f5798fcefddb523b189e473080.tar.bz2
patchage-924775a79c07a4f5798fcefddb523b189e473080.zip
Abstract out sending of events
This removes the details of how events are handled from drivers, so the owner can set them up to do anything. For example, a driver could be run in the GUI thread and have its events simply dispatched immediately, but here everything is enqueued to the same queue which is drained later for simplicity.
Diffstat (limited to 'src/JackDriver.hpp')
-rw-r--r--src/JackDriver.hpp9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/JackDriver.hpp b/src/JackDriver.hpp
index 1e680a0..6c9c05e 100644
--- a/src/JackDriver.hpp
+++ b/src/JackDriver.hpp
@@ -19,24 +19,21 @@
#include "ClientInfo.hpp"
#include "Driver.hpp"
-#include "PatchageEvent.hpp"
#include "PortInfo.hpp"
#include <glibmm/thread.h>
#include <jack/jack.h>
#include <mutex>
-#include <queue>
#include <string>
class ILog;
-class Patchage;
/// Driver for JACK audio and midi ports
class JackDriver : public Driver
{
public:
- explicit JackDriver(ILog& log);
+ explicit JackDriver(ILog& log, EventSink emit_event);
JackDriver(const JackDriver&) = delete;
JackDriver& operator=(const JackDriver&) = delete;
@@ -73,8 +70,6 @@ public:
jack_nframes_t buffer_size();
bool set_buffer_size(jack_nframes_t size);
- void process_events(Patchage* app) override;
-
private:
ClientInfo get_client_info(const char* name);
PortInfo get_port_info(const jack_port_t* port);
@@ -101,8 +96,6 @@ private:
ILog& _log;
jack_client_t* _client;
- std::queue<PatchageEvent> _events;
-
std::mutex _shutdown_mutex;
jack_position_t _last_pos;