mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-01-09 14:53:38 +00:00
Remember previous capture settings (#2450)
This commit is contained in:
parent
854ac514cb
commit
57ce978bab
@ -55,12 +55,15 @@ CaptureAppView::CaptureAppView(NavigationView& nav)
|
|||||||
this->field_frequency.set_step(v);
|
this->field_frequency.set_step(v);
|
||||||
};
|
};
|
||||||
|
|
||||||
option_format.set_selected_index(0); // Default to C16
|
option_format.set_selected_index(previous_format);
|
||||||
option_format.on_change = [this](size_t, uint32_t file_type) {
|
option_format.on_change = [this](size_t, uint32_t file_type) {
|
||||||
|
previous_format = file_type;
|
||||||
record_view.set_file_type((RecordView::FileType)file_type);
|
record_view.set_file_type((RecordView::FileType)file_type);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
check_trim.set_value(previous_trim);
|
||||||
check_trim.on_select = [this](Checkbox&, bool v) {
|
check_trim.on_select = [this](Checkbox&, bool v) {
|
||||||
|
previous_trim = v;
|
||||||
record_view.set_auto_trim(v);
|
record_view.set_auto_trim(v);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -100,7 +103,7 @@ CaptureAppView::CaptureAppView(NavigationView& nav)
|
|||||||
};
|
};
|
||||||
|
|
||||||
receiver_model.enable();
|
receiver_model.enable();
|
||||||
option_bandwidth.set_by_value(500000);
|
option_bandwidth.set_by_value(previous_bandwidth);
|
||||||
|
|
||||||
record_view.on_error = [&nav](std::string message) {
|
record_view.on_error = [&nav](std::string message) {
|
||||||
nav.display_modal("Error", message);
|
nav.display_modal("Error", message);
|
||||||
|
@ -48,12 +48,21 @@ class CaptureAppView : public View {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static constexpr ui::Dim header_height = 3 * 16;
|
static constexpr ui::Dim header_height = 3 * 16;
|
||||||
|
|
||||||
uint32_t previous_bandwidth{500000};
|
uint32_t previous_bandwidth{500000};
|
||||||
|
uint32_t previous_format{0};
|
||||||
|
bool previous_trim{false};
|
||||||
|
|
||||||
NavigationView& nav_;
|
NavigationView& nav_;
|
||||||
RxRadioState radio_state_{ReceiverModel::Mode::Capture};
|
RxRadioState radio_state_{ReceiverModel::Mode::Capture};
|
||||||
app_settings::SettingsManager settings_{
|
app_settings::SettingsManager settings_{
|
||||||
"rx_capture", app_settings::Mode::RX};
|
"rx_capture",
|
||||||
|
app_settings::Mode::RX,
|
||||||
|
{
|
||||||
|
{"previous_bandwidth"sv, &previous_bandwidth},
|
||||||
|
{"previous_format"sv, &previous_format},
|
||||||
|
{"previous_trim"sv, &previous_trim},
|
||||||
|
}};
|
||||||
|
|
||||||
Labels labels{
|
Labels labels{
|
||||||
{{0 * 8, 1 * 16}, "Rate:", Theme::getInstance()->fg_light->foreground},
|
{{0 * 8, 1 * 16}, "Rate:", Theme::getInstance()->fg_light->foreground},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user