mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-10 16:46:35 +01:00
probe buffersize if jackd is already running.
This commit is contained in:
parent
b86a8edcff
commit
573ec69a9a
3 changed files with 11 additions and 2 deletions
|
|
@ -362,7 +362,7 @@ JACKAudioBackend::sample_rate () const
|
||||||
if (available()) {
|
if (available()) {
|
||||||
return _current_sample_rate;
|
return _current_sample_rate;
|
||||||
} else {
|
} else {
|
||||||
return 0;
|
return _jack_connection->probed_sample_rate ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return _target_sample_rate;
|
return _target_sample_rate;
|
||||||
|
|
@ -375,7 +375,7 @@ JACKAudioBackend::buffer_size () const
|
||||||
if (available()) {
|
if (available()) {
|
||||||
return _current_buffer_size;
|
return _current_buffer_size;
|
||||||
} else {
|
} else {
|
||||||
return 0;
|
return _jack_connection->probed_buffer_size ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return _target_buffer_size;
|
return _target_buffer_size;
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,8 @@ JackConnection::JackConnection (const std::string& arg1, const std::string& arg2
|
||||||
: _jack (0)
|
: _jack (0)
|
||||||
, _client_name (arg1)
|
, _client_name (arg1)
|
||||||
, session_uuid (arg2)
|
, session_uuid (arg2)
|
||||||
|
, _probed_buffer_size (0)
|
||||||
|
, _probed_sample_rate (0)
|
||||||
{
|
{
|
||||||
/* See if the server is already up
|
/* See if the server is already up
|
||||||
*/
|
*/
|
||||||
|
|
@ -77,6 +79,8 @@ JackConnection::JackConnection (const std::string& arg1, const std::string& arg2
|
||||||
jack_client_t* c = jack_client_open ("ardourprobe", JackNoStartServer, &status);
|
jack_client_t* c = jack_client_open ("ardourprobe", JackNoStartServer, &status);
|
||||||
|
|
||||||
if (status == 0) {
|
if (status == 0) {
|
||||||
|
_probed_buffer_size = jack_get_buffer_size(c);
|
||||||
|
_probed_sample_rate = jack_get_sample_rate(c);
|
||||||
jack_client_close (c);
|
jack_client_close (c);
|
||||||
_in_control = false;
|
_in_control = false;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -29,11 +29,16 @@ class JackConnection {
|
||||||
|
|
||||||
static bool in_control() { return _in_control; }
|
static bool in_control() { return _in_control; }
|
||||||
|
|
||||||
|
uint32_t probed_buffer_size () const { assert (!connected ()); return _probed_buffer_size; }
|
||||||
|
uint32_t probed_sample_rate () const { assert (!connected ()); return _probed_sample_rate; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
jack_client_t* volatile _jack;
|
jack_client_t* volatile _jack;
|
||||||
std::string _client_name;
|
std::string _client_name;
|
||||||
std::string session_uuid;
|
std::string session_uuid;
|
||||||
static bool _in_control;
|
static bool _in_control;
|
||||||
|
uint32_t _probed_buffer_size; // when not in control
|
||||||
|
uint32_t _probed_sample_rate; // when not in control
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue