Distinct engine-states per sample-rate

Previously only the one engine-state per device was
saved. However systemic latency depends on the sample-rate
(and buffersize)
This commit is contained in:
Robin Gareus 2023-06-02 21:44:36 +02:00
parent 5a17ca56ea
commit d66b70f3a2
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
2 changed files with 41 additions and 18 deletions

View file

@ -271,6 +271,7 @@ private:
StateStruct ()
: sample_rate (48000)
, buffer_size (1024)
, n_periods (0)
, input_latency (0)
, output_latency (0)
, active (false)
@ -281,8 +282,8 @@ private:
};
typedef std::shared_ptr<StateStruct> State;
typedef std::list<State> StateList;
static bool state_sort_cmp (const State& a, const State& b);
typedef std::list<State> StateList;
static bool state_sort_cmp (const State& a, const State& b);
StateList states;
@ -290,11 +291,13 @@ private:
State get_matching_state (const std::string& backend,
const std::string& driver,
const std::string& device);
const std::string& device,
const float sample_rate = 0);
State get_matching_state (const std::string& backend,
const std::string& driver,
const std::string& input_device,
const std::string& output_device);
const std::string& output_device,
const float sample_rate = 0);
State get_saved_state_for_currently_displayed_backend_and_device ();
void maybe_display_saved_state ();