| @@ -317,7 +317,6 @@ OBJECTS := \ | |||
| $(OBJDIR)/juce_win32_CameraDevice_ea35306d.o \ | |||
| $(OBJDIR)/juce_win32_Direct2DGraphicsContext_9f1b6be1.o \ | |||
| $(OBJDIR)/juce_win32_DirectSound_3462415e.o \ | |||
| $(OBJDIR)/juce_win32_DynamicLibraryLoader_2df0d241.o \ | |||
| $(OBJDIR)/juce_win32_FileChooser_18a257.o \ | |||
| $(OBJDIR)/juce_win32_Files_f3e9a2ef.o \ | |||
| $(OBJDIR)/juce_win32_Fonts_e695d7fc.o \ | |||
| @@ -1775,11 +1774,6 @@ $(OBJDIR)/juce_win32_DirectSound_3462415e.o: ../../src/native/windows/juce_win32 | |||
| @echo "Compiling juce_win32_DirectSound.cpp" | |||
| @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" | |||
| $(OBJDIR)/juce_win32_DynamicLibraryLoader_2df0d241.o: ../../src/native/windows/juce_win32_DynamicLibraryLoader.cpp | |||
| -@mkdir -p $(OBJDIR) | |||
| @echo "Compiling juce_win32_DynamicLibraryLoader.cpp" | |||
| @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" | |||
| $(OBJDIR)/juce_win32_FileChooser_18a257.o: ../../src/native/windows/juce_win32_FileChooser.cpp | |||
| -@mkdir -p $(OBJDIR) | |||
| @echo "Compiling juce_win32_FileChooser.cpp" | |||
| @@ -312,7 +312,6 @@ | |||
| 79B4C2F1C0CF592ACE8093C0 = { isa = PBXBuildFile; fileRef = 3A37CD82212075940421CE4F; }; | |||
| 88A87D28B3809665F28DC16E = { isa = PBXBuildFile; fileRef = 7F3EF672D07ECE3E13AAF267; }; | |||
| BC3C22F5350ED7433D303A04 = { isa = PBXBuildFile; fileRef = 58B70C726D186B4E770300BC; }; | |||
| 527CF9C21EB7512B2283E61C = { isa = PBXBuildFile; fileRef = 0CFD86AE0B7CBAE2ADE75C53; }; | |||
| 0B41EC4D7839F8CBCB8F9A0D = { isa = PBXBuildFile; fileRef = DCD09B6EF4A4A109DE01F152; }; | |||
| B420CD4B589C08EAFA6E3DA4 = { isa = PBXBuildFile; fileRef = 7527A5E8F4F39581159D3E5B; }; | |||
| D4A05D7CA67B6F0527C9BD81 = { isa = PBXBuildFile; fileRef = 1DBF9DAAD0690CB2CA4E9960; }; | |||
| @@ -1007,7 +1006,6 @@ | |||
| 3A37CD82212075940421CE4F = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_win32_CameraDevice.cpp; path = ../../src/native/windows/juce_win32_CameraDevice.cpp; sourceTree = SOURCE_ROOT; }; | |||
| 7F3EF672D07ECE3E13AAF267 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_win32_Direct2DGraphicsContext.cpp; path = ../../src/native/windows/juce_win32_Direct2DGraphicsContext.cpp; sourceTree = SOURCE_ROOT; }; | |||
| 58B70C726D186B4E770300BC = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_win32_DirectSound.cpp; path = ../../src/native/windows/juce_win32_DirectSound.cpp; sourceTree = SOURCE_ROOT; }; | |||
| 0CFD86AE0B7CBAE2ADE75C53 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_win32_DynamicLibraryLoader.cpp; path = ../../src/native/windows/juce_win32_DynamicLibraryLoader.cpp; sourceTree = SOURCE_ROOT; }; | |||
| BA66E265749F75DBA86EC3F1 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_win32_DynamicLibraryLoader.h; path = ../../src/native/windows/juce_win32_DynamicLibraryLoader.h; sourceTree = SOURCE_ROOT; }; | |||
| DCD09B6EF4A4A109DE01F152 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_win32_FileChooser.cpp; path = ../../src/native/windows/juce_win32_FileChooser.cpp; sourceTree = SOURCE_ROOT; }; | |||
| 7527A5E8F4F39581159D3E5B = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_win32_Files.cpp; path = ../../src/native/windows/juce_win32_Files.cpp; sourceTree = SOURCE_ROOT; }; | |||
| @@ -1835,7 +1833,6 @@ | |||
| 3A37CD82212075940421CE4F, | |||
| 7F3EF672D07ECE3E13AAF267, | |||
| 58B70C726D186B4E770300BC, | |||
| 0CFD86AE0B7CBAE2ADE75C53, | |||
| BA66E265749F75DBA86EC3F1, | |||
| DCD09B6EF4A4A109DE01F152, | |||
| 7527A5E8F4F39581159D3E5B, | |||
| @@ -2342,7 +2339,6 @@ | |||
| 79B4C2F1C0CF592ACE8093C0, | |||
| 88A87D28B3809665F28DC16E, | |||
| BC3C22F5350ED7433D303A04, | |||
| 527CF9C21EB7512B2283E61C, | |||
| 0B41EC4D7839F8CBCB8F9A0D, | |||
| B420CD4B589C08EAFA6E3DA4, | |||
| D4A05D7CA67B6F0527C9BD81, | |||
| @@ -913,7 +913,6 @@ | |||
| <File RelativePath="..\..\src\native\windows\juce_win32_CameraDevice.cpp"/> | |||
| <File RelativePath="..\..\src\native\windows\juce_win32_Direct2DGraphicsContext.cpp"/> | |||
| <File RelativePath="..\..\src\native\windows\juce_win32_DirectSound.cpp"/> | |||
| <File RelativePath="..\..\src\native\windows\juce_win32_DynamicLibraryLoader.cpp"/> | |||
| <File RelativePath="..\..\src\native\windows\juce_win32_DynamicLibraryLoader.h"/> | |||
| <File RelativePath="..\..\src\native\windows\juce_win32_FileChooser.cpp"/> | |||
| <File RelativePath="..\..\src\native\windows\juce_win32_Files.cpp"/> | |||
| @@ -913,7 +913,6 @@ | |||
| <File RelativePath="..\..\src\native\windows\juce_win32_CameraDevice.cpp"/> | |||
| <File RelativePath="..\..\src\native\windows\juce_win32_Direct2DGraphicsContext.cpp"/> | |||
| <File RelativePath="..\..\src\native\windows\juce_win32_DirectSound.cpp"/> | |||
| <File RelativePath="..\..\src\native\windows\juce_win32_DynamicLibraryLoader.cpp"/> | |||
| <File RelativePath="..\..\src\native\windows\juce_win32_DynamicLibraryLoader.h"/> | |||
| <File RelativePath="..\..\src\native\windows\juce_win32_FileChooser.cpp"/> | |||
| <File RelativePath="..\..\src\native\windows\juce_win32_Files.cpp"/> | |||
| @@ -915,7 +915,6 @@ | |||
| <File RelativePath="..\..\src\native\windows\juce_win32_CameraDevice.cpp"/> | |||
| <File RelativePath="..\..\src\native\windows\juce_win32_Direct2DGraphicsContext.cpp"/> | |||
| <File RelativePath="..\..\src\native\windows\juce_win32_DirectSound.cpp"/> | |||
| <File RelativePath="..\..\src\native\windows\juce_win32_DynamicLibraryLoader.cpp"/> | |||
| <File RelativePath="..\..\src\native\windows\juce_win32_DynamicLibraryLoader.h"/> | |||
| <File RelativePath="..\..\src\native\windows\juce_win32_FileChooser.cpp"/> | |||
| <File RelativePath="..\..\src\native\windows\juce_win32_Files.cpp"/> | |||
| @@ -400,7 +400,6 @@ | |||
| <ClCompile Include="..\..\src\native\windows\juce_win32_CameraDevice.cpp"/> | |||
| <ClCompile Include="..\..\src\native\windows\juce_win32_Direct2DGraphicsContext.cpp"/> | |||
| <ClCompile Include="..\..\src\native\windows\juce_win32_DirectSound.cpp"/> | |||
| <ClCompile Include="..\..\src\native\windows\juce_win32_DynamicLibraryLoader.cpp"/> | |||
| <ClCompile Include="..\..\src\native\windows\juce_win32_FileChooser.cpp"/> | |||
| <ClCompile Include="..\..\src\native\windows\juce_win32_Files.cpp"/> | |||
| <ClCompile Include="..\..\src\native\windows\juce_win32_Fonts.cpp"/> | |||
| @@ -1135,9 +1135,6 @@ | |||
| <ClCompile Include="..\..\src\native\windows\juce_win32_DirectSound.cpp"> | |||
| <Filter>Juce\Source\native\windows</Filter> | |||
| </ClCompile> | |||
| <ClCompile Include="..\..\src\native\windows\juce_win32_DynamicLibraryLoader.cpp"> | |||
| <Filter>Juce\Source\native\windows</Filter> | |||
| </ClCompile> | |||
| <ClCompile Include="..\..\src\native\windows\juce_win32_FileChooser.cpp"> | |||
| <Filter>Juce\Source\native\windows</Filter> | |||
| </ClCompile> | |||
| @@ -312,7 +312,6 @@ | |||
| 79B4C2F1C0CF592ACE8093C0 = { isa = PBXBuildFile; fileRef = 3A37CD82212075940421CE4F; }; | |||
| 88A87D28B3809665F28DC16E = { isa = PBXBuildFile; fileRef = 7F3EF672D07ECE3E13AAF267; }; | |||
| BC3C22F5350ED7433D303A04 = { isa = PBXBuildFile; fileRef = 58B70C726D186B4E770300BC; }; | |||
| 527CF9C21EB7512B2283E61C = { isa = PBXBuildFile; fileRef = 0CFD86AE0B7CBAE2ADE75C53; }; | |||
| 0B41EC4D7839F8CBCB8F9A0D = { isa = PBXBuildFile; fileRef = DCD09B6EF4A4A109DE01F152; }; | |||
| B420CD4B589C08EAFA6E3DA4 = { isa = PBXBuildFile; fileRef = 7527A5E8F4F39581159D3E5B; }; | |||
| D4A05D7CA67B6F0527C9BD81 = { isa = PBXBuildFile; fileRef = 1DBF9DAAD0690CB2CA4E9960; }; | |||
| @@ -1007,7 +1006,6 @@ | |||
| 3A37CD82212075940421CE4F = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_win32_CameraDevice.cpp; path = ../../src/native/windows/juce_win32_CameraDevice.cpp; sourceTree = SOURCE_ROOT; }; | |||
| 7F3EF672D07ECE3E13AAF267 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_win32_Direct2DGraphicsContext.cpp; path = ../../src/native/windows/juce_win32_Direct2DGraphicsContext.cpp; sourceTree = SOURCE_ROOT; }; | |||
| 58B70C726D186B4E770300BC = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_win32_DirectSound.cpp; path = ../../src/native/windows/juce_win32_DirectSound.cpp; sourceTree = SOURCE_ROOT; }; | |||
| 0CFD86AE0B7CBAE2ADE75C53 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_win32_DynamicLibraryLoader.cpp; path = ../../src/native/windows/juce_win32_DynamicLibraryLoader.cpp; sourceTree = SOURCE_ROOT; }; | |||
| BA66E265749F75DBA86EC3F1 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_win32_DynamicLibraryLoader.h; path = ../../src/native/windows/juce_win32_DynamicLibraryLoader.h; sourceTree = SOURCE_ROOT; }; | |||
| DCD09B6EF4A4A109DE01F152 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_win32_FileChooser.cpp; path = ../../src/native/windows/juce_win32_FileChooser.cpp; sourceTree = SOURCE_ROOT; }; | |||
| 7527A5E8F4F39581159D3E5B = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_win32_Files.cpp; path = ../../src/native/windows/juce_win32_Files.cpp; sourceTree = SOURCE_ROOT; }; | |||
| @@ -1835,7 +1833,6 @@ | |||
| 3A37CD82212075940421CE4F, | |||
| 7F3EF672D07ECE3E13AAF267, | |||
| 58B70C726D186B4E770300BC, | |||
| 0CFD86AE0B7CBAE2ADE75C53, | |||
| BA66E265749F75DBA86EC3F1, | |||
| DCD09B6EF4A4A109DE01F152, | |||
| 7527A5E8F4F39581159D3E5B, | |||
| @@ -2346,7 +2343,6 @@ | |||
| 79B4C2F1C0CF592ACE8093C0, | |||
| 88A87D28B3809665F28DC16E, | |||
| BC3C22F5350ED7433D303A04, | |||
| 527CF9C21EB7512B2283E61C, | |||
| 0B41EC4D7839F8CBCB8F9A0D, | |||
| B420CD4B589C08EAFA6E3DA4, | |||
| D4A05D7CA67B6F0527C9BD81, | |||
| @@ -1405,8 +1405,6 @@ | |||
| resource="0" file="src/native/windows/juce_win32_Direct2DGraphicsContext.cpp"/> | |||
| <FILE id="CVNbte6ov" name="juce_win32_DirectSound.cpp" compile="1" | |||
| resource="0" file="src/native/windows/juce_win32_DirectSound.cpp"/> | |||
| <FILE id="4w3jvZBLt" name="juce_win32_DynamicLibraryLoader.cpp" compile="1" | |||
| resource="0" file="src/native/windows/juce_win32_DynamicLibraryLoader.cpp"/> | |||
| <FILE id="WuS4E8Pvz" name="juce_win32_DynamicLibraryLoader.h" compile="0" | |||
| resource="0" file="src/native/windows/juce_win32_DynamicLibraryLoader.h"/> | |||
| <FILE id="bHW3fjXfz" name="juce_win32_FileChooser.cpp" compile="1" | |||
| @@ -653,11 +653,6 @@ static const unsigned char temp_794304c3[] = | |||
| "//==============================================================================\r\n" | |||
| "int main (int argc, char* argv[])\r\n" | |||
| "{\r\n" | |||
| " // This object makes sure that Juce is initialised and shut down correctly\r\n" | |||
| " // for the scope of this function call. Make sure this declaration is the\r\n" | |||
| " // first statement of this function.\r\n" | |||
| " const ScopedJuceInitialiser_NonGUI juceSystemInitialiser;\r\n" | |||
| "\r\n" | |||
| "\r\n" | |||
| " // ..your code goes here!\r\n" | |||
| "\r\n" | |||
| @@ -26,7 +26,7 @@ namespace BinaryData | |||
| const int jucer_AudioPluginFilterTemplate_hSize = 2413; | |||
| extern const char* jucer_MainConsoleAppTemplate_cpp; | |||
| const int jucer_MainConsoleAppTemplate_cppSize = 749; | |||
| const int jucer_MainConsoleAppTemplate_cppSize = 483; | |||
| extern const char* jucer_MainTemplate_cpp; | |||
| const int jucer_MainTemplate_cppSize = 1820; | |||
| @@ -14,11 +14,6 @@ APPHEADERS | |||
| //============================================================================== | |||
| int main (int argc, char* argv[]) | |||
| { | |||
| // This object makes sure that Juce is initialised and shut down correctly | |||
| // for the scope of this function call. Make sure this declaration is the | |||
| // first statement of this function. | |||
| const ScopedJuceInitialiser_NonGUI juceSystemInitialiser; | |||
| // ..your code goes here! | |||
| @@ -43,9 +43,6 @@ public: | |||
| ~ContentComp() | |||
| { | |||
| // (need to do this because the old school look-and-feel object is one of our members, | |||
| // so will be deleted with us, and would leave a dangling pointer if it's selected) | |||
| LookAndFeel::setDefaultLookAndFeel (0); | |||
| } | |||
| //============================================================================== | |||
| @@ -402,7 +399,7 @@ public: | |||
| break; | |||
| case setDefaultLookAndFeel: | |||
| LookAndFeel::setDefaultLookAndFeel (0); | |||
| LookAndFeel::setDefaultLookAndFeel (nullptr); | |||
| break; | |||
| case setOldSchoolLookAndFeel: | |||
| @@ -367,11 +367,6 @@ static void mungeJuce (const File& juceFolder) | |||
| //============================================================================== | |||
| int main (int argc, char* argv[]) | |||
| { | |||
| // This object makes sure that Juce is initialised and shut down correctly | |||
| // for the scope of this function call. Make sure this declaration is the | |||
| // first statement of this function. | |||
| const ScopedJuceInitialiser_NonGUI juceSystemInitialiser; | |||
| std::cout << "\n*** The C++ Amalgamator! Written for Juce - www.rawmaterialsoftware.com\n"; | |||
| if (argc == 4) | |||
| @@ -390,7 +385,7 @@ int main (int argc, char* argv[]) | |||
| } | |||
| else | |||
| { | |||
| std::cout << " Usage: amalgamator TemplateFile TargetFile \"FileToReplaceWildcard\"\n\n"; | |||
| std::cout << " Usage: amalgamator TemplateFile TargetFile \"FileToReplaceWildcard\"\n\n" | |||
| " amalgamator will run through a C++ file and replace any\n" | |||
| " #include statements with the contents of the file they refer to.\n" | |||
| " It'll only do this for files that are within the same parent\n" | |||
| @@ -71,11 +71,6 @@ static bool isHiddenFile (const File& f, const File& root) | |||
| //============================================================================== | |||
| int main (int argc, char* argv[]) | |||
| { | |||
| // This object makes sure that Juce is initialised and shut down correctly | |||
| // for the scope of this function call. Make sure this declaration is the | |||
| // first statement of this function. | |||
| const ScopedJuceInitialiser_NonGUI juceSystemInitialiser; | |||
| std::cout << "\n BinaryBuilder! Copyright 2007 by Julian Storer - www.rawmaterialsoftware.com\n\n"; | |||
| if (argc < 4 || argc > 5) | |||
| @@ -133,7 +133,6 @@ MainWindow::~MainWindow() | |||
| clearContentComponent(); | |||
| LookAndFeel::setDefaultLookAndFeel (0); | |||
| deleteAndZero (oldLook); | |||
| } | |||
| @@ -371,7 +370,7 @@ void MainWindow::menuItemSelected (int menuItemID, | |||
| } | |||
| else if (menuItemID == 201) | |||
| { | |||
| LookAndFeel::setDefaultLookAndFeel (0); | |||
| LookAndFeel::setDefaultLookAndFeel (nullptr); | |||
| } | |||
| else if (menuItemID >= 300 && menuItemID < 400) | |||
| { | |||
| @@ -85,7 +85,7 @@ | |||
| START_JUCE_APPLICATION (MyJUCEApp) | |||
| @endcode | |||
| @see MessageManager, DeletedAtShutdown | |||
| @see MessageManager | |||
| */ | |||
| class JUCE_API JUCEApplication : public ApplicationCommandTarget | |||
| { | |||
| @@ -220,7 +220,7 @@ public: | |||
| and maybe cancel the quit, you'll need to handle this in the systemRequestedQuit() | |||
| method - see that method's help for more info. | |||
| @see MessageManager, DeletedAtShutdown | |||
| @see MessageManager | |||
| */ | |||
| static void quit(); | |||
| @@ -96,19 +96,6 @@ public: | |||
| */ | |||
| virtual void sendMessageNow (const MidiMessage& message); | |||
| /** Sends a midi reset to the device. */ | |||
| virtual void reset(); | |||
| //============================================================================== | |||
| /** Returns the current volume setting for this device. */ | |||
| virtual bool getVolume (float& leftVol, | |||
| float& rightVol); | |||
| /** Changes the overall volume for this device. */ | |||
| virtual void setVolume (float leftVol, | |||
| float rightVol); | |||
| //============================================================================== | |||
| /** This lets you supply a block of messages that will be sent out at some point | |||
| in the future. | |||
| @@ -926,15 +926,14 @@ public: | |||
| DefineManufacturerNamesAndID (JucePlugin_Manufacturer, JucePlugin_RTASManufacturerCode); | |||
| DefinePlugInNamesAndVersion (createRTASName().toUTF8(), JucePlugin_VersionCode); | |||
| #ifndef JUCE_DEBUG | |||
| #ifndef JUCE_DEBUG | |||
| AddGestalt (pluginGestalt_IsCacheable); | |||
| #endif | |||
| #endif | |||
| } | |||
| ~JucePlugInGroup() | |||
| { | |||
| shutdownJuce_GUI(); | |||
| shutdownJuce_NonGUI(); | |||
| } | |||
| //============================================================================== | |||
| @@ -1021,7 +1020,6 @@ CProcessGroupInterface* CProcessGroup::CreateProcessGroup() | |||
| initialiseMacRTAS(); | |||
| #endif | |||
| initialiseJuce_NonGUI(); | |||
| return new JucePlugInGroup(); | |||
| } | |||
| @@ -27,43 +27,12 @@ | |||
| BEGIN_JUCE_NAMESPACE | |||
| #include "../memory/juce_Atomic.h" | |||
| #include "juce_PlatformUtilities.h" | |||
| #include "juce_SystemStats.h" | |||
| #include "../text/juce_LocalisedStrings.h" | |||
| #include "../io/streams/juce_MemoryOutputStream.h" | |||
| #include "../io/streams/juce_MemoryInputStream.h" | |||
| #include "../threads/juce_Thread.h" | |||
| #if ! JUCE_ONLY_BUILD_CORE_LIBRARY | |||
| #include "../events/juce_MessageManager.h" | |||
| #include "../gui/components/buttons/juce_TextButton.h" | |||
| #include "../gui/components/lookandfeel/juce_LookAndFeel.h" | |||
| #endif | |||
| //============================================================================== | |||
| static bool juceInitialisedNonGUI = false; | |||
| JUCE_API void JUCE_CALLTYPE initialiseJuce_NonGUI() | |||
| { | |||
| if (! juceInitialisedNonGUI) | |||
| { | |||
| juceInitialisedNonGUI = true; | |||
| DBG (SystemStats::getJUCEVersion()); | |||
| } | |||
| } | |||
| JUCE_API void JUCE_CALLTYPE shutdownJuce_NonGUI() | |||
| { | |||
| if (juceInitialisedNonGUI) | |||
| { | |||
| juceInitialisedNonGUI = false; | |||
| Thread::stopAllThreads (3000); | |||
| } | |||
| } | |||
| //============================================================================== | |||
| #if ! JUCE_ONLY_BUILD_CORE_LIBRARY | |||
| @@ -76,27 +45,7 @@ JUCE_API void JUCE_CALLTYPE initialiseJuce_GUI() | |||
| juceInitialisedGUI = true; | |||
| JUCE_AUTORELEASEPOOL | |||
| initialiseJuce_NonGUI(); | |||
| MessageManager::getInstance(); | |||
| LookAndFeel::setDefaultLookAndFeel (nullptr); | |||
| #if JUCE_DEBUG | |||
| try // This section is just a safety-net for catching builds without RTTI enabled.. | |||
| { | |||
| MemoryOutputStream mo; | |||
| OutputStream* o = &mo; | |||
| // Got an exception here? Then TURN ON RTTI in your compiler settings!! | |||
| o = dynamic_cast <MemoryOutputStream*> (o); | |||
| jassert (o != nullptr); | |||
| } | |||
| catch (...) | |||
| { | |||
| // Ended up here? If so, TURN ON RTTI in your compiler settings!! | |||
| jassertfalse; | |||
| } | |||
| #endif | |||
| } | |||
| } | |||
| @@ -108,20 +57,17 @@ JUCE_API void JUCE_CALLTYPE shutdownJuce_GUI() | |||
| JUCE_AUTORELEASEPOOL | |||
| DeletedAtShutdown::deleteAll(); | |||
| LookAndFeel::clearDefaultLookAndFeel(); | |||
| delete MessageManager::getInstance(); | |||
| shutdownJuce_NonGUI(); | |||
| } | |||
| } | |||
| #endif | |||
| //============================================================================== | |||
| #if JUCE_UNIT_TESTS | |||
| #include "../utilities/juce_UnitTest.h" | |||
| #include "../memory/juce_Atomic.h" | |||
| class AtomicTests : public UnitTest | |||
| { | |||
| @@ -37,7 +37,7 @@ | |||
| Note that if you're creating a Juce DLL for Windows, you may also need to call the | |||
| PlatformUtilities::setCurrentModuleInstanceHandle() method. | |||
| @see shutdownJuce_GUI(), initialiseJuce_NonGUI() | |||
| @see shutdownJuce_GUI() | |||
| */ | |||
| JUCE_API void JUCE_CALLTYPE initialiseJuce_GUI(); | |||
| @@ -47,60 +47,11 @@ JUCE_API void JUCE_CALLTYPE initialiseJuce_GUI(); | |||
| than using the START_JUCE_APPLICATION macro, call this function in your shutdown | |||
| code to clean up any juce objects that might be lying around. | |||
| @see initialiseJuce_GUI(), initialiseJuce_NonGUI() | |||
| @see initialiseJuce_GUI() | |||
| */ | |||
| JUCE_API void JUCE_CALLTYPE shutdownJuce_GUI(); | |||
| //============================================================================== | |||
| /** Initialises the core parts of Juce. | |||
| If you're embedding Juce into either a command-line program, call this function | |||
| at the start of your main() function to make sure that Juce is initialised correctly. | |||
| Note that if you're creating a Juce DLL for Windows, you may also need to call the | |||
| PlatformUtilities::setCurrentModuleInstanceHandle() method. | |||
| @see shutdownJuce_NonGUI, initialiseJuce_GUI | |||
| */ | |||
| JUCE_API void JUCE_CALLTYPE initialiseJuce_NonGUI(); | |||
| /** Clears up any static data being used by Juce's non-gui core classes. | |||
| If you're embedding Juce into either a command-line program, call this function | |||
| at the end of your main() function if you want to make sure any Juce objects are | |||
| cleaned up correctly. | |||
| @see initialiseJuce_NonGUI, initialiseJuce_GUI | |||
| */ | |||
| JUCE_API void JUCE_CALLTYPE shutdownJuce_NonGUI(); | |||
| //============================================================================== | |||
| /** A utility object that helps you initialise and shutdown Juce correctly | |||
| using an RAII pattern. | |||
| When an instance of this class is created, it calls initialiseJuce_NonGUI(), | |||
| and when it's deleted, it calls shutdownJuce_NonGUI(), which lets you easily | |||
| make sure that these functions are matched correctly. | |||
| This class is particularly handy to use at the beginning of a console app's | |||
| main() function, because it'll take care of shutting down whenever you return | |||
| from the main() call. | |||
| @see ScopedJuceInitialiser_GUI | |||
| */ | |||
| class ScopedJuceInitialiser_NonGUI | |||
| { | |||
| public: | |||
| /** The constructor simply calls initialiseJuce_NonGUI(). */ | |||
| ScopedJuceInitialiser_NonGUI() { initialiseJuce_NonGUI(); } | |||
| /** The destructor simply calls shutdownJuce_NonGUI(). */ | |||
| ~ScopedJuceInitialiser_NonGUI() { shutdownJuce_NonGUI(); } | |||
| }; | |||
| //============================================================================== | |||
| /** A utility object that helps you initialise and shutdown Juce correctly | |||
| using an RAII pattern. | |||
| @@ -33,7 +33,7 @@ | |||
| */ | |||
| #define JUCE_MAJOR_VERSION 1 | |||
| #define JUCE_MINOR_VERSION 53 | |||
| #define JUCE_BUILDNUMBER 79 | |||
| #define JUCE_BUILDNUMBER 80 | |||
| /** Current Juce version number. | |||
| @@ -66,6 +66,18 @@ const String SystemStats::getJUCEVersion() | |||
| #undef JUCE_STRINGIFYVERSION2 | |||
| } | |||
| #if JUCE_DEBUG | |||
| struct JuceVersionPrinter | |||
| { | |||
| JuceVersionPrinter() | |||
| { | |||
| DBG (SystemStats::getJUCEVersion()); | |||
| } | |||
| }; | |||
| static JuceVersionPrinter juceVersionPrinter; | |||
| #endif | |||
| //============================================================================== | |||
| #ifdef JUCE_DLL | |||
| void* juce_Malloc (int size) { return malloc (size); } | |||
| @@ -419,9 +419,9 @@ Component::Component (const String& name) | |||
| Component::~Component() | |||
| { | |||
| #if ! JUCE_VC6 // (access to private union not allowed in VC6) | |||
| #if ! JUCE_VC6 // (access to private union not allowed in VC6) | |||
| static_jassert (sizeof (flags) <= sizeof (componentFlags)); | |||
| #endif | |||
| #endif | |||
| componentListeners.call (&ComponentListener::componentBeingDeleted, *this); | |||
| @@ -32,6 +32,7 @@ BEGIN_JUCE_NAMESPACE | |||
| #include "mouse/juce_MouseInputSource.h" | |||
| #include "mouse/juce_MouseListener.h" | |||
| #include "mouse/juce_MouseEvent.h" | |||
| #include "lookandfeel/juce_LookAndFeel.h" | |||
| //============================================================================== | |||
| @@ -166,6 +167,33 @@ Component* Desktop::findComponentAt (const Point<int>& screenPosition) const | |||
| return nullptr; | |||
| } | |||
| //============================================================================== | |||
| LookAndFeel& Desktop::getDefaultLookAndFeel() noexcept | |||
| { | |||
| if (currentLookAndFeel == nullptr) | |||
| { | |||
| if (defaultLookAndFeel == nullptr) | |||
| defaultLookAndFeel = new LookAndFeel(); | |||
| currentLookAndFeel = defaultLookAndFeel; | |||
| } | |||
| return *currentLookAndFeel; | |||
| } | |||
| void Desktop::setDefaultLookAndFeel (LookAndFeel* newDefaultLookAndFeel) | |||
| { | |||
| currentLookAndFeel = newDefaultLookAndFeel; | |||
| for (int i = getNumComponents(); --i >= 0;) | |||
| { | |||
| Component* const c = getComponent (i); | |||
| if (c != nullptr) | |||
| c->sendLookAndFeelChange(); | |||
| } | |||
| } | |||
| //============================================================================== | |||
| void Desktop::addDesktopComponent (Component* const c) | |||
| { | |||
| @@ -246,6 +246,22 @@ public: | |||
| */ | |||
| ComponentAnimator& getAnimator() noexcept { return animator; } | |||
| //============================================================================== | |||
| /** Returns the current default look-and-feel for components which don't have one | |||
| explicitly set. | |||
| @see setDefaultLookAndFeel | |||
| */ | |||
| LookAndFeel& getDefaultLookAndFeel() noexcept; | |||
| /** Changes the default look-and-feel. | |||
| @param newDefaultLookAndFeel the new look-and-feel object to use - if this is | |||
| set to nullptr, it will revert to using the system's | |||
| default one. The object passed-in must be deleted by the | |||
| caller when it's no longer needed. | |||
| @see getDefaultLookAndFeel | |||
| */ | |||
| void setDefaultLookAndFeel (LookAndFeel* newDefaultLookAndFeel); | |||
| //============================================================================== | |||
| /** Returns the number of MouseInputSource objects the system has at its disposal. | |||
| In a traditional single-mouse system, there might be only one object. On a multi-touch | |||
| @@ -365,6 +381,9 @@ private: | |||
| ScopedPointer<Timer> dragRepeater; | |||
| ScopedPointer<LookAndFeel> defaultLookAndFeel; | |||
| WeakReference<LookAndFeel> currentLookAndFeel; | |||
| Component* kioskModeComponent; | |||
| Rectangle<int> kioskComponentOriginalBounds; | |||
| @@ -156,9 +156,6 @@ namespace LookAndFeelHelpers | |||
| return tl; | |||
| } | |||
| LookAndFeel* defaultLF = nullptr; | |||
| LookAndFeel* currentDefaultLF = nullptr; | |||
| } | |||
| //============================================================================== | |||
| @@ -313,8 +310,12 @@ LookAndFeel::LookAndFeel() | |||
| LookAndFeel::~LookAndFeel() | |||
| { | |||
| if (this == LookAndFeelHelpers::currentDefaultLF) | |||
| setDefaultLookAndFeel (nullptr); | |||
| weakReferenceMaster.clear(); | |||
| } | |||
| const WeakReference<LookAndFeel>::SharedRef& LookAndFeel::getWeakReference() | |||
| { | |||
| return weakReferenceMaster (this); | |||
| } | |||
| //============================================================================== | |||
| @@ -352,48 +353,14 @@ bool LookAndFeel::isColourSpecified (const int colourId) const noexcept | |||
| //============================================================================== | |||
| LookAndFeel& LookAndFeel::getDefaultLookAndFeel() noexcept | |||
| { | |||
| // if this happens, your app hasn't initialised itself properly.. if you're | |||
| // trying to hack your own main() function, have a look at | |||
| // JUCEApplication::initialiseForGUI() | |||
| jassert (LookAndFeelHelpers::currentDefaultLF != nullptr); | |||
| return *LookAndFeelHelpers::currentDefaultLF; | |||
| return Desktop::getInstance().getDefaultLookAndFeel(); | |||
| } | |||
| void LookAndFeel::setDefaultLookAndFeel (LookAndFeel* newDefaultLookAndFeel) noexcept | |||
| { | |||
| using namespace LookAndFeelHelpers; | |||
| if (newDefaultLookAndFeel == nullptr) | |||
| { | |||
| if (defaultLF == nullptr) | |||
| defaultLF = new LookAndFeel(); | |||
| newDefaultLookAndFeel = defaultLF; | |||
| } | |||
| LookAndFeelHelpers::currentDefaultLF = newDefaultLookAndFeel; | |||
| for (int i = Desktop::getInstance().getNumComponents(); --i >= 0;) | |||
| { | |||
| Component* const c = Desktop::getInstance().getComponent (i); | |||
| if (c != nullptr) | |||
| c->sendLookAndFeelChange(); | |||
| } | |||
| } | |||
| void LookAndFeel::clearDefaultLookAndFeel() noexcept | |||
| { | |||
| using namespace LookAndFeelHelpers; | |||
| if (currentDefaultLF == defaultLF) | |||
| currentDefaultLF = nullptr; | |||
| deleteAndZero (defaultLF); | |||
| Desktop::getInstance().setDefaultLookAndFeel (newDefaultLookAndFeel); | |||
| } | |||
| //============================================================================== | |||
| const Typeface::Ptr LookAndFeel::getTypefaceForFont (const Font& font) | |||
| { | |||
| @@ -649,8 +649,9 @@ public: | |||
| private: | |||
| //============================================================================== | |||
| friend JUCE_API void JUCE_CALLTYPE shutdownJuce_GUI(); | |||
| static void clearDefaultLookAndFeel() noexcept; // called at shutdown | |||
| friend class WeakReference<LookAndFeel>; | |||
| WeakReference<LookAndFeel>::Master weakReferenceMaster; | |||
| const WeakReference<LookAndFeel>::SharedRef& getWeakReference(); | |||
| Array <int> colourIds; | |||
| Array <Colour> colours; | |||
| @@ -249,21 +249,37 @@ void DropShadower::updateShadows() | |||
| if (shadowWindows.size() >= 4) | |||
| { | |||
| for (int i = shadowWindows.size(); --i >= 0;) | |||
| { | |||
| shadowWindows.getUnchecked(i)->setAlwaysOnTop (owner->isAlwaysOnTop()); | |||
| shadowWindows.getUnchecked(i)->setVisible (isOwnerVisible); | |||
| } | |||
| const int x = owner->getX(); | |||
| const int y = owner->getY() - shadowEdge; | |||
| const int w = owner->getWidth(); | |||
| const int h = owner->getHeight() + shadowEdge + shadowEdge; | |||
| shadowWindows.getUnchecked(0)->setBounds (x - shadowEdge, y, shadowEdge, h); | |||
| shadowWindows.getUnchecked(1)->setBounds (x + w, y, shadowEdge, h); | |||
| shadowWindows.getUnchecked(2)->setBounds (x, y, w, shadowEdge); | |||
| shadowWindows.getUnchecked(3)->setBounds (x, owner->getBottom(), w, shadowEdge); | |||
| for (int i = shadowWindows.size(); --i >= 0;) | |||
| { | |||
| // there seem to be rare situations where the dropshadower may be deleted by | |||
| // callbacks during this loop, so use a weak ref to watch out for this.. | |||
| WeakReference<Component> sw (shadowWindows[i]); | |||
| if (sw == nullptr) | |||
| return; | |||
| sw->setAlwaysOnTop (owner->isAlwaysOnTop()); | |||
| if (sw == nullptr) | |||
| return; | |||
| switch (i) | |||
| { | |||
| case 0: sw->setBounds (x - shadowEdge, y, shadowEdge, h); break; | |||
| case 1: sw->setBounds (x + w, y, shadowEdge, h); break; | |||
| case 2: sw->setBounds (x, y, w, shadowEdge); break; | |||
| case 3: sw->setBounds (x, owner->getBottom(), w, shadowEdge); break; | |||
| default: break; | |||
| } | |||
| if (sw == nullptr) | |||
| return; | |||
| } | |||
| } | |||
| } | |||
| @@ -131,8 +131,7 @@ OpenGLContext* OpenGLContext::getCurrentContext() | |||
| } | |||
| //============================================================================== | |||
| class OpenGLComponent::OpenGLComponentRenderThread : public Thread, | |||
| public AsyncUpdater | |||
| class OpenGLComponent::OpenGLComponentRenderThread : public Thread | |||
| { | |||
| public: | |||
| //============================================================================== | |||
| @@ -144,24 +143,18 @@ public: | |||
| void run() | |||
| { | |||
| // Context will get created and callback triggered on first render | |||
| while (owner.renderAndSwapBuffers() && ! threadShouldExit()) | |||
| owner.waitAfterSwapping(); | |||
| while (! threadShouldExit()) | |||
| { | |||
| const uint32 startOfRendering = Time::getMillisecondCounter(); | |||
| owner.releaseOpenGLContext(); | |||
| if (! owner.renderAndSwapBuffers()) | |||
| break; | |||
| #if JUCE_LINUX | |||
| owner.deleteContext(); | |||
| #else | |||
| owner.makeCurrentContextInactive(); | |||
| #endif | |||
| const int elapsed = Time::getMillisecondCounter() - startOfRendering; | |||
| Thread::sleep (jmax (1, 20 - elapsed)); | |||
| } | |||
| triggerAsyncUpdate(); | |||
| } | |||
| void handleAsyncUpdate() | |||
| { | |||
| owner.stopRendering(); | |||
| owner.stopRenderThread(); | |||
| } | |||
| //============================================================================== | |||
| @@ -172,9 +165,9 @@ private: | |||
| }; | |||
| //============================================================================== | |||
| class OpenGLComponent::OpenGLComponentWatcher : public ComponentMovementWatcher | |||
| class OpenGLComponent::OpenGLComponentWatcher : public ComponentMovementWatcher, | |||
| public AsyncUpdater | |||
| { | |||
| public: | |||
| //============================================================================== | |||
| @@ -201,6 +194,11 @@ public: | |||
| owner->stopRendering(); | |||
| } | |||
| void handleAsyncUpdate() | |||
| { | |||
| owner->stopRendering(); | |||
| } | |||
| //============================================================================== | |||
| private: | |||
| OpenGLComponent* const owner; | |||
| @@ -339,17 +337,17 @@ void OpenGLComponent::paint (Graphics&) | |||
| if (! renderThread->isThreadRunning()) | |||
| { | |||
| renderThread->handleUpdateNowIfNeeded(); // may still be shutting down as well | |||
| componentWatcher->handleUpdateNowIfNeeded(); // may still be shutting down as well | |||
| #if ! JUCE_LINUX | |||
| // Except for Linux, create the context etc. first | |||
| // Except for Linux, create the context first | |||
| const ScopedLock sl (contextLock); | |||
| if (makeCurrentContextActive()) // Make active just to create | |||
| makeCurrentContextInactive(); | |||
| #endif | |||
| renderThread->startThread (6); | |||
| startRenderThread(); | |||
| } | |||
| // fall-through and update the masking region | |||
| @@ -375,6 +373,28 @@ void OpenGLComponent::paint (Graphics&) | |||
| } | |||
| } | |||
| void OpenGLComponent::startRenderThread() | |||
| { | |||
| // If this is overriden, user will provide a thread. The renderThread object will | |||
| // not be used | |||
| jassert (renderThread != nullptr); | |||
| renderThread->startThread (6); | |||
| } | |||
| void OpenGLComponent::stopRenderThread() | |||
| { | |||
| releaseOpenGLContext(); | |||
| #if JUCE_LINUX | |||
| deleteContext(); | |||
| #else | |||
| makeCurrentContextInactive(); | |||
| #endif | |||
| componentWatcher->triggerAsyncUpdate(); | |||
| } | |||
| bool OpenGLComponent::renderAndSwapBuffers() | |||
| { | |||
| const ScopedLock sl (contextLock); | |||
| @@ -394,13 +414,6 @@ bool OpenGLComponent::renderAndSwapBuffers() | |||
| return true; | |||
| } | |||
| void OpenGLComponent::waitAfterSwapping() | |||
| { | |||
| jassert (renderThread != nullptr && Thread::getCurrentThread() == renderThread); | |||
| Thread::sleep (20); | |||
| } | |||
| void OpenGLComponent::stopRendering() | |||
| { | |||
| if (renderThread != nullptr) | |||
| @@ -192,10 +192,10 @@ public: | |||
| { | |||
| openGLDefault = 0, | |||
| #if JUCE_IOS | |||
| #if JUCE_IOS | |||
| openGLES1, /**< On the iPhone, this selects openGL ES 1.0 */ | |||
| openGLES2 /**< On the iPhone, this selects openGL ES 2.0 */ | |||
| #endif | |||
| #endif | |||
| }; | |||
| /** Creates an OpenGLComponent. */ | |||
| @@ -279,7 +279,8 @@ public: | |||
| /** This method is called when the component shuts down its OpenGL context. | |||
| You can use this callback to delete textures and any other OpenGL objects you | |||
| created in the component's context. | |||
| created in the component's context. Be aware: if you are using a render | |||
| thread, this may be called on the thread. | |||
| When this callback happens, the context will have been made current | |||
| using the makeCurrentContextActive() method, so there's no need to call it | |||
| @@ -342,13 +343,6 @@ public: | |||
| */ | |||
| virtual bool renderAndSwapBuffers(); | |||
| /** Wait after swapping before next render pass. | |||
| Used when rendering is running on a thread. The default is 20 millseconds, giving | |||
| a nominal frame rate of just under 50 fps. | |||
| */ | |||
| virtual void waitAfterSwapping(); | |||
| /** This returns a critical section that can be used to lock the current context. | |||
| Because the context that is used by this component can change, e.g. when the | |||
| @@ -370,6 +364,18 @@ public: | |||
| This can be called back on the same thread that created the context. */ | |||
| void deleteContext(); | |||
| protected: | |||
| /** Kicks off a thread to start rendering. | |||
| The default implementation creates and manages an internal thread that tries | |||
| to render at around 50fps, but this can be overloaded to create a custom thread. | |||
| */ | |||
| virtual void startRenderThread(); | |||
| /** Cleans up the rendering thread. | |||
| Used to shut down the thread that was started by startRenderThread(). If you've | |||
| created a custom thread, then you should overload this to clean it up and delete it. | |||
| */ | |||
| virtual void stopRenderThread(); | |||
| //============================================================================== | |||
| /** @internal */ | |||
| @@ -50,19 +50,6 @@ MidiOutput::~MidiOutput() | |||
| { | |||
| } | |||
| void MidiOutput::reset() | |||
| { | |||
| } | |||
| bool MidiOutput::getVolume (float&, float&) | |||
| { | |||
| return false; | |||
| } | |||
| void MidiOutput::setVolume (float, float) | |||
| { | |||
| } | |||
| void MidiOutput::sendMessageNow (const MidiMessage&) | |||
| { | |||
| } | |||
| @@ -256,19 +256,6 @@ MidiOutput::~MidiOutput() | |||
| delete static_cast <MidiOutputDevice*> (internal); | |||
| } | |||
| void MidiOutput::reset() | |||
| { | |||
| } | |||
| bool MidiOutput::getVolume (float& leftVol, float& rightVol) | |||
| { | |||
| return false; | |||
| } | |||
| void MidiOutput::setVolume (float leftVol, float rightVol) | |||
| { | |||
| } | |||
| void MidiOutput::sendMessageNow (const MidiMessage& message) | |||
| { | |||
| static_cast <MidiOutputDevice*> (internal)->sendMessageNow (message); | |||
| @@ -435,9 +422,6 @@ int MidiOutput::getDefaultDeviceIndex() { return 0; | |||
| MidiOutput* MidiOutput::openDevice (int) { return nullptr; } | |||
| MidiOutput* MidiOutput::createNewDevice (const String&) { return nullptr; } | |||
| MidiOutput::~MidiOutput() {} | |||
| void MidiOutput::reset() {} | |||
| bool MidiOutput::getVolume (float&, float&) { return false; } | |||
| void MidiOutput::setVolume (float, float) {} | |||
| void MidiOutput::sendMessageNow (const MidiMessage&) {} | |||
| MidiInput::MidiInput (const String& name_) : name (name_), internal (0) {} | |||
| @@ -369,19 +369,6 @@ MidiOutput::~MidiOutput() | |||
| delete static_cast<CoreMidiHelpers::MidiPortAndEndpoint*> (internal); | |||
| } | |||
| void MidiOutput::reset() | |||
| { | |||
| } | |||
| bool MidiOutput::getVolume (float& /*leftVol*/, float& /*rightVol*/) | |||
| { | |||
| return false; | |||
| } | |||
| void MidiOutput::setVolume (float /*leftVol*/, float /*rightVol*/) | |||
| { | |||
| } | |||
| void MidiOutput::sendMessageNow (const MidiMessage& message) | |||
| { | |||
| CoreMidiHelpers::MidiPortAndEndpoint* const mpe = static_cast<CoreMidiHelpers::MidiPortAndEndpoint*> (internal); | |||
| @@ -568,9 +555,6 @@ void MidiInput::stop() | |||
| #else // Stubs for iOS... | |||
| MidiOutput::~MidiOutput() {} | |||
| void MidiOutput::reset() {} | |||
| bool MidiOutput::getVolume (float& /*leftVol*/, float& /*rightVol*/) { return false; } | |||
| void MidiOutput::setVolume (float /*leftVol*/, float /*rightVol*/) {} | |||
| void MidiOutput::sendMessageNow (const MidiMessage& message) {} | |||
| const StringArray MidiOutput::getDevices() { return StringArray(); } | |||
| MidiOutput* MidiOutput::openDevice (int index) { return nullptr; } | |||
| @@ -1,56 +0,0 @@ | |||
| /* | |||
| ============================================================================== | |||
| This file is part of the JUCE library - "Jules' Utility Class Extensions" | |||
| Copyright 2004-11 by Raw Material Software Ltd. | |||
| ------------------------------------------------------------------------------ | |||
| JUCE can be redistributed and/or modified under the terms of the GNU General | |||
| Public License (Version 2), as published by the Free Software Foundation. | |||
| A copy of the license is included in the JUCE distribution, or can be found | |||
| online at www.gnu.org/licenses. | |||
| JUCE is distributed in the hope that it will be useful, but WITHOUT ANY | |||
| WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR | |||
| A PARTICULAR PURPOSE. See the GNU General Public License for more details. | |||
| ------------------------------------------------------------------------------ | |||
| To release a closed-source product which uses JUCE, commercial licenses are | |||
| available: visit www.rawmaterialsoftware.com/juce for more information. | |||
| ============================================================================== | |||
| */ | |||
| // (This file gets included by juce_win32_NativeCode.cpp, rather than being | |||
| // compiled on its own). | |||
| #if JUCE_INCLUDED_FILE | |||
| #include "juce_win32_DynamicLibraryLoader.h" | |||
| //============================================================================== | |||
| DynamicLibraryLoader::DynamicLibraryLoader (const String& name) | |||
| : libHandle (0) | |||
| { | |||
| load (name); | |||
| } | |||
| DynamicLibraryLoader::~DynamicLibraryLoader() | |||
| { | |||
| load (String::empty); | |||
| } | |||
| bool DynamicLibraryLoader::load (const String& name) | |||
| { | |||
| FreeLibrary ((HMODULE) libHandle); | |||
| libHandle = name.isNotEmpty() ? LoadLibrary (name.toWideCharPointer()) : 0; | |||
| return libHandle != 0; | |||
| } | |||
| void* DynamicLibraryLoader::findProcAddress (const String& functionName) | |||
| { | |||
| return (void*) GetProcAddress ((HMODULE) libHandle, functionName.toUTF8()); // (void* cast is required for mingw) | |||
| } | |||
| #endif | |||
| @@ -48,12 +48,28 @@ | |||
| class JUCE_API DynamicLibraryLoader | |||
| { | |||
| public: | |||
| DynamicLibraryLoader (const String& name = String::empty); | |||
| ~DynamicLibraryLoader(); | |||
| bool load (const String& libraryName); | |||
| void* findProcAddress (const String& functionName); | |||
| DynamicLibraryLoader (const String& name = String::empty) | |||
| : libHandle (0) | |||
| { | |||
| load (name); | |||
| } | |||
| ~DynamicLibraryLoader() | |||
| { | |||
| load (String::empty); | |||
| } | |||
| bool load (const String& name) | |||
| { | |||
| FreeLibrary ((HMODULE) libHandle); | |||
| libHandle = name.isNotEmpty() ? LoadLibrary (name.toWideCharPointer()) : 0; | |||
| return libHandle != 0; | |||
| } | |||
| void* findProcAddress (const String& functionName) | |||
| { | |||
| return (void*) GetProcAddress ((HMODULE) libHandle, functionName.toUTF8()); // (void* cast is required for mingw) | |||
| } | |||
| private: | |||
| void* libHandle; | |||
| @@ -187,11 +187,11 @@ void FileChooser::showPlatformDialog (Array<File>& results, const String& title_ | |||
| bi.lpszTitle = title.toWideCharPointer(); | |||
| bi.lParam = (LPARAM) &info; | |||
| bi.lpfn = browseCallbackProc; | |||
| #ifdef BIF_USENEWUI | |||
| #ifdef BIF_USENEWUI | |||
| bi.ulFlags = BIF_USENEWUI | BIF_VALIDATE; | |||
| #else | |||
| #else | |||
| bi.ulFlags = 0x50; | |||
| #endif | |||
| #endif | |||
| LPITEMIDLIST list = SHBrowseForFolder (&bi); | |||
| @@ -98,9 +98,9 @@ void Font::getPlatformDefaultFontNames (String& defaultSans, String& defaultSeri | |||
| if (juce_IsRunningInWine()) | |||
| { | |||
| // If we're running in Wine, then use fonts that might be available on Linux.. | |||
| defaultSans = "Bitstream Vera Sans"; | |||
| defaultSerif = "Bitstream Vera Serif"; | |||
| defaultFixed = "Bitstream Vera Sans Mono"; | |||
| defaultSans = "Bitstream Vera Sans"; | |||
| defaultSerif = "Bitstream Vera Serif"; | |||
| defaultFixed = "Bitstream Vera Sans Mono"; | |||
| } | |||
| else | |||
| { | |||
| @@ -261,6 +261,23 @@ void MessageManager::broadcastMessage (const String& value) | |||
| //============================================================================== | |||
| void MessageManager::doPlatformSpecificInitialisation() | |||
| { | |||
| #if JUCE_DEBUG | |||
| try // This section is just a safety-net for catching builds without RTTI enabled.. | |||
| { | |||
| MemoryOutputStream mo; | |||
| OutputStream* o = &mo; | |||
| // Got an exception here? Then TURN ON RTTI in your compiler settings!! | |||
| o = dynamic_cast <MemoryOutputStream*> (o); | |||
| jassert (o != nullptr); | |||
| } | |||
| catch (...) | |||
| { | |||
| // Ended up here? If so, TURN ON RTTI in your compiler settings!! | |||
| jassertfalse; | |||
| } | |||
| #endif | |||
| OleInitialize (0); | |||
| // this name has to be different for each app/dll instance because otherwise | |||
| @@ -454,42 +454,6 @@ MidiOutput::~MidiOutput() | |||
| } | |||
| } | |||
| void MidiOutput::reset() | |||
| { | |||
| const MidiOutHandle* const h = static_cast <const MidiOutHandle*> (internal); | |||
| midiOutReset (h->handle); | |||
| } | |||
| bool MidiOutput::getVolume (float& leftVol, float& rightVol) | |||
| { | |||
| const MidiOutHandle* const handle = static_cast <const MidiOutHandle*> (internal); | |||
| DWORD n; | |||
| if (midiOutGetVolume (handle->handle, &n) == MMSYSERR_NOERROR) | |||
| { | |||
| const unsigned short* const nn = reinterpret_cast<const unsigned short*> (&n); | |||
| rightVol = nn[0] / (float) 0xffff; | |||
| leftVol = nn[1] / (float) 0xffff; | |||
| return true; | |||
| } | |||
| else | |||
| { | |||
| rightVol = leftVol = 1.0f; | |||
| return false; | |||
| } | |||
| } | |||
| void MidiOutput::setVolume (float leftVol, float rightVol) | |||
| { | |||
| const MidiOutHandle* const handle = static_cast <MidiOutHandle*> (internal); | |||
| DWORD n; | |||
| unsigned short* const nn = reinterpret_cast<unsigned short*> (&n); | |||
| nn[0] = (unsigned short) jlimit (0, 0xffff, (int) (rightVol * 0xffff)); | |||
| nn[1] = (unsigned short) jlimit (0, 0xffff, (int) (leftVol * 0xffff)); | |||
| midiOutSetVolume (handle->handle, n); | |||
| } | |||
| void MidiOutput::sendMessageNow (const MidiMessage& message) | |||
| { | |||
| const MidiOutHandle* const handle = static_cast <const MidiOutHandle*> (internal); | |||
| @@ -51,6 +51,7 @@ BEGIN_JUCE_NAMESPACE | |||
| #include "../../threads/juce_InterProcessLock.h" | |||
| #include "../../io/files/juce_FileInputStream.h" | |||
| #include "../../io/files/juce_FileOutputStream.h" | |||
| #include "../../io/streams/juce_MemoryOutputStream.h" | |||
| #include "../../io/files/juce_NamedPipe.h" | |||
| #include "../../io/files/juce_DirectoryIterator.h" | |||
| #include "../../io/network/juce_URL.h" | |||
| @@ -95,7 +96,7 @@ BEGIN_JUCE_NAMESPACE | |||
| #define JUCE_INCLUDED_FILE 1 | |||
| // Now include the actual code files.. | |||
| #include "juce_win32_DynamicLibraryLoader.cpp" | |||
| #include "juce_win32_DynamicLibraryLoader.h" | |||
| #include "juce_win32_SystemStats.cpp" | |||
| #include "juce_win32_Threads.cpp" | |||
| #include "juce_win32_Files.cpp" | |||
| @@ -40,6 +40,13 @@ public: | |||
| { | |||
| } | |||
| ~RunningThreadsList() | |||
| { | |||
| // Some threads are still running! Make sure you stop all your | |||
| // threads cleanly before your app quits! | |||
| jassert (threads.size() == 0); | |||
| } | |||
| void add (Thread* const thread) | |||
| { | |||
| const SpinLock::ScopedLockType sl (lock); | |||