mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-02-10 03:38:50 -05:00
Setting for hiding the speaker
This commit is contained in:
parent
3c304b9fe3
commit
bf3f9cfe75
@ -29,6 +29,7 @@
|
|||||||
#include "lpc43xx_cpp.hpp"
|
#include "lpc43xx_cpp.hpp"
|
||||||
using namespace lpc43xx;
|
using namespace lpc43xx;
|
||||||
|
|
||||||
|
#include "audio.hpp"
|
||||||
#include "portapack.hpp"
|
#include "portapack.hpp"
|
||||||
using portapack::receiver_model;
|
using portapack::receiver_model;
|
||||||
using namespace portapack;
|
using namespace portapack;
|
||||||
@ -240,12 +241,14 @@ void SetPlayDeadView::focus() {
|
|||||||
SetUIView::SetUIView(NavigationView& nav) {
|
SetUIView::SetUIView(NavigationView& nav) {
|
||||||
add_children({
|
add_children({
|
||||||
//&checkbox_login,
|
//&checkbox_login,
|
||||||
|
&checkbox_speaker,
|
||||||
&checkbox_bloff,
|
&checkbox_bloff,
|
||||||
&options_bloff,
|
&options_bloff,
|
||||||
&checkbox_showsplash,
|
&checkbox_showsplash,
|
||||||
&button_ok
|
&button_ok
|
||||||
});
|
});
|
||||||
|
|
||||||
|
checkbox_speaker.set_value(persistent_memory::config_speaker());
|
||||||
checkbox_showsplash.set_value(persistent_memory::config_splash());
|
checkbox_showsplash.set_value(persistent_memory::config_splash());
|
||||||
//checkbox_login.set_value(persistent_memory::config_login());
|
//checkbox_login.set_value(persistent_memory::config_login());
|
||||||
|
|
||||||
@ -258,6 +261,15 @@ SetUIView::SetUIView(NavigationView& nav) {
|
|||||||
options_bloff.set_selected_index(0);
|
options_bloff.set_selected_index(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
checkbox_speaker.on_select = [this](Checkbox&, bool v) {
|
||||||
|
if (v) audio::output::speaker_mute(); //Just mute audio if speaker is disabled
|
||||||
|
|
||||||
|
persistent_memory::set_config_speaker(v); //Store Speaker status
|
||||||
|
|
||||||
|
StatusRefreshMessage message { }; //Refresh status bar with/out speaker
|
||||||
|
EventDispatcher::send_message(message);
|
||||||
|
};
|
||||||
|
|
||||||
button_ok.on_select = [&nav, this](Button&) {
|
button_ok.on_select = [&nav, this](Button&) {
|
||||||
if (checkbox_bloff.value())
|
if (checkbox_bloff.value())
|
||||||
persistent_memory::set_config_backlight_timer(options_bloff.selected_index() + 1);
|
persistent_memory::set_config_backlight_timer(options_bloff.selected_index() + 1);
|
||||||
|
@ -200,6 +200,11 @@ private:
|
|||||||
"Login with play dead"
|
"Login with play dead"
|
||||||
};*/
|
};*/
|
||||||
|
|
||||||
|
Checkbox checkbox_speaker {
|
||||||
|
{ 3 * 8, 2 * 16 },
|
||||||
|
20,
|
||||||
|
"Hide H1 Speaker option"
|
||||||
|
};
|
||||||
Checkbox checkbox_bloff {
|
Checkbox checkbox_bloff {
|
||||||
{ 3 * 8, 5 * 16 },
|
{ 3 * 8, 5 * 16 },
|
||||||
20,
|
20,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user