mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-14 09:25:30 -04:00
Fix hang in Audio when switching from Capture app, & bug fixes. (#1167)
* Fix hang in Audio when switching from Capture app * Bug fixes
This commit is contained in:
parent
5daa0dfbb1
commit
7ebf3d3cdd
10 changed files with 78 additions and 89 deletions
|
@ -30,6 +30,12 @@
|
|||
|
||||
/* Stashes current radio bandwidth and sampling rate.
|
||||
* Inits to defaults, and restores previous when destroyed.
|
||||
* The idea here is that an app will eventually call enable
|
||||
* on the model which will sync all of the model state into
|
||||
* the radio. We tried lazily setting these using the
|
||||
* set_configuration_without_update function, but there are
|
||||
* still various UI components (mainly Waterfall) that need
|
||||
* the radio set in order to load properly.
|
||||
* NB: This member must be added before SettingsManager. */
|
||||
template <typename TModel, TModel* model>
|
||||
class RadioState {
|
||||
|
@ -41,8 +47,9 @@ class RadioState {
|
|||
RadioState(uint32_t new_bandwidth, uint32_t new_sampling_rate)
|
||||
: prev_bandwidth_{model->baseband_bandwidth()},
|
||||
prev_sampling_rate_{model->sampling_rate()} {
|
||||
model->set_configuration_without_update(
|
||||
new_bandwidth, new_sampling_rate);
|
||||
// Update the new settings in the radio.
|
||||
model->set_sampling_rate(new_sampling_rate);
|
||||
model->set_baseband_bandwidth(new_bandwidth);
|
||||
}
|
||||
|
||||
~RadioState() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue