Add AudioBackend::info() method to retrieve AudioBackendInfo object

Goal is to be able to call AudioBackendInfo::already_configured() from the right place.
This commit is contained in:
Paul Davis 2014-05-01 09:14:25 -04:00
parent 6544df039b
commit 66559cd795
8 changed files with 87 additions and 70 deletions

View file

@ -25,6 +25,19 @@ using namespace ARDOUR;
static boost::shared_ptr<JACKAudioBackend> backend;
static boost::shared_ptr<JackConnection> jack_connection;
static boost::shared_ptr<AudioBackend> backend_factory (AudioEngine& ae);
static int instantiate (const std::string& arg1, const std::string& arg2);
static int deinstantiate ();
static bool already_configured ();
static ARDOUR::AudioBackendInfo _descriptor = {
"JACK",
instantiate,
deinstantiate,
backend_factory,
already_configured,
};
static boost::shared_ptr<AudioBackend>
backend_factory (AudioEngine& ae)
{
@ -33,7 +46,7 @@ backend_factory (AudioEngine& ae)
}
if (!backend) {
backend.reset (new JACKAudioBackend (ae, jack_connection));
backend.reset (new JACKAudioBackend (ae, _descriptor, jack_connection));
}
return backend;
@ -66,13 +79,5 @@ already_configured ()
return !JackConnection::in_control ();
}
static ARDOUR::AudioBackendInfo _descriptor = {
"JACK",
instantiate,
deinstantiate,
backend_factory,
already_configured,
};
extern "C" ARDOURBACKEND_API ARDOUR::AudioBackendInfo* descriptor() { return &_descriptor; }