diff --git a/src/audio/audio_file_formats/juce_AudioThumbnail.h b/src/audio/audio_file_formats/juce_AudioThumbnail.h index 5032dc3865..afce95538c 100644 --- a/src/audio/audio_file_formats/juce_AudioThumbnail.h +++ b/src/audio/audio_file_formats/juce_AudioThumbnail.h @@ -66,7 +66,9 @@ public: /** Creates an audio thumbnail. @param sourceSamplesPerThumbnailSample when creating a stored, low-res version - of the audio data, this is the scale at which it should be done + of the audio data, this is the scale at which it should be done. (This + number is the number of original samples that will be averaged for each + low-res sample) @param formatManagerToUse the audio format manager that is used to open the file @param cacheToUse an instance of an AudioThumbnailCache - this provides a background thread and storage that is used to by the thumbnail, and the cache @@ -113,7 +115,7 @@ public: */ int getNumChannels() const throw(); - /** Returns the length of the audio file. + /** Returns the length of the audio file, in seconds. */ double getTotalLength() const throw(); @@ -129,8 +131,8 @@ public: */ void drawChannel (Graphics& g, int x, int y, int w, int h, - double startTime, - double endTime, + double startTimeSeconds, + double endTimeSeconds, int channelNum, const float verticalZoomFactor); diff --git a/src/gui/graphics/drawables/juce_DrawablePath.cpp b/src/gui/graphics/drawables/juce_DrawablePath.cpp index ed515304f7..5ee9a2ab90 100644 --- a/src/gui/graphics/drawables/juce_DrawablePath.cpp +++ b/src/gui/graphics/drawables/juce_DrawablePath.cpp @@ -371,7 +371,7 @@ bool DrawablePath::readXml (const XmlElement& xml) const String jointStyle (xml.getStringAttribute (T("jointStyle"), String::empty)); const String endStyle (xml.getStringAttribute (T("capStyle"), String::empty)); - strokeType = PathStrokeType (xml.getDoubleAttribute (T("strokeWidth"), 0.0), + strokeType = PathStrokeType ((float) xml.getDoubleAttribute (T("strokeWidth"), 0.0), jointStyle.equalsIgnoreCase (T("curved")) ? PathStrokeType::curved : (jointStyle.equalsIgnoreCase (T("bevel")) ? PathStrokeType::beveled : PathStrokeType::mitered), diff --git a/src/native/mac/juce_mac_FileChooser.mm b/src/native/mac/juce_mac_FileChooser.mm index dd9e0a667c..d22f6668ee 100644 --- a/src/native/mac/juce_mac_FileChooser.mm +++ b/src/native/mac/juce_mac_FileChooser.mm @@ -33,7 +33,11 @@ using namespace JUCE_NAMESPACE; #define JuceFileChooserDelegate MakeObjCClassName(JuceFileChooserDelegate) +#if defined (MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 +@interface JuceFileChooserDelegate : NSObject +#else @interface JuceFileChooserDelegate : NSObject +#endif { StringArray* filters; } diff --git a/src/native/mac/juce_mac_Files.mm b/src/native/mac/juce_mac_Files.mm index 701c46669c..bb9180d32b 100644 --- a/src/native/mac/juce_mac_Files.mm +++ b/src/native/mac/juce_mac_Files.mm @@ -151,9 +151,15 @@ bool juce_copyFile (const String& src, const String& dst) throw() NSFileManager* fm = [NSFileManager defaultManager]; return [fm fileExistsAtPath: juceStringToNS (src)] +#if defined (MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 + && [fm copyItemAtPath: juceStringToNS (src) + toPath: juceStringToNS (dst) + error: nil]; +#else && [fm copyPath: juceStringToNS (src) toPath: juceStringToNS (dst) handler: nil]; +#endif } const StringArray juce_getFileSystemRoots() throw() diff --git a/src/native/mac/juce_mac_MainMenu.mm b/src/native/mac/juce_mac_MainMenu.mm index a87fc6093b..29fc3f1815 100644 --- a/src/native/mac/juce_mac_MainMenu.mm +++ b/src/native/mac/juce_mac_MainMenu.mm @@ -35,7 +35,11 @@ using namespace JUCE_NAMESPACE; #define JuceMenuCallback MakeObjCClassName(JuceMenuCallback) +#if defined (MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 +@interface JuceMenuCallback : NSObject +#else @interface JuceMenuCallback : NSObject +#endif { JuceMainMenuHandler* owner; } diff --git a/src/native/mac/juce_mac_MiscUtilities.mm b/src/native/mac/juce_mac_MiscUtilities.mm index 8eb2cc2398..5a11603225 100644 --- a/src/native/mac/juce_mac_MiscUtilities.mm +++ b/src/native/mac/juce_mac_MiscUtilities.mm @@ -149,7 +149,9 @@ void Desktop::setMousePosition (int x, int y) throw() // this rubbish needs to be done around the warp call, to avoid causing a // bizarre glitch.. CGAssociateMouseAndMouseCursorPosition (false); +#if (! defined (MAC_OS_X_VERSION_10_6)) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6 CGSetLocalEventsSuppressionInterval (0); +#endif CGPoint pos = { x, y }; CGWarpMouseCursorPosition (pos); @@ -215,8 +217,13 @@ void Desktop::setScreenSaverEnabled (const bool isEnabled) throw() { if (screenSaverDisablerID == 0) { - IOPMAssertionCreate (kIOPMAssertionTypeNoIdleSleep, - kIOPMAssertionLevelOn, &screenSaverDisablerID); +#if defined (MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 + IOPMAssertionCreateWithName (kIOPMAssertionTypeNoIdleSleep, kIOPMAssertionLevelOn, + CFSTR ("Juce"), &screenSaverDisablerID); +#else + IOPMAssertionCreate (kIOPMAssertionTypeNoIdleSleep, kIOPMAssertionLevelOn, + &screenSaverDisablerID); +#endif } } } diff --git a/src/native/mac/juce_mac_NSViewComponentPeer.mm b/src/native/mac/juce_mac_NSViewComponentPeer.mm index 48a7512865..0db1747bee 100644 --- a/src/native/mac/juce_mac_NSViewComponentPeer.mm +++ b/src/native/mac/juce_mac_NSViewComponentPeer.mm @@ -91,7 +91,11 @@ END_JUCE_NAMESPACE //============================================================================== #define JuceNSWindow MakeObjCClassName(JuceNSWindow) +#if defined (MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 +@interface JuceNSWindow : NSWindow +#else @interface JuceNSWindow : NSWindow +#endif { @private NSViewComponentPeer* owner;