mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-06-29 17:17:28 -04:00
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:
parent
f83027d451
commit
fa06df1400
7 changed files with 25 additions and 38 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue