| @@ -169,10 +169,6 @@ AudioDeviceManager& getSharedAudioDeviceManager (int numInputChannels, int numOu | |||||
| } | } | ||||
| //============================================================================== | //============================================================================== | ||||
| // need to split this into two files otherwise VS will fall over | |||||
| void registerDemos_One() noexcept; | |||||
| void registerDemos_Two() noexcept; | |||||
| void registerAllDemos() noexcept | void registerAllDemos() noexcept | ||||
| { | { | ||||
| registerDemos_One(); | registerDemos_One(); | ||||
| @@ -57,6 +57,9 @@ struct JUCEDemos | |||||
| static File findExamplesDirectoryFromExecutable (File exec); | static File findExamplesDirectoryFromExecutable (File exec); | ||||
| }; | }; | ||||
| void registerDemos_One() noexcept; | |||||
| void registerDemos_Two() noexcept; | |||||
| //============================================================================== | //============================================================================== | ||||
| // used by child-process demo | // used by child-process demo | ||||
| bool invokeChildProcessDemo (const String& commandLine); | bool invokeChildProcessDemo (const String& commandLine); | ||||
| @@ -78,7 +78,7 @@ namespace build_tools | |||||
| } | } | ||||
| } // namespace mac | } // namespace mac | ||||
| void writeMacIcon (const Icons& icons, OutputStream& out) | |||||
| static void writeMacIcon (const Icons& icons, OutputStream& out) | |||||
| { | { | ||||
| MemoryOutputStream data; | MemoryOutputStream data; | ||||
| auto smallest = std::numeric_limits<int>::max(); | auto smallest = std::numeric_limits<int>::max(); | ||||
| @@ -269,7 +269,7 @@ namespace build_tools | |||||
| } | } | ||||
| } // namespace win | } // namespace win | ||||
| void writeWinIcon (const Icons& icons, OutputStream& os) | |||||
| static void writeWinIcon (const Icons& icons, OutputStream& os) | |||||
| { | { | ||||
| Array<Image> images; | Array<Image> images; | ||||
| int sizes[] = { 16, 32, 48, 256 }; | int sizes[] = { 16, 32, 48, 256 }; | ||||
| @@ -1452,7 +1452,7 @@ void ProjucerApplication::initCommandManager() | |||||
| registerGUIEditorCommands(); | registerGUIEditorCommands(); | ||||
| } | } | ||||
| void rescanModules (AvailableModulesList& list, const Array<File>& paths, bool async) | |||||
| static void rescanModules (AvailableModulesList& list, const Array<File>& paths, bool async) | |||||
| { | { | ||||
| if (async) | if (async) | ||||
| list.scanPathsAsync (paths); | list.scanPathsAsync (paths); | ||||
| @@ -1556,13 +1556,13 @@ void ProjucerApplication::setEditorColourScheme (int index, bool saveSetting) | |||||
| getCommandManager().commandStatusChanged(); | getCommandManager().commandStatusChanged(); | ||||
| } | } | ||||
| bool isEditorColourSchemeADefaultScheme (const StringArray& schemes, int editorColourSchemeIndex) | |||||
| static bool isEditorColourSchemeADefaultScheme (const StringArray& schemes, int editorColourSchemeIndex) | |||||
| { | { | ||||
| auto& schemeName = schemes[editorColourSchemeIndex]; | auto& schemeName = schemes[editorColourSchemeIndex]; | ||||
| return (schemeName == "Default (Dark)" || schemeName == "Default (Light)"); | return (schemeName == "Default (Dark)" || schemeName == "Default (Light)"); | ||||
| } | } | ||||
| int getEditorColourSchemeForGUIColourScheme (const StringArray& schemes, int guiColourSchemeIndex) | |||||
| static int getEditorColourSchemeForGUIColourScheme (const StringArray& schemes, int guiColourSchemeIndex) | |||||
| { | { | ||||
| auto defaultDarkEditorIndex = schemes.indexOf ("Default (Dark)"); | auto defaultDarkEditorIndex = schemes.indexOf ("Default (Dark)"); | ||||
| auto defaultLightEditorIndex = schemes.indexOf ("Default (Light)"); | auto defaultLightEditorIndex = schemes.indexOf ("Default (Light)"); | ||||
| @@ -499,7 +499,7 @@ private: | |||||
| std::function<void()> completionCallback; | std::function<void()> completionCallback; | ||||
| }; | }; | ||||
| void restartProcess (const File& targetFolder) | |||||
| static void restartProcess (const File& targetFolder) | |||||
| { | { | ||||
| #if JUCE_MAC || JUCE_LINUX | #if JUCE_MAC || JUCE_LINUX | ||||
| #if JUCE_MAC | #if JUCE_MAC | ||||
| @@ -1217,6 +1217,7 @@ Image JucerDocumentEditor::createComponentLayerSnapshot() const | |||||
| const int gridSnapMenuItemBase = 0x8723620; | const int gridSnapMenuItemBase = 0x8723620; | ||||
| const int snapSizes[] = { 2, 3, 4, 5, 6, 8, 10, 12, 16, 20, 24, 32 }; | const int snapSizes[] = { 2, 3, 4, 5, 6, 8, 10, 12, 16, 20, 24, 32 }; | ||||
| PopupMenu createGUIEditorMenu(); | |||||
| PopupMenu createGUIEditorMenu() | PopupMenu createGUIEditorMenu() | ||||
| { | { | ||||
| PopupMenu menu; | PopupMenu menu; | ||||
| @@ -1293,6 +1294,7 @@ PopupMenu createGUIEditorMenu() | |||||
| menu.addSubMenu ("Component Overlay", overlays, holder != nullptr); | menu.addSubMenu ("Component Overlay", overlays, holder != nullptr); | ||||
| } | } | ||||
| return menu; | return menu; | ||||
| } | } | ||||
| @@ -366,7 +366,7 @@ bool isJUCEModulesFolder (const File& f) | |||||
| } | } | ||||
| //============================================================================== | //============================================================================== | ||||
| bool isDivider (const String& line) | |||||
| static bool isDivider (const String& line) | |||||
| { | { | ||||
| auto afterIndent = line.trim(); | auto afterIndent = line.trim(); | ||||
| @@ -385,7 +385,7 @@ bool isDivider (const String& line) | |||||
| return false; | return false; | ||||
| } | } | ||||
| int getIndexOfCommentBlockStart (const StringArray& lines, int endIndex) | |||||
| static int getIndexOfCommentBlockStart (const StringArray& lines, int endIndex) | |||||
| { | { | ||||
| auto endLine = lines[endIndex]; | auto endLine = lines[endIndex]; | ||||
| @@ -431,7 +431,7 @@ int findBestLineToScrollToForClass (StringArray lines, const String& className, | |||||
| } | } | ||||
| //============================================================================== | //============================================================================== | ||||
| var parseJUCEHeaderMetadata (const StringArray& lines) | |||||
| static var parseJUCEHeaderMetadata (const StringArray& lines) | |||||
| { | { | ||||
| auto* o = new DynamicObject(); | auto* o = new DynamicObject(); | ||||
| var result (o); | var result (o); | ||||
| @@ -454,7 +454,7 @@ var parseJUCEHeaderMetadata (const StringArray& lines) | |||||
| return result; | return result; | ||||
| } | } | ||||
| String parseMetadataItem (const StringArray& lines, int& index) | |||||
| static String parseMetadataItem (const StringArray& lines, int& index) | |||||
| { | { | ||||
| String result = lines[index++]; | String result = lines[index++]; | ||||
| @@ -47,7 +47,8 @@ namespace OggVorbisNamespace | |||||
| "-Wsign-conversion", | "-Wsign-conversion", | ||||
| "-Wswitch-default", | "-Wswitch-default", | ||||
| "-Wredundant-decls", | "-Wredundant-decls", | ||||
| "-Wmisleading-indentation") | |||||
| "-Wmisleading-indentation", | |||||
| "-Wmissing-prototypes") | |||||
| #include "oggvorbis/vorbisenc.h" | #include "oggvorbis/vorbisenc.h" | ||||
| #include "oggvorbis/codec.h" | #include "oggvorbis/codec.h" | ||||
| @@ -2975,6 +2975,7 @@ JUCE_END_IGNORE_WARNINGS_MSVC | |||||
| JUCE_END_IGNORE_WARNINGS_GCC_LIKE | JUCE_END_IGNORE_WARNINGS_GCC_LIKE | ||||
| //============================================================================== | //============================================================================== | ||||
| bool initModule(); | |||||
| bool initModule() | bool initModule() | ||||
| { | { | ||||
| #if JUCE_MAC | #if JUCE_MAC | ||||
| @@ -2984,6 +2985,7 @@ bool initModule() | |||||
| return true; | return true; | ||||
| } | } | ||||
| bool shutdownModule(); | |||||
| bool shutdownModule() | bool shutdownModule() | ||||
| { | { | ||||
| return true; | return true; | ||||
| @@ -2992,17 +2994,19 @@ bool shutdownModule() | |||||
| #undef JUCE_EXPORTED_FUNCTION | #undef JUCE_EXPORTED_FUNCTION | ||||
| #if JUCE_WINDOWS | #if JUCE_WINDOWS | ||||
| extern "C" __declspec (dllexport) bool InitDll() { return initModule(); } | |||||
| extern "C" __declspec (dllexport) bool ExitDll() { return shutdownModule(); } | |||||
| #define JUCE_EXPORTED_FUNCTION | #define JUCE_EXPORTED_FUNCTION | ||||
| #else | #else | ||||
| #define JUCE_EXPORTED_FUNCTION extern "C" __attribute__ ((visibility ("default"))) | |||||
| #define JUCE_EXPORTED_FUNCTION extern "C" __attribute__ ((visibility("default"))) | |||||
| #endif | #endif | ||||
| #if JUCE_LINUX | |||||
| #if JUCE_WINDOWS | |||||
| extern "C" __declspec (dllexport) bool InitDll() { return initModule(); } | |||||
| extern "C" __declspec (dllexport) bool ExitDll() { return shutdownModule(); } | |||||
| #elif JUCE_LINUX | |||||
| void* moduleHandle = nullptr; | void* moduleHandle = nullptr; | ||||
| int moduleEntryCounter = 0; | int moduleEntryCounter = 0; | ||||
| JUCE_EXPORTED_FUNCTION bool ModuleEntry (void* sharedLibraryHandle); | |||||
| JUCE_EXPORTED_FUNCTION bool ModuleEntry (void* sharedLibraryHandle) | JUCE_EXPORTED_FUNCTION bool ModuleEntry (void* sharedLibraryHandle) | ||||
| { | { | ||||
| if (++moduleEntryCounter == 1) | if (++moduleEntryCounter == 1) | ||||
| @@ -3014,6 +3018,7 @@ bool shutdownModule() | |||||
| return true; | return true; | ||||
| } | } | ||||
| JUCE_EXPORTED_FUNCTION bool ModuleExit(); | |||||
| JUCE_EXPORTED_FUNCTION bool ModuleExit() | JUCE_EXPORTED_FUNCTION bool ModuleExit() | ||||
| { | { | ||||
| if (--moduleEntryCounter == 0) | if (--moduleEntryCounter == 0) | ||||
| @@ -3033,6 +3038,7 @@ bool shutdownModule() | |||||
| char modulePath[MaxPathLength] = { 0 }; | char modulePath[MaxPathLength] = { 0 }; | ||||
| void* moduleHandle = nullptr; | void* moduleHandle = nullptr; | ||||
| JUCE_EXPORTED_FUNCTION bool bundleEntry (CFBundleRef ref); | |||||
| JUCE_EXPORTED_FUNCTION bool bundleEntry (CFBundleRef ref) | JUCE_EXPORTED_FUNCTION bool bundleEntry (CFBundleRef ref) | ||||
| { | { | ||||
| if (ref != nullptr) | if (ref != nullptr) | ||||
| @@ -3056,6 +3062,7 @@ bool shutdownModule() | |||||
| return initModule(); | return initModule(); | ||||
| } | } | ||||
| JUCE_EXPORTED_FUNCTION bool bundleExit(); | |||||
| JUCE_EXPORTED_FUNCTION bool bundleExit() | JUCE_EXPORTED_FUNCTION bool bundleExit() | ||||
| { | { | ||||
| if (shutdownModule()) | if (shutdownModule()) | ||||
| @@ -127,4 +127,5 @@ | |||||
| #endif | #endif | ||||
| #include "utility/juce_PluginHostType.h" | #include "utility/juce_PluginHostType.h" | ||||
| #include "utility/juce_CreatePluginFilter.h" | |||||
| #include "VST/juce_VSTCallbackHandler.h" | #include "VST/juce_VSTCallbackHandler.h" | ||||
| @@ -43,7 +43,8 @@ JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wparentheses", | |||||
| "-Wzero-as-null-pointer-constant", | "-Wzero-as-null-pointer-constant", | ||||
| "-Wnullable-to-nonnull-conversion", | "-Wnullable-to-nonnull-conversion", | ||||
| "-Wignored-qualifiers", | "-Wignored-qualifiers", | ||||
| "-Wfour-char-constants") | |||||
| "-Wfour-char-constants", | |||||
| "-Wmissing-prototypes") | |||||
| // From MacOS 10.13 and iOS 11 Apple has (sensibly!) stopped defining a whole | // From MacOS 10.13 and iOS 11 Apple has (sensibly!) stopped defining a whole | ||||
| // set of functions with rather generic names. However, we still need a couple | // set of functions with rather generic names. However, we still need a couple | ||||
| @@ -25,8 +25,6 @@ | |||||
| #pragma once | #pragma once | ||||
| #include <juce_audio_processors/juce_audio_processors.h> | |||||
| /** Somewhere in the codebase of your plugin, you need to implement this function | /** Somewhere in the codebase of your plugin, you need to implement this function | ||||
| and make it return a new instance of the filter subclass that you're building. | and make it return a new instance of the filter subclass that you're building. | ||||
| */ | */ | ||||
| @@ -74,7 +74,7 @@ namespace AudioUnitFormatHelpers | |||||
| static ThreadLocalValue<int> insideCallback; | static ThreadLocalValue<int> insideCallback; | ||||
| #endif | #endif | ||||
| String osTypeToString (OSType type) noexcept | |||||
| static String osTypeToString (OSType type) noexcept | |||||
| { | { | ||||
| const juce_wchar s[4] = { (juce_wchar) ((type >> 24) & 0xff), | const juce_wchar s[4] = { (juce_wchar) ((type >> 24) & 0xff), | ||||
| (juce_wchar) ((type >> 16) & 0xff), | (juce_wchar) ((type >> 16) & 0xff), | ||||
| @@ -83,7 +83,7 @@ namespace AudioUnitFormatHelpers | |||||
| return String (s, 4); | return String (s, 4); | ||||
| } | } | ||||
| OSType stringToOSType (String s) | |||||
| static OSType stringToOSType (String s) | |||||
| { | { | ||||
| if (s.trim().length() >= 4) // (to avoid trimming leading spaces) | if (s.trim().length() >= 4) // (to avoid trimming leading spaces) | ||||
| s = s.trim(); | s = s.trim(); | ||||
| @@ -98,7 +98,7 @@ namespace AudioUnitFormatHelpers | |||||
| static const char* auIdentifierPrefix = "AudioUnit:"; | static const char* auIdentifierPrefix = "AudioUnit:"; | ||||
| String createPluginIdentifier (const AudioComponentDescription& desc) | |||||
| static String createPluginIdentifier (const AudioComponentDescription& desc) | |||||
| { | { | ||||
| String s (auIdentifierPrefix); | String s (auIdentifierPrefix); | ||||
| @@ -123,7 +123,7 @@ namespace AudioUnitFormatHelpers | |||||
| return s; | return s; | ||||
| } | } | ||||
| void getNameAndManufacturer (AudioComponent comp, String& name, String& manufacturer) | |||||
| static void getNameAndManufacturer (AudioComponent comp, String& name, String& manufacturer) | |||||
| { | { | ||||
| CFStringRef cfName; | CFStringRef cfName; | ||||
| if (AudioComponentCopyName (comp, &cfName) == noErr) | if (AudioComponentCopyName (comp, &cfName) == noErr) | ||||
| @@ -142,8 +142,8 @@ namespace AudioUnitFormatHelpers | |||||
| name = "<Unknown>"; | name = "<Unknown>"; | ||||
| } | } | ||||
| bool getComponentDescFromIdentifier (const String& fileOrIdentifier, AudioComponentDescription& desc, | |||||
| String& name, String& version, String& manufacturer) | |||||
| static bool getComponentDescFromIdentifier (const String& fileOrIdentifier, AudioComponentDescription& desc, | |||||
| String& name, String& version, String& manufacturer) | |||||
| { | { | ||||
| if (fileOrIdentifier.startsWithIgnoreCase (auIdentifierPrefix)) | if (fileOrIdentifier.startsWithIgnoreCase (auIdentifierPrefix)) | ||||
| { | { | ||||
| @@ -188,8 +188,8 @@ namespace AudioUnitFormatHelpers | |||||
| return false; | return false; | ||||
| } | } | ||||
| bool getComponentDescFromFile (const String& fileOrIdentifier, AudioComponentDescription& desc, | |||||
| String& name, String& version, String& manufacturer) | |||||
| static bool getComponentDescFromFile (const String& fileOrIdentifier, AudioComponentDescription& desc, | |||||
| String& name, String& version, String& manufacturer) | |||||
| { | { | ||||
| zerostruct (desc); | zerostruct (desc); | ||||
| @@ -291,7 +291,7 @@ namespace AudioUnitFormatHelpers | |||||
| #endif | #endif | ||||
| } | } | ||||
| const char* getCategory (OSType type) noexcept | |||||
| static const char* getCategory (OSType type) noexcept | |||||
| { | { | ||||
| switch (type) | switch (type) | ||||
| { | { | ||||
| @@ -55,7 +55,8 @@ JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wnon-virtual-dtor", | |||||
| "-Wformat", | "-Wformat", | ||||
| "-Wpedantic", | "-Wpedantic", | ||||
| "-Wextra", | "-Wextra", | ||||
| "-Wclass-memaccess") | |||||
| "-Wclass-memaccess", | |||||
| "-Wmissing-prototypes") | |||||
| #undef DEVELOPMENT | #undef DEVELOPMENT | ||||
| #define DEVELOPMENT 0 // This avoids a Clang warning in Steinberg code about unused values | #define DEVELOPMENT 0 // This avoids a Clang warning in Steinberg code about unused values | ||||
| @@ -87,14 +87,14 @@ namespace ArrayBaseTestsHelpers | |||||
| }; | }; | ||||
| } | } | ||||
| bool operator== (const ArrayBaseTestsHelpers::TriviallyCopyableType& tct, | |||||
| const ArrayBaseTestsHelpers::NonTriviallyCopyableType& ntct) | |||||
| static bool operator== (const ArrayBaseTestsHelpers::TriviallyCopyableType& tct, | |||||
| const ArrayBaseTestsHelpers::NonTriviallyCopyableType& ntct) | |||||
| { | { | ||||
| return tct.getValue() == ntct.getValue(); | return tct.getValue() == ntct.getValue(); | ||||
| } | } | ||||
| bool operator== (const ArrayBaseTestsHelpers::NonTriviallyCopyableType& ntct, | |||||
| const ArrayBaseTestsHelpers::TriviallyCopyableType& tct) | |||||
| static bool operator== (const ArrayBaseTestsHelpers::NonTriviallyCopyableType& ntct, | |||||
| const ArrayBaseTestsHelpers::TriviallyCopyableType& tct) | |||||
| { | { | ||||
| return tct == ntct; | return tct == ntct; | ||||
| } | } | ||||
| @@ -42,7 +42,7 @@ public: | |||||
| } | } | ||||
| }; | }; | ||||
| void updateButtonTickColour (ToggleButton* button, bool usingDefault) | |||||
| static void updateButtonTickColour (ToggleButton* button, bool usingDefault) | |||||
| { | { | ||||
| button->setColour (ToggleButton::tickColourId, button->getLookAndFeel().findColour (ToggleButton::tickColourId) | button->setColour (ToggleButton::tickColourId, button->getLookAndFeel().findColour (ToggleButton::tickColourId) | ||||
| .withAlpha (usingDefault ? 0.4f : 1.0f)); | .withAlpha (usingDefault ? 0.4f : 1.0f)); | ||||
| @@ -36,7 +36,7 @@ namespace juce | |||||
| #endif | #endif | ||||
| NSMutableURLRequest* getRequestForURL (const String& url, const StringArray* headers, const MemoryBlock* postData) | |||||
| static NSMutableURLRequest* getRequestForURL (const String& url, const StringArray* headers, const MemoryBlock* postData) | |||||
| { | { | ||||
| NSString* urlString = juceStringToNS (url); | NSString* urlString = juceStringToNS (url); | ||||