diff --git a/extras/amalgamator/juce_AmalgamatorMain.cpp b/extras/amalgamator/juce_AmalgamatorMain.cpp index 8d03d776d5..f83dadf9b7 100644 --- a/extras/amalgamator/juce_AmalgamatorMain.cpp +++ b/extras/amalgamator/juce_AmalgamatorMain.cpp @@ -71,8 +71,8 @@ static bool canFileBeReincluded (const File& f) //============================================================================== static bool parseFile (const File& rootFolder, const File& newTargetFile, - StringArray& dest, - const File& file, + StringArray& dest, + const File& file, StringArray& alreadyIncludedFiles, const StringArray& includesToIgnore, const StringArray& wildcards, @@ -133,18 +133,18 @@ static bool parseFile (const File& rootFolder, alreadyIncludedFiles.add (targetFile.getFullPathName()); dest.add (String::empty); - dest.add (T("/********* Start of inlined file: ") + dest.add (T("/********* Start of inlined file: ") + targetFile.getFileName() + T(" *********/")); - if (! parseFile (rootFolder, newTargetFile, + if (! parseFile (rootFolder, newTargetFile, dest, targetFile, alreadyIncludedFiles, includesToIgnore, wildcards, false, stripUnnecessaryStuff)) { return false; } - dest.add (T("/********* End of inlined file: ") + dest.add (T("/********* End of inlined file: ") + targetFile.getFileName() + T(" *********/")); dest.add (String::empty); @@ -192,9 +192,9 @@ static bool munge (const File& templateFile, const File& targetFile, const Strin wildcards.trim(); wildcards.removeEmptyStrings(); - if (! parseFile (targetFile.getParentDirectory(), + if (! parseFile (targetFile.getParentDirectory(), targetFile, - lines, templateFile, + lines, templateFile, alreadyIncludedFiles, includesToIgnore, wildcards, @@ -296,7 +296,7 @@ static void mungeJuce (const File& juceFolder) //============================================================================== int main (int argc, char* argv[]) { - // If you're running a command-line app, you need to initialise juce manually + // If you're running a command-line app, you need to initialise juce manually // before calling any Juce functionality.. initialiseJuce_NonGUI(); @@ -327,10 +327,9 @@ int main (int argc, char* argv[]) " ignoring any repeated instances of it.\n\n" " The wildcard lets you specify what kind of files will be replaced, so\n" " \"*.cpp;*.h\" would replace only includes that reference a .cpp or .h file.\n\n" - " Or: just run 'amalgamator YourJuceDirectory' to rebuild the juce files." + " Or: just run 'amalgamator YourJuceDirectory' to rebuild the juce files." ); } return 0; } - diff --git a/extras/amalgamator/juce_AppConfig.h b/extras/amalgamator/juce_AppConfig.h index 5ae80b760f..aa04cb8e61 100644 --- a/extras/amalgamator/juce_AppConfig.h +++ b/extras/amalgamator/juce_AppConfig.h @@ -1,5 +1,5 @@ /* - This file contains settings that you might want to explicitly apply to + This file contains settings that you might want to explicitly apply to your Juce build. These flags enable or disable juce features - if you're linking to juce as @@ -8,7 +8,7 @@ just include this file before including your juce_amalgamated.cpp file to have the same effect. - If you leave any of these commented-out, they'll take on the default value + If you leave any of these commented-out, they'll take on the default value assigned to them in juce_Config.h, so to force them on or off, just set them to an explicit 0 or 1 in here. */ diff --git a/extras/amalgamator/juce_LibrarySource.cpp b/extras/amalgamator/juce_LibrarySource.cpp index 5567cbfd82..db6b7e85fd 100644 --- a/extras/amalgamator/juce_LibrarySource.cpp +++ b/extras/amalgamator/juce_LibrarySource.cpp @@ -1,10 +1,10 @@ -/* +/* This file includes the entire juce source tree via the amalgamated file. You could add the amalgamated file directly to your project, but doing it - like this allows you to put your app's config settings in the - juce_AppConfig.h file and have them applied to both the juce headers and + like this allows you to put your app's config settings in the + juce_AppConfig.h file and have them applied to both the juce headers and the source code. */ diff --git a/extras/amalgamator/juce_LibrarySource.mm b/extras/amalgamator/juce_LibrarySource.mm index 96e9e774e2..fcbdfc2744 100755 --- a/extras/amalgamator/juce_LibrarySource.mm +++ b/extras/amalgamator/juce_LibrarySource.mm @@ -1,10 +1,10 @@ -/* +/* This file includes the entire juce source tree via the amalgamated file. You could add the amalgamated file directly to your project, but doing it - like this allows you to put your app's config settings in the - juce_AppConfig.h file and have them applied to both the juce headers and + like this allows you to put your app's config settings in the + juce_AppConfig.h file and have them applied to both the juce headers and the source code. */ diff --git a/extras/audio plugins/demo/src/DemoJuceFilter.h b/extras/audio plugins/demo/src/DemoJuceFilter.h index 8ef5cd64aa..88eef9618d 100644 --- a/extras/audio plugins/demo/src/DemoJuceFilter.h +++ b/extras/audio plugins/demo/src/DemoJuceFilter.h @@ -45,7 +45,7 @@ public: void prepareToPlay (double sampleRate, int samplesPerBlock); void releaseResources(); - void processBlock (AudioSampleBuffer& buffer, + void processBlock (AudioSampleBuffer& buffer, MidiBuffer& midiMessages); //============================================================================== diff --git a/extras/binarybuilder/BinaryBuilder.cpp b/extras/binarybuilder/BinaryBuilder.cpp index ac8ac32eec..afb4511e3f 100644 --- a/extras/binarybuilder/BinaryBuilder.cpp +++ b/extras/binarybuilder/BinaryBuilder.cpp @@ -17,7 +17,7 @@ //============================================================================== static int addFile (const File& file, - const String& classname, + const String& classname, OutputStream& headerStream, OutputStream& cppStream) { @@ -29,7 +29,7 @@ static int addFile (const File& file, .replaceCharacter ('.', '_') .retainCharacters (T("abcdefghijklmnopqrstuvwxyz_0123456789"))); - printf ("Adding %s: %d bytes\n", + printf ("Adding %s: %d bytes\n", (const char*) name, mb.getSize()); @@ -59,8 +59,8 @@ static int addFile (const File& file, cppStream.printf ("%d,0,0};\r\n", (int) data[i]); cppStream.printf ("const char* %s::%s = (const char*) temp%d;\r\n\r\n", - (const char*) classname, - (const char*) name, + (const char*) classname, + (const char*) name, tempNum); return mb.getSize(); @@ -78,7 +78,7 @@ static bool isHiddenFile (const File& f, const File& root) //============================================================================== int main (int argc, char* argv[]) { - // If you're running a command-line app, you need to initialise juce manually + // If you're running a command-line app, you need to initialise juce manually // before calling any Juce functionality.. initialiseJuce_NonGUI(); @@ -128,15 +128,15 @@ int main (int argc, char* argv[]) const File cppFile (destDirectory.getChildFile (className).withFileExtension (T(".cpp"))); String message; - message << "Creating " << headerFile.getFullPathName() + message << "Creating " << headerFile.getFullPathName() << " and " << cppFile.getFullPathName() - << " from files in " << sourceDirectory.getFullPathName() + << " from files in " << sourceDirectory.getFullPathName() << "...\n\n"; printf ((const char*) message); OwnedArray files; - sourceDirectory.findChildFiles (files, File::findFiles, true, + sourceDirectory.findChildFiles (files, File::findFiles, true, (argc > 4) ? argv[4] : "*"); if (files.size() == 0) diff --git a/extras/binarybuilder/juce_AppConfig.h b/extras/binarybuilder/juce_AppConfig.h index 5ae80b760f..aa04cb8e61 100644 --- a/extras/binarybuilder/juce_AppConfig.h +++ b/extras/binarybuilder/juce_AppConfig.h @@ -1,5 +1,5 @@ /* - This file contains settings that you might want to explicitly apply to + This file contains settings that you might want to explicitly apply to your Juce build. These flags enable or disable juce features - if you're linking to juce as @@ -8,7 +8,7 @@ just include this file before including your juce_amalgamated.cpp file to have the same effect. - If you leave any of these commented-out, they'll take on the default value + If you leave any of these commented-out, they'll take on the default value assigned to them in juce_Config.h, so to force them on or off, just set them to an explicit 0 or 1 in here. */ diff --git a/extras/binarybuilder/juce_LibrarySource.cpp b/extras/binarybuilder/juce_LibrarySource.cpp index 5567cbfd82..db6b7e85fd 100644 --- a/extras/binarybuilder/juce_LibrarySource.cpp +++ b/extras/binarybuilder/juce_LibrarySource.cpp @@ -1,10 +1,10 @@ -/* +/* This file includes the entire juce source tree via the amalgamated file. You could add the amalgamated file directly to your project, but doing it - like this allows you to put your app's config settings in the - juce_AppConfig.h file and have them applied to both the juce headers and + like this allows you to put your app's config settings in the + juce_AppConfig.h file and have them applied to both the juce headers and the source code. */ diff --git a/extras/binarybuilder/juce_LibrarySource.mm b/extras/binarybuilder/juce_LibrarySource.mm index 96e9e774e2..fcbdfc2744 100644 --- a/extras/binarybuilder/juce_LibrarySource.mm +++ b/extras/binarybuilder/juce_LibrarySource.mm @@ -1,10 +1,10 @@ -/* +/* This file includes the entire juce source tree via the amalgamated file. You could add the amalgamated file directly to your project, but doing it - like this allows you to put your app's config settings in the - juce_AppConfig.h file and have them applied to both the juce headers and + like this allows you to put your app's config settings in the + juce_AppConfig.h file and have them applied to both the juce headers and the source code. */ diff --git a/extras/example projects/common/Main.cpp b/extras/example projects/common/Main.cpp index 2e08e0d66c..9a7de4bfae 100644 --- a/extras/example projects/common/Main.cpp +++ b/extras/example projects/common/Main.cpp @@ -11,7 +11,7 @@ #include "MainComponent.h" //============================================================================== -/** +/** This is the top-level window that we'll pop up. Inside it, we'll create and show a component from the MainComponent.cpp file (you can open this file using the Jucer to edit it). @@ -20,13 +20,13 @@ class HelloWorldWindow : public DocumentWindow { public: //============================================================================== - HelloWorldWindow() + HelloWorldWindow() : DocumentWindow (T("JUCE Hello World!"), - Colours::lightgrey, + Colours::lightgrey, DocumentWindow::allButtons, true) { - // Create an instance of our main content component, and add it + // Create an instance of our main content component, and add it // to our window. MainComponent* const contentComponent = new MainComponent(); @@ -46,9 +46,9 @@ public: //============================================================================== void closeButtonPressed() { - // When the user presses the close button, we'll tell the app to quit. This + // When the user presses the close button, we'll tell the app to quit. This // window will be deleted by our HelloWorldApplication::shutdown() method - // + // JUCEApplication::quit(); } }; diff --git a/extras/example projects/common/juce_AppConfig.h b/extras/example projects/common/juce_AppConfig.h index 1d8761f6d1..c0714651c5 100644 --- a/extras/example projects/common/juce_AppConfig.h +++ b/extras/example projects/common/juce_AppConfig.h @@ -1,5 +1,5 @@ /* - This file contains settings that you might want to explicitly apply to + This file contains settings that you might want to explicitly apply to your Juce build. These flags enable or disable juce features - if you're linking to juce as @@ -8,7 +8,7 @@ just include this file before including your juce_amalgamated.cpp file to have the same effect. - If you leave any of these commented-out, they'll take on the default value + If you leave any of these commented-out, they'll take on the default value assigned to them in juce_Config.h, so to force them on or off, just set them to an explicit 0 or 1 in here. */ diff --git a/extras/example projects/common/juce_LibrarySource.cpp b/extras/example projects/common/juce_LibrarySource.cpp index ab4357598c..6310476300 100644 --- a/extras/example projects/common/juce_LibrarySource.cpp +++ b/extras/example projects/common/juce_LibrarySource.cpp @@ -1,10 +1,10 @@ -/* +/* This file includes the entire juce source tree via the amalgamated file. You could add the amalgamated file directly to your project, but doing it - like this allows you to put your app's config settings in the - juce_AppConfig.h file and have them applied to both the juce headers and + like this allows you to put your app's config settings in the + juce_AppConfig.h file and have them applied to both the juce headers and the source code. */ diff --git a/extras/example projects/common/juce_LibrarySource.mm b/extras/example projects/common/juce_LibrarySource.mm index 628b36d217..8e2b658e82 100644 --- a/extras/example projects/common/juce_LibrarySource.mm +++ b/extras/example projects/common/juce_LibrarySource.mm @@ -1,12 +1,12 @@ - -/* - This file includes the entire juce source tree via the amalgamated file. - - You could add the amalgamated file directly to your project, but doing it - like this allows you to put your app's config settings in the - juce_AppConfig.h file and have them applied to both the juce headers and - the source code. -*/ - -#include "juce_AppConfig.h" -#include "../../../juce_amalgamated.mm" + +/* + This file includes the entire juce source tree via the amalgamated file. + + You could add the amalgamated file directly to your project, but doing it + like this allows you to put your app's config settings in the + juce_AppConfig.h file and have them applied to both the juce headers and + the source code. +*/ + +#include "juce_AppConfig.h" +#include "../../../juce_amalgamated.mm" diff --git a/juce.h b/juce.h index a6f3936fe9..6876868daa 100644 --- a/juce.h +++ b/juce.h @@ -98,8 +98,8 @@ END_JUCE_NAMESPACE /* "Rectangle" is defined in some of the newer windows header files, so this makes it easier to use the juce version explicitly. - If you run into difficulties where this macro interferes with other 3rd party header - files, you may need to use the juce_WithoutMacros.h file - see the comments in that + If you run into difficulties where this macro interferes with other 3rd party header + files, you may need to use the juce_WithoutMacros.h file - see the comments in that file for more information. */ #if JUCE_WINDOWS && ! JUCE_DONT_DEFINE_MACROS diff --git a/juce_amalgamated.cpp b/juce_amalgamated.cpp index 547a361185..ea36eaf025 100644 --- a/juce_amalgamated.cpp +++ b/juce_amalgamated.cpp @@ -258063,7 +258063,7 @@ bool File::moveToTrash() const throw() struct FindFileStruct { NSDirectoryEnumerator* enumerator; - String parentDir; + String parentDir, wildCard; }; bool juce_findFileNext (void* handle, String& resultFile, @@ -258071,46 +258071,53 @@ bool juce_findFileNext (void* handle, String& resultFile, { FindFileStruct* ff = (FindFileStruct*) handle; NSString* file; + const char* const wildcardUTF8 = ff->wildCard.toUTF8(); - if (ff == 0 || (file = [ff->enumerator nextObject]) == 0) - return false; + for (;;) + { + if (ff == 0 || (file = [ff->enumerator nextObject]) == 0) + return false; - [ff->enumerator skipDescendents]; - resultFile = nsStringToJuce (file); + [ff->enumerator skipDescendents]; + resultFile = nsStringToJuce (file); - const String path (ff->parentDir + resultFile); + if (fnmatch (wildcardUTF8, resultFile.toUTF8(), FNM_CASEFOLD) != 0) + continue; - if (isDir != 0 || fileSize != 0) - { - struct stat info; - const bool statOk = juce_stat (path, info); + const String path (ff->parentDir + resultFile); - if (isDir != 0) - *isDir = statOk && ((info.st_mode & S_IFDIR) != 0); + if (isDir != 0 || fileSize != 0) + { + struct stat info; + const bool statOk = juce_stat (path, info); - if (isHidden != 0) - *isHidden = juce_isHiddenFile (path); + if (isDir != 0) + *isDir = statOk && ((info.st_mode & S_IFDIR) != 0); - if (fileSize != 0) - *fileSize = statOk ? info.st_size : 0; - } + if (isHidden != 0) + *isHidden = juce_isHiddenFile (path); - if (modTime != 0 || creationTime != 0) - { - int64 m, a, c; - juce_getFileTimes (path, m, a, c); + if (fileSize != 0) + *fileSize = statOk ? info.st_size : 0; + } - if (modTime != 0) - *modTime = m; + if (modTime != 0 || creationTime != 0) + { + int64 m, a, c; + juce_getFileTimes (path, m, a, c); - if (creationTime != 0) - *creationTime = c; - } + if (modTime != 0) + *modTime = m; - if (isReadOnly != 0) - *isReadOnly = ! juce_canWriteToFile (path); + if (creationTime != 0) + *creationTime = c; + } - return true; + if (isReadOnly != 0) + *isReadOnly = ! juce_canWriteToFile (path); + + return true; + } } void* juce_findFileStart (const String& directory, const String& wildCard, String& firstResultFile, @@ -258124,6 +258131,7 @@ void* juce_findFileStart (const String& directory, const String& wildCard, Strin FindFileStruct* ff = new FindFileStruct(); ff->enumerator = [e retain]; ff->parentDir = directory; + ff->wildCard = wildCard; if (! ff->parentDir.endsWithChar (File::separator)) ff->parentDir += File::separator; @@ -258370,7 +258378,7 @@ void Desktop::setMousePosition (int x, int y) throw() void Desktop::setScreenSaverEnabled (const bool isEnabled) throw() { - [[UIApplication sharedApplication] setIdleTimerDisabled: ! isEnabled]; + [[UIApplication sharedApplication] setIdleTimerDisabled: ! isEnabled]; } bool Desktop::isScreenSaverEnabled() throw() diff --git a/juce_amalgamated.mm b/juce_amalgamated.mm index 628dd987e6..e841bb5d6b 100644 --- a/juce_amalgamated.mm +++ b/juce_amalgamated.mm @@ -1,10 +1,10 @@ - -/* - When using XCode, you should add this file to your project - instead of using juce_amalgamated.cpp directly. - - This is because on the Mac we need to force the compiler to - treat the code as mixed C++/objective-C. -*/ - -#include "juce_amalgamated.cpp" + +/* + When using XCode, you should add this file to your project + instead of using juce_amalgamated.cpp directly. + + This is because on the Mac we need to force the compiler to + treat the code as mixed C++/objective-C. +*/ + +#include "juce_amalgamated.cpp" diff --git a/src/audio/plugins/formats/juce_VSTPluginFormat.mm b/src/audio/plugins/formats/juce_VSTPluginFormat.mm index 28025a09cf..344fe1c01b 100644 --- a/src/audio/plugins/formats/juce_VSTPluginFormat.mm +++ b/src/audio/plugins/formats/juce_VSTPluginFormat.mm @@ -26,4 +26,3 @@ // This file just wraps juce_VSTPluginFormat.cpp in an objective-C wrapper #define JUCE_MAC_VST_INCLUDED 1 #include "juce_VSTPluginFormat.cpp" - diff --git a/src/native/mac/juce_iphone_MiscUtilities.mm b/src/native/mac/juce_iphone_MiscUtilities.mm index b3cf7e8332..7e6f40fb10 100644 --- a/src/native/mac/juce_iphone_MiscUtilities.mm +++ b/src/native/mac/juce_iphone_MiscUtilities.mm @@ -145,7 +145,7 @@ void Desktop::setMousePosition (int x, int y) throw() //============================================================================== void Desktop::setScreenSaverEnabled (const bool isEnabled) throw() { - [[UIApplication sharedApplication] setIdleTimerDisabled: ! isEnabled]; + [[UIApplication sharedApplication] setIdleTimerDisabled: ! isEnabled]; } bool Desktop::isScreenSaverEnabled() throw() diff --git a/src/native/mac/juce_mac_Files.mm b/src/native/mac/juce_mac_Files.mm index 79e2dac613..d54b9f6175 100644 --- a/src/native/mac/juce_mac_Files.mm +++ b/src/native/mac/juce_mac_Files.mm @@ -334,7 +334,7 @@ bool File::moveToTrash() const throw() struct FindFileStruct { NSDirectoryEnumerator* enumerator; - String parentDir; + String parentDir, wildCard; }; bool juce_findFileNext (void* handle, String& resultFile, @@ -342,46 +342,53 @@ bool juce_findFileNext (void* handle, String& resultFile, { FindFileStruct* ff = (FindFileStruct*) handle; NSString* file; + const char* const wildcardUTF8 = ff->wildCard.toUTF8(); - if (ff == 0 || (file = [ff->enumerator nextObject]) == 0) - return false; + for (;;) + { + if (ff == 0 || (file = [ff->enumerator nextObject]) == 0) + return false; - [ff->enumerator skipDescendents]; - resultFile = nsStringToJuce (file); + [ff->enumerator skipDescendents]; + resultFile = nsStringToJuce (file); - const String path (ff->parentDir + resultFile); + if (fnmatch (wildcardUTF8, resultFile.toUTF8(), FNM_CASEFOLD) != 0) + continue; - if (isDir != 0 || fileSize != 0) - { - struct stat info; - const bool statOk = juce_stat (path, info); + const String path (ff->parentDir + resultFile); - if (isDir != 0) - *isDir = statOk && ((info.st_mode & S_IFDIR) != 0); + if (isDir != 0 || fileSize != 0) + { + struct stat info; + const bool statOk = juce_stat (path, info); - if (isHidden != 0) - *isHidden = juce_isHiddenFile (path); + if (isDir != 0) + *isDir = statOk && ((info.st_mode & S_IFDIR) != 0); - if (fileSize != 0) - *fileSize = statOk ? info.st_size : 0; - } + if (isHidden != 0) + *isHidden = juce_isHiddenFile (path); - if (modTime != 0 || creationTime != 0) - { - int64 m, a, c; - juce_getFileTimes (path, m, a, c); + if (fileSize != 0) + *fileSize = statOk ? info.st_size : 0; + } - if (modTime != 0) - *modTime = m; + if (modTime != 0 || creationTime != 0) + { + int64 m, a, c; + juce_getFileTimes (path, m, a, c); - if (creationTime != 0) - *creationTime = c; - } + if (modTime != 0) + *modTime = m; - if (isReadOnly != 0) - *isReadOnly = ! juce_canWriteToFile (path); + if (creationTime != 0) + *creationTime = c; + } - return true; + if (isReadOnly != 0) + *isReadOnly = ! juce_canWriteToFile (path); + + return true; + } } void* juce_findFileStart (const String& directory, const String& wildCard, String& firstResultFile, @@ -395,6 +402,7 @@ void* juce_findFileStart (const String& directory, const String& wildCard, Strin FindFileStruct* ff = new FindFileStruct(); ff->enumerator = [e retain]; ff->parentDir = directory; + ff->wildCard = wildCard; if (! ff->parentDir.endsWithChar (File::separator)) ff->parentDir += File::separator;