mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-05-14 12:42:19 -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();
|
button_record.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CaptureAppView::is_recording() const {
|
||||||
|
return (bool)capture_thread;
|
||||||
|
}
|
||||||
|
|
||||||
void CaptureAppView::on_record() {
|
void CaptureAppView::on_record() {
|
||||||
if( capture_thread ) {
|
if( is_recording() ) {
|
||||||
capture_thread.reset();
|
record_stop();
|
||||||
button_record.set_bitmap(&bitmap_record);
|
|
||||||
} else {
|
} else {
|
||||||
|
record_start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CaptureAppView::record_start() {
|
||||||
const auto filename_stem = next_filename_stem_matching_pattern("BBD_????");
|
const auto filename_stem = next_filename_stem_matching_pattern("BBD_????");
|
||||||
text_record_filename.set(filename_stem);
|
text_record_filename.set(filename_stem);
|
||||||
text_record_dropped.set("");
|
text_record_dropped.set("");
|
||||||
|
@ -124,7 +132,11 @@ void CaptureAppView::on_record() {
|
||||||
|
|
||||||
capture_thread = std::make_unique<CaptureThread>(filename_stem + ".C16", 14, 1);
|
capture_thread = std::make_unique<CaptureThread>(filename_stem + ".C16", 14, 1);
|
||||||
button_record.set_bitmap(&bitmap_stop);
|
button_record.set_bitmap(&bitmap_stop);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CaptureAppView::record_stop() {
|
||||||
|
capture_thread.reset();
|
||||||
|
button_record.set_bitmap(&bitmap_record);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CaptureAppView::on_tick_second() {
|
void CaptureAppView::on_tick_second() {
|
||||||
|
|
|
@ -61,6 +61,10 @@ private:
|
||||||
SignalToken signal_token_tick_second;
|
SignalToken signal_token_tick_second;
|
||||||
|
|
||||||
void on_record();
|
void on_record();
|
||||||
|
bool is_recording() const;
|
||||||
|
void record_start();
|
||||||
|
void record_stop();
|
||||||
|
|
||||||
void on_tick_second();
|
void on_tick_second();
|
||||||
|
|
||||||
void on_tuning_frequency_changed(rf::Frequency f);
|
void on_tuning_frequency_changed(rf::Frequency f);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue