Persistent audio mute support revisions (#1169)

* Don't disable DAC when other audio output is using it
* Persistent audio mute revisions
* Moved persistent audio mute code to audio.cpp
* Make "Disable AK speaker amp" take effect immediately
This commit is contained in:
Mark Thompson 2023-06-19 14:06:07 -05:00 committed by GitHub
parent f83027d451
commit fa06df1400
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 25 additions and 38 deletions

View file

@ -194,6 +194,8 @@ SystemStatusView::SystemStatusView(
button_clock_status.on_select = [this](ImageButton&) {
this->on_clk();
};
audio::output::update_audio_mute();
}
void SystemStatusView::refresh() {
@ -213,9 +215,6 @@ void SystemStatusView::refresh() {
}
}
portapack::set_speaker_disable(portapack::persistent_memory::config_speaker_disable());
portapack::set_audio_mute(portapack::persistent_memory::config_audio_mute());
if (portapack::persistent_memory::config_audio_mute()) {
button_speaker.set_foreground(Color::light_grey());
button_speaker.set_bitmap(&bitmap_icon_speaker_mute);
@ -287,13 +286,8 @@ void SystemStatusView::on_converter() {
}
void SystemStatusView::on_speaker() {
if (portapack::persistent_memory::config_audio_mute()) {
portapack::set_audio_mute(false);
portapack::persistent_memory::set_config_audio_mute(false);
} else {
portapack::set_audio_mute(true);
portapack::persistent_memory::set_config_audio_mute(true);
}
portapack::persistent_memory::set_config_audio_mute(!portapack::persistent_memory::config_audio_mute());
audio::output::update_audio_mute();
refresh();
}