From 3305a2b697a4da62bbe2e5e5bc072bf70efa5d62 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Fri, 14 Jun 2024 18:53:33 -0500 Subject: [PATCH] expose all audio formats supported by sndfile --- src/gui/gui.cpp | 47 +++++++++++++++++++++++++++++++++++++++++++++-- src/gui/gui.h | 2 ++ 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index b20d3a1cd..a39e2cd14 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -67,6 +67,10 @@ #include "actionUtil.h" +#ifdef HAVE_SNDFILE +#include +#endif + bool Particle::update(float frameTime) { pos.x+=speed.x*frameTime; pos.y+=speed.y*frameTime; @@ -1835,8 +1839,7 @@ void FurnaceGUI::openFileDialog(FurnaceGUIFileDialogs type) { if (!dirExists(workingDirSample)) workingDirSample=getHomeDir(); hasOpened=fileDialog->openLoad( _("Load Sample"), - {_("compatible files"), "*.wav *.dmc *.brr", - _("all files"), "*"}, + audioLoadFormats, workingDirSample, dpiScale, NULL, // TODO @@ -7202,6 +7205,46 @@ bool FurnaceGUI::init() { } #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 sysCategories; + std::vector audioLoadFormats; + bool wavePreviewOn; SDL_Scancode wavePreviewKey; int wavePreviewNote;