mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-05-13 12:12:16 -04:00
Start/stop control of baseband capture.
This commit is contained in:
parent
5558ca60d7
commit
40df73b923
2 changed files with 36 additions and 1 deletions
|
@ -28,7 +28,13 @@
|
|||
namespace ui {
|
||||
|
||||
CaptureAppView::CaptureAppView(NavigationView&) {
|
||||
capture_thread = std::make_unique<AudioThread>("baseband.c16");
|
||||
add_children({ {
|
||||
&button_start,
|
||||
&button_stop,
|
||||
} });
|
||||
|
||||
button_start.on_select = [this](Button&){ this->on_start(); };
|
||||
button_stop.on_select = [this](Button&){ this->on_stop(); };
|
||||
|
||||
radio::enable({
|
||||
tuning_frequency(),
|
||||
|
@ -51,6 +57,20 @@ CaptureAppView::~CaptureAppView() {
|
|||
radio::disable();
|
||||
}
|
||||
|
||||
void CaptureAppView::focus() {
|
||||
button_start.focus();
|
||||
}
|
||||
|
||||
void CaptureAppView::on_start() {
|
||||
if( !capture_thread ) {
|
||||
capture_thread = std::make_unique<AudioThread>("baseband.c16");
|
||||
}
|
||||
}
|
||||
|
||||
void CaptureAppView::on_stop() {
|
||||
capture_thread.reset();
|
||||
}
|
||||
|
||||
uint32_t CaptureAppView::target_frequency() const {
|
||||
return initial_target_frequency;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue