summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/audio_backend.h
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2014-05-01 09:14:25 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2014-05-01 09:14:25 -0400
commit66559cd795eb27c389e2dd2d973ec6b280ac2763 (patch)
treecd7ff769badf27c7842bdfe2e97682e7bc9cb922 /libs/ardour/ardour/audio_backend.h
parent6544df039bf95899204c05c665bfec4d0d86e85b (diff)
Add AudioBackend::info() method to retrieve AudioBackendInfo object
Goal is to be able to call AudioBackendInfo::already_configured() from the right place.
Diffstat (limited to 'libs/ardour/ardour/audio_backend.h')
-rw-r--r--libs/ardour/ardour/audio_backend.h72
1 files changed, 39 insertions, 33 deletions
diff --git a/libs/ardour/ardour/audio_backend.h b/libs/ardour/ardour/audio_backend.h
index e4add4e92b..78e3903182 100644
--- a/libs/ardour/ardour/audio_backend.h
+++ b/libs/ardour/ardour/audio_backend.h
@@ -42,11 +42,46 @@
namespace ARDOUR {
+struct LIBARDOUR_API AudioBackendInfo {
+ const char* name;
+
+ /** Using arg1 and arg2, initialize this audiobackend.
+ *
+ * Returns zero on success, non-zero otherwise.
+ */
+ int (*instantiate) (const std::string& arg1, const std::string& arg2);
+
+ /** Release all resources associated with this audiobackend
+ */
+ int (*deinstantiate) (void);
+
+ /** Factory method to create an AudioBackend-derived class.
+ *
+ * Returns a valid shared_ptr to the object if successfull,
+ * or a "null" shared_ptr otherwise.
+ */
+ boost::shared_ptr<AudioBackend> (*factory) (AudioEngine&);
+
+ /** Return true if the underlying mechanism/API has been
+ * configured and does not need (re)configuration in order
+ * to be usable. Return false otherwise.
+ *
+ * Note that this may return true if (re)configuration, even though
+ * not currently required, is still possible.
+ */
+ bool (*already_configured)();
+};
+
class LIBARDOUR_API AudioBackend : public PortEngine {
public:
- AudioBackend (AudioEngine& e) : PortEngine (e), engine (e) {}
+ AudioBackend (AudioEngine& e, AudioBackendInfo& i) : PortEngine (e), _info (i), engine (e) {}
virtual ~AudioBackend () {}
+
+ /** Return the AudioBackendInfo object from which this backend
+ was constructed.
+ */
+ AudioBackendInfo& info() const { return _info; }
/** Return the name of this backend.
*
@@ -482,39 +517,10 @@ class LIBARDOUR_API AudioBackend : public PortEngine {
}
protected:
- AudioEngine& engine;
-
- virtual int _start (bool for_latency_measurement) = 0;
-};
-
-struct LIBARDOUR_API AudioBackendInfo {
- const char* name;
-
- /** Using arg1 and arg2, initialize this audiobackend.
- *
- * Returns zero on success, non-zero otherwise.
- */
- int (*instantiate) (const std::string& arg1, const std::string& arg2);
-
- /** Release all resources associated with this audiobackend
- */
- int (*deinstantiate) (void);
+ AudioBackendInfo& _info;
+ AudioEngine& engine;
- /** Factory method to create an AudioBackend-derived class.
- *
- * Returns a valid shared_ptr to the object if successfull,
- * or a "null" shared_ptr otherwise.
- */
- boost::shared_ptr<AudioBackend> (*factory) (AudioEngine&);
-
- /** Return true if the underlying mechanism/API has been
- * configured and does not need (re)configuration in order
- * to be usable. Return false otherwise.
- *
- * Note that this may return true if (re)configuration, even though
- * not currently required, is still possible.
- */
- bool (*already_configured)();
+ virtual int _start (bool for_latency_measurement) = 0;
};
} // namespace