diff options
author | David Robillard <d@drobilla.net> | 2020-11-28 21:41:26 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-11-28 22:49:10 +0100 |
commit | 5128bfab7ddb9504abf17375e910e5bc94af291e (patch) | |
tree | 79cc0953718e1f79ed47282b9f11f9f087edc3bc /src/JackDriver.hpp | |
parent | 0f25dd575f9c74cc34a54e64468f07e6c631750d (diff) | |
download | patchage-5128bfab7ddb9504abf17375e910e5bc94af291e.tar.gz patchage-5128bfab7ddb9504abf17375e910e5bc94af291e.tar.bz2 patchage-5128bfab7ddb9504abf17375e910e5bc94af291e.zip |
Refresh by emitting events
This decouples drivers from the rest of the application, in particular the
horrible situation where they were working with the canvas directly, by having
them always communicate changes by emitting events.
Diffstat (limited to 'src/JackDriver.hpp')
-rw-r--r-- | src/JackDriver.hpp | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/src/JackDriver.hpp b/src/JackDriver.hpp index 6e41fbb..1e680a0 100644 --- a/src/JackDriver.hpp +++ b/src/JackDriver.hpp @@ -31,15 +31,12 @@ class ILog; class Patchage; -class PatchageCanvas; -class PatchageModule; -class PatchagePort; /// Driver for JACK audio and midi ports class JackDriver : public Driver { public: - explicit JackDriver(Patchage* app, ILog& log); + explicit JackDriver(ILog& log); JackDriver(const JackDriver&) = delete; JackDriver& operator=(const JackDriver&) = delete; @@ -56,16 +53,12 @@ public: bool is_realtime() const { return _client && jack_is_realtime(_client); } - void refresh() override; - void destroy_all() override; + void refresh(const EventSink& sink) override; bool port_names(const PortID& id, std::string& module_name, std::string& port_name); - PatchagePort* - create_port_view(Patchage* patchage, const PortID& id) override; - bool connect(PortID tail_id, PortID head_id) override; bool disconnect(PortID tail_id, PortID head_id) override; @@ -86,9 +79,6 @@ private: ClientInfo get_client_info(const char* name); PortInfo get_port_info(const jack_port_t* port); - PatchagePort* - create_port(PatchageModule& parent, jack_port_t* port, const PortID& id); - void shutdown(); static void jack_client_registration_cb(const char* name, @@ -108,7 +98,6 @@ private: static void jack_shutdown_cb(void* jack_driver); - Patchage* _app; ILog& _log; jack_client_t* _client; |