GUI: implement instrument preview in file dialog

SADLY it's just for the built-in file dialog
but i'll think of a solution for the external one
This commit is contained in:
tildearrow 2022-04-25 18:58:17 -05:00
parent 663e724111
commit e8c9b645c5
38 changed files with 113 additions and 85 deletions

View file

@ -1293,7 +1293,15 @@ void FurnaceGUI::openFileDialog(FurnaceGUIFileDialogs type) {
"all files", ".*"},
"compatible files{.fui,.dmp,.tfi,.vgi,.s3i,.sbi,.opli,.opni,.y12,.bnk,.ff,.opm},.*",
workingDirIns,
dpiScale
dpiScale,
[this](const char* path) {
std::vector<DivInstrument*> instruments=e->instrumentFromFile(path);
if (!instruments.empty()) {
e->loadTempIns(instruments[0]);
curIns=-2;
}
for (DivInstrument* i: instruments) delete i;
}
);
break;
case GUI_FILE_INS_SAVE: