From 78b359c44b67f4f1fff9e31dd9243af5e996f38a Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 29 Nov 2020 17:14:35 +0100 Subject: Add AudioDriver interface --- src/JackDbusDriver.hpp | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'src/JackDbusDriver.hpp') 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 @@ -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; }; -- cgit v1.2.1