Capture: Write simple metadata for baseband and audio files.

Will probably turn the audio metadata file into .wav data, eventually.
This commit is contained in:
Jared Boone 2016-04-30 11:25:04 -07:00
parent a6d41547a0
commit 24192b4043
4 changed files with 33 additions and 0 deletions

View file

@ -130,6 +130,8 @@ void CaptureAppView::record_start() {
return;
}
write_metadata_file(filename_stem + ".TXT");
capture_thread = std::make_unique<CaptureThread>(filename_stem + ".C16", 14, 1);
button_record.set_bitmap(&bitmap_stop);
}
@ -139,6 +141,13 @@ void CaptureAppView::record_stop() {
button_record.set_bitmap(&bitmap_record);
}
void CaptureAppView::write_metadata_file(const std::string& filename) {
File file;
file.open_for_writing(filename);
file.puts("sample_rate=" + to_string_dec_uint(sampling_rate) + "\n");
file.puts("center_frequency=" + to_string_dec_uint(receiver_model.tuning_frequency()) + "\n");
}
void CaptureAppView::on_tick_second() {
if( capture_thread ) {
const auto dropped_percent = std::min(99U, capture_thread->state().dropped_percent());