diff options
author | David Robillard <d@drobilla.net> | 2020-11-29 17:14:35 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-11-29 18:03:31 +0100 |
commit | 78b359c44b67f4f1fff9e31dd9243af5e996f38a (patch) | |
tree | 59aeee028fd339894e94eb21fc5cdbf53a2b8c5d /src/JackDbusDriver.hpp | |
parent | d3561e8cf1d5a289ff2ce4a26e4a970437a812d5 (diff) | |
download | patchage-78b359c44b67f4f1fff9e31dd9243af5e996f38a.tar.gz patchage-78b359c44b67f4f1fff9e31dd9243af5e996f38a.tar.bz2 patchage-78b359c44b67f4f1fff9e31dd9243af5e996f38a.zip |
Add AudioDriver interface
Diffstat (limited to 'src/JackDbusDriver.hpp')
-rw-r--r-- | src/JackDbusDriver.hpp | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/src/JackDbusDriver.hpp b/src/JackDbusDriver.hpp index 42c70ef..068c7cc 100644 --- a/src/JackDbusDriver.hpp +++ b/src/JackDbusDriver.hpp @@ -18,7 +18,7 @@ #ifndef PATCHAGE_JACKDBUSDRIVER_HPP #define PATCHAGE_JACKDBUSDRIVER_HPP -#include "Driver.hpp" +#include "AudioDriver.hpp" #include <dbus/dbus.h> @@ -28,7 +28,7 @@ class ILog; /// Driver for JACK audio and midi ports that uses D-Bus -class JackDriver : public Driver +class JackDriver : public AudioDriver { public: explicit JackDriver(ILog& log, EventSink emit_event); @@ -41,23 +41,20 @@ public: ~JackDriver() override; + // Driver interface void attach(bool launch_daemon) override; void detach() override; - bool is_attached() const override; - void refresh(const EventSink& sink) override; - bool connect(const PortID& tail_id, const PortID& head_id) override; - bool disconnect(const PortID& tail_id, const PortID& head_id) override; - uint32_t get_xruns(); - void reset_xruns(); - - float sample_rate(); - uint32_t buffer_size(); - bool set_buffer_size(uint32_t size); + // AudioDriver interface + uint32_t xruns() override; + void reset_xruns() override; + uint32_t buffer_size() override; + bool set_buffer_size(uint32_t frames) override; + uint32_t sample_rate() override; private: PortType patchage_port_type(dbus_uint32_t dbus_port_type) const; @@ -96,8 +93,8 @@ private: DBusError _dbus_error; DBusConnection* _dbus_connection; - bool _server_responding; - bool _server_started; + mutable bool _server_responding; + bool _server_started; dbus_uint64_t _graph_version; }; |