Rearrange UI code RecordView::start() to keep consistent in failure.

This commit is contained in:
Jared Boone 2016-05-02 11:47:44 -07:00
parent 3f36d8b7bf
commit 2e6230e29c

View File

@ -82,13 +82,14 @@ void RecordView::toggle() {
void RecordView::start() { void RecordView::start() {
stop(); stop();
text_record_filename.set("");
text_record_dropped.set("");
if( sampling_rate == 0 ) { if( sampling_rate == 0 ) {
return; return;
} }
const auto filename_stem = next_filename_stem_matching_pattern(filename_stem_pattern); const auto filename_stem = next_filename_stem_matching_pattern(filename_stem_pattern);
text_record_filename.set(filename_stem);
text_record_dropped.set("");
if( filename_stem.empty() ) { if( filename_stem.empty() ) {
return; return;
} }
@ -114,11 +115,12 @@ void RecordView::start() {
}; };
if( writer ) { if( writer ) {
text_record_filename.set(filename_stem);
button_record.set_bitmap(&bitmap_stop);
capture_thread = std::make_unique<CaptureThread>( capture_thread = std::make_unique<CaptureThread>(
std::move(writer), std::move(writer),
buffer_size_k, buffer_count_k buffer_size_k, buffer_count_k
); );
button_record.set_bitmap(&bitmap_stop);
} }
} }