Skip to content

Commit 546ca01

Browse files
committed
dynamically change supported VST types
1 parent f7f7044 commit 546ca01

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

src/core/Clipboard.cpp

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,13 @@
3434
namespace lmms::Clipboard
3535
{
3636

37-
const QStringList projectExtensions{"mmp", "mpt", "mmpz"};
38-
const QStringList presetExtensions{"xpf", "xml", "xiz", "lv2"};
39-
const QStringList soundFontExtensions{"sf2", "sf3"};
40-
const QStringList patchExtensions{"pat"};
41-
const QStringList midiExtensions{"mid", "midi", "rmi"};
42-
#ifdef LMMS_BUILD_WINDOWS
43-
const QStringList vstPluginExtensions{"dll"};
44-
#else
45-
const QStringList vstPluginExtensions{"dll", "so"};
46-
#endif
47-
QStringList audioExtensions{};
37+
static const QStringList projectExtensions{"mmp", "mpt", "mmpz"};
38+
static const QStringList presetExtensions{"xpf", "xml", "xiz", "lv2"};
39+
static const QStringList soundFontExtensions{"sf2", "sf3"};
40+
static const QStringList patchExtensions{"pat"};
41+
static const QStringList midiExtensions{"mid", "midi", "rmi"};
42+
static QStringList vstPluginExtensions{};
43+
static QStringList audioExtensions{};
4844

4945
//! gets the extension of a file, or returns the string back if no extension is found
5046
inline QString getExtension(const QString& file)
@@ -54,10 +50,22 @@ namespace lmms::Clipboard
5450
}
5551

5652
//
57-
/* @brief updates the lists of extensions. TODO: currently, this only applies for audioExtensions, but all the lists should be made
53+
/* @brief updates the lists of extensions.
54+
* TODO: currently, this only applies for audioExtensions and vstPluginExtensions, but all the lists should be filled dynamically
5855
*/
5956
void updateExtensionLists()
6057
{
58+
#if defined(LMMS_BUILD_WIN32)
59+
vstPluginExtensions = QStringList{"dll"}
60+
#elif defined(LMMS_BUILD_LINUX)
61+
#if defined(LMMS_HAVE_VST_32) || defined(LMMS_HAVE_VST_64)
62+
vstPluginExtensions = QStringList{"so", "dll"};
63+
#else
64+
vstPluginExtensions = QStringList{"so"};
65+
#endif
66+
#endif
67+
68+
audioExtensions.clear();
6169
for (const SampleDecoder::AudioType& at : SampleDecoder::supportedAudioTypes())
6270
{
6371
audioExtensions += QString::fromStdString(at.extension);

0 commit comments

Comments
 (0)