| @@ -1116,7 +1116,7 @@ public: | |||||
| { | { | ||||
| case kEventWindowHandleDeactivate: | case kEventWindowHandleDeactivate: | ||||
| ActivateWindow (wrapperWindow, TRUE); | ActivateWindow (wrapperWindow, TRUE); | ||||
| break; | |||||
| return noErr; | |||||
| case kEventWindowGetClickActivation: | case kEventWindowGetClickActivation: | ||||
| { | { | ||||
| @@ -1128,11 +1128,11 @@ public: | |||||
| sizeof (ClickActivationResult), &howToHandleClick); | sizeof (ClickActivationResult), &howToHandleClick); | ||||
| HIViewSetNeedsDisplay (embeddedView, true); | HIViewSetNeedsDisplay (embeddedView, true); | ||||
| return noErr; | |||||
| } | } | ||||
| break; | |||||
| } | } | ||||
| return noErr; | |||||
| return eventNotHandledErr; | |||||
| } | } | ||||
| static pascal OSStatus carbonEventCallback (EventHandlerCallRef nextHandlerRef, | static pascal OSStatus carbonEventCallback (EventHandlerCallRef nextHandlerRef, | ||||
| @@ -274336,30 +274336,34 @@ AudioCDReader::~AudioCDReader() | |||||
| { | { | ||||
| } | } | ||||
| static int juce_getCDTrackNumber (const File& file) | |||||
| { | |||||
| return file.getFileName() | |||||
| .initialSectionContainingOnly ("0123456789") | |||||
| .getIntValue(); | |||||
| } | |||||
| int AudioCDReader::compareElements (const File& first, const File& second) | |||||
| { | |||||
| const int firstTrack = juce_getCDTrackNumber (first); | |||||
| const int secondTrack = juce_getCDTrackNumber (second); | |||||
| jassert (firstTrack > 0 && secondTrack > 0); | |||||
| return firstTrack - secondTrack; | |||||
| } | |||||
| void AudioCDReader::refreshTrackLengths() | void AudioCDReader::refreshTrackLengths() | ||||
| { | { | ||||
| tracks.clear(); | tracks.clear(); | ||||
| trackStartSamples.clear(); | trackStartSamples.clear(); | ||||
| volumeDir.findChildFiles (tracks, File::findFiles | File::ignoreHiddenFiles, false, "*.aiff"); | volumeDir.findChildFiles (tracks, File::findFiles | File::ignoreHiddenFiles, false, "*.aiff"); | ||||
| tracks.sort (*this); | |||||
| struct CDTrackSorter | |||||
| { | |||||
| static int getCDTrackNumber (const File& file) | |||||
| { | |||||
| return file.getFileName() | |||||
| .initialSectionContainingOnly ("0123456789") | |||||
| .getIntValue(); | |||||
| } | |||||
| static int compareElements (const File& first, const File& second) | |||||
| { | |||||
| const int firstTrack = getCDTrackNumber (first); | |||||
| const int secondTrack = getCDTrackNumber (second); | |||||
| jassert (firstTrack > 0 && secondTrack > 0); | |||||
| return firstTrack - secondTrack; | |||||
| } | |||||
| }; | |||||
| CDTrackSorter sorter; | |||||
| tracks.sort (sorter); | |||||
| AiffAudioFormat format; | AiffAudioFormat format; | ||||
| int sample = 0; | int sample = 0; | ||||
| @@ -5929,8 +5929,8 @@ template <typename Type> | |||||
| inline Type Atomic<Type>::get() const throw() | inline Type Atomic<Type>::get() const throw() | ||||
| { | { | ||||
| #if JUCE_ATOMICS_MAC | #if JUCE_ATOMICS_MAC | ||||
| return sizeof (Type) == 4 ? castFrom32Bit ((int32) OSAtomicAdd32Barrier (0, (volatile int32_t*) &value)) | |||||
| : castFrom64Bit ((int64) OSAtomicAdd64Barrier (0, (volatile int64_t*) &value)); | |||||
| return sizeof (Type) == 4 ? castFrom32Bit ((int32) OSAtomicAdd32Barrier ((int32_t) 0, (volatile int32_t*) &value)) | |||||
| : castFrom64Bit ((int64) OSAtomicAdd64Barrier ((int64_t) 0, (volatile int64_t*) &value)); | |||||
| #elif JUCE_ATOMICS_WINDOWS | #elif JUCE_ATOMICS_WINDOWS | ||||
| return sizeof (Type) == 4 ? castFrom32Bit ((int32) juce_InterlockedExchangeAdd ((volatile long*) &value, (long) 0)) | return sizeof (Type) == 4 ? castFrom32Bit ((int32) juce_InterlockedExchangeAdd ((volatile long*) &value, (long) 0)) | ||||
| : castFrom64Bit ((int64) juce_InterlockedExchangeAdd64 ((volatile __int64*) &value, (__int64) 0)); | : castFrom64Bit ((int64) juce_InterlockedExchangeAdd64 ((volatile __int64*) &value, (__int64) 0)); | ||||
| @@ -30521,9 +30521,6 @@ private: | |||||
| int currentReaderTrack; | int currentReaderTrack; | ||||
| ScopedPointer <AudioFormatReader> reader; | ScopedPointer <AudioFormatReader> reader; | ||||
| AudioCDReader (const File& volume); | AudioCDReader (const File& volume); | ||||
| public: | |||||
| static int compareElements (const File&, const File&); | |||||
| private: | |||||
| #elif JUCE_WINDOWS | #elif JUCE_WINDOWS | ||||
| int numTracks; | int numTracks; | ||||
| @@ -158,9 +158,6 @@ private: | |||||
| int currentReaderTrack; | int currentReaderTrack; | ||||
| ScopedPointer <AudioFormatReader> reader; | ScopedPointer <AudioFormatReader> reader; | ||||
| AudioCDReader (const File& volume); | AudioCDReader (const File& volume); | ||||
| public: | |||||
| static int compareElements (const File&, const File&); | |||||
| private: | |||||
| #elif JUCE_WINDOWS | #elif JUCE_WINDOWS | ||||
| int numTracks; | int numTracks; | ||||
| @@ -230,8 +230,8 @@ template <typename Type> | |||||
| inline Type Atomic<Type>::get() const throw() | inline Type Atomic<Type>::get() const throw() | ||||
| { | { | ||||
| #if JUCE_ATOMICS_MAC | #if JUCE_ATOMICS_MAC | ||||
| return sizeof (Type) == 4 ? castFrom32Bit ((int32) OSAtomicAdd32Barrier (0, (volatile int32_t*) &value)) | |||||
| : castFrom64Bit ((int64) OSAtomicAdd64Barrier (0, (volatile int64_t*) &value)); | |||||
| return sizeof (Type) == 4 ? castFrom32Bit ((int32) OSAtomicAdd32Barrier ((int32_t) 0, (volatile int32_t*) &value)) | |||||
| : castFrom64Bit ((int64) OSAtomicAdd64Barrier ((int64_t) 0, (volatile int64_t*) &value)); | |||||
| #elif JUCE_ATOMICS_WINDOWS | #elif JUCE_ATOMICS_WINDOWS | ||||
| return sizeof (Type) == 4 ? castFrom32Bit ((int32) juce_InterlockedExchangeAdd ((volatile long*) &value, (long) 0)) | return sizeof (Type) == 4 ? castFrom32Bit ((int32) juce_InterlockedExchangeAdd ((volatile long*) &value, (long) 0)) | ||||
| : castFrom64Bit ((int64) juce_InterlockedExchangeAdd64 ((volatile __int64*) &value, (__int64) 0)); | : castFrom64Bit ((int64) juce_InterlockedExchangeAdd64 ((volatile __int64*) &value, (__int64) 0)); | ||||
| @@ -80,30 +80,34 @@ AudioCDReader::~AudioCDReader() | |||||
| { | { | ||||
| } | } | ||||
| static int juce_getCDTrackNumber (const File& file) | |||||
| { | |||||
| return file.getFileName() | |||||
| .initialSectionContainingOnly ("0123456789") | |||||
| .getIntValue(); | |||||
| } | |||||
| int AudioCDReader::compareElements (const File& first, const File& second) | |||||
| { | |||||
| const int firstTrack = juce_getCDTrackNumber (first); | |||||
| const int secondTrack = juce_getCDTrackNumber (second); | |||||
| jassert (firstTrack > 0 && secondTrack > 0); | |||||
| return firstTrack - secondTrack; | |||||
| } | |||||
| void AudioCDReader::refreshTrackLengths() | void AudioCDReader::refreshTrackLengths() | ||||
| { | { | ||||
| tracks.clear(); | tracks.clear(); | ||||
| trackStartSamples.clear(); | trackStartSamples.clear(); | ||||
| volumeDir.findChildFiles (tracks, File::findFiles | File::ignoreHiddenFiles, false, "*.aiff"); | volumeDir.findChildFiles (tracks, File::findFiles | File::ignoreHiddenFiles, false, "*.aiff"); | ||||
| tracks.sort (*this); | |||||
| struct CDTrackSorter | |||||
| { | |||||
| static int getCDTrackNumber (const File& file) | |||||
| { | |||||
| return file.getFileName() | |||||
| .initialSectionContainingOnly ("0123456789") | |||||
| .getIntValue(); | |||||
| } | |||||
| static int compareElements (const File& first, const File& second) | |||||
| { | |||||
| const int firstTrack = getCDTrackNumber (first); | |||||
| const int secondTrack = getCDTrackNumber (second); | |||||
| jassert (firstTrack > 0 && secondTrack > 0); | |||||
| return firstTrack - secondTrack; | |||||
| } | |||||
| }; | |||||
| CDTrackSorter sorter; | |||||
| tracks.sort (sorter); | |||||
| AiffAudioFormat format; | AiffAudioFormat format; | ||||
| int sample = 0; | int sample = 0; | ||||
| @@ -242,7 +242,7 @@ public: | |||||
| { | { | ||||
| case kEventWindowHandleDeactivate: | case kEventWindowHandleDeactivate: | ||||
| ActivateWindow (wrapperWindow, TRUE); | ActivateWindow (wrapperWindow, TRUE); | ||||
| break; | |||||
| return noErr; | |||||
| case kEventWindowGetClickActivation: | case kEventWindowGetClickActivation: | ||||
| { | { | ||||
| @@ -254,11 +254,11 @@ public: | |||||
| sizeof (ClickActivationResult), &howToHandleClick); | sizeof (ClickActivationResult), &howToHandleClick); | ||||
| HIViewSetNeedsDisplay (embeddedView, true); | HIViewSetNeedsDisplay (embeddedView, true); | ||||
| return noErr; | |||||
| } | } | ||||
| break; | |||||
| } | } | ||||
| return noErr; | |||||
| return eventNotHandledErr; | |||||
| } | } | ||||
| static pascal OSStatus carbonEventCallback (EventHandlerCallRef nextHandlerRef, | static pascal OSStatus carbonEventCallback (EventHandlerCallRef nextHandlerRef, | ||||