From 16296c1dfb85b34b42df3625b6d806a23fa10725 Mon Sep 17 00:00:00 2001 From: Dalton Messmer Date: Wed, 26 Mar 2025 21:31:38 -0400 Subject: [PATCH] Fix Vestige file browser filter (#7816) - Remove pointless *.exe option - Add an "All VST files" option on Linux when there is both LinuxVST and Wine VST support - Remove *.dll option from Linux builds without Wine VST support (i.e. LinuxVST-only builds) --- plugins/Vestige/Vestige.cpp | 26 +++++++++++++++++--------- src/gui/FileBrowser.cpp | 14 ++++++++++---- src/lmmsconfig.h.in | 2 ++ 3 files changed, 29 insertions(+), 13 deletions(-) diff --git a/plugins/Vestige/Vestige.cpp b/plugins/Vestige/Vestige.cpp index 05716008e..e37292400 100644 --- a/plugins/Vestige/Vestige.cpp +++ b/plugins/Vestige/Vestige.cpp @@ -79,10 +79,14 @@ Plugin::Descriptor Q_DECL_EXPORT vestige_plugin_descriptor = 0x0100, Plugin::Type::Instrument, new PluginPixmapLoader( "logo" ), -#ifdef LMMS_BUILD_LINUX - "dll,so", -#else +#if defined(LMMS_BUILD_WIN32) "dll", +#elif defined(LMMS_BUILD_LINUX) +# if defined(LMMS_HAVE_VST_32) || defined(LMMS_HAVE_VST_64) + "dll,so", +# else + "so", +# endif #endif nullptr, } ; @@ -669,13 +673,17 @@ void VestigeInstrumentView::openPlugin() // set filters QStringList types; - types << tr( "DLL-files (*.dll)" ) - << tr( "EXE-files (*.exe)" ) -#ifdef LMMS_BUILD_LINUX - << tr( "SO-files (*.so)" ) +#if defined(LMMS_BUILD_WIN32) + types << tr("VST2 files (*.dll)"); +#elif defined(LMMS_BUILD_LINUX) +# if defined(LMMS_HAVE_VST_32) || defined(LMMS_HAVE_VST_64) + types << tr("All VST files (*.dll *.so)") + << tr("Windows VST2 files (*.dll)"); +# endif + types << tr("LinuxVST files (*.so)"); #endif - ; - ofd.setNameFilters( types ); + + ofd.setNameFilters(types); if( m_vi->m_pluginDLL != "" ) { diff --git a/src/gui/FileBrowser.cpp b/src/gui/FileBrowser.cpp index 5e8c84e33..3ba634176 100644 --- a/src/gui/FileBrowser.cpp +++ b/src/gui/FileBrowser.cpp @@ -1222,15 +1222,21 @@ void FileItem::determineFileType() m_type = FileType::Midi; m_handling = FileHandling::ImportAsProject; } - else if( ext == "dll" -#ifdef LMMS_BUILD_LINUX - || ext == "so" -#endif +#ifdef LMMS_HAVE_VST + else if ( +# if defined(LMMS_BUILD_LINUX) + ext == "so" || +# endif +# if defined(LMMS_HAVE_VST_32) || defined(LMMS_HAVE_VST_64) + ext == "dll" || +# endif + false ) { m_type = FileType::VstPlugin; m_handling = FileHandling::LoadByPlugin; } +#endif else if ( ext == "lv2" ) { m_type = FileType::Preset; diff --git a/src/lmmsconfig.h.in b/src/lmmsconfig.h.in index 867a04a45..e63ce1fa4 100644 --- a/src/lmmsconfig.h.in +++ b/src/lmmsconfig.h.in @@ -33,6 +33,8 @@ #cmakedefine LMMS_HAVE_SDL #cmakedefine LMMS_HAVE_STK #cmakedefine LMMS_HAVE_VST +#cmakedefine LMMS_HAVE_VST_32 +#cmakedefine LMMS_HAVE_VST_64 #cmakedefine LMMS_HAVE_SF_COMPLEVEL #cmakedefine LMMS_DEBUG_FPE