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<T>) and define
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;
-
/** 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
*/
/** Return true if the port referred to by @param port has any connections
* to other ports. Return false otherwise.
*/
- virtual bool connected (PortHandle port) = 0;
+ virtual bool connected (PortHandle port, bool process_callback_safe = true) = 0;
/** Return true if the port referred to by @param port is connected to
* the port named by @param name. Return false otherwise.
*/
- virtual bool connected_to (PortHandle, const std::string& name) = 0;
+ virtual bool connected_to (PortHandle, const std::string& name, bool process_callback_safe = true) = 0;
/** Return true if the port referred to by @param port has any connections
* to ports marked with the PortFlag IsPhysical. Return false otherwise.
*/
- virtual bool physically_connected (PortHandle port) = 0;
+ virtual bool physically_connected (PortHandle port, bool process_callback_safe = true) = 0;
/** Place the names of all ports connected to the port named by @param
* ports into @param names, and return the number of connections.
*/
- virtual int get_connections (PortHandle port, std::vector<std::string>& names) = 0;
+ virtual int get_connections (PortHandle port, std::vector<std::string>& names, bool process_callback_safe = true) = 0;
/* MIDI */