expose all audio formats supported by sndfile
This commit is contained in:
parent
3949821ae2
commit
3305a2b697
|
@ -67,6 +67,10 @@
|
||||||
|
|
||||||
#include "actionUtil.h"
|
#include "actionUtil.h"
|
||||||
|
|
||||||
|
#ifdef HAVE_SNDFILE
|
||||||
|
#include <sndfile.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
bool Particle::update(float frameTime) {
|
bool Particle::update(float frameTime) {
|
||||||
pos.x+=speed.x*frameTime;
|
pos.x+=speed.x*frameTime;
|
||||||
pos.y+=speed.y*frameTime;
|
pos.y+=speed.y*frameTime;
|
||||||
|
@ -1835,8 +1839,7 @@ void FurnaceGUI::openFileDialog(FurnaceGUIFileDialogs type) {
|
||||||
if (!dirExists(workingDirSample)) workingDirSample=getHomeDir();
|
if (!dirExists(workingDirSample)) workingDirSample=getHomeDir();
|
||||||
hasOpened=fileDialog->openLoad(
|
hasOpened=fileDialog->openLoad(
|
||||||
_("Load Sample"),
|
_("Load Sample"),
|
||||||
{_("compatible files"), "*.wav *.dmc *.brr",
|
audioLoadFormats,
|
||||||
_("all files"), "*"},
|
|
||||||
workingDirSample,
|
workingDirSample,
|
||||||
dpiScale,
|
dpiScale,
|
||||||
NULL, // TODO
|
NULL, // TODO
|
||||||
|
@ -7202,6 +7205,46 @@ bool FurnaceGUI::init() {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// initialize audio formats
|
||||||
|
String compatFormats;
|
||||||
|
|
||||||
|
audioLoadFormats.push_back(_("compatible files"));
|
||||||
|
audioLoadFormats.push_back("");
|
||||||
|
|
||||||
|
#ifdef HAVE_SNDFILE
|
||||||
|
int value=0;
|
||||||
|
sf_command(NULL,SFC_GET_FORMAT_MAJOR_COUNT,&value,sizeof(int));
|
||||||
|
logV("simple formats: %d",value);
|
||||||
|
|
||||||
|
for (int i=0; i<value; i++) {
|
||||||
|
SF_FORMAT_INFO f;
|
||||||
|
f.format=i;
|
||||||
|
if (sf_command(NULL,SFC_GET_FORMAT_MAJOR,&f,sizeof(SF_FORMAT_INFO))!=0) continue;
|
||||||
|
logV("format %d: %s (%s)\n",i,f.name,f.extension);
|
||||||
|
// these two are/will be handled somewhere else
|
||||||
|
if (strcmp(f.extension,"raw")==0) continue;
|
||||||
|
if (strcmp(f.extension,"xi")==0) continue;
|
||||||
|
// just in case
|
||||||
|
if (strcmp(f.extension,"dmc")==0) continue;
|
||||||
|
if (strcmp(f.extension,"brr")==0) continue;
|
||||||
|
audioLoadFormats.push_back(f.name);
|
||||||
|
audioLoadFormats.push_back(fmt::sprintf("*.%s",f.extension));
|
||||||
|
compatFormats+=fmt::sprintf("*.%s ",f.extension);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
compatFormats+="*.dmc ";
|
||||||
|
compatFormats+="*.brr";
|
||||||
|
audioLoadFormats[1]=compatFormats;
|
||||||
|
|
||||||
|
audioLoadFormats.push_back(_("NES DPCM data"));
|
||||||
|
audioLoadFormats.push_back("*.dmc");
|
||||||
|
|
||||||
|
audioLoadFormats.push_back(_("SNES Bit Rate Reduction"));
|
||||||
|
audioLoadFormats.push_back("*.brr");
|
||||||
|
|
||||||
|
audioLoadFormats.push_back(_("all files"));
|
||||||
|
audioLoadFormats.push_back("*");
|
||||||
|
|
||||||
logI("done!");
|
logI("done!");
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -2357,6 +2357,8 @@ class FurnaceGUI {
|
||||||
|
|
||||||
std::vector<FurnaceGUISysCategory> sysCategories;
|
std::vector<FurnaceGUISysCategory> sysCategories;
|
||||||
|
|
||||||
|
std::vector<String> audioLoadFormats;
|
||||||
|
|
||||||
bool wavePreviewOn;
|
bool wavePreviewOn;
|
||||||
SDL_Scancode wavePreviewKey;
|
SDL_Scancode wavePreviewKey;
|
||||||
int wavePreviewNote;
|
int wavePreviewNote;
|
||||||
|
|
Loading…
Reference in a new issue