mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-14 18:46:34 +01:00
audio_backend: Merge is_realtime() into client_real_time_priority()
The description of is_realtime() did not match its actual use. And client_real_time_priority() did not have any description. It was hard to come up with good descriptions of what they actually did. Most backends returned true from is_realtime(), but every one except JACK used the default implementation of client_real_time_priority() that returned 0 ... which is exactly the same as when is_realtime() returns false. Just merge them and keep it simple.
This commit is contained in:
parent
a3ac3c7201
commit
9c0c4f527b
14 changed files with 5 additions and 55 deletions
|
|
@ -149,15 +149,10 @@ public:
|
|||
*/
|
||||
virtual std::string name () const = 0;
|
||||
|
||||
/** Return true if the callback from the underlying mechanism/API
|
||||
* (CoreAudio, JACK, ASIO etc.) occurs in a thread subject to realtime
|
||||
* constraints. Return false otherwise.
|
||||
*/
|
||||
virtual bool is_realtime () const = 0;
|
||||
|
||||
/** Return true if the backed is JACK */
|
||||
/** Return true if the backend is JACK */
|
||||
virtual bool is_jack () const { return false; }
|
||||
|
||||
/** Return the priority to be set with pbd_set_engine_rt_priority. */
|
||||
virtual int client_real_time_priority () { return 0; }
|
||||
|
||||
/* Discovering devices and parameters */
|
||||
|
|
|
|||
|
|
@ -1067,11 +1067,7 @@ AudioEngine::start (bool for_latency)
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (_backend->is_realtime ()) {
|
||||
pbd_set_engine_rt_priority (_backend->client_real_time_priority ());
|
||||
} else {
|
||||
pbd_set_engine_rt_priority (0);
|
||||
}
|
||||
|
||||
_running = true;
|
||||
|
||||
|
|
|
|||
|
|
@ -99,12 +99,6 @@ AlsaAudioBackend::name () const
|
|||
return X_("ALSA");
|
||||
}
|
||||
|
||||
bool
|
||||
AlsaAudioBackend::is_realtime () const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
std::vector<AudioBackend::DeviceStatus>
|
||||
AlsaAudioBackend::enumerate_devices () const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -125,7 +125,6 @@ class AlsaAudioBackend : public AudioBackend, public PortEngineSharedImpl
|
|||
/* AUDIOBACKEND API */
|
||||
|
||||
std::string name () const;
|
||||
bool is_realtime () const;
|
||||
|
||||
bool use_separate_input_and_output_devices () const { return true; }
|
||||
bool match_input_output_devices_or_none () const { return false; }
|
||||
|
|
|
|||
|
|
@ -149,12 +149,6 @@ CoreAudioBackend::name () const
|
|||
return X_("CoreAudio");
|
||||
}
|
||||
|
||||
bool
|
||||
CoreAudioBackend::is_realtime () const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
std::vector<AudioBackend::DeviceStatus>
|
||||
CoreAudioBackend::enumerate_devices () const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -160,7 +160,6 @@ class CoreAudioBackend : public AudioBackend, public PortEngineSharedImpl {
|
|||
/* AUDIOBACKEND API */
|
||||
|
||||
std::string name () const;
|
||||
bool is_realtime () const;
|
||||
|
||||
bool use_separate_input_and_output_devices () const { return true; }
|
||||
std::vector<DeviceStatus> enumerate_devices () const;
|
||||
|
|
|
|||
|
|
@ -110,12 +110,6 @@ DummyAudioBackend::name () const
|
|||
return X_("Dummy"); // internal name
|
||||
}
|
||||
|
||||
bool
|
||||
DummyAudioBackend::is_realtime () const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
std::vector<AudioBackend::DeviceStatus>
|
||||
DummyAudioBackend::enumerate_devices () const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -194,7 +194,6 @@ class DummyAudioBackend : public AudioBackend, public PortEngineSharedImpl
|
|||
/* AUDIOBACKEND API */
|
||||
|
||||
std::string name () const;
|
||||
bool is_realtime () const;
|
||||
|
||||
bool requires_driver_selection() const { return true; }
|
||||
std::string driver_name () const;
|
||||
|
|
|
|||
|
|
@ -105,13 +105,6 @@ JACKAudioBackend::available() const
|
|||
return (private_handle() != 0);
|
||||
}
|
||||
|
||||
bool
|
||||
JACKAudioBackend::is_realtime () const
|
||||
{
|
||||
GET_PRIVATE_JACK_POINTER_RET (_priv_jack,false);
|
||||
return jack_is_realtime (_priv_jack);
|
||||
}
|
||||
|
||||
bool
|
||||
JACKAudioBackend::requires_driver_selection() const
|
||||
{
|
||||
|
|
@ -882,6 +875,8 @@ int
|
|||
JACKAudioBackend::client_real_time_priority ()
|
||||
{
|
||||
GET_PRIVATE_JACK_POINTER_RET (_priv_jack, 0);
|
||||
if (!jack_is_realtime (_priv_jack))
|
||||
return 0;
|
||||
return jack_client_real_time_priority (_priv_jack);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -58,7 +58,6 @@ class JACKAudioBackend : public AudioBackend {
|
|||
|
||||
std::string name() const;
|
||||
void* private_handle() const;
|
||||
bool is_realtime () const;
|
||||
|
||||
bool is_jack () const { return true; }
|
||||
|
||||
|
|
|
|||
|
|
@ -118,12 +118,6 @@ PortAudioBackend::name () const
|
|||
return X_("PortAudio");
|
||||
}
|
||||
|
||||
bool
|
||||
PortAudioBackend::is_realtime () const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
PortAudioBackend::requires_driver_selection() const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -99,7 +99,6 @@ class PortAudioBackend : public AudioBackend, public PortEngineSharedImpl {
|
|||
/* AUDIOBACKEND API */
|
||||
|
||||
std::string name () const;
|
||||
bool is_realtime () const;
|
||||
|
||||
bool requires_driver_selection() const;
|
||||
std::string driver_name () const;
|
||||
|
|
|
|||
|
|
@ -332,12 +332,6 @@ PulseAudioBackend::name () const
|
|||
return X_("PulseAudio");
|
||||
}
|
||||
|
||||
bool
|
||||
PulseAudioBackend::is_realtime () const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
std::vector<AudioBackend::DeviceStatus>
|
||||
PulseAudioBackend::enumerate_devices () const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -102,7 +102,6 @@ public:
|
|||
/* AUDIOBACKEND API */
|
||||
|
||||
std::string name () const;
|
||||
bool is_realtime () const;
|
||||
|
||||
std::vector<DeviceStatus> enumerate_devices () const;
|
||||
std::vector<float> available_sample_rates (const std::string& device) const;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue