mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-15 01:45:46 -04:00
Speaker option for the H1
This commit is contained in:
parent
bf3f9cfe75
commit
934f4b07c4
4 changed files with 56 additions and 1 deletions
|
@ -106,6 +106,7 @@ SystemStatusView::SystemStatusView(
|
|||
&backdrop,
|
||||
&button_back,
|
||||
&title,
|
||||
&button_speaker,
|
||||
&button_stealth,
|
||||
//&button_textentry,
|
||||
&button_camera,
|
||||
|
@ -115,6 +116,11 @@ SystemStatusView::SystemStatusView(
|
|||
&sd_card_status_view,
|
||||
});
|
||||
|
||||
if (portapack::persistent_memory::config_speaker())
|
||||
button_speaker.hidden(false);
|
||||
else
|
||||
button_speaker.hidden(true);
|
||||
|
||||
button_back.id = -1; // Special ID used by FocusManager
|
||||
title.set_style(&style_systemstatus);
|
||||
|
||||
|
@ -133,6 +139,10 @@ SystemStatusView::SystemStatusView(
|
|||
this->on_back();
|
||||
};
|
||||
|
||||
button_speaker.on_select = [this](ImageButton&) {
|
||||
this->on_speaker();
|
||||
};
|
||||
|
||||
button_stealth.on_select = [this](ImageButton&) {
|
||||
this->on_stealth();
|
||||
};
|
||||
|
@ -156,6 +166,14 @@ SystemStatusView::SystemStatusView(
|
|||
}
|
||||
|
||||
void SystemStatusView::refresh() {
|
||||
if (!portapack::persistent_memory::config_speaker()) {
|
||||
button_speaker.set_foreground(Color::light_grey());
|
||||
button_speaker.set_bitmap(&bitmap_icon_speaker_mute);
|
||||
button_speaker.hidden(false);
|
||||
}
|
||||
else {
|
||||
button_speaker.hidden(true);
|
||||
}
|
||||
if (portapack::get_antenna_bias()) {
|
||||
button_bias_tee.set_bitmap(&bitmap_icon_biast_on);
|
||||
button_bias_tee.set_foreground(ui::Color::yellow());
|
||||
|
@ -188,6 +206,23 @@ void SystemStatusView::set_title(const std::string new_value) {
|
|||
}
|
||||
}
|
||||
|
||||
void SystemStatusView::on_speaker() {
|
||||
if (!portapack::speaker_mode)
|
||||
{
|
||||
portapack::set_speaker_mode(true);
|
||||
button_speaker.set_foreground(Color::green());
|
||||
button_speaker.set_bitmap(&bitmap_icon_speaker);
|
||||
}
|
||||
else
|
||||
{
|
||||
portapack::set_speaker_mode(false);
|
||||
button_speaker.set_foreground(Color::light_grey());
|
||||
button_speaker.set_bitmap(&bitmap_icon_speaker_mute);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void SystemStatusView::on_stealth() {
|
||||
bool mode = not portapack::persistent_memory::stealth_mode();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue