Added Soundboard

file.cpp: scan_root_files
proc_audiotx.cpp: bandwidth setting
ui_widget.cpp: button on_focus
This commit is contained in:
furrtek 2016-08-26 08:11:24 +02:00
parent 5de6349199
commit f7e0f36bd9
19 changed files with 462 additions and 121 deletions

View file

@ -1,5 +1,6 @@
/*
* Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc.
* Copyright (C) 2016 Furrtek
*
* This file is part of PortaPack.
*
@ -177,6 +178,28 @@ std::string next_filename_stem_matching_pattern(const std::string& filename_stem
return filename_stem;
}
std::vector<std::string> scan_root_files(const std::string& extension) {
std::vector<std::string> file_list { };
std::string fname;
FRESULT res;
DIR dir;
static FILINFO fno;
res = f_opendir(&dir, "/");
if (res == FR_OK) {
for (;;) {
res = f_readdir(&dir, &fno);
if (res != FR_OK || fno.fname[0] == 0) break;
fname.assign(fno.fname);
if (fname.find(extension) != std::string::npos)
file_list.push_back(fname);
}
f_closedir(&dir);
}
return file_list;
}
namespace std {
namespace filesystem {