13
0

Add AudioEngine::set_default_backend

This commit is contained in:
Tim Mayberry 2013-10-11 12:01:15 +10:00
parent 034c80088c
commit 025adbe920
2 changed files with 11 additions and 0 deletions

View File

@ -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;

View File

@ -557,6 +557,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)
{