summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libs/ardour/ardour/audioengine.h1
-rw-r--r--libs/ardour/audioengine.cc10
2 files changed, 11 insertions, 0 deletions
diff --git a/libs/ardour/ardour/audioengine.h b/libs/ardour/ardour/audioengine.h
index ddffd1d5c0..45257d8129 100644
--- a/libs/ardour/ardour/audioengine.h
+++ b/libs/ardour/ardour/audioengine.h
@@ -70,6 +70,7 @@ public:
int discover_backends();
std::vector<const AudioBackendInfo*> available_backends() const;
std::string current_backend_name () const;
+ boost::shared_ptr<AudioBackend> set_default_backend ();
boost::shared_ptr<AudioBackend> set_backend (const std::string&, const std::string& arg1, const std::string& arg2);
boost::shared_ptr<AudioBackend> current_backend() const { return _backend; }
bool setup_required () const;
diff --git a/libs/ardour/audioengine.cc b/libs/ardour/audioengine.cc
index f79c90feea..a9956666d8 100644
--- a/libs/ardour/audioengine.cc
+++ b/libs/ardour/audioengine.cc
@@ -558,6 +558,16 @@ AudioEngine::drop_backend ()
}
boost::shared_ptr<AudioBackend>
+AudioEngine::set_default_backend ()
+{
+ if (_backends.empty()) {
+ return boost::shared_ptr<AudioBackend>();
+ }
+
+ return set_backend (_backends.begin()->first, "", "");
+}
+
+boost::shared_ptr<AudioBackend>
AudioEngine::set_backend (const std::string& name, const std::string& arg1, const std::string& arg2)
{
BackendMap::iterator b = _backends.find (name);