mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-14 04:27:39 +00:00
Added Soundboard
file.cpp: scan_root_files proc_audiotx.cpp: bandwidth setting ui_widget.cpp: button on_focus
This commit is contained in:
@@ -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 {
|
||||
|
||||
|
Reference in New Issue
Block a user