Browse Source

minor tidying up and removal of a few compiler warnings

tags/2021-05-28
Julian Storer 16 years ago
parent
commit
151f5e3d09
7 changed files with 34 additions and 7 deletions
  1. +6
    -4
      src/audio/audio_file_formats/juce_AudioThumbnail.h
  2. +1
    -1
      src/gui/graphics/drawables/juce_DrawablePath.cpp
  3. +4
    -0
      src/native/mac/juce_mac_FileChooser.mm
  4. +6
    -0
      src/native/mac/juce_mac_Files.mm
  5. +4
    -0
      src/native/mac/juce_mac_MainMenu.mm
  6. +9
    -2
      src/native/mac/juce_mac_MiscUtilities.mm
  7. +4
    -0
      src/native/mac/juce_mac_NSViewComponentPeer.mm

+ 6
- 4
src/audio/audio_file_formats/juce_AudioThumbnail.h View File

@@ -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);


+ 1
- 1
src/gui/graphics/drawables/juce_DrawablePath.cpp View File

@@ -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),


+ 4
- 0
src/native/mac/juce_mac_FileChooser.mm View File

@@ -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 <NSOpenSavePanelDelegate>
#else
@interface JuceFileChooserDelegate : NSObject
#endif
{
StringArray* filters;
}


+ 6
- 0
src/native/mac/juce_mac_Files.mm View File

@@ -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()


+ 4
- 0
src/native/mac/juce_mac_MainMenu.mm View File

@@ -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 <NSMenuDelegate>
#else
@interface JuceMenuCallback : NSObject
#endif
{
JuceMainMenuHandler* owner;
}


+ 9
- 2
src/native/mac/juce_mac_MiscUtilities.mm View File

@@ -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
}
}
}


+ 4
- 0
src/native/mac/juce_mac_NSViewComponentPeer.mm View File

@@ -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 <NSWindowDelegate>
#else
@interface JuceNSWindow : NSWindow
#endif
{
@private
NSViewComponentPeer* owner;


Loading…
Cancel
Save