mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-05-14 20:52:12 -04:00
Make CaptureAppView capture functions same as AnalogAudioView.
This commit is contained in:
parent
18e40562b5
commit
a6d41547a0
2 changed files with 29 additions and 13 deletions
|
@ -110,11 +110,19 @@ void CaptureAppView::focus() {
|
|||
button_record.focus();
|
||||
}
|
||||
|
||||
bool CaptureAppView::is_recording() const {
|
||||
return (bool)capture_thread;
|
||||
}
|
||||
|
||||
void CaptureAppView::on_record() {
|
||||
if( capture_thread ) {
|
||||
capture_thread.reset();
|
||||
button_record.set_bitmap(&bitmap_record);
|
||||
if( is_recording() ) {
|
||||
record_stop();
|
||||
} else {
|
||||
record_start();
|
||||
}
|
||||
}
|
||||
|
||||
void CaptureAppView::record_start() {
|
||||
const auto filename_stem = next_filename_stem_matching_pattern("BBD_????");
|
||||
text_record_filename.set(filename_stem);
|
||||
text_record_dropped.set("");
|
||||
|
@ -125,6 +133,10 @@ void CaptureAppView::on_record() {
|
|||
capture_thread = std::make_unique<CaptureThread>(filename_stem + ".C16", 14, 1);
|
||||
button_record.set_bitmap(&bitmap_stop);
|
||||
}
|
||||
|
||||
void CaptureAppView::record_stop() {
|
||||
capture_thread.reset();
|
||||
button_record.set_bitmap(&bitmap_record);
|
||||
}
|
||||
|
||||
void CaptureAppView::on_tick_second() {
|
||||
|
|
|
@ -61,6 +61,10 @@ private:
|
|||
SignalToken signal_token_tick_second;
|
||||
|
||||
void on_record();
|
||||
bool is_recording() const;
|
||||
void record_start();
|
||||
void record_stop();
|
||||
|
||||
void on_tick_second();
|
||||
|
||||
void on_tuning_frequency_changed(rf::Frequency f);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue