diff --git a/modules/juce_audio_formats/format/juce_AudioFormatManager.cpp b/modules/juce_audio_formats/format/juce_AudioFormatManager.cpp index 847bfc5a10..a4bda4c4a1 100644 --- a/modules/juce_audio_formats/format/juce_AudioFormatManager.cpp +++ b/modules/juce_audio_formats/format/juce_AudioFormatManager.cpp @@ -71,7 +71,7 @@ void AudioFormatManager::registerBasicFormats() #if JUCE_MAC || JUCE_IOS registerFormat (new CoreAudioFormat(), false); - #elif JUCE_WINDOWS + #elif JUCE_USE_WINDOWS_MEDIA_FORMAT registerFormat (new WindowsMediaAudioFormat(), false); #elif JUCE_USE_MP3AUDIOFORMAT // The software MP3 decoder is only used as a default format if diff --git a/modules/juce_audio_formats/juce_audio_formats.cpp b/modules/juce_audio_formats/juce_audio_formats.cpp index ebfbef1560..a35978173f 100644 --- a/modules/juce_audio_formats/juce_audio_formats.cpp +++ b/modules/juce_audio_formats/juce_audio_formats.cpp @@ -80,7 +80,9 @@ #endif #endif - #include + #if JUCE_USE_WINDOWS_MEDIA_FORMAT + #include + #endif #endif //============================================================================== diff --git a/modules/juce_audio_formats/juce_audio_formats.h b/modules/juce_audio_formats/juce_audio_formats.h index 835c855b98..e591be2a62 100644 --- a/modules/juce_audio_formats/juce_audio_formats.h +++ b/modules/juce_audio_formats/juce_audio_formats.h @@ -63,6 +63,18 @@ #define JUCE_USE_MP3AUDIOFORMAT 0 #endif +/** Config: JUCE_USE_WINDOWS_MEDIA_FORMAT + Enables the Windows Media SDK codecs. +*/ +#ifndef JUCE_USE_WINDOWS_MEDIA_FORMAT + #define JUCE_USE_WINDOWS_MEDIA_FORMAT 1 +#endif + +#if ! JUCE_MSVC + #undef JUCE_USE_WINDOWS_MEDIA_FORMAT + #define JUCE_USE_WINDOWS_MEDIA_FORMAT 0 +#endif + //============================================================================= namespace juce { diff --git a/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.h b/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.h index ea64365b55..fd39979054 100644 --- a/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.h +++ b/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.h @@ -85,8 +85,7 @@ public: NamedValueSet properties; //============================================================================== - /** A convenient typedef for referring to a pointer to a node object. - */ + /** A convenient typedef for referring to a pointer to a node object. */ typedef ReferenceCountedObjectPtr Ptr; private: @@ -96,9 +95,9 @@ public: const ScopedPointer processor; bool isPrepared; - Node (uint32 nodeId, AudioProcessor* processor) noexcept; + Node (uint32 nodeId, AudioProcessor*) noexcept; - void prepare (double sampleRate, int blockSize, AudioProcessorGraph* graph); + void prepare (double sampleRate, int blockSize, AudioProcessorGraph*); void unprepare(); JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Node); @@ -161,15 +160,13 @@ public: int getNumNodes() const { return nodes.size(); } /** Returns a pointer to one of the nodes in the graph. - - This will return 0 if the index is out of range. + This will return nullptr if the index is out of range. @see getNodeForId */ Node* getNode (const int index) const { return nodes [index]; } /** Searches the graph for a node with the given ID number and returns it. - - If no such node was found, this returns 0. + If no such node was found, this returns nullptr. @see getNode */ Node* getNodeForId (const uint32 nodeId) const; @@ -202,7 +199,7 @@ public: /** Searches for a connection between some specified channels. - If no such connection is found, this returns 0. + If no such connection is found, this returns nullptr. */ const Connection* getConnectionBetween (uint32 sourceNodeId, int sourceChannelIndex, @@ -307,7 +304,7 @@ public: /** Returns the mode of this processor. */ IODeviceType getType() const { return type; } - /** Returns the parent graph to which this processor belongs, or 0 if it + /** Returns the parent graph to which this processor belongs, or nullptr if it hasn't yet been added to one. */ AudioProcessorGraph* getParentGraph() const { return graph; } @@ -321,11 +318,11 @@ public: ~AudioGraphIOProcessor(); const String getName() const; - void fillInPluginDescription (PluginDescription& d) const; + void fillInPluginDescription (PluginDescription&) const; void prepareToPlay (double sampleRate, int estimatedSamplesPerBlock); void releaseResources(); - void processBlock (AudioSampleBuffer& buffer, MidiBuffer& midiMessages); + void processBlock (AudioSampleBuffer&, MidiBuffer&); const String getInputChannelName (int channelIndex) const; const String getOutputChannelName (int channelIndex) const; @@ -353,7 +350,7 @@ public: void setStateInformation (const void* data, int sizeInBytes); /** @internal */ - void setParentGraph (AudioProcessorGraph* graph); + void setParentGraph (AudioProcessorGraph*); private: const IODeviceType type; @@ -369,7 +366,7 @@ public: void prepareToPlay (double sampleRate, int estimatedSamplesPerBlock); void releaseResources(); - void processBlock (AudioSampleBuffer& buffer, MidiBuffer& midiMessages); + void processBlock (AudioSampleBuffer&, MidiBuffer&); const String getInputChannelName (int channelIndex) const; const String getOutputChannelName (int channelIndex) const; diff --git a/modules/juce_core/juce_core.cpp b/modules/juce_core/juce_core.cpp index a57fdadf4f..272404ebd2 100644 --- a/modules/juce_core/juce_core.cpp +++ b/modules/juce_core/juce_core.cpp @@ -54,7 +54,7 @@ #include #if JUCE_MINGW - #include + #include #endif #else diff --git a/modules/juce_core/logging/juce_Logger.cpp b/modules/juce_core/logging/juce_Logger.cpp index e848f44c51..56d6e17e3c 100644 --- a/modules/juce_core/logging/juce_Logger.cpp +++ b/modules/juce_core/logging/juce_Logger.cpp @@ -54,7 +54,7 @@ void Logger::writeToLog (const String& message) } #if JUCE_LOG_ASSERTIONS -void JUCE_API juce_LogAssertion (const char* filename, const int lineNum) noexcept +void JUCE_API logAssertion (const char* filename, const int lineNum) noexcept { String m ("JUCE Assertion failure in "); m << filename << ", line " << lineNum; diff --git a/modules/juce_core/native/juce_BasicNativeHeaders.h b/modules/juce_core/native/juce_BasicNativeHeaders.h index 70a5de7607..40ef0b180f 100644 --- a/modules/juce_core/native/juce_BasicNativeHeaders.h +++ b/modules/juce_core/native/juce_BasicNativeHeaders.h @@ -102,7 +102,9 @@ #include #include - #if ! JUCE_MINGW + #if JUCE_MINGW + #include + #else #include #include #endif diff --git a/modules/juce_core/native/juce_win32_Files.cpp b/modules/juce_core/native/juce_win32_Files.cpp index 6dab87dcd4..a14af1fe19 100644 --- a/modules/juce_core/native/juce_win32_Files.cpp +++ b/modules/juce_core/native/juce_win32_Files.cpp @@ -704,16 +704,20 @@ bool Process::openDocument (const String& fileName, const String& parameters) void File::revealToUser() const { - #pragma warning (push) - #pragma warning (disable: 4090) // (alignment warning) + #if JUCE_MINGW + jassertfalse; // not supported in MinGW.. + #else + #pragma warning (push) + #pragma warning (disable: 4090) // (alignment warning) ITEMIDLIST* const itemIDList = ILCreateFromPath (fullPath.toWideCharPointer()); - #pragma warning (pop) + #pragma warning (pop) if (itemIDList != nullptr) { SHOpenFolderAndSelectItems (itemIDList, 0, nullptr, 0); ILFree (itemIDList); } + #endif } //============================================================================== diff --git a/modules/juce_core/system/juce_PlatformDefs.h b/modules/juce_core/system/juce_PlatformDefs.h index 144685842b..c96fd15106 100644 --- a/modules/juce_core/system/juce_PlatformDefs.h +++ b/modules/juce_core/system/juce_PlatformDefs.h @@ -52,7 +52,7 @@ // Debugging and assertion macros #if JUCE_LOG_ASSERTIONS - #define juce_LogCurrentAssertion juce_LogAssertion (__FILE__, __LINE__); + #define juce_LogCurrentAssertion juce::logAssertion (__FILE__, __LINE__); #elif JUCE_DEBUG #define juce_LogCurrentAssertion std::cerr << "JUCE Assertion failure in " << __FILE__ << ", line " << __LINE__ << std::endl; #else diff --git a/modules/juce_core/system/juce_StandardHeader.h b/modules/juce_core/system/juce_StandardHeader.h index 6ba3851240..ff82c89483 100644 --- a/modules/juce_core/system/juce_StandardHeader.h +++ b/modules/juce_core/system/juce_StandardHeader.h @@ -154,7 +154,7 @@ BEGIN_JUCE_NAMESPACE extern JUCE_API bool JUCE_CALLTYPE juce_isRunningUnderDebugger(); #if JUCE_LOG_ASSERTIONS - extern JUCE_API void juce_LogAssertion (const char* filename, int lineNum) noexcept; + extern JUCE_API void logAssertion (const char* filename, int lineNum) noexcept; #endif #include "../memory/juce_Memory.h" diff --git a/modules/juce_gui_basics/native/juce_win32_Windowing.cpp b/modules/juce_gui_basics/native/juce_win32_Windowing.cpp index 46bfb14a0c..f76c36da77 100644 --- a/modules/juce_gui_basics/native/juce_win32_Windowing.cpp +++ b/modules/juce_gui_basics/native/juce_win32_Windowing.cpp @@ -27,14 +27,19 @@ // these are in the windows SDK, but need to be repeated here for GCC.. #ifndef GET_APPCOMMAND_LPARAM - #define FAPPCOMMAND_MASK 0xF000 #define GET_APPCOMMAND_LPARAM(lParam) ((short) (HIWORD (lParam) & ~FAPPCOMMAND_MASK)) + + #define FAPPCOMMAND_MASK 0xF000 #define APPCOMMAND_MEDIA_NEXTTRACK 11 #define APPCOMMAND_MEDIA_PREVIOUSTRACK 12 #define APPCOMMAND_MEDIA_STOP 13 #define APPCOMMAND_MEDIA_PLAY_PAUSE 14 #endif +#ifndef WM_APPCOMMAND + #define WM_APPCOMMAND 0x0319 +#endif + extern void juce_repeatLastProcessPriority(); extern void juce_CheckCurrentlyFocusedTopLevelWindow(); // in juce_TopLevelWindow.cpp extern bool juce_IsRunningInWine(); @@ -44,21 +49,22 @@ extern CheckEventBlockedByModalComps isEventBlockedByModalComps; static bool shouldDeactivateTitleBar = true; +void* getUser32Function (const char* functionName) // (NB: this function also used from other modules) +{ + HMODULE user32Mod = GetModuleHandleA ("user32.dll"); + jassert (user32Mod != 0); + + return static_cast (GetProcAddress (user32Mod, functionName)); +} + //============================================================================== typedef BOOL (WINAPI* UpdateLayeredWinFunc) (HWND, HDC, POINT*, SIZE*, HDC, POINT*, COLORREF, BLENDFUNCTION*, DWORD); static UpdateLayeredWinFunc updateLayeredWindow = nullptr; bool Desktop::canUseSemiTransparentWindows() noexcept { - if (updateLayeredWindow == 0) - { - if (! juce_IsRunningInWine()) - { - HMODULE user32Mod = GetModuleHandle (_T("user32.dll")); - jassert (user32Mod != 0); - updateLayeredWindow = (UpdateLayeredWinFunc) GetProcAddress (user32Mod, "UpdateLayeredWindow"); - } - } + if (updateLayeredWindow == nullptr && ! juce_IsRunningInWine()) + updateLayeredWindow = (UpdateLayeredWinFunc) getUser32Function ("UpdateLayeredWindow"); return updateLayeredWindow != 0; } @@ -103,12 +109,9 @@ static bool canUseMultiTouch() { hasCheckedForMultiTouch = true; - HMODULE user32Mod = GetModuleHandle (_T("user32.dll")); - jassert (user32Mod != 0); - - registerTouchWindow = (RegisterTouchWindowFunc) GetProcAddress (user32Mod, "RegisterTouchWindow"); - getTouchInputInfo = (GetTouchInputInfoFunc) GetProcAddress (user32Mod, "GetTouchInputInfo"); - closeTouchInputHandle = (CloseTouchInputHandleFunc) GetProcAddress (user32Mod, "CloseTouchInputHandle"); + registerTouchWindow = (RegisterTouchWindowFunc) getUser32Function ("RegisterTouchWindow"); + getTouchInputInfo = (GetTouchInputInfoFunc) getUser32Function ("GetTouchInputInfo"); + closeTouchInputHandle = (CloseTouchInputHandleFunc) getUser32Function ("CloseTouchInputHandle"); } return registerTouchWindow != nullptr; diff --git a/modules/juce_gui_extra/native/juce_win32_ActiveXComponent.cpp b/modules/juce_gui_extra/native/juce_win32_ActiveXComponent.cpp index ec10ec5946..db567e756f 100644 --- a/modules/juce_gui_extra/native/juce_win32_ActiveXComponent.cpp +++ b/modules/juce_gui_extra/native/juce_win32_ActiveXComponent.cpp @@ -99,7 +99,7 @@ namespace ActiveXHelpers If you don't call AddRef then others crash (e.g. QuickTime).. Bit of a catch-22, so letting it leak is probably preferable. */ if (lplpFrame != nullptr) { frame->AddRef(); *lplpFrame = frame; } - if (lplpDoc != nullptr) *lplpDoc = 0; + if (lplpDoc != nullptr) *lplpDoc = nullptr; lpFrameInfo->fMDIApp = FALSE; lpFrameInfo->hwndFrame = window; lpFrameInfo->haccel = 0; @@ -146,7 +146,7 @@ namespace ActiveXHelpers JUCE_COMRESULT SaveObject() { return E_NOTIMPL; } JUCE_COMRESULT GetMoniker (DWORD, DWORD, IMoniker**) { return E_NOTIMPL; } - JUCE_COMRESULT GetContainer (LPOLECONTAINER* ppContainer) { *ppContainer = 0; return E_NOINTERFACE; } + JUCE_COMRESULT GetContainer (LPOLECONTAINER* ppContainer) { *ppContainer = nullptr; return E_NOINTERFACE; } JUCE_COMRESULT ShowObject() { return S_OK; } JUCE_COMRESULT OnShowWindow (BOOL) { return E_NOTIMPL; } JUCE_COMRESULT RequestNewObjectLayout() { return E_NOTIMPL; } @@ -190,7 +190,7 @@ namespace ActiveXHelpers case WM_MBUTTONUP: case WM_RBUTTONUP: peer->handleMouseEvent (0, Point (GET_X_LPARAM (lParam) + activeXRect.left - peerRect.left, - GET_Y_LPARAM (lParam) + activeXRect.top - peerRect.top), + GET_Y_LPARAM (lParam) + activeXRect.top - peerRect.top), ModifierKeys::getCurrentModifiersRealtime(), getMouseEventTime()); break; diff --git a/modules/juce_gui_extra/native/juce_win32_SystemTrayIcon.cpp b/modules/juce_gui_extra/native/juce_win32_SystemTrayIcon.cpp index b5bbeea184..1293a6ab4c 100644 --- a/modules/juce_gui_extra/native/juce_win32_SystemTrayIcon.cpp +++ b/modules/juce_gui_extra/native/juce_win32_SystemTrayIcon.cpp @@ -23,9 +23,12 @@ ============================================================================== */ +// (these functions are from juce_win32_Windowing.cpp) +extern void* getUser32Function (const char*); + namespace IconConverters { - extern HICON createHICONFromImage (const Image& image, const BOOL isIcon, int hotspotX, int hotspotY); + extern HICON createHICONFromImage (const Image&, BOOL isIcon, int hotspotX, int hotspotY); } //============================================================================== @@ -185,14 +188,6 @@ private: const DWORD taskbarCreatedMessage; enum { WM_TRAYNOTIFY = WM_USER + 100 }; - static void* getUser32Function (const char* functionName) - { - HMODULE user32Mod = GetModuleHandle (_T("user32.dll")); - jassert (user32Mod != 0); - - return GetProcAddress (user32Mod, functionName); - } - JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Pimpl); };