From f9d08daa477230f90c194edc555f77c267b5078c Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 13 Sep 2013 11:21:15 -0400 Subject: change inheritance so that an AudioBackend IS-A PortEngine This allows a derived (concrete) implementation to share information (e.g. sample rate, buffer size) between the audio backend side of things and the port management side of things. --- libs/ardour/ardour/port_engine.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'libs/ardour/ardour/port_engine.h') diff --git a/libs/ardour/ardour/port_engine.h b/libs/ardour/ardour/port_engine.h index 71f93ea05e..8c0ec9e754 100644 --- a/libs/ardour/ardour/port_engine.h +++ b/libs/ardour/ardour/port_engine.h @@ -79,6 +79,11 @@ class PortEngine { PortEngine (PortManager& pm) : manager (pm) {} virtual ~PortEngine() {} + /** Return a private, type-free pointer to any data + * that might be useful to a concrete implementation + */ + virtual void* private_handle() const = 0; + /* We use void* here so that the API can be defined for any implementation. * * We could theoretically use a template (PortEngine) and define @@ -89,21 +94,16 @@ class PortEngine { typedef void* PortHandle; - /** Return a typeless pointer to an object that may be of interest - * that understands the internals of a particular PortEngine - * implementation. - * - * XXX the existence of this method is a band-aid over some design - * issues and will it will be removed in the future - */ - virtual void* private_handle() const = 0; - - virtual bool connected() const = 0; - /** Return the name of this process as used by the port manager * when naming ports. */ virtual const std::string& my_name() const = 0; + + /** Return true if the underlying mechanism/API is still available + * for us to utilize. return false if some or all of the AudioBackend + * API can no longer be effectively used. + */ + virtual bool available() const = 0; /** Return the maximum size of a port name */ -- cgit v1.2.3