| @@ -98,6 +98,14 @@ public: | |||||
| props.add (new TextPropertyComponent (getSetting ("documentExtensions"), "Document file extensions", 128, false)); | props.add (new TextPropertyComponent (getSetting ("documentExtensions"), "Document file extensions", 128, false)); | ||||
| props.getLast()->setTooltip ("A comma-separated list of file extensions for documents that your app can open."); | props.getLast()->setTooltip ("A comma-separated list of file extensions for documents that your app can open."); | ||||
| } | } | ||||
| else if (iPhone) | |||||
| { | |||||
| props.add (new BooleanPropertyComponent (getSetting ("UIFileSharingEnabled"), "File Sharing Enabled", "Enabled")); | |||||
| props.getLast()->setTooltip ("Enable this to expose your app's files to iTunes."); | |||||
| props.add (new BooleanPropertyComponent (getSetting ("UIStatusBarHidden"), "Status Bar Hidden", "Enabled")); | |||||
| props.getLast()->setTooltip ("Enable this to disable the status bar in your app."); | |||||
| } | |||||
| } | } | ||||
| void launchProject() | void launchProject() | ||||
| @@ -326,6 +334,9 @@ private: | |||||
| XmlElement plist ("plist"); | XmlElement plist ("plist"); | ||||
| XmlElement* dict = plist.createNewChildElement ("dict"); | XmlElement* dict = plist.createNewChildElement ("dict"); | ||||
| if (iPhone) | |||||
| addPlistDictionaryKeyBool (dict, "LSRequiresIPhoneOS", true); | |||||
| addPlistDictionaryKey (dict, "CFBundleExecutable", "${EXECUTABLE_NAME}"); | addPlistDictionaryKey (dict, "CFBundleExecutable", "${EXECUTABLE_NAME}"); | ||||
| addPlistDictionaryKey (dict, "CFBundleIconFile", iconFile.exists() ? iconFile.getFileName() : String::empty); | addPlistDictionaryKey (dict, "CFBundleIconFile", iconFile.exists() ? iconFile.getFileName() : String::empty); | ||||
| addPlistDictionaryKey (dict, "CFBundleIdentifier", project.getBundleIdentifier().toString()); | addPlistDictionaryKey (dict, "CFBundleIdentifier", project.getBundleIdentifier().toString()); | ||||
| @@ -370,6 +381,12 @@ private: | |||||
| } | } | ||||
| } | } | ||||
| if (getSetting ("UIFileSharingEnabled").getValue()) | |||||
| addPlistDictionaryKeyBool (dict, "UIFileSharingEnabled", true); | |||||
| if (getSetting ("UIStatusBarHidden").getValue()) | |||||
| addPlistDictionaryKeyBool (dict, "UIStatusBarHidden", true); | |||||
| MemoryOutputStream mo; | MemoryOutputStream mo; | ||||
| plist.writeToStream (mo, "<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">"); | plist.writeToStream (mo, "<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">"); | ||||
| @@ -730,6 +747,12 @@ private: | |||||
| xml->createNewChildElement ("string")->addTextElement (value); | xml->createNewChildElement ("string")->addTextElement (value); | ||||
| } | } | ||||
| static void addPlistDictionaryKeyBool (XmlElement* xml, const String& key, const bool value) | |||||
| { | |||||
| xml->createNewChildElement ("key")->addTextElement (key); | |||||
| xml->createNewChildElement (value ? "true" : "false"); | |||||
| } | |||||
| const String addBuildFile (const RelativePath& path, const String& fileRefID, bool addToSourceBuildPhase, bool inhibitWarnings) | const String addBuildFile (const RelativePath& path, const String& fileRefID, bool addToSourceBuildPhase, bool inhibitWarnings) | ||||
| { | { | ||||
| String fileID (createID (path.toUnixStyle() + "buildref")); | String fileID (createID (path.toUnixStyle() + "buildref")); | ||||
| @@ -48,7 +48,7 @@ public: | |||||
| { | { | ||||
| } | } | ||||
| void initialise (const String& /*commandLine*/) | |||||
| void initialise (const String& commandLine) | |||||
| { | { | ||||
| // initialise our settings file.. | // initialise our settings file.. | ||||
| ApplicationProperties::getInstance() | ApplicationProperties::getInstance() | ||||
| @@ -83,6 +83,8 @@ public: | |||||
| void addPluginsToMenu (PopupMenu& m) const; | void addPluginsToMenu (PopupMenu& m) const; | ||||
| const PluginDescription* getChosenType (const int menuID) const; | const PluginDescription* getChosenType (const int menuID) const; | ||||
| GraphDocumentComponent* getGraphEditor() const; | |||||
| private: | private: | ||||
| //============================================================================== | //============================================================================== | ||||
| AudioDeviceManager deviceManager; | AudioDeviceManager deviceManager; | ||||
| @@ -92,7 +94,6 @@ private: | |||||
| KnownPluginList::SortMethod pluginSortMethod; | KnownPluginList::SortMethod pluginSortMethod; | ||||
| void showAudioSettings(); | void showAudioSettings(); | ||||
| GraphDocumentComponent* getGraphEditor() const; | |||||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainHostWindow); | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainHostWindow); | ||||
| }; | }; | ||||
| @@ -7567,7 +7567,13 @@ const String File::parseAbsolutePath (const String& p) | |||||
| } | } | ||||
| #else | #else | ||||
| // Mac or Linux.. | // Mac or Linux.. | ||||
| String path (p.replaceCharacter ('\\', '/')); | |||||
| // Yes, I know it's legal for a unix pathname to contain a backslash, but this assertion is here | |||||
| // to catch anyone who's trying to run code that was written on Windows with hard-coded path names. | |||||
| // If that's why you've ended up here, use File::getChildFile() to build your paths instead. | |||||
| jassert ((! p.containsChar ('\\')) || (p.indexOfChar ('/') >= 0 && p.indexOfChar ('/') < p.indexOfChar ('\\'))); | |||||
| String path (p); | |||||
| if (path.startsWithChar ('~')) | if (path.startsWithChar ('~')) | ||||
| { | { | ||||
| @@ -7808,11 +7814,11 @@ bool File::isAChildOf (const File& potentialParent) const | |||||
| bool File::isAbsolutePath (const String& path) | bool File::isAbsolutePath (const String& path) | ||||
| { | { | ||||
| return path.startsWithChar ('/') || path.startsWithChar ('\\') | return path.startsWithChar ('/') || path.startsWithChar ('\\') | ||||
| #if JUCE_WINDOWS | |||||
| #if JUCE_WINDOWS | |||||
| || (path.isNotEmpty() && path[1] == ':'); | || (path.isNotEmpty() && path[1] == ':'); | ||||
| #else | |||||
| #else | |||||
| || path.startsWithChar ('~'); | || path.startsWithChar ('~'); | ||||
| #endif | |||||
| #endif | |||||
| } | } | ||||
| const File File::getChildFile (String relativePath) const | const File File::getChildFile (String relativePath) const | ||||
| @@ -7829,11 +7835,12 @@ const File File::getChildFile (String relativePath) const | |||||
| if (relativePath[0] == '.') | if (relativePath[0] == '.') | ||||
| { | { | ||||
| #if JUCE_WINDOWS | |||||
| #if JUCE_WINDOWS | |||||
| relativePath = relativePath.replaceCharacter ('/', '\\').trimStart(); | relativePath = relativePath.replaceCharacter ('/', '\\').trimStart(); | ||||
| #else | |||||
| relativePath = relativePath.replaceCharacter ('\\', '/').trimStart(); | |||||
| #endif | |||||
| #else | |||||
| relativePath = relativePath.trimStart(); | |||||
| #endif | |||||
| while (relativePath[0] == '.') | while (relativePath[0] == '.') | ||||
| { | { | ||||
| if (relativePath[1] == '.') | if (relativePath[1] == '.') | ||||
| @@ -20657,7 +20664,7 @@ AudioFormatReader* AiffAudioFormat::createReaderFor (InputStream* sourceStream, | |||||
| { | { | ||||
| ScopedPointer <AiffAudioFormatReader> w (new AiffAudioFormatReader (sourceStream)); | ScopedPointer <AiffAudioFormatReader> w (new AiffAudioFormatReader (sourceStream)); | ||||
| if (w->sampleRate != 0) | |||||
| if (w->sampleRate > 0) | |||||
| return w.release(); | return w.release(); | ||||
| if (! deleteStreamIfOpeningFails) | if (! deleteStreamIfOpeningFails) | ||||
| @@ -22618,10 +22625,13 @@ public: | |||||
| { | { | ||||
| if (destSamples[j] != 0) | if (destSamples[j] != 0) | ||||
| { | { | ||||
| const short* const src = ((const short*) bufferList->mBuffers[0].mData) + j; | |||||
| const short* src = ((const short*) bufferList->mBuffers[0].mData) + j; | |||||
| for (int i = 0; i < samplesReceived; ++i) | for (int i = 0; i < samplesReceived; ++i) | ||||
| destSamples[j][startOffsetInDestBuffer + i] = src [i << 1] << 16; | |||||
| { | |||||
| destSamples[j][startOffsetInDestBuffer + i] = (*src << 16); | |||||
| src += numChannels; | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| @@ -23398,7 +23408,7 @@ AudioFormatReader* WavAudioFormat::createReaderFor (InputStream* sourceStream, | |||||
| { | { | ||||
| ScopedPointer <WavAudioFormatReader> r (new WavAudioFormatReader (sourceStream)); | ScopedPointer <WavAudioFormatReader> r (new WavAudioFormatReader (sourceStream)); | ||||
| if (r->sampleRate != 0) | |||||
| if (r->sampleRate > 0) | |||||
| return r.release(); | return r.release(); | ||||
| if (! deleteStreamIfOpeningFails) | if (! deleteStreamIfOpeningFails) | ||||
| @@ -23870,7 +23880,7 @@ void AudioTransportSource::setSource (PositionableAudioSource* const newSource, | |||||
| newPositionableSource->setNextReadPosition (0); | newPositionableSource->setNextReadPosition (0); | ||||
| if (sourceSampleRateToCorrectFor != 0) | |||||
| if (sourceSampleRateToCorrectFor > 0) | |||||
| newMasterSource = newResamplerSource | newMasterSource = newResamplerSource | ||||
| = new ResamplingAudioSource (newPositionableSource, false, maxNumChannels); | = new ResamplingAudioSource (newPositionableSource, false, maxNumChannels); | ||||
| else | else | ||||
| @@ -24013,7 +24023,7 @@ void AudioTransportSource::prepareToPlay (int samplesPerBlockExpected, | |||||
| if (masterSource != 0) | if (masterSource != 0) | ||||
| masterSource->prepareToPlay (samplesPerBlockExpected, sampleRate); | masterSource->prepareToPlay (samplesPerBlockExpected, sampleRate); | ||||
| if (resamplerSource != 0 && sourceSampleRate != 0) | |||||
| if (resamplerSource != 0 && sourceSampleRate > 0) | |||||
| resamplerSource->setResamplingRatio (sourceSampleRate / sampleRate); | resamplerSource->setResamplingRatio (sourceSampleRate / sampleRate); | ||||
| isPrepared = true; | isPrepared = true; | ||||
| @@ -24668,7 +24678,7 @@ void MixerAudioSource::addInputSource (AudioSource* input, const bool deleteWhen | |||||
| localBufferSize = bufferSizeExpected; | localBufferSize = bufferSizeExpected; | ||||
| } | } | ||||
| if (localRate != 0.0) | |||||
| if (localRate > 0.0) | |||||
| input->prepareToPlay (localBufferSize, localRate); | input->prepareToPlay (localBufferSize, localRate); | ||||
| const ScopedLock sl (lock); | const ScopedLock sl (lock); | ||||
| @@ -25516,7 +25526,7 @@ double AudioDeviceManager::chooseBestSampleRate (double rate) const | |||||
| { | { | ||||
| const double sr = currentAudioDevice->getSampleRate (i); | const double sr = currentAudioDevice->getSampleRate (i); | ||||
| if (sr >= 44100.0 && (lowestAbove44 == 0 || sr < lowestAbove44)) | |||||
| if (sr >= 44100.0 && (lowestAbove44 < 1.0 || sr < lowestAbove44)) | |||||
| lowestAbove44 = sr; | lowestAbove44 = sr; | ||||
| } | } | ||||
| @@ -28043,7 +28053,6 @@ namespace MidiFileHelpers | |||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| return correctedTempoTime + (time - tempoTime) * secsPerTick; | return correctedTempoTime + (time - tempoTime) * secsPerTick; | ||||
| @@ -28062,19 +28071,16 @@ namespace MidiFileHelpers | |||||
| { | { | ||||
| const double diff = (first->message.getTimeStamp() - second->message.getTimeStamp()); | const double diff = (first->message.getTimeStamp() - second->message.getTimeStamp()); | ||||
| if (diff == 0) | |||||
| { | |||||
| if (first->message.isNoteOff() && second->message.isNoteOn()) | |||||
| return -1; | |||||
| else if (first->message.isNoteOn() && second->message.isNoteOff()) | |||||
| return 1; | |||||
| else | |||||
| return 0; | |||||
| } | |||||
| else | |||||
| { | |||||
| return (diff > 0) ? 1 : -1; | |||||
| } | |||||
| if (diff > 0) | |||||
| return 1; | |||||
| else if (diff < 0) | |||||
| return -1; | |||||
| else if (first->message.isNoteOff() && second->message.isNoteOn()) | |||||
| return -1; | |||||
| else if (first->message.isNoteOn() && second->message.isNoteOff()) | |||||
| return 1; | |||||
| return 0; | |||||
| } | } | ||||
| }; | }; | ||||
| } | } | ||||
| @@ -62983,7 +62989,7 @@ void ResizableEdgeComponent::paint (Graphics& g) | |||||
| isMouseOver(), isMouseButtonDown()); | isMouseOver(), isMouseButtonDown()); | ||||
| } | } | ||||
| void ResizableEdgeComponent::mouseDown (const MouseEvent& e) | |||||
| void ResizableEdgeComponent::mouseDown (const MouseEvent&) | |||||
| { | { | ||||
| if (component == 0) | if (component == 0) | ||||
| { | { | ||||
| @@ -81073,7 +81079,7 @@ void Colour::getHSB (float& h, float& s, float& v) const throw() | |||||
| { | { | ||||
| s = (hi - lo) / (float) hi; | s = (hi - lo) / (float) hi; | ||||
| if (s != 0) | |||||
| if (s > 0) | |||||
| { | { | ||||
| const float invDiff = 1.0f / (hi - lo); | const float invDiff = 1.0f / (hi - lo); | ||||
| @@ -81451,6 +81457,16 @@ bool ColourGradient::isInvisible() const throw() | |||||
| return true; | return true; | ||||
| } | } | ||||
| bool ColourGradient::ColourPoint::operator== (const ColourPoint& other) const throw() | |||||
| { | |||||
| return position == other.position && colour == other.colour; | |||||
| } | |||||
| bool ColourGradient::ColourPoint::operator!= (const ColourPoint& other) const throw() | |||||
| { | |||||
| return position != other.position || colour != other.colour; | |||||
| } | |||||
| END_JUCE_NAMESPACE | END_JUCE_NAMESPACE | ||||
| /*** End of inlined file: juce_ColourGradient.cpp ***/ | /*** End of inlined file: juce_ColourGradient.cpp ***/ | ||||
| @@ -86641,7 +86657,7 @@ public: | |||||
| owner.repaint(); | owner.repaint(); | ||||
| } | } | ||||
| void applyNewBounds (const Rectangle<int>& newBounds) | |||||
| void applyNewBounds (const Rectangle<int>&) | |||||
| { | { | ||||
| jassertfalse; // drawables can't be resized directly! | jassertfalse; // drawables can't be resized directly! | ||||
| } | } | ||||
| @@ -87701,7 +87717,7 @@ public: | |||||
| owner.applyRelativePath (*owner.relativePath, &scope); | owner.applyRelativePath (*owner.relativePath, &scope); | ||||
| } | } | ||||
| void applyNewBounds (const Rectangle<int>& newBounds) | |||||
| void applyNewBounds (const Rectangle<int>&) | |||||
| { | { | ||||
| jassertfalse; // drawables can't be resized directly! | jassertfalse; // drawables can't be resized directly! | ||||
| } | } | ||||
| @@ -93782,6 +93798,12 @@ PathFlatteningIterator::~PathFlatteningIterator() | |||||
| { | { | ||||
| } | } | ||||
| bool PathFlatteningIterator::isLastInSubpath() const throw() | |||||
| { | |||||
| return stackPos == stackBase.getData() | |||||
| && (index >= path.numElements || points [index] == Path::moveMarker); | |||||
| } | |||||
| bool PathFlatteningIterator::next() | bool PathFlatteningIterator::next() | ||||
| { | { | ||||
| x1 = x2; | x1 = x2; | ||||
| @@ -129170,7 +129192,7 @@ AudioFormatReader* FlacAudioFormat::createReaderFor (InputStream* in, | |||||
| { | { | ||||
| ScopedPointer<FlacReader> r (new FlacReader (in)); | ScopedPointer<FlacReader> r (new FlacReader (in)); | ||||
| if (r->sampleRate != 0) | |||||
| if (r->sampleRate > 0) | |||||
| return r.release(); | return r.release(); | ||||
| if (! deleteStreamIfOpeningFails) | if (! deleteStreamIfOpeningFails) | ||||
| @@ -188176,7 +188198,7 @@ AudioFormatReader* OggVorbisAudioFormat::createReaderFor (InputStream* in, | |||||
| { | { | ||||
| ScopedPointer <OggReader> r (new OggReader (in)); | ScopedPointer <OggReader> r (new OggReader (in)); | ||||
| if (r->sampleRate != 0) | |||||
| if (r->sampleRate > 0) | |||||
| return r.release(); | return r.release(); | ||||
| if (! deleteStreamIfOpeningFails) | if (! deleteStreamIfOpeningFails) | ||||
| @@ -24103,7 +24103,7 @@ public: | |||||
| const Point<ValueType> delta (end - start); | const Point<ValueType> delta (end - start); | ||||
| const double length = juce_hypot ((double) delta.getX(), | const double length = juce_hypot ((double) delta.getX(), | ||||
| (double) delta.getY()); | (double) delta.getY()); | ||||
| if (length == 0) | |||||
| if (length <= 0) | |||||
| return start; | return start; | ||||
| return Point<ValueType> (start.getX() + (ValueType) ((delta.getX() * distanceFromStart - delta.getY() * perpendicularDistance) / length), | return Point<ValueType> (start.getX() + (ValueType) ((delta.getX() * distanceFromStart - delta.getY() * perpendicularDistance) / length), | ||||
| @@ -27692,8 +27692,8 @@ private: | |||||
| : position (position_), colour (colour_) | : position (position_), colour (colour_) | ||||
| {} | {} | ||||
| bool operator== (const ColourPoint& other) const throw() { return position == other.position && colour == other.colour; } | |||||
| bool operator!= (const ColourPoint& other) const throw() { return position != other.position || colour != other.colour; } | |||||
| bool operator== (const ColourPoint& other) const throw(); | |||||
| bool operator!= (const ColourPoint& other) const throw(); | |||||
| double position; | double position; | ||||
| Colour colour; | Colour colour; | ||||
| @@ -65679,8 +65679,7 @@ public: | |||||
| int subPathIndex; | int subPathIndex; | ||||
| /** Returns true if the current segment is the last in the current sub-path. */ | /** Returns true if the current segment is the last in the current sub-path. */ | ||||
| bool isLastInSubpath() const throw() { return stackPos == stackBase.getData() | |||||
| && (index >= path.numElements || points [index] == Path::moveMarker); } | |||||
| bool isLastInSubpath() const throw(); | |||||
| /** This is the default value that should be used for the tolerance value (see the constructor parameters). */ | /** This is the default value that should be used for the tolerance value (see the constructor parameters). */ | ||||
| static const float defaultTolerance; | static const float defaultTolerance; | ||||
| @@ -404,7 +404,7 @@ AudioFormatReader* AiffAudioFormat::createReaderFor (InputStream* sourceStream, | |||||
| { | { | ||||
| ScopedPointer <AiffAudioFormatReader> w (new AiffAudioFormatReader (sourceStream)); | ScopedPointer <AiffAudioFormatReader> w (new AiffAudioFormatReader (sourceStream)); | ||||
| if (w->sampleRate != 0) | |||||
| if (w->sampleRate > 0) | |||||
| return w.release(); | return w.release(); | ||||
| if (! deleteStreamIfOpeningFails) | if (! deleteStreamIfOpeningFails) | ||||
| @@ -507,7 +507,7 @@ AudioFormatReader* FlacAudioFormat::createReaderFor (InputStream* in, | |||||
| { | { | ||||
| ScopedPointer<FlacReader> r (new FlacReader (in)); | ScopedPointer<FlacReader> r (new FlacReader (in)); | ||||
| if (r->sampleRate != 0) | |||||
| if (r->sampleRate > 0) | |||||
| return r.release(); | return r.release(); | ||||
| if (! deleteStreamIfOpeningFails) | if (! deleteStreamIfOpeningFails) | ||||
| @@ -426,7 +426,7 @@ AudioFormatReader* OggVorbisAudioFormat::createReaderFor (InputStream* in, | |||||
| { | { | ||||
| ScopedPointer <OggReader> r (new OggReader (in)); | ScopedPointer <OggReader> r (new OggReader (in)); | ||||
| if (r->sampleRate != 0) | |||||
| if (r->sampleRate > 0) | |||||
| return r.release(); | return r.release(); | ||||
| if (! deleteStreamIfOpeningFails) | if (! deleteStreamIfOpeningFails) | ||||
| @@ -280,10 +280,13 @@ public: | |||||
| { | { | ||||
| if (destSamples[j] != 0) | if (destSamples[j] != 0) | ||||
| { | { | ||||
| const short* const src = ((const short*) bufferList->mBuffers[0].mData) + j; | |||||
| const short* src = ((const short*) bufferList->mBuffers[0].mData) + j; | |||||
| for (int i = 0; i < samplesReceived; ++i) | for (int i = 0; i < samplesReceived; ++i) | ||||
| destSamples[j][startOffsetInDestBuffer + i] = src [i << 1] << 16; | |||||
| { | |||||
| destSamples[j][startOffsetInDestBuffer + i] = (*src << 16); | |||||
| src += numChannels; | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| @@ -718,7 +718,7 @@ AudioFormatReader* WavAudioFormat::createReaderFor (InputStream* sourceStream, | |||||
| { | { | ||||
| ScopedPointer <WavAudioFormatReader> r (new WavAudioFormatReader (sourceStream)); | ScopedPointer <WavAudioFormatReader> r (new WavAudioFormatReader (sourceStream)); | ||||
| if (r->sampleRate != 0) | |||||
| if (r->sampleRate > 0) | |||||
| return r.release(); | return r.release(); | ||||
| if (! deleteStreamIfOpeningFails) | if (! deleteStreamIfOpeningFails) | ||||
| @@ -94,7 +94,7 @@ void AudioTransportSource::setSource (PositionableAudioSource* const newSource, | |||||
| newPositionableSource->setNextReadPosition (0); | newPositionableSource->setNextReadPosition (0); | ||||
| if (sourceSampleRateToCorrectFor != 0) | |||||
| if (sourceSampleRateToCorrectFor > 0) | |||||
| newMasterSource = newResamplerSource | newMasterSource = newResamplerSource | ||||
| = new ResamplingAudioSource (newPositionableSource, false, maxNumChannels); | = new ResamplingAudioSource (newPositionableSource, false, maxNumChannels); | ||||
| else | else | ||||
| @@ -237,7 +237,7 @@ void AudioTransportSource::prepareToPlay (int samplesPerBlockExpected, | |||||
| if (masterSource != 0) | if (masterSource != 0) | ||||
| masterSource->prepareToPlay (samplesPerBlockExpected, sampleRate); | masterSource->prepareToPlay (samplesPerBlockExpected, sampleRate); | ||||
| if (resamplerSource != 0 && sourceSampleRate != 0) | |||||
| if (resamplerSource != 0 && sourceSampleRate > 0) | |||||
| resamplerSource->setResamplingRatio (sourceSampleRate / sampleRate); | resamplerSource->setResamplingRatio (sourceSampleRate / sampleRate); | ||||
| isPrepared = true; | isPrepared = true; | ||||
| @@ -59,7 +59,7 @@ void MixerAudioSource::addInputSource (AudioSource* input, const bool deleteWhen | |||||
| localBufferSize = bufferSizeExpected; | localBufferSize = bufferSizeExpected; | ||||
| } | } | ||||
| if (localRate != 0.0) | |||||
| if (localRate > 0.0) | |||||
| input->prepareToPlay (localBufferSize, localRate); | input->prepareToPlay (localBufferSize, localRate); | ||||
| const ScopedLock sl (lock); | const ScopedLock sl (lock); | ||||
| @@ -468,7 +468,7 @@ double AudioDeviceManager::chooseBestSampleRate (double rate) const | |||||
| { | { | ||||
| const double sr = currentAudioDevice->getSampleRate (i); | const double sr = currentAudioDevice->getSampleRate (i); | ||||
| if (sr >= 44100.0 && (lowestAbove44 == 0 || sr < lowestAbove44)) | |||||
| if (sr >= 44100.0 && (lowestAbove44 < 1.0 || sr < lowestAbove44)) | |||||
| lowestAbove44 = sr; | lowestAbove44 = sr; | ||||
| } | } | ||||
| @@ -150,7 +150,6 @@ namespace MidiFileHelpers | |||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| return correctedTempoTime + (time - tempoTime) * secsPerTick; | return correctedTempoTime + (time - tempoTime) * secsPerTick; | ||||
| @@ -169,19 +168,16 @@ namespace MidiFileHelpers | |||||
| { | { | ||||
| const double diff = (first->message.getTimeStamp() - second->message.getTimeStamp()); | const double diff = (first->message.getTimeStamp() - second->message.getTimeStamp()); | ||||
| if (diff == 0) | |||||
| { | |||||
| if (first->message.isNoteOff() && second->message.isNoteOn()) | |||||
| return -1; | |||||
| else if (first->message.isNoteOn() && second->message.isNoteOff()) | |||||
| return 1; | |||||
| else | |||||
| return 0; | |||||
| } | |||||
| else | |||||
| { | |||||
| return (diff > 0) ? 1 : -1; | |||||
| } | |||||
| if (diff > 0) | |||||
| return 1; | |||||
| else if (diff < 0) | |||||
| return -1; | |||||
| else if (first->message.isNoteOff() && second->message.isNoteOn()) | |||||
| return -1; | |||||
| else if (first->message.isNoteOn() && second->message.isNoteOff()) | |||||
| return 1; | |||||
| return 0; | |||||
| } | } | ||||
| }; | }; | ||||
| } | } | ||||
| @@ -60,7 +60,7 @@ void ResizableEdgeComponent::paint (Graphics& g) | |||||
| isMouseOver(), isMouseButtonDown()); | isMouseOver(), isMouseButtonDown()); | ||||
| } | } | ||||
| void ResizableEdgeComponent::mouseDown (const MouseEvent& e) | |||||
| void ResizableEdgeComponent::mouseDown (const MouseEvent&) | |||||
| { | { | ||||
| if (component == 0) | if (component == 0) | ||||
| { | { | ||||
| @@ -339,7 +339,7 @@ void Colour::getHSB (float& h, float& s, float& v) const throw() | |||||
| { | { | ||||
| s = (hi - lo) / (float) hi; | s = (hi - lo) / (float) hi; | ||||
| if (s != 0) | |||||
| if (s > 0) | |||||
| { | { | ||||
| const float invDiff = 1.0f / (hi - lo); | const float invDiff = 1.0f / (hi - lo); | ||||
| @@ -219,5 +219,15 @@ bool ColourGradient::isInvisible() const throw() | |||||
| return true; | return true; | ||||
| } | } | ||||
| bool ColourGradient::ColourPoint::operator== (const ColourPoint& other) const throw() | |||||
| { | |||||
| return position == other.position && colour == other.colour; | |||||
| } | |||||
| bool ColourGradient::ColourPoint::operator!= (const ColourPoint& other) const throw() | |||||
| { | |||||
| return position != other.position || colour != other.colour; | |||||
| } | |||||
| END_JUCE_NAMESPACE | END_JUCE_NAMESPACE | ||||
| @@ -163,8 +163,8 @@ private: | |||||
| : position (position_), colour (colour_) | : position (position_), colour (colour_) | ||||
| {} | {} | ||||
| bool operator== (const ColourPoint& other) const throw() { return position == other.position && colour == other.colour; } | |||||
| bool operator!= (const ColourPoint& other) const throw() { return position != other.position || colour != other.colour; } | |||||
| bool operator== (const ColourPoint& other) const throw(); | |||||
| bool operator!= (const ColourPoint& other) const throw(); | |||||
| double position; | double position; | ||||
| Colour colour; | Colour colour; | ||||
| @@ -123,7 +123,7 @@ public: | |||||
| owner.applyRelativePath (*owner.relativePath, &scope); | owner.applyRelativePath (*owner.relativePath, &scope); | ||||
| } | } | ||||
| void applyNewBounds (const Rectangle<int>& newBounds) | |||||
| void applyNewBounds (const Rectangle<int>&) | |||||
| { | { | ||||
| jassertfalse; // drawables can't be resized directly! | jassertfalse; // drawables can't be resized directly! | ||||
| } | } | ||||
| @@ -77,7 +77,7 @@ public: | |||||
| owner.repaint(); | owner.repaint(); | ||||
| } | } | ||||
| void applyNewBounds (const Rectangle<int>& newBounds) | |||||
| void applyNewBounds (const Rectangle<int>&) | |||||
| { | { | ||||
| jassertfalse; // drawables can't be resized directly! | jassertfalse; // drawables can't be resized directly! | ||||
| } | } | ||||
| @@ -211,7 +211,7 @@ public: | |||||
| const Point<ValueType> delta (end - start); | const Point<ValueType> delta (end - start); | ||||
| const double length = juce_hypot ((double) delta.getX(), | const double length = juce_hypot ((double) delta.getX(), | ||||
| (double) delta.getY()); | (double) delta.getY()); | ||||
| if (length == 0) | |||||
| if (length <= 0) | |||||
| return start; | return start; | ||||
| return Point<ValueType> (start.getX() + (ValueType) ((delta.getX() * distanceFromStart - delta.getY() * perpendicularDistance) / length), | return Point<ValueType> (start.getX() + (ValueType) ((delta.getX() * distanceFromStart - delta.getY() * perpendicularDistance) / length), | ||||
| @@ -63,6 +63,12 @@ PathFlatteningIterator::~PathFlatteningIterator() | |||||
| { | { | ||||
| } | } | ||||
| bool PathFlatteningIterator::isLastInSubpath() const throw() | |||||
| { | |||||
| return stackPos == stackBase.getData() | |||||
| && (index >= path.numElements || points [index] == Path::moveMarker); | |||||
| } | |||||
| bool PathFlatteningIterator::next() | bool PathFlatteningIterator::next() | ||||
| { | { | ||||
| x1 = x2; | x1 = x2; | ||||
| @@ -91,9 +91,7 @@ public: | |||||
| int subPathIndex; | int subPathIndex; | ||||
| /** Returns true if the current segment is the last in the current sub-path. */ | /** Returns true if the current segment is the last in the current sub-path. */ | ||||
| bool isLastInSubpath() const throw() { return stackPos == stackBase.getData() | |||||
| && (index >= path.numElements || points [index] == Path::moveMarker); } | |||||
| bool isLastInSubpath() const throw(); | |||||
| /** This is the default value that should be used for the tolerance value (see the constructor parameters). */ | /** This is the default value that should be used for the tolerance value (see the constructor parameters). */ | ||||
| static const float defaultTolerance; | static const float defaultTolerance; | ||||
| @@ -118,7 +118,13 @@ const String File::parseAbsolutePath (const String& p) | |||||
| } | } | ||||
| #else | #else | ||||
| // Mac or Linux.. | // Mac or Linux.. | ||||
| String path (p.replaceCharacter ('\\', '/')); | |||||
| // Yes, I know it's legal for a unix pathname to contain a backslash, but this assertion is here | |||||
| // to catch anyone who's trying to run code that was written on Windows with hard-coded path names. | |||||
| // If that's why you've ended up here, use File::getChildFile() to build your paths instead. | |||||
| jassert ((! p.containsChar ('\\')) || (p.indexOfChar ('/') >= 0 && p.indexOfChar ('/') < p.indexOfChar ('\\'))); | |||||
| String path (p); | |||||
| if (path.startsWithChar ('~')) | if (path.startsWithChar ('~')) | ||||
| { | { | ||||
| @@ -364,11 +370,11 @@ bool File::isAChildOf (const File& potentialParent) const | |||||
| bool File::isAbsolutePath (const String& path) | bool File::isAbsolutePath (const String& path) | ||||
| { | { | ||||
| return path.startsWithChar ('/') || path.startsWithChar ('\\') | return path.startsWithChar ('/') || path.startsWithChar ('\\') | ||||
| #if JUCE_WINDOWS | |||||
| #if JUCE_WINDOWS | |||||
| || (path.isNotEmpty() && path[1] == ':'); | || (path.isNotEmpty() && path[1] == ':'); | ||||
| #else | |||||
| #else | |||||
| || path.startsWithChar ('~'); | || path.startsWithChar ('~'); | ||||
| #endif | |||||
| #endif | |||||
| } | } | ||||
| const File File::getChildFile (String relativePath) const | const File File::getChildFile (String relativePath) const | ||||
| @@ -385,11 +391,12 @@ const File File::getChildFile (String relativePath) const | |||||
| if (relativePath[0] == '.') | if (relativePath[0] == '.') | ||||
| { | { | ||||
| #if JUCE_WINDOWS | |||||
| #if JUCE_WINDOWS | |||||
| relativePath = relativePath.replaceCharacter ('/', '\\').trimStart(); | relativePath = relativePath.replaceCharacter ('/', '\\').trimStart(); | ||||
| #else | |||||
| relativePath = relativePath.replaceCharacter ('\\', '/').trimStart(); | |||||
| #endif | |||||
| #else | |||||
| relativePath = relativePath.trimStart(); | |||||
| #endif | |||||
| while (relativePath[0] == '.') | while (relativePath[0] == '.') | ||||
| { | { | ||||
| if (relativePath[1] == '.') | if (relativePath[1] == '.') | ||||