use AudioEngine destructor to do necessary stuff when shutting it down, and remove...
[ardour.git] / libs / ardour / ardour / port_engine.h
index 8e36ad8b09e9b381f04397cad47e0bdf86792d2f..8c0ec9e75453ee0b9bc1655f8052a12d343061d5 100644 (file)
@@ -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<T>) and define
@@ -89,19 +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;
-
     /** 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 
      */
@@ -183,21 +185,21 @@ class PortEngine {
     /** 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 */