From 248ce973044e37d384b5a238355c7526cbccf423 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 17 Jan 2016 01:07:31 +0100 Subject: [PATCH] Don't use unneeded functions in discovery, fixes windows build --- source/backend/CarlaUtils.cpp | 316 ++++++++++++++------------- source/discovery/carla-discovery.cpp | 1 + 2 files changed, 161 insertions(+), 156 deletions(-) diff --git a/source/backend/CarlaUtils.cpp b/source/backend/CarlaUtils.cpp index 02d10bc16..5256f03d4 100644 --- a/source/backend/CarlaUtils.cpp +++ b/source/backend/CarlaUtils.cpp @@ -25,7 +25,9 @@ #include "CarlaThread.hpp" #include "LinkedList.hpp" -#include "juce_audio_formats/juce_audio_formats.h" +#ifndef CARLA_UTILS_CACHED_PLUGINS_ONLY +# include "juce_audio_formats/juce_audio_formats.h" +#endif #ifdef CARLA_OS_MAC # include "juce_audio_processors/juce_audio_processors.h" @@ -59,161 +61,6 @@ _CarlaCachedPluginInfo::_CarlaCachedPluginInfo() noexcept // ------------------------------------------------------------------------------------------------------------------- -const char* carla_get_complete_license_text() -{ - carla_debug("carla_get_complete_license_text()"); - - static CarlaString retText; - - if (retText.isEmpty()) - { - retText = - "

This current Carla build is using the following features and 3rd-party code:

" - "" - - "

" -#if defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN) || ! defined(VESTIGE_HEADER) - // Required by VST SDK - " [1] Trademark of Steinberg Media Technologies GmbH.
" -#endif -#ifdef HAVE_LINUXSAMPLER - // LinuxSampler GPL exception - " [" LS_NOTE_NO "] Using LinuxSampler code in commercial hardware or software products is not allowed without prior written authorization by the authors." -#endif - "

" - ; - } - - return retText; -} - -const char* carla_get_juce_version() -{ - carla_debug("carla_get_juce_version()"); - - static CarlaString retVersion; - - if (retVersion.isEmpty()) - { - if (const char* const version = juce::SystemStats::getJUCEVersion().toRawUTF8()) - retVersion = version+6; - else - retVersion = "3.0"; - } - - return retVersion; -} - -const char* carla_get_supported_file_extensions() -{ - carla_debug("carla_get_supported_file_extensions()"); - - static CarlaString retText; - - if (retText.isEmpty()) - { - retText = - // Base types - "*.carxp;*.carxs" - // MIDI files - ";*.mid;*.midi" -#ifdef HAVE_FLUIDSYNTH - // fluidsynth (sf2) - ";*.sf2" -#endif -#ifdef HAVE_LINUXSAMPLER - // linuxsampler (gig and sfz) - ";*.gig;*.sfz" -#endif -#ifdef HAVE_ZYN_DEPS - // zynaddsubfx presets - ";*.xmz;*.xiz" -#endif - ; - - // Audio files - { - using namespace juce; - - AudioFormatManager afm; - afm.registerBasicFormats(); - - String juceFormats; - - for (AudioFormat **it=afm.begin(), **end=afm.end(); it != end; ++it) - { - const StringArray& exts((*it)->getFileExtensions()); - - for (String *eit=exts.begin(), *eend=exts.end(); eit != eend; ++eit) - juceFormats += String(";*" + (*eit)).toRawUTF8(); - } - - retText += juceFormats.toRawUTF8(); - } - } - - return retText; -} - -// ------------------------------------------------------------------------------------------------------------------- - uint carla_get_cached_plugin_count(CB::PluginType ptype, const char* pluginPath) { CARLA_SAFE_ASSERT_RETURN(ptype == CB::PLUGIN_INTERNAL || ptype == CB::PLUGIN_LV2 || ptype == CB::PLUGIN_AU, 0); @@ -650,6 +497,162 @@ const CarlaCachedPluginInfo* carla_get_cached_plugin_info(CB::PluginType ptype, return &info; } +#ifndef CARLA_UTILS_CACHED_PLUGINS_ONLY +// ------------------------------------------------------------------------------------------------------------------- + +const char* carla_get_complete_license_text() +{ + carla_debug("carla_get_complete_license_text()"); + + static CarlaString retText; + + if (retText.isEmpty()) + { + retText = + "

This current Carla build is using the following features and 3rd-party code:

" + "" + + "

" +#if defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN) || ! defined(VESTIGE_HEADER) + // Required by VST SDK + " [1] Trademark of Steinberg Media Technologies GmbH.
" +#endif +#ifdef HAVE_LINUXSAMPLER + // LinuxSampler GPL exception + " [" LS_NOTE_NO "] Using LinuxSampler code in commercial hardware or software products is not allowed without prior written authorization by the authors." +#endif + "

" + ; + } + + return retText; +} + +const char* carla_get_juce_version() +{ + carla_debug("carla_get_juce_version()"); + + static CarlaString retVersion; + + if (retVersion.isEmpty()) + { + if (const char* const version = juce::SystemStats::getJUCEVersion().toRawUTF8()) + retVersion = version+6; + else + retVersion = "3.0"; + } + + return retVersion; +} + +const char* carla_get_supported_file_extensions() +{ + carla_debug("carla_get_supported_file_extensions()"); + + static CarlaString retText; + + if (retText.isEmpty()) + { + retText = + // Base types + "*.carxp;*.carxs" + // MIDI files + ";*.mid;*.midi" +#ifdef HAVE_FLUIDSYNTH + // fluidsynth (sf2) + ";*.sf2" +#endif +#ifdef HAVE_LINUXSAMPLER + // linuxsampler (gig and sfz) + ";*.gig;*.sfz" +#endif +#ifdef HAVE_ZYN_DEPS + // zynaddsubfx presets + ";*.xmz;*.xiz" +#endif + ; + + // Audio files + { + using namespace juce; + + AudioFormatManager afm; + afm.registerBasicFormats(); + + String juceFormats; + + for (AudioFormat **it=afm.begin(), **end=afm.end(); it != end; ++it) + { + const StringArray& exts((*it)->getFileExtensions()); + + for (String *eit=exts.begin(), *eend=exts.end(); eit != eend; ++eit) + juceFormats += String(";*" + (*eit)).toRawUTF8(); + } + + retText += juceFormats.toRawUTF8(); + } + } + + return retText; +} + // ------------------------------------------------------------------------------------------------------------------- void carla_set_process_name(const char* name) @@ -825,3 +828,4 @@ const char* carla_get_library_folder() #include "CarlaPipeUtils.cpp" // ------------------------------------------------------------------------------------------------------------------- +#endif // CARLA_UTILS_CACHED_PLUGINS_ONLY diff --git a/source/discovery/carla-discovery.cpp b/source/discovery/carla-discovery.cpp index cb6f6c7a5..98aad3782 100644 --- a/source/discovery/carla-discovery.cpp +++ b/source/discovery/carla-discovery.cpp @@ -37,6 +37,7 @@ #include "CarlaVstUtils.hpp" // need to include this before linuxsampler +#define CARLA_UTILS_CACHED_PLUGINS_ONLY #include "CarlaUtils.cpp" #ifdef HAVE_FLUIDSYNTH