mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-11 09:06:33 +01:00
add 'available' interface to the AudioBackendInfo
If a backend can be loaded, it does not mean that it can be used; e.g. weak-linked jack-backend if libjack is not available.
This commit is contained in:
parent
f3ff1b9669
commit
d991bb10ca
6 changed files with 41 additions and 0 deletions
|
|
@ -70,6 +70,14 @@ struct LIBARDOUR_API AudioBackendInfo {
|
||||||
* not currently required, is still possible.
|
* not currently required, is still possible.
|
||||||
*/
|
*/
|
||||||
bool (*already_configured)();
|
bool (*already_configured)();
|
||||||
|
|
||||||
|
/** Return true if the underlying mechanism/API can be
|
||||||
|
* used on the given system.
|
||||||
|
*
|
||||||
|
* If this function returns false, the backend is not
|
||||||
|
* listed in the engine dialog.
|
||||||
|
*/
|
||||||
|
bool (*available)();
|
||||||
};
|
};
|
||||||
|
|
||||||
class LIBARDOUR_API AudioBackend : public PortEngine {
|
class LIBARDOUR_API AudioBackend : public PortEngine {
|
||||||
|
|
|
||||||
|
|
@ -1567,6 +1567,7 @@ static boost::shared_ptr<AudioBackend> backend_factory (AudioEngine& e);
|
||||||
static int instantiate (const std::string& arg1, const std::string& /* arg2 */);
|
static int instantiate (const std::string& arg1, const std::string& /* arg2 */);
|
||||||
static int deinstantiate ();
|
static int deinstantiate ();
|
||||||
static bool already_configured ();
|
static bool already_configured ();
|
||||||
|
static bool available ();
|
||||||
|
|
||||||
static ARDOUR::AudioBackendInfo _descriptor = {
|
static ARDOUR::AudioBackendInfo _descriptor = {
|
||||||
"ALSA",
|
"ALSA",
|
||||||
|
|
@ -1574,6 +1575,7 @@ static ARDOUR::AudioBackendInfo _descriptor = {
|
||||||
deinstantiate,
|
deinstantiate,
|
||||||
backend_factory,
|
backend_factory,
|
||||||
already_configured,
|
already_configured,
|
||||||
|
available
|
||||||
};
|
};
|
||||||
|
|
||||||
static boost::shared_ptr<AudioBackend>
|
static boost::shared_ptr<AudioBackend>
|
||||||
|
|
@ -1605,6 +1607,12 @@ already_configured ()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool
|
||||||
|
available ()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
extern "C" ARDOURBACKEND_API ARDOUR::AudioBackendInfo* descriptor ()
|
extern "C" ARDOURBACKEND_API ARDOUR::AudioBackendInfo* descriptor ()
|
||||||
{
|
{
|
||||||
return &_descriptor;
|
return &_descriptor;
|
||||||
|
|
|
||||||
|
|
@ -1207,6 +1207,7 @@ static boost::shared_ptr<AudioBackend> backend_factory (AudioEngine& e);
|
||||||
static int instantiate (const std::string& arg1, const std::string& /* arg2 */);
|
static int instantiate (const std::string& arg1, const std::string& /* arg2 */);
|
||||||
static int deinstantiate ();
|
static int deinstantiate ();
|
||||||
static bool already_configured ();
|
static bool already_configured ();
|
||||||
|
static bool available ();
|
||||||
|
|
||||||
static ARDOUR::AudioBackendInfo _descriptor = {
|
static ARDOUR::AudioBackendInfo _descriptor = {
|
||||||
"Dummy",
|
"Dummy",
|
||||||
|
|
@ -1214,6 +1215,7 @@ static ARDOUR::AudioBackendInfo _descriptor = {
|
||||||
deinstantiate,
|
deinstantiate,
|
||||||
backend_factory,
|
backend_factory,
|
||||||
already_configured,
|
already_configured,
|
||||||
|
available
|
||||||
};
|
};
|
||||||
|
|
||||||
static boost::shared_ptr<AudioBackend>
|
static boost::shared_ptr<AudioBackend>
|
||||||
|
|
@ -1245,6 +1247,12 @@ already_configured ()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool
|
||||||
|
available ()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
extern "C" ARDOURBACKEND_API ARDOUR::AudioBackendInfo* descriptor ()
|
extern "C" ARDOURBACKEND_API ARDOUR::AudioBackendInfo* descriptor ()
|
||||||
{
|
{
|
||||||
return &_descriptor;
|
return &_descriptor;
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ static boost::shared_ptr<AudioBackend> backend_factory (AudioEngine& ae);
|
||||||
static int instantiate (const std::string& arg1, const std::string& arg2);
|
static int instantiate (const std::string& arg1, const std::string& arg2);
|
||||||
static int deinstantiate ();
|
static int deinstantiate ();
|
||||||
static bool already_configured ();
|
static bool already_configured ();
|
||||||
|
static bool available ();
|
||||||
|
|
||||||
static ARDOUR::AudioBackendInfo _descriptor = {
|
static ARDOUR::AudioBackendInfo _descriptor = {
|
||||||
"JACK",
|
"JACK",
|
||||||
|
|
@ -36,6 +37,7 @@ static ARDOUR::AudioBackendInfo _descriptor = {
|
||||||
deinstantiate,
|
deinstantiate,
|
||||||
backend_factory,
|
backend_factory,
|
||||||
already_configured,
|
already_configured,
|
||||||
|
available
|
||||||
};
|
};
|
||||||
|
|
||||||
static boost::shared_ptr<AudioBackend>
|
static boost::shared_ptr<AudioBackend>
|
||||||
|
|
@ -79,5 +81,11 @@ already_configured ()
|
||||||
return !JackConnection::in_control ();
|
return !JackConnection::in_control ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool
|
||||||
|
available ()
|
||||||
|
{
|
||||||
|
return have_libjack() ? false : true;
|
||||||
|
}
|
||||||
|
|
||||||
extern "C" ARDOURBACKEND_API ARDOUR::AudioBackendInfo* descriptor() { return &_descriptor; }
|
extern "C" ARDOURBACKEND_API ARDOUR::AudioBackendInfo* descriptor() { return &_descriptor; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1254,6 +1254,13 @@ WavesAudioBackend::__already_configured ()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
WavesAudioBackend::__available ()
|
||||||
|
{
|
||||||
|
// COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::__available ():" << std::endl;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void*
|
void*
|
||||||
WavesAudioBackend::private_handle () const
|
WavesAudioBackend::private_handle () const
|
||||||
|
|
@ -1298,6 +1305,7 @@ AudioBackendInfo WavesAudioBackend::__backend_info = {
|
||||||
WavesAudioBackend::__deinstantiate,
|
WavesAudioBackend::__deinstantiate,
|
||||||
WavesAudioBackend::__waves_backend_factory,
|
WavesAudioBackend::__waves_backend_factory,
|
||||||
WavesAudioBackend::__already_configured,
|
WavesAudioBackend::__already_configured,
|
||||||
|
WavesAudioBackend::__available,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -335,6 +335,7 @@ class WavesMidiPort;
|
||||||
static int __instantiate (const std::string& arg1, const std::string& arg2);
|
static int __instantiate (const std::string& arg1, const std::string& arg2);
|
||||||
static int __deinstantiate ();
|
static int __deinstantiate ();
|
||||||
static bool __already_configured ();
|
static bool __already_configured ();
|
||||||
|
static bool __available ();
|
||||||
|
|
||||||
static void* __start_process_thread (void*);
|
static void* __start_process_thread (void*);
|
||||||
static uint64_t __get_time_nanos ();
|
static uint64_t __get_time_nanos ();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue