summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-11-29 12:51:55 +0100
committerDavid Robillard <d@drobilla.net>2020-11-29 12:53:09 +0100
commite36324c1b52be757d10bd5b791be261d2f67c9a4 (patch)
tree4f5a32c52332ec5cd1d311e9def8b2dba5d3ee90
parent01fca5f7a52a7f7bef788e6bff4c8252d847dc29 (diff)
downloadpatchage-e36324c1b52be757d10bd5b791be261d2f67c9a4.tar.gz
patchage-e36324c1b52be757d10bd5b791be261d2f67c9a4.tar.bz2
patchage-e36324c1b52be757d10bd5b791be261d2f67c9a4.zip
Clean up Driver interface
-rw-r--r--src/Driver.hpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/Driver.hpp b/src/Driver.hpp
index e7c4510..21f604e 100644
--- a/src/Driver.hpp
+++ b/src/Driver.hpp
@@ -22,8 +22,6 @@
#include <functional>
#include <utility>
-class Patchage;
-
/// Base class for drivers that handle system clients and ports
class Driver
{
@@ -42,18 +40,26 @@ public:
virtual ~Driver() = default;
+ /// Connect to the underlying system API
virtual void attach(bool launch_daemon) = 0;
- virtual void detach() = 0;
- virtual bool is_attached() const = 0;
+ /// Disconnect from the underlying system API
+ virtual void detach() = 0;
+
+ /// Return true iff the driver is active and connected to the system
+ virtual bool is_attached() const = 0;
+
+ /// Send events to `sink` that describe the complete current system state
virtual void refresh(const EventSink& sink) = 0;
+ /// Make a connection between ports
virtual bool connect(const PortID& tail_id, const PortID& head_id) = 0;
+ /// Remove a connection between ports
virtual bool disconnect(const PortID& tail_id, const PortID& head_id) = 0;
protected:
- EventSink _emit_event;
+ EventSink _emit_event; ///< Sink for emitting "live" events
};
#endif // PATCHAGE_DRIVER_HPP