Change next-file naming functions to work on filename stems.

This paves the way for writing metadata files with similar prefixes, and avoids confusing numbering of capture files with different extensions (e.g. BAD_0000.S16 and BBD_0000.S8).
This commit is contained in:
Jared Boone 2016-04-29 11:27:12 -07:00
parent dc8c34487f
commit 12b8a1b2a9
7 changed files with 29 additions and 34 deletions

View file

@ -81,12 +81,12 @@ void SystemStatusView::set_title(const std::string new_value) {
}
void SystemStatusView::on_camera() {
const auto filename = next_filename_matching_pattern("SCR_????.PNG");
if( filename.empty() ) {
const auto filename_stem = next_filename_stem_matching_pattern("SCR_????");
if( filename_stem.empty() ) {
return;
}
PNGWriter png { filename };
PNGWriter png { filename_stem + ".PNG" };
for(int i=0; i<320; i++) {
std::array<ColorRGB888, 240> row;