From a728139698e5de2e46e775339f9fcf5460808170 Mon Sep 17 00:00:00 2001 From: Julian Storer Date: Thu, 25 Mar 2010 14:21:34 +0000 Subject: [PATCH] Small fix for demo plugin code. Minor code clean-ups. --- .../demo/Source/PluginEditor.cpp | 2 +- .../demo/Source/PluginProcessor.cpp | 1 + .../wrapper/AU/juce_AU_Wrapper.mm | 2 +- juce_amalgamated.cpp | 275 +++----- juce_amalgamated.h | 651 ++++++++---------- .../juce_AudioFormatManager.h | 4 +- .../juce_AudioFormatReader.h | 10 +- .../juce_AudioFormatWriter.h | 10 +- .../juce_AudioSubsectionReader.h | 8 +- .../audio_file_formats/juce_AudioThumbnail.h | 18 +- .../juce_AudioThumbnailCache.h | 10 +- src/audio/devices/juce_AudioDeviceManager.h | 18 +- src/audio/devices/juce_AudioIODeviceType.h | 6 +- src/audio/devices/juce_MidiOutput.h | 2 +- src/audio/dsp/juce_AudioDataConverters.h | 40 +- src/audio/dsp/juce_AudioSampleBuffer.h | 126 ++-- src/audio/dsp/juce_IIRFilter.h | 38 +- src/audio/midi/juce_MidiBuffer.cpp | 33 +- src/audio/midi/juce_MidiBuffer.h | 2 +- src/audio/midi/juce_MidiFile.cpp | 12 +- src/audio/midi/juce_MidiFile.h | 10 +- src/audio/midi/juce_MidiKeyboardState.cpp | 10 +- src/audio/midi/juce_MidiKeyboardState.h | 2 +- src/audio/midi/juce_MidiMessage.cpp | 59 +- src/audio/midi/juce_MidiMessage.h | 122 ++-- src/audio/midi/juce_MidiMessageCollector.h | 5 +- src/audio/midi/juce_MidiMessageSequence.h | 30 +- .../formats/juce_AudioUnitPluginFormat.h | 2 +- .../plugins/formats/juce_VSTPluginFormat.h | 2 +- src/audio/plugins/juce_AudioPluginFormat.h | 2 +- src/audio/plugins/juce_KnownPluginList.h | 8 +- .../plugins/juce_PluginDirectoryScanner.h | 4 +- src/audio/plugins/juce_PluginListComponent.h | 2 +- .../processors/juce_AudioProcessorGraph.h | 45 +- src/audio/synthesisers/juce_Sampler.h | 8 +- src/audio/synthesisers/juce_Synthesiser.h | 26 +- src/core/juce_Uuid.cpp | 3 +- .../juce_DirectoryContentsDisplayComponent.h | 4 +- .../filebrowser/juce_DirectoryContentsList.h | 21 +- .../filebrowser/juce_FileBrowserComponent.h | 4 +- .../components/filebrowser/juce_FileChooser.h | 25 +- .../filebrowser/juce_FileChooserDialogBox.h | 2 +- .../filebrowser/juce_FilenameComponent.h | 18 +- .../components/special/juce_DropShadower.cpp | 6 +- src/gui/graphics/effects/juce_GlowEffect.cpp | 7 +- src/gui/graphics/geometry/juce_Path.cpp | 37 +- .../imaging/juce_ImageConvolutionKernel.cpp | 38 +- .../imaging/juce_ImageConvolutionKernel.h | 18 +- src/io/streams/juce_MemoryOutputStream.cpp | 15 +- src/io/streams/juce_MemoryOutputStream.h | 7 +- src/native/linux/juce_linux_Audio.cpp | 8 +- src/native/linux/juce_linux_FileChooser.cpp | 5 +- src/native/linux/juce_linux_JackAudio.cpp | 8 +- src/native/mac/juce_iphone_Audio.cpp | 6 +- src/native/mac/juce_mac_CoreAudio.cpp | 6 +- src/native/windows/juce_win32_ASIO.cpp | 6 +- .../windows/juce_win32_AudioCDReader.cpp | 2 +- src/native/windows/juce_win32_DirectSound.cpp | 6 +- src/native/windows/juce_win32_WASAPI.cpp | 6 +- src/text/juce_XmlElement.cpp | 2 +- 60 files changed, 836 insertions(+), 1029 deletions(-) diff --git a/extras/audio plugins/demo/Source/PluginEditor.cpp b/extras/audio plugins/demo/Source/PluginEditor.cpp index d6a5a64caf..9581cbc3f9 100644 --- a/extras/audio plugins/demo/Source/PluginEditor.cpp +++ b/extras/audio plugins/demo/Source/PluginEditor.cpp @@ -59,7 +59,7 @@ JuceDemoPluginAudioProcessorEditor::~JuceDemoPluginAudioProcessorEditor() //============================================================================== void JuceDemoPluginAudioProcessorEditor::paint (Graphics& g) { - g.setGradientFill (ColourGradient (Colours::white, 0, 0, Colours::grey, 0, getHeight(), false)); + g.setGradientFill (ColourGradient (Colours::white, 0, 0, Colours::grey, 0, (float) getHeight(), false)); g.fillAll(); } diff --git a/extras/audio plugins/demo/Source/PluginProcessor.cpp b/extras/audio plugins/demo/Source/PluginProcessor.cpp index 838a2945b4..b6ef4e9887 100644 --- a/extras/audio plugins/demo/Source/PluginProcessor.cpp +++ b/extras/audio plugins/demo/Source/PluginProcessor.cpp @@ -210,6 +210,7 @@ void JuceDemoPluginAudioProcessor::prepareToPlay (double sampleRate, int samples { // Use this method as the place to do any pre-playback // initialisation that you need.. + synth.setCurrentPlaybackSampleRate (sampleRate); keyboardState.reset(); delayBuffer.clear(); } diff --git a/extras/audio plugins/wrapper/AU/juce_AU_Wrapper.mm b/extras/audio plugins/wrapper/AU/juce_AU_Wrapper.mm index f19dd4dfa4..3b9ac11e82 100644 --- a/extras/audio plugins/wrapper/AU/juce_AU_Wrapper.mm +++ b/extras/audio plugins/wrapper/AU/juce_AU_Wrapper.mm @@ -766,7 +766,7 @@ public: { const ScopedLock sl (incomingMidiLock); midiEvents.clear(); - incomingEvents.swap (midiEvents); + incomingEvents.swapWith (midiEvents); } { diff --git a/juce_amalgamated.cpp b/juce_amalgamated.cpp index 4e33b278b8..a70cb369b4 100644 --- a/juce_amalgamated.cpp +++ b/juce_amalgamated.cpp @@ -8623,16 +8623,6 @@ const char* MemoryOutputStream::getData() const throw() return d; } -size_t MemoryOutputStream::getDataSize() const throw() -{ - return size; -} - -int64 MemoryOutputStream::getPosition() -{ - return position; -} - bool MemoryOutputStream::setPosition (int64 newPosition) { if (newPosition <= (int64) size) @@ -8648,6 +8638,11 @@ bool MemoryOutputStream::setPosition (int64 newPosition) } } +const String MemoryOutputStream::toUTF8() const +{ + return String (getData(), getDataSize()); +} + END_JUCE_NAMESPACE /*** End of inlined file: juce_MemoryOutputStream.cpp ***/ @@ -8846,7 +8841,8 @@ Uuid& Uuid::operator= (const Uuid& other) bool Uuid::operator== (const Uuid& other) const { - return memcmp (value.asBytes, other.value.asBytes, 16) == 0; + return value.asInt64[0] == other.value.asInt64[0] + && value.asInt64[1] == other.value.asInt64[1]; } bool Uuid::operator!= (const Uuid& other) const @@ -14125,7 +14121,7 @@ const String XmlElement::createDocument (const String& dtdToUse, MemoryOutputStream mem (2048, 4096); writeToStream (mem, dtdToUse, allOnOneLine, includeXmlHeader, encodingType, lineWrapLength); - return String (mem.getData(), mem.getDataSize()); + return mem.toUTF8(); } void XmlElement::writeToStream (OutputStream& output, @@ -26326,7 +26322,7 @@ MidiBuffer& MidiBuffer::operator= (const MidiBuffer& other) throw() return *this; } -void MidiBuffer::swap (MidiBuffer& other) +void MidiBuffer::swapWith (MidiBuffer& other) { data.swapWith (other.data); swapVariables (bytesUsed, other.bytesUsed); @@ -26410,13 +26406,11 @@ void MidiBuffer::addEvent (const uint8* const newData, const int bytesToMove = bytesUsed - (int) (d - getData()); if (bytesToMove > 0) - memmove (d + numBytes + 6, - d, - bytesToMove); + memmove (d + numBytes + 6, d, bytesToMove); - *(int*) d = sampleNumber; + *reinterpret_cast (d) = sampleNumber; d += 4; - *(uint16*) d = (uint16) numBytes; + *reinterpret_cast (d) = (uint16) numBytes; d += 2; memcpy (d, newData, numBytes); @@ -26457,7 +26451,7 @@ int MidiBuffer::getNumEvents() const throw() while (d < end) { d += 4; - d += 2 + *(const uint16*) d; + d += 2 + *reinterpret_cast (d); ++n; } @@ -26479,10 +26473,10 @@ int MidiBuffer::getLastEventTime() const throw() for (;;) { - const uint8* nextOne = d + 6 + * (const uint16*) (d + 4); + const uint8* nextOne = d + 6 + *reinterpret_cast (d + 4); if (nextOne >= endData) - return *(const int*) d; + return *reinterpret_cast (d); d = nextOne; } @@ -26492,10 +26486,10 @@ uint8* MidiBuffer::findEventAfter (uint8* d, const int samplePosition) const thr { const uint8* const endData = getData() + bytesUsed; - while (d < endData && *(int*) d <= samplePosition) + while (d < endData && *reinterpret_cast (d) <= samplePosition) { d += 4; - d += 2 + *(uint16*) d; + d += 2 + *reinterpret_cast (d); } return d; @@ -26516,23 +26510,21 @@ void MidiBuffer::Iterator::setNextSamplePosition (const int samplePosition) thro data = buffer.getData(); const uint8* dataEnd = data + buffer.bytesUsed; - while (data < dataEnd && *reinterpret_cast (data) < samplePosition) + while (data < dataEnd && *reinterpret_cast (data) < samplePosition) { data += 4; data += 2 + *(uint16*) data; } } -bool MidiBuffer::Iterator::getNextEvent (const uint8* &midiData, - int& numBytes, - int& samplePosition) throw() +bool MidiBuffer::Iterator::getNextEvent (const uint8* &midiData, int& numBytes, int& samplePosition) throw() { if (data >= buffer.getData() + buffer.bytesUsed) return false; - samplePosition = *(int*) data; + samplePosition = *reinterpret_cast (data); data += 4; - numBytes = *(uint16*) data; + numBytes = *reinterpret_cast (data); data += 2; midiData = data; data += numBytes; @@ -26540,8 +26532,7 @@ bool MidiBuffer::Iterator::getNextEvent (const uint8* &midiData, return true; } -bool MidiBuffer::Iterator::getNextEvent (MidiMessage& result, - int& samplePosition) throw() +bool MidiBuffer::Iterator::getNextEvent (MidiMessage& result, int& samplePosition) throw() { if (data >= buffer.getData() + buffer.bytesUsed) return false; @@ -26693,17 +26684,17 @@ namespace MidiFileHelpers } } -MidiFile::MidiFile() throw() +MidiFile::MidiFile() : timeFormat ((short) (unsigned short) 0xe728) { } -MidiFile::~MidiFile() throw() +MidiFile::~MidiFile() { clear(); } -void MidiFile::clear() throw() +void MidiFile::clear() { tracks.clear(); } @@ -26718,7 +26709,7 @@ const MidiMessageSequence* MidiFile::getTrack (const int index) const throw() return tracks [index]; } -void MidiFile::addTrack (const MidiMessageSequence& trackSequence) throw() +void MidiFile::addTrack (const MidiMessageSequence& trackSequence) { tracks.add (new MidiMessageSequence (trackSequence)); } @@ -26730,7 +26721,7 @@ short MidiFile::getTimeFormat() const throw() void MidiFile::setTicksPerQuarterNote (const int ticks) throw() { - timeFormat = (short)ticks; + timeFormat = (short) ticks; } void MidiFile::setSmpteTimeFormat (const int framesPerSecond, @@ -26833,7 +26824,7 @@ bool MidiFile::readFrom (InputStream& sourceStream) // a comparator that puts all the note-offs before note-ons that have the same time int MidiFile::compareElements (const MidiMessageSequence::MidiEventHolder* const first, - const MidiMessageSequence::MidiEventHolder* const second) throw() + const MidiMessageSequence::MidiEventHolder* const second) { const double diff = (first->message.getTimeStamp() - second->message.getTimeStamp()); @@ -26983,7 +26974,7 @@ BEGIN_JUCE_NAMESPACE MidiKeyboardState::MidiKeyboardState() { - zeromem (noteStates, sizeof (noteStates)); + zerostruct (noteStates); } MidiKeyboardState::~MidiKeyboardState() @@ -26993,7 +26984,7 @@ MidiKeyboardState::~MidiKeyboardState() void MidiKeyboardState::reset() { const ScopedLock sl (lock); - zeromem (noteStates, sizeof (noteStates)); + zerostruct (noteStates); eventsToAdd.clear(); } @@ -27035,8 +27026,7 @@ void MidiKeyboardState::noteOnInternal (const int midiChannel, const int midiNo noteStates [midiNoteNumber] |= (1 << (midiChannel - 1)); for (int i = listeners.size(); --i >= 0;) - ((MidiKeyboardStateListener*) listeners.getUnchecked(i)) - ->handleNoteOn (this, midiChannel, midiNoteNumber, velocity); + listeners.getUnchecked(i)->handleNoteOn (this, midiChannel, midiNoteNumber, velocity); } } @@ -27061,8 +27051,7 @@ void MidiKeyboardState::noteOffInternal (const int midiChannel, const int midiN noteStates [midiNoteNumber] &= ~(1 << (midiChannel - 1)); for (int i = listeners.size(); --i >= 0;) - ((MidiKeyboardStateListener*) listeners.getUnchecked(i)) - ->handleNoteOff (this, midiChannel, midiNoteNumber); + listeners.getUnchecked(i)->handleNoteOff (this, midiChannel, midiNoteNumber); } } @@ -27191,9 +27180,7 @@ int MidiMessage::getMessageLengthFromFirstByte (const uint8 firstByte) throw() return messageLengths [firstByte & 0x7f]; } -MidiMessage::MidiMessage (const uint8* const d, - const int dataSize, - const double t) throw() +MidiMessage::MidiMessage (const void* const d, const int dataSize, const double t) : timeStamp (t), message (0), size (dataSize) @@ -27208,11 +27195,11 @@ MidiMessage::MidiMessage (const uint8* const d, memcpy (data, d, dataSize); // check that the length matches the data.. - jassert (size > 3 || *d >= 0xf0 || getMessageLengthFromFirstByte (*d) == size); + jassert (size > 3 || *reinterpret_cast (d) >= 0xf0 + || getMessageLengthFromFirstByte (*reinterpret_cast (d)) == size); } -MidiMessage::MidiMessage (const int byte1, - const double t) throw() +MidiMessage::MidiMessage (const int byte1, const double t) throw() : timeStamp (t), data ((uint8*) &message), size (1) @@ -27223,9 +27210,7 @@ MidiMessage::MidiMessage (const int byte1, jassert (byte1 >= 0xf0 || getMessageLengthFromFirstByte ((uint8) byte1) == 1); } -MidiMessage::MidiMessage (const int byte1, - const int byte2, - const double t) throw() +MidiMessage::MidiMessage (const int byte1, const int byte2, const double t) throw() : timeStamp (t), data ((uint8*) &message), size (2) @@ -27237,10 +27222,7 @@ MidiMessage::MidiMessage (const int byte1, jassert (byte1 >= 0xf0 || getMessageLengthFromFirstByte ((uint8) byte1) == 2); } -MidiMessage::MidiMessage (const int byte1, - const int byte2, - const int byte3, - const double t) throw() +MidiMessage::MidiMessage (const int byte1, const int byte2, const int byte3, const double t) throw() : timeStamp (t), data ((uint8*) &message), size (3) @@ -27253,7 +27235,7 @@ MidiMessage::MidiMessage (const int byte1, jassert (byte1 >= 0xf0 || getMessageLengthFromFirstByte ((uint8) byte1) == 3); } -MidiMessage::MidiMessage (const MidiMessage& other) throw() +MidiMessage::MidiMessage (const MidiMessage& other) : timeStamp (other.timeStamp), message (other.message), size (other.size) @@ -27269,8 +27251,7 @@ MidiMessage::MidiMessage (const MidiMessage& other) throw() } } -MidiMessage::MidiMessage (const MidiMessage& other, - const double newTimeStamp) throw() +MidiMessage::MidiMessage (const MidiMessage& other, const double newTimeStamp) : timeStamp (newTimeStamp), message (other.message), size (other.size) @@ -27286,15 +27267,12 @@ MidiMessage::MidiMessage (const MidiMessage& other, } } -MidiMessage::MidiMessage (const uint8* src, - int sz, - int& numBytesUsed, - const uint8 lastStatusByte, - double t) throw() +MidiMessage::MidiMessage (const void* src_, int sz, int& numBytesUsed, const uint8 lastStatusByte, double t) : timeStamp (t), data ((uint8*) &message), message (0) { + const uint8* src = static_cast (src_); unsigned int byte = (unsigned int) *src; if (byte < 0x80) @@ -27313,7 +27291,7 @@ MidiMessage::MidiMessage (const uint8* src, { if (byte == 0xf0) { - const uint8* d = (const uint8*) src; + const uint8* d = src; while (d < src + sz) { @@ -27367,7 +27345,7 @@ MidiMessage::MidiMessage (const uint8* src, } } -MidiMessage& MidiMessage::operator= (const MidiMessage& other) throw() +MidiMessage& MidiMessage::operator= (const MidiMessage& other) { if (this != &other) { @@ -27392,7 +27370,7 @@ MidiMessage& MidiMessage::operator= (const MidiMessage& other) throw() return *this; } -MidiMessage::~MidiMessage() throw() +MidiMessage::~MidiMessage() { if (data != (uint8*) &message) juce_free (data); @@ -27650,7 +27628,7 @@ const MidiMessage MidiMessage::allControllersOff (const int channel) throw() return controllerEvent (channel, 121, 0); } -const MidiMessage MidiMessage::masterVolume (const float volume) throw() +const MidiMessage MidiMessage::masterVolume (const float volume) { const int vol = jlimit (0, 0x3fff, roundToInt (volume * 0x4000)); @@ -27672,8 +27650,7 @@ bool MidiMessage::isSysEx() const throw() return *data == 0xf0; } -const MidiMessage MidiMessage::createSysExMessage (const uint8* sysexData, - const int dataSize) throw() +const MidiMessage MidiMessage::createSysExMessage (const uint8* sysexData, const int dataSize) { MemoryBlock mm (dataSize + 2); uint8* const m = (uint8*) mm.getData(); @@ -27687,14 +27664,12 @@ const MidiMessage MidiMessage::createSysExMessage (const uint8* sysexData, const uint8* MidiMessage::getSysExData() const throw() { - return (isSysEx()) ? getRawData() + 1 - : 0; + return (isSysEx()) ? getRawData() + 1 : 0; } int MidiMessage::getSysExDataSize() const throw() { - return (isSysEx()) ? size - 2 - : 0; + return (isSysEx()) ? size - 2 : 0; } bool MidiMessage::isMetaEvent() const throw() @@ -27751,10 +27726,9 @@ bool MidiMessage::isTextMetaEvent() const throw() return t > 0 && t < 16; } -const String MidiMessage::getTextFromTextMetaEvent() const throw() +const String MidiMessage::getTextFromTextMetaEvent() const { - return String ((const char*) getMetaEventData(), - getMetaEventLength()); + return String ((const char*) getMetaEventData(), getMetaEventLength()); } bool MidiMessage::isTrackNameEvent() const throw() @@ -27840,8 +27814,7 @@ bool MidiMessage::isTimeSignatureMetaEvent() const throw() && (*data == (uint8) 0xff); } -void MidiMessage::getTimeSignatureInfo (int& numerator, - int& denominator) const throw() +void MidiMessage::getTimeSignatureInfo (int& numerator, int& denominator) const throw() { if (isTimeSignatureMetaEvent()) { @@ -27856,8 +27829,7 @@ void MidiMessage::getTimeSignatureInfo (int& numerator, } } -const MidiMessage MidiMessage::timeSignatureMetaEvent (const int numerator, - const int denominator) throw() +const MidiMessage MidiMessage::timeSignatureMetaEvent (const int numerator, const int denominator) { uint8 d[8]; d[0] = 0xff; @@ -73417,10 +73389,8 @@ void DropShadower::updateShadows() blurKernel.createGaussianBlur (blurRadius); blurKernel.applyToImage (*bigIm, 0, - xOffset, - yOffset, - bigIm->getWidth(), - bigIm->getHeight()); + Rectangle (xOffset, yOffset, + bigIm->getWidth(), bigIm->getHeight())); ImageCache::addImageToCache (bigIm, hash); } @@ -84872,17 +84842,14 @@ void GlowEffect::setGlowProperties (const float newRadius, void GlowEffect::applyEffect (Image& image, Graphics& g) { - const int w = image.getWidth(); - const int h = image.getHeight(); - - Image temp (image.getFormat(), w, h, true); + Image temp (image.getFormat(), image.getWidth(), image.getHeight(), true); ImageConvolutionKernel blurKernel (roundToInt (radius * 2.0f)); blurKernel.createGaussianBlur (radius); blurKernel.rescaleAllValues (radius); - blurKernel.applyToImage (temp, &image, 0, 0, w, h); + blurKernel.applyToImage (temp, &image, image.getBounds()); g.setColour (colour); g.drawImageAt (&temp, 0, 0, true); @@ -88815,7 +88782,7 @@ const String Path::toString() const { MemoryOutputStream s (2048, 2048); if (! useNonZeroWinding) - s << "a "; + s << 'a'; size_t i = 0; float lastMarker = 0.0f; @@ -88854,36 +88821,31 @@ const String Path::toString() const if (marker != lastMarker) { - s << markerChar << ' '; + if (s.getDataSize() != 0) + s << ' '; + + s << markerChar; lastMarker = marker; } while (--numCoords >= 0 && i < numElements) { - String n (data.elements [i++], 3); + String coord (data.elements [i++], 3); - if (n.endsWithChar ('0')) - { - do - { - n = n.dropLastCharacters (1); - } while (n.endsWithChar ('0')); + while (coord.endsWithChar ('0') && coord != "0") + coord = coord.dropLastCharacters (1); - if (n.endsWithChar ('.')) - n = n.dropLastCharacters (1); - } + if (coord.endsWithChar ('.')) + coord = coord.dropLastCharacters (1); - s << n << ' '; + if (s.getDataSize() != 0) + s << ' '; + + s << coord; } } - const char* const result = (const char*) s.getData(); - size_t len = s.getDataSize(); - - while (len > 0 && CharacterFunctions::isWhitespace (result [len - 1])) - --len; - - return String (result, len); + return s.toUTF8(); } void Path::restoreFromString (const String& stringVersion) @@ -88899,7 +88861,7 @@ void Path::restoreFromString (const String& stringVersion) while (*t != 0) { const String token (PathHelpers::nextToken (t)); - const tchar firstChar = token[0]; + const juce_wchar firstChar = token[0]; int startNum = 0; if (firstChar == 'm' || firstChar == 'l') @@ -91500,10 +91462,7 @@ void ImageConvolutionKernel::createGaussianBlur (const float radius) void ImageConvolutionKernel::applyToImage (Image& destImage, const Image* sourceImage, - int dx, - int dy, - int dw, - int dh) const + const Rectangle& destinationArea) const { ScopedPointer imageCreated; @@ -91523,34 +91482,27 @@ void ImageConvolutionKernel::applyToImage (Image& destImage, return; } - const int imageWidth = destImage.getWidth(); - const int imageHeight = destImage.getHeight(); + const Rectangle area (destinationArea.getIntersection (destImage.getBounds())); - if (dx >= imageWidth || dy >= imageHeight) + if (area.isEmpty()) return; - if (dx + dw > imageWidth) - dw = imageWidth - dx; + const int right = area.getRight(); + const int bottom = area.getBottom(); - if (dy + dh > imageHeight) - dh = imageHeight - dy; - - const int dx2 = dx + dw; - const int dy2 = dy + dh; - - const Image::BitmapData destData (destImage, dx, dy, dw, dh, true); + const Image::BitmapData destData (destImage, area.getX(), area.getY(), area.getWidth(), area.getHeight(), true); uint8* line = destData.data; const Image::BitmapData srcData (*sourceImage, 0, 0, sourceImage->getWidth(), sourceImage->getHeight()); if (destData.pixelStride == 4) { - for (int y = dy; y < dy2; ++y) + for (int y = area.getY(); y < bottom; ++y) { uint8* dest = line; line += destData.lineStride; - for (int x = dx; x < dx2; ++x) + for (int x = area.getX(); x < right; ++x) { float c1 = 0; float c2 = 0; @@ -91561,7 +91513,7 @@ void ImageConvolutionKernel::applyToImage (Image& destImage, { const int sy = y + yy - (size >> 1); - if (sy >= imageHeight) + if (sy >= srcData.height) break; if (sy >= 0) @@ -91571,7 +91523,7 @@ void ImageConvolutionKernel::applyToImage (Image& destImage, for (int xx = 0; xx < size; ++xx) { - if (sx >= imageWidth) + if (sx >= srcData.width) break; if (sx >= 0) @@ -91601,12 +91553,12 @@ void ImageConvolutionKernel::applyToImage (Image& destImage, } else if (destData.pixelStride == 3) { - for (int y = dy; y < dy2; ++y) + for (int y = area.getY(); y < bottom; ++y) { uint8* dest = line; line += destData.lineStride; - for (int x = dx; x < dx2; ++x) + for (int x = area.getX(); x < right; ++x) { float c1 = 0; float c2 = 0; @@ -91616,7 +91568,7 @@ void ImageConvolutionKernel::applyToImage (Image& destImage, { const int sy = y + yy - (size >> 1); - if (sy >= imageHeight) + if (sy >= srcData.height) break; if (sy >= 0) @@ -91626,7 +91578,7 @@ void ImageConvolutionKernel::applyToImage (Image& destImage, for (int xx = 0; xx < size; ++xx) { - if (sx >= imageWidth) + if (sx >= srcData.width) break; if (sx >= 0) @@ -220261,7 +220213,7 @@ bool CDController::readAudio (CDReadBuffer* rb, CDReadBuffer* overlapBuffer) for (int i = 0; i < maxToCheck; ++i) { - if (!memcmp (p, rb->buffer + i, checkLen)) + if (memcmp (p, rb->buffer + i, checkLen) == 0) { i += checkLen; rb->dataStartOffset = i; @@ -223917,14 +223869,14 @@ public: } } - const StringArray getDeviceNames (const bool /*wantInputNames*/) const + const StringArray getDeviceNames (bool /*wantInputNames*/) const { jassert (hasScanned); // need to call scanForDevices() before doing this return deviceNames; } - int getDefaultDeviceIndex (const bool) const + int getDefaultDeviceIndex (bool) const { jassert (hasScanned); // need to call scanForDevices() before doing this @@ -223952,7 +223904,7 @@ public: return -1; } - int getIndexOfDevice (AudioIODevice* d, const bool /*asInput*/) const + int getIndexOfDevice (AudioIODevice* d, bool /*asInput*/) const { jassert (hasScanned); // need to call scanForDevices() before doing this @@ -225432,7 +225384,7 @@ public: } } - const StringArray getDeviceNames (const bool wantInputNames) const + const StringArray getDeviceNames (bool wantInputNames) const { jassert (hasScanned); // need to call scanForDevices() before doing this @@ -225440,13 +225392,13 @@ public: : outputDeviceNames; } - int getDefaultDeviceIndex (const bool /*forInput*/) const + int getDefaultDeviceIndex (bool /*forInput*/) const { jassert (hasScanned); // need to call scanForDevices() before doing this return 0; } - int getIndexOfDevice (AudioIODevice* device, const bool asInput) const + int getIndexOfDevice (AudioIODevice* device, bool asInput) const { jassert (hasScanned); // need to call scanForDevices() before doing this @@ -226697,7 +226649,7 @@ public: outputDeviceNames.appendNumbersToDuplicates (false, false); } - const StringArray getDeviceNames (const bool wantInputNames) const + const StringArray getDeviceNames (bool wantInputNames) const { jassert (hasScanned); // need to call scanForDevices() before doing this @@ -226705,13 +226657,13 @@ public: : outputDeviceNames; } - int getDefaultDeviceIndex (const bool /*forInput*/) const + int getDefaultDeviceIndex (bool /*forInput*/) const { jassert (hasScanned); // need to call scanForDevices() before doing this return 0; } - int getIndexOfDevice (AudioIODevice* device, const bool asInput) const + int getIndexOfDevice (AudioIODevice* device, bool asInput) const { jassert (hasScanned); // need to call scanForDevices() before doing this WASAPIAudioIODevice* const d = dynamic_cast (device); @@ -235183,14 +235135,14 @@ public: outputNames.appendNumbersToDuplicates (false, true); } - const StringArray getDeviceNames (const bool wantInputNames) const + const StringArray getDeviceNames (bool wantInputNames) const { jassert (hasScanned); // need to call scanForDevices() before doing this return wantInputNames ? inputNames : outputNames; } - int getDefaultDeviceIndex (const bool forInput) const + int getDefaultDeviceIndex (bool forInput) const { jassert (hasScanned); // need to call scanForDevices() before doing this return 0; @@ -235198,11 +235150,11 @@ public: bool hasSeparateInputsAndOutputs() const { return true; } - int getIndexOfDevice (AudioIODevice* device, const bool asInput) const + int getIndexOfDevice (AudioIODevice* device, bool asInput) const { jassert (hasScanned); // need to call scanForDevices() before doing this - ALSAAudioIODevice* const d = dynamic_cast (device); + ALSAAudioIODevice* d = dynamic_cast (device); if (d == 0) return -1; @@ -235779,13 +235731,13 @@ public: } } - const StringArray getDeviceNames (const bool wantInputNames) const + const StringArray getDeviceNames (bool wantInputNames) const { jassert (hasScanned); // need to call scanForDevices() before doing this return wantInputNames ? inputNames : outputNames; } - int getDefaultDeviceIndex (const bool forInput) const + int getDefaultDeviceIndex (bool forInput) const { jassert (hasScanned); // need to call scanForDevices() before doing this return 0; @@ -235793,11 +235745,11 @@ public: bool hasSeparateInputsAndOutputs() const { return true; } - int getIndexOfDevice (AudioIODevice* device, const bool asInput) const + int getIndexOfDevice (AudioIODevice* device, bool asInput) const { jassert (hasScanned); // need to call scanForDevices() before doing this - JackAudioIODevice* const d = dynamic_cast (device); + JackAudioIODevice* d = dynamic_cast (device); if (d == 0) return -1; @@ -236404,13 +236356,12 @@ void FileChooser::showPlatformDialog (Array& results, if (status == 0) { - String resultString (String::fromUTF8 (result.getData(), result.getDataSize())); StringArray tokens; if (selectMultipleFiles) - tokens.addTokens (resultString, separator, String::empty); + tokens.addTokens (result.toUTF8(), separator, String::empty); else - tokens.add (resultString); + tokens.add (result.toUTF8()); for (int i = 0; i < tokens.size(); i++) results.add (File (tokens[i])); @@ -243080,19 +243031,19 @@ public: { } - const StringArray getDeviceNames (const bool wantInputNames) const + const StringArray getDeviceNames (bool wantInputNames) const { StringArray s; s.add ("iPhone Audio"); return s; } - int getDefaultDeviceIndex (const bool forInput) const + int getDefaultDeviceIndex (bool forInput) const { return 0; } - int getIndexOfDevice (AudioIODevice* device, const bool asInput) const + int getIndexOfDevice (AudioIODevice* device, bool asInput) const { return device != 0 ? 0 : -1; } @@ -251157,7 +251108,7 @@ public: outputDeviceNames.appendNumbersToDuplicates (false, true); } - const StringArray getDeviceNames (const bool wantInputNames) const + const StringArray getDeviceNames (bool wantInputNames) const { jassert (hasScanned); // need to call scanForDevices() before doing this @@ -251167,7 +251118,7 @@ public: return outputDeviceNames; } - int getDefaultDeviceIndex (const bool forInput) const + int getDefaultDeviceIndex (bool forInput) const { jassert (hasScanned); // need to call scanForDevices() before doing this @@ -251201,7 +251152,7 @@ public: return 0; } - int getIndexOfDevice (AudioIODevice* device, const bool asInput) const + int getIndexOfDevice (AudioIODevice* device, bool asInput) const { jassert (hasScanned); // need to call scanForDevices() before doing this diff --git a/juce_amalgamated.h b/juce_amalgamated.h index 2fe4b96624..33586aaf01 100644 --- a/juce_amalgamated.h +++ b/juce_amalgamated.h @@ -8395,13 +8395,15 @@ public: const char* getData() const throw(); - size_t getDataSize() const throw(); + size_t getDataSize() const throw() { return size; } void reset() throw(); + const String toUTF8() const; + void flush(); bool write (const void* buffer, int howMany); - int64 getPosition(); + int64 getPosition() { return position; } bool setPosition (int64 newPosition); juce_UseDebuggingNewOperator @@ -13449,7 +13451,7 @@ class JUCE_API AudioFormatReader { protected: - AudioFormatReader (InputStream* const sourceStream, + AudioFormatReader (InputStream* sourceStream, const String& formatName); public: @@ -13461,7 +13463,7 @@ public: int numDestChannels, int64 startSampleInSource, int numSamplesToRead, - const bool fillLeftoverChannelsWithCopies); + bool fillLeftoverChannelsWithCopies); virtual void readMaxLevels (int64 startSample, int64 numSamples, @@ -13472,9 +13474,9 @@ public: int64 searchForLevel (int64 startSample, int64 numSamplesToSearch, - const double magnitudeRangeMinimum, - const double magnitudeRangeMaximum, - const int minimumConsecutiveSamples); + double magnitudeRangeMinimum, + double magnitudeRangeMaximum, + int minimumConsecutiveSamples); double sampleRate; @@ -13530,12 +13532,12 @@ class JUCE_API AudioSampleBuffer { public: - AudioSampleBuffer (const int numChannels, - const int numSamples) throw(); + AudioSampleBuffer (int numChannels, + int numSamples) throw(); AudioSampleBuffer (float** dataToReferTo, - const int numChannels, - const int numSamples) throw(); + int numChannels, + int numSamples) throw(); AudioSampleBuffer (const AudioSampleBuffer& other) throw(); @@ -13563,113 +13565,113 @@ public: float** getArrayOfChannels() const throw() { return channels; } - void setSize (const int newNumChannels, - const int newNumSamples, - const bool keepExistingContent = false, - const bool clearExtraSpace = false, - const bool avoidReallocating = false) throw(); + void setSize (int newNumChannels, + int newNumSamples, + bool keepExistingContent = false, + bool clearExtraSpace = false, + bool avoidReallocating = false) throw(); void setDataToReferTo (float** dataToReferTo, - const int numChannels, - const int numSamples) throw(); + int numChannels, + int numSamples) throw(); void clear() throw(); - void clear (const int startSample, - const int numSamples) throw(); + void clear (int startSample, + int numSamples) throw(); - void clear (const int channel, - const int startSample, - const int numSamples) throw(); + void clear (int channel, + int startSample, + int numSamples) throw(); - void applyGain (const int channel, - const int startSample, + void applyGain (int channel, + int startSample, int numSamples, - const float gain) throw(); + float gain) throw(); - void applyGain (const int startSample, - const int numSamples, - const float gain) throw(); + void applyGain (int startSample, + int numSamples, + float gain) throw(); - void applyGainRamp (const int channel, - const int startSample, + void applyGainRamp (int channel, + int startSample, int numSamples, float startGain, float endGain) throw(); - void addFrom (const int destChannel, - const int destStartSample, + void addFrom (int destChannel, + int destStartSample, const AudioSampleBuffer& source, - const int sourceChannel, - const int sourceStartSample, + int sourceChannel, + int sourceStartSample, int numSamples, - const float gainToApplyToSource = 1.0f) throw(); + float gainToApplyToSource = 1.0f) throw(); - void addFrom (const int destChannel, - const int destStartSample, + void addFrom (int destChannel, + int destStartSample, const float* source, int numSamples, - const float gainToApplyToSource = 1.0f) throw(); + float gainToApplyToSource = 1.0f) throw(); - void addFromWithRamp (const int destChannel, - const int destStartSample, + void addFromWithRamp (int destChannel, + int destStartSample, const float* source, int numSamples, float startGain, float endGain) throw(); - void copyFrom (const int destChannel, - const int destStartSample, + void copyFrom (int destChannel, + int destStartSample, const AudioSampleBuffer& source, - const int sourceChannel, - const int sourceStartSample, + int sourceChannel, + int sourceStartSample, int numSamples) throw(); - void copyFrom (const int destChannel, - const int destStartSample, + void copyFrom (int destChannel, + int destStartSample, const float* source, int numSamples) throw(); - void copyFrom (const int destChannel, - const int destStartSample, + void copyFrom (int destChannel, + int destStartSample, const float* source, int numSamples, - const float gain) throw(); + float gain) throw(); - void copyFromWithRamp (const int destChannel, - const int destStartSample, + void copyFromWithRamp (int destChannel, + int destStartSample, const float* source, int numSamples, float startGain, float endGain) throw(); - void findMinMax (const int channel, - const int startSample, + void findMinMax (int channel, + int startSample, int numSamples, float& minVal, float& maxVal) const throw(); - float getMagnitude (const int channel, - const int startSample, - const int numSamples) const throw(); + float getMagnitude (int channel, + int startSample, + int numSamples) const throw(); - float getMagnitude (const int startSample, - const int numSamples) const throw(); + float getMagnitude (int startSample, + int numSamples) const throw(); - float getRMSLevel (const int channel, - const int startSample, - const int numSamples) const throw(); + float getRMSLevel (int channel, + int startSample, + int numSamples) const throw(); void readFromAudioReader (AudioFormatReader* reader, - const int startSample, - const int numSamples, - const int readerStartSample, - const bool useReaderLeftChan, - const bool useReaderRightChan) throw(); + int startSample, + int numSamples, + int readerStartSample, + bool useReaderLeftChan, + bool useReaderRightChan) throw(); void writeToAudioWriter (AudioFormatWriter* writer, - const int startSample, - const int numSamples) const throw(); + int startSample, + int numSamples) const throw(); juce_UseDebuggingNewOperator @@ -13681,7 +13683,7 @@ private: float* preallocatedChannelSpace [32]; void allocateData(); - void allocateChannels (float** const dataToReferTo); + void allocateChannels (float** dataToReferTo); }; #endif // __JUCE_AUDIOSAMPLEBUFFER_JUCEHEADER__ @@ -13726,11 +13728,11 @@ class JUCE_API AudioFormatWriter { protected: - AudioFormatWriter (OutputStream* const destStream, + AudioFormatWriter (OutputStream* destStream, const String& formatName, - const double sampleRate, - const unsigned int numberOfChannels, - const unsigned int bitsPerSample); + double sampleRate, + unsigned int numberOfChannels, + unsigned int bitsPerSample); public: virtual ~AudioFormatWriter(); @@ -13746,7 +13748,7 @@ public: bool writeFromAudioSource (AudioSource& source, int numSamplesToRead, - const int samplesPerBlock = 2048); + int samplesPerBlock = 2048); double getSampleRate() const throw() { return sampleRate; } @@ -14041,7 +14043,7 @@ public: juce_DeclareSingleton (AudioFormatManager, false); void registerFormat (AudioFormat* newFormat, - const bool makeThisTheDefaultFormat); + bool makeThisTheDefaultFormat); void registerBasicFormats(); @@ -14049,7 +14051,7 @@ public: int getNumKnownFormats() const; - AudioFormat* getKnownFormat (const int index) const; + AudioFormat* getKnownFormat (int index) const; AudioFormat* findFormatForFileExtension (const String& fileExtension) const; @@ -14089,10 +14091,10 @@ class JUCE_API AudioSubsectionReader : public AudioFormatReader { public: - AudioSubsectionReader (AudioFormatReader* const sourceReader, - const int64 subsectionStartSample, - const int64 subsectionLength, - const bool deleteSourceWhenDeleted); + AudioSubsectionReader (AudioFormatReader* sourceReader, + int64 subsectionStartSample, + int64 subsectionLength, + bool deleteSourceWhenDeleted); ~AudioSubsectionReader(); @@ -14136,13 +14138,13 @@ class JUCE_API AudioThumbnail : public ChangeBroadcaster, { public: - AudioThumbnail (const int sourceSamplesPerThumbnailSample, + AudioThumbnail (int sourceSamplesPerThumbnailSample, AudioFormatManager& formatManagerToUse, AudioThumbnailCache& cacheToUse); ~AudioThumbnail(); - void setSource (InputSource* const newSource); + void setSource (InputSource* newSource); void loadFrom (InputStream& input); @@ -14157,7 +14159,7 @@ public: double startTimeSeconds, double endTimeSeconds, int channelNum, - const float verticalZoomFactor); + float verticalZoomFactor); bool isFullyLoaded() const throw(); @@ -14182,18 +14184,10 @@ private: bool cacheNeedsRefilling; void clear(); - AudioFormatReader* createReader() const; - - void generateSection (AudioFormatReader& reader, - int64 startSample, - int numSamples); - + void generateSection (AudioFormatReader& reader, int64 startSample, int numSamples); char* getChannelData (int channel) const; - - void refillCache (const int numSamples, - double startTime, - const double timePerPixel); + void refillCache (int numSamples, double startTime, double timePerPixel); friend class AudioThumbnailCache; @@ -14221,15 +14215,15 @@ class JUCE_API AudioThumbnailCache : public TimeSliceThread { public: - AudioThumbnailCache (const int maxNumThumbsToStore); + AudioThumbnailCache (int maxNumThumbsToStore); ~AudioThumbnailCache(); void clear(); - bool loadThumb (AudioThumbnail& thumb, const int64 hashCode); + bool loadThumb (AudioThumbnail& thumb, int64 hashCode); - void storeThumb (const AudioThumbnail& thumb, const int64 hashCode); + void storeThumb (const AudioThumbnail& thumb, int64 hashCode); juce_UseDebuggingNewOperator @@ -14239,8 +14233,8 @@ private: int maxNumThumbsToStore; friend class AudioThumbnail; - void addThumbnail (AudioThumbnail* const thumb); - void removeThumbnail (AudioThumbnail* const thumb); + void addThumbnail (AudioThumbnail* thumb); + void removeThumbnail (AudioThumbnail* thumb); }; #endif // __JUCE_AUDIOTHUMBNAILCACHE_JUCEHEADER__ @@ -14924,31 +14918,31 @@ public: void reset() throw(); - void processSamples (float* const samples, - const int numSamples) throw(); + void processSamples (float* samples, + int numSamples) throw(); - float processSingleSampleRaw (const float sample) throw(); + float processSingleSampleRaw (float sample) throw(); - void makeLowPass (const double sampleRate, - const double frequency) throw(); + void makeLowPass (double sampleRate, + double frequency) throw(); - void makeHighPass (const double sampleRate, - const double frequency) throw(); + void makeHighPass (double sampleRate, + double frequency) throw(); - void makeLowShelf (const double sampleRate, - const double cutOffFrequency, - const double Q, - const float gainFactor) throw(); + void makeLowShelf (double sampleRate, + double cutOffFrequency, + double Q, + float gainFactor) throw(); - void makeHighShelf (const double sampleRate, - const double cutOffFrequency, - const double Q, - const float gainFactor) throw(); + void makeHighShelf (double sampleRate, + double cutOffFrequency, + double Q, + float gainFactor) throw(); - void makeBandPass (const double sampleRate, - const double centreFrequency, - const double Q, - const float gainFactor) throw(); + void makeBandPass (double sampleRate, + double centreFrequency, + double Q, + float gainFactor) throw(); void makeInactive() throw(); @@ -15122,11 +15116,11 @@ public: virtual void scanForDevices() = 0; - virtual const StringArray getDeviceNames (const bool wantInputNames = false) const = 0; + virtual const StringArray getDeviceNames (bool wantInputNames = false) const = 0; - virtual int getDefaultDeviceIndex (const bool forInput) const = 0; + virtual int getDefaultDeviceIndex (bool forInput) const = 0; - virtual int getIndexOfDevice (AudioIODevice* device, const bool asInput) const = 0; + virtual int getIndexOfDevice (AudioIODevice* device, bool asInput) const = 0; virtual bool hasSeparateInputsAndOutputs() const = 0; @@ -15170,36 +15164,25 @@ class JUCE_API MidiMessage { public: - MidiMessage (const int byte1, - const int byte2, - const int byte3, - const double timeStamp = 0) throw(); + MidiMessage (int byte1, int byte2, int byte3, double timeStamp = 0) throw(); - MidiMessage (const int byte1, - const int byte2, - const double timeStamp = 0) throw(); + MidiMessage (int byte1, int byte2, double timeStamp = 0) throw(); - MidiMessage (const int byte1, - const double timeStamp = 0) throw(); + MidiMessage (int byte1, double timeStamp = 0) throw(); - MidiMessage (const uint8* const data, - const int dataSize, - const double timeStamp = 0) throw(); + MidiMessage (const void* data, int numBytes, double timeStamp = 0); - MidiMessage (const uint8* data, - int size, - int& numBytesUsed, - uint8 lastStatusByte, - double timeStamp = 0) throw(); + MidiMessage (const void* data, int maxBytesToUse, + int& numBytesUsed, uint8 lastStatusByte, + double timeStamp = 0); - MidiMessage (const MidiMessage& other) throw(); + MidiMessage (const MidiMessage& other); - MidiMessage (const MidiMessage& other, - const double newTimeStamp) throw(); + MidiMessage (const MidiMessage& other, double newTimeStamp); - ~MidiMessage() throw(); + ~MidiMessage(); - MidiMessage& operator= (const MidiMessage& other) throw(); + MidiMessage& operator= (const MidiMessage& other); uint8* getRawData() const throw() { return data; } @@ -15207,15 +15190,15 @@ public: double getTimeStamp() const throw() { return timeStamp; } - void setTimeStamp (const double newTimestamp) throw() { timeStamp = newTimestamp; } + void setTimeStamp (double newTimestamp) throw() { timeStamp = newTimestamp; } - void addToTimeStamp (const double delta) throw() { timeStamp += delta; } + void addToTimeStamp (double delta) throw() { timeStamp += delta; } int getChannel() const throw(); - bool isForChannel (const int channelNumber) const throw(); + bool isForChannel (int channelNumber) const throw(); - void setChannel (const int newChannelNumber) throw(); + void setChannel (int newChannelNumber) throw(); bool isSysEx() const throw(); @@ -15223,63 +15206,55 @@ public: int getSysExDataSize() const throw(); - bool isNoteOn (const bool returnTrueForVelocity0 = false) const throw(); + bool isNoteOn (bool returnTrueForVelocity0 = false) const throw(); - static const MidiMessage noteOn (const int channel, - const int noteNumber, - const float velocity) throw(); + static const MidiMessage noteOn (int channel, int noteNumber, float velocity) throw(); - static const MidiMessage noteOn (const int channel, - const int noteNumber, - const uint8 velocity) throw(); + static const MidiMessage noteOn (int channel, int noteNumber, uint8 velocity) throw(); - bool isNoteOff (const bool returnTrueForNoteOnVelocity0 = true) const throw(); + bool isNoteOff (bool returnTrueForNoteOnVelocity0 = true) const throw(); - static const MidiMessage noteOff (const int channel, - const int noteNumber) throw(); + static const MidiMessage noteOff (int channel, int noteNumber) throw(); bool isNoteOnOrOff() const throw(); int getNoteNumber() const throw(); - void setNoteNumber (const int newNoteNumber) throw(); + void setNoteNumber (int newNoteNumber) throw(); uint8 getVelocity() const throw(); float getFloatVelocity() const throw(); - void setVelocity (const float newVelocity) throw(); + void setVelocity (float newVelocity) throw(); - void multiplyVelocity (const float scaleFactor) throw(); + void multiplyVelocity (float scaleFactor) throw(); bool isProgramChange() const throw(); int getProgramChangeNumber() const throw(); - static const MidiMessage programChange (const int channel, - const int programNumber) throw(); + static const MidiMessage programChange (int channel, int programNumber) throw(); bool isPitchWheel() const throw(); int getPitchWheelValue() const throw(); - static const MidiMessage pitchWheel (const int channel, - const int position) throw(); + static const MidiMessage pitchWheel (int channel, int position) throw(); bool isAftertouch() const throw(); int getAfterTouchValue() const throw(); - static const MidiMessage aftertouchChange (const int channel, - const int noteNumber, - const int aftertouchAmount) throw(); + static const MidiMessage aftertouchChange (int channel, + int noteNumber, + int aftertouchAmount) throw(); bool isChannelPressure() const throw(); int getChannelPressureValue() const throw(); - static const MidiMessage channelPressureChange (const int channel, - const int pressure) throw(); + static const MidiMessage channelPressureChange (int channel, int pressure) throw(); bool isController() const throw(); @@ -15287,19 +15262,19 @@ public: int getControllerValue() const throw(); - static const MidiMessage controllerEvent (const int channel, - const int controllerType, - const int value) throw(); + static const MidiMessage controllerEvent (int channel, + int controllerType, + int value) throw(); bool isAllNotesOff() const throw(); bool isAllSoundOff() const throw(); - static const MidiMessage allNotesOff (const int channel) throw(); + static const MidiMessage allNotesOff (int channel) throw(); - static const MidiMessage allSoundOff (const int channel) throw(); + static const MidiMessage allSoundOff (int channel) throw(); - static const MidiMessage allControllersOff (const int channel) throw(); + static const MidiMessage allControllersOff (int channel) throw(); bool isMetaEvent() const throw(); @@ -15319,23 +15294,21 @@ public: bool isTextMetaEvent() const throw(); - const String getTextFromTextMetaEvent() const throw(); + const String getTextFromTextMetaEvent() const; bool isTempoMetaEvent() const throw(); - double getTempoMetaEventTickLength (const short timeFormat) const throw(); + double getTempoMetaEventTickLength (short timeFormat) const throw(); double getTempoSecondsPerQuarterNote() const throw(); - static const MidiMessage tempoMetaEvent (const int microsecondsPerQuarterNote) throw(); + static const MidiMessage tempoMetaEvent (int microsecondsPerQuarterNote) throw(); bool isTimeSignatureMetaEvent() const throw(); - void getTimeSignatureInfo (int& numerator, - int& denominator) const throw(); + void getTimeSignatureInfo (int& numerator, int& denominator) const throw(); - static const MidiMessage timeSignatureMetaEvent (const int numerator, - const int denominator) throw(); + static const MidiMessage timeSignatureMetaEvent (int numerator, int denominator); bool isKeySignatureMetaEvent() const throw(); @@ -15345,7 +15318,7 @@ public: int getMidiChannelMetaEventChannel() const throw(); - static const MidiMessage midiChannelMetaEvent (const int channel) throw(); + static const MidiMessage midiChannelMetaEvent (int channel) throw(); bool isActiveSense() const throw(); @@ -15369,7 +15342,7 @@ public: int getSongPositionPointerMidiBeat() const throw(); - static const MidiMessage songPositionPointer (const int positionInMidiBeats) throw(); + static const MidiMessage songPositionPointer (int positionInMidiBeats) throw(); bool isQuarterFrame() const throw(); @@ -15377,8 +15350,7 @@ public: int getQuarterFrameValue() const throw(); - static const MidiMessage quarterFrame (const int sequenceNumber, - const int value) throw(); + static const MidiMessage quarterFrame (int sequenceNumber, int value) throw(); enum SmpteTimecodeType { @@ -15396,10 +15368,10 @@ public: int& frames, SmpteTimecodeType& timecodeType) const throw(); - static const MidiMessage fullFrame (const int hours, - const int minutes, - const int seconds, - const int frames, + static const MidiMessage fullFrame (int hours, + int minutes, + int seconds, + int frames, SmpteTimecodeType timecodeType); enum MidiMachineControlCommand @@ -15430,10 +15402,10 @@ public: int seconds, int frames); - static const MidiMessage masterVolume (const float volume) throw(); + static const MidiMessage masterVolume (float volume); static const MidiMessage createSysExMessage (const uint8* sysexData, - const int dataSize) throw(); + int dataSize); static int readVariableLengthVal (const uint8* data, int& numBytesUsed) throw(); @@ -15577,7 +15549,7 @@ public: int getLastEventTime() const throw(); - void swap (MidiBuffer& other); + void swapWith (MidiBuffer& other); class Iterator { @@ -15647,7 +15619,7 @@ public: float rightVol); virtual void sendBlockOfMessages (const MidiBuffer& buffer, - const double millisecondCounterToStartAt, + double millisecondCounterToStartAt, double samplesPerSecondForBuffer); virtual void clearAllPendingMessages(); @@ -16970,10 +16942,10 @@ public: bool useDefaultOutputChannels; }; - const String initialise (const int numInputChannelsNeeded, - const int numOutputChannelsNeeded, - const XmlElement* const savedState, - const bool selectDefaultDeviceOnFailure, + const String initialise (int numInputChannelsNeeded, + int numOutputChannelsNeeded, + const XmlElement* savedState, + bool selectDefaultDeviceOnFailure, const String& preferredDefaultDeviceName = String::empty, const AudioDeviceSetup* preferredSetupOptions = 0); @@ -16982,7 +16954,7 @@ public: void getAudioDeviceSetup (AudioDeviceSetup& setup); const String setAudioDeviceSetup (const AudioDeviceSetup& newSetup, - const bool treatAsChosenDevice); + bool treatAsChosenDevice); AudioIODevice* getCurrentAudioDevice() const throw() { return currentAudioDevice; } @@ -16991,7 +16963,7 @@ public: AudioIODeviceType* getCurrentDeviceTypeObject() const; void setCurrentAudioDeviceType (const String& type, - const bool treatAsChosenDevice); + bool treatAsChosenDevice); void closeAudioDevice(); @@ -17004,7 +16976,7 @@ public: double getCpuUsage() const; void setMidiInputEnabled (const String& midiInputDeviceName, - const bool enabled); + bool enabled); bool isMidiInputEnabled (const String& midiInputDeviceName) const; @@ -17026,7 +16998,7 @@ public: void playTestSound(); - void enableInputLevelMeasurement (const bool enableMeasurement); + void enableInputLevelMeasurement (bool enableMeasurement); double getCurrentInputLevel() const; @@ -17089,7 +17061,7 @@ private: float** outputChannelData, int totalNumOutputChannels, int numSamples); - void audioDeviceAboutToStartInt (AudioIODevice* const device); + void audioDeviceAboutToStartInt (AudioIODevice* device); void audioDeviceStoppedInt(); void handleIncomingMidiMessageInt (MidiInput* source, const MidiMessage& message); @@ -17139,29 +17111,29 @@ class JUCE_API AudioDataConverters { public: - static void convertFloatToInt16LE (const float* source, void* dest, int numSamples, const int destBytesPerSample = 2); - static void convertFloatToInt16BE (const float* source, void* dest, int numSamples, const int destBytesPerSample = 2); + static void convertFloatToInt16LE (const float* source, void* dest, int numSamples, int destBytesPerSample = 2); + static void convertFloatToInt16BE (const float* source, void* dest, int numSamples, int destBytesPerSample = 2); - static void convertFloatToInt24LE (const float* source, void* dest, int numSamples, const int destBytesPerSample = 3); - static void convertFloatToInt24BE (const float* source, void* dest, int numSamples, const int destBytesPerSample = 3); + static void convertFloatToInt24LE (const float* source, void* dest, int numSamples, int destBytesPerSample = 3); + static void convertFloatToInt24BE (const float* source, void* dest, int numSamples, int destBytesPerSample = 3); - static void convertFloatToInt32LE (const float* source, void* dest, int numSamples, const int destBytesPerSample = 4); - static void convertFloatToInt32BE (const float* source, void* dest, int numSamples, const int destBytesPerSample = 4); + static void convertFloatToInt32LE (const float* source, void* dest, int numSamples, int destBytesPerSample = 4); + static void convertFloatToInt32BE (const float* source, void* dest, int numSamples, int destBytesPerSample = 4); - static void convertFloatToFloat32LE (const float* source, void* dest, int numSamples, const int destBytesPerSample = 4); - static void convertFloatToFloat32BE (const float* source, void* dest, int numSamples, const int destBytesPerSample = 4); + static void convertFloatToFloat32LE (const float* source, void* dest, int numSamples, int destBytesPerSample = 4); + static void convertFloatToFloat32BE (const float* source, void* dest, int numSamples, int destBytesPerSample = 4); - static void convertInt16LEToFloat (const void* source, float* dest, int numSamples, const int srcBytesPerSample = 2); - static void convertInt16BEToFloat (const void* source, float* dest, int numSamples, const int srcBytesPerSample = 2); + static void convertInt16LEToFloat (const void* source, float* dest, int numSamples, int srcBytesPerSample = 2); + static void convertInt16BEToFloat (const void* source, float* dest, int numSamples, int srcBytesPerSample = 2); - static void convertInt24LEToFloat (const void* source, float* dest, int numSamples, const int srcBytesPerSample = 3); - static void convertInt24BEToFloat (const void* source, float* dest, int numSamples, const int srcBytesPerSample = 3); + static void convertInt24LEToFloat (const void* source, float* dest, int numSamples, int srcBytesPerSample = 3); + static void convertInt24BEToFloat (const void* source, float* dest, int numSamples, int srcBytesPerSample = 3); - static void convertInt32LEToFloat (const void* source, float* dest, int numSamples, const int srcBytesPerSample = 4); - static void convertInt32BEToFloat (const void* source, float* dest, int numSamples, const int srcBytesPerSample = 4); + static void convertInt32LEToFloat (const void* source, float* dest, int numSamples, int srcBytesPerSample = 4); + static void convertInt32BEToFloat (const void* source, float* dest, int numSamples, int srcBytesPerSample = 4); - static void convertFloat32LEToFloat (const void* source, float* dest, int numSamples, const int srcBytesPerSample = 4); - static void convertFloat32BEToFloat (const void* source, float* dest, int numSamples, const int srcBytesPerSample = 4); + static void convertFloat32LEToFloat (const void* source, float* dest, int numSamples, int srcBytesPerSample = 4); + static void convertFloat32BEToFloat (const void* source, float* dest, int numSamples, int srcBytesPerSample = 4); enum DataFormat { @@ -17175,17 +17147,17 @@ public: float32BE, }; - static void convertFloatToFormat (const DataFormat destFormat, + static void convertFloatToFormat (DataFormat destFormat, const float* source, void* dest, int numSamples); - static void convertFormatToFloat (const DataFormat sourceFormat, + static void convertFormatToFloat (DataFormat sourceFormat, const void* source, float* dest, int numSamples); static void interleaveSamples (const float** source, float* dest, - const int numSamples, const int numChannels); + int numSamples, int numChannels); static void deinterleaveSamples (const float* source, float** dest, - const int numSamples, const int numChannels); + int numSamples, int numChannels); }; #endif // __JUCE_AUDIODATACONVERTERS_JUCEHEADER__ @@ -17246,27 +17218,26 @@ public: int getNumEvents() const; - MidiEventHolder* getEventPointer (const int index) const; + MidiEventHolder* getEventPointer (int index) const; - double getTimeOfMatchingKeyUp (const int index) const; + double getTimeOfMatchingKeyUp (int index) const; - int getIndexOfMatchingKeyUp (const int index) const; + int getIndexOfMatchingKeyUp (int index) const; - int getIndexOf (MidiEventHolder* const event) const; + int getIndexOf (MidiEventHolder* event) const; - int getNextIndexAtTime (const double timeStamp) const; + int getNextIndexAtTime (double timeStamp) const; double getStartTime() const; double getEndTime() const; - double getEventTime (const int index) const; + double getEventTime (int index) const; void addEvent (const MidiMessage& newMessage, double timeAdjustment = 0); - void deleteEvent (const int index, - const bool deleteMatchingNoteUp); + void deleteEvent (int index, bool deleteMatchingNoteUp); void addSequence (const MidiMessageSequence& other, double timeAdjustmentDelta, @@ -17275,28 +17246,27 @@ public: void updateMatchedPairs(); - void extractMidiChannelMessages (const int channelNumberToExtract, + void extractMidiChannelMessages (int channelNumberToExtract, MidiMessageSequence& destSequence, - const bool alsoIncludeMetaEvents) const; + bool alsoIncludeMetaEvents) const; void extractSysExMessages (MidiMessageSequence& destSequence) const; - void deleteMidiChannelMessages (const int channelNumberToRemove); + void deleteMidiChannelMessages (int channelNumberToRemove); void deleteSysExMessages(); - void addTimeToMessages (const double deltaTime); + void addTimeToMessages (double deltaTime); - void createControllerUpdatesForTime (const int channelNumber, - const double time, + void createControllerUpdatesForTime (int channelNumber, double time, OwnedArray& resultMessages); void swapWith (MidiMessageSequence& other) throw(); juce_UseDebuggingNewOperator - static int compareElements (const MidiMessageSequence::MidiEventHolder* const first, - const MidiMessageSequence::MidiEventHolder* const second) throw(); + static int compareElements (const MidiMessageSequence::MidiEventHolder* first, + const MidiMessageSequence::MidiEventHolder* second) throw(); private: @@ -17313,17 +17283,17 @@ class JUCE_API MidiFile { public: - MidiFile() throw(); + MidiFile(); - ~MidiFile() throw(); + ~MidiFile(); int getNumTracks() const throw(); const MidiMessageSequence* getTrack (const int index) const throw(); - void addTrack (const MidiMessageSequence& trackSequence) throw(); + void addTrack (const MidiMessageSequence& trackSequence); - void clear() throw(); + void clear(); short getTimeFormat() const throw(); @@ -17347,7 +17317,7 @@ public: juce_UseDebuggingNewOperator static int compareElements (const MidiMessageSequence::MidiEventHolder* const first, - const MidiMessageSequence::MidiEventHolder* const second) throw(); + const MidiMessageSequence::MidiEventHolder* const second); private: OwnedArray tracks; @@ -17423,7 +17393,7 @@ private: CriticalSection lock; uint16 noteStates [128]; MidiBuffer eventsToAdd; - VoidArray listeners; + Array listeners; void noteOnInternal (const int midiChannel, const int midiNoteNumber, const float velocity); void noteOffInternal (const int midiChannel, const int midiNoteNumber); @@ -17455,12 +17425,11 @@ public: ~MidiMessageCollector(); - void reset (const double sampleRate); + void reset (double sampleRate); void addMessageToQueue (const MidiMessage& message); - void removeNextBlockOfMessages (MidiBuffer& destBuffer, - const int numSamples); + void removeNextBlockOfMessages (MidiBuffer& destBuffer, int numSamples); void handleNoteOn (MidiKeyboardState* source, int midiChannel, int midiNoteNumber, float velocity); void handleNoteOff (MidiKeyboardState* source, int midiChannel, int midiNoteNumber); @@ -17865,7 +17834,7 @@ public: virtual bool doesPluginStillExist (const PluginDescription& desc) = 0; virtual const StringArray searchPathsForPlugins (const FileSearchPath& directoriesToSearch, - const bool recursive) = 0; + bool recursive) = 0; virtual const FileSearchPath getDefaultLocationsToSearch() = 0; @@ -17895,7 +17864,7 @@ public: AudioPluginInstance* createInstanceFromDescription (const PluginDescription& desc); bool fileMightContainThisPluginType (const String& fileOrIdentifier); const String getNameOfPluginFromIdentifier (const String& fileOrIdentifier); - const StringArray searchPathsForPlugins (const FileSearchPath& directoriesToSearch, const bool recursive); + const StringArray searchPathsForPlugins (const FileSearchPath& directoriesToSearch, bool recursive); bool doesPluginStillExist (const PluginDescription& desc); const FileSearchPath getDefaultLocationsToSearch(); @@ -18167,7 +18136,7 @@ public: AudioPluginInstance* createInstanceFromDescription (const PluginDescription& desc); bool fileMightContainThisPluginType (const String& fileOrIdentifier); const String getNameOfPluginFromIdentifier (const String& fileOrIdentifier); - const StringArray searchPathsForPlugins (const FileSearchPath& directoriesToSearch, const bool recursive); + const StringArray searchPathsForPlugins (const FileSearchPath& directoriesToSearch, bool recursive); bool doesPluginStillExist (const PluginDescription& desc); const FileSearchPath getDefaultLocationsToSearch(); @@ -18253,7 +18222,7 @@ public: int getNumTypes() const throw() { return types.size(); } - PluginDescription* getType (const int index) const throw() { return types [index]; } + PluginDescription* getType (int index) const throw() { return types [index]; } PluginDescription* getTypeForFile (const String& fileOrIdentifier) const throw(); @@ -18261,10 +18230,10 @@ public: bool addType (const PluginDescription& type); - void removeType (const int index) throw(); + void removeType (int index) throw(); bool scanAndAddFile (const String& possiblePluginFileOrIdentifier, - const bool dontRescanIfAlreadyInList, + bool dontRescanIfAlreadyInList, OwnedArray & typesFound, AudioPluginFormat& formatToUse); @@ -18285,7 +18254,7 @@ public: void addToMenu (PopupMenu& menu, const SortMethod sortMethod) const; - int getIndexChosenByMenu (const int menuResultCode) const; + int getIndexChosenByMenu (int menuResultCode) const; void sort (const SortMethod method); @@ -18323,12 +18292,12 @@ public: PluginDirectoryScanner (KnownPluginList& listToAddResultsTo, AudioPluginFormat& formatToLookFor, FileSearchPath directoriesToSearch, - const bool searchRecursively, + bool searchRecursively, const File& deadMansPedalFile); ~PluginDirectoryScanner(); - bool scanNextFile (const bool dontRescanIfAlreadyInList); + bool scanNextFile (bool dontRescanIfAlreadyInList); const String getNextPluginFileThatWillBeScanned() const throw(); @@ -18604,7 +18573,7 @@ public: PluginListComponent (KnownPluginList& listToRepresent, const File& deadMansPedalFile, - PropertiesFile* const propertiesToUse); + PropertiesFile* propertiesToUse); ~PluginListComponent(); @@ -18683,9 +18652,9 @@ public: bool isPrepared; - Node (const uint32 id, AudioProcessor* const processor); + Node (uint32 id, AudioProcessor* processor); - void prepare (const double sampleRate, const int blockSize, AudioProcessorGraph* const graph); + void prepare (double sampleRate, int blockSize, AudioProcessorGraph* graph); void unprepare(); Node (const Node&); @@ -18717,35 +18686,34 @@ public: Node* getNodeForId (const uint32 nodeId) const; - Node* addNode (AudioProcessor* const newProcessor, - uint32 nodeId = 0); + Node* addNode (AudioProcessor* newProcessor, uint32 nodeId = 0); - bool removeNode (const uint32 nodeId); + bool removeNode (uint32 nodeId); int getNumConnections() const { return connections.size(); } - const Connection* getConnection (const int index) const { return connections [index]; } + const Connection* getConnection (int index) const { return connections [index]; } - const Connection* getConnectionBetween (const uint32 sourceNodeId, - const int sourceChannelIndex, - const uint32 destNodeId, - const int destChannelIndex) const; + const Connection* getConnectionBetween (uint32 sourceNodeId, + int sourceChannelIndex, + uint32 destNodeId, + int destChannelIndex) const; - bool isConnected (const uint32 possibleSourceNodeId, - const uint32 possibleDestNodeId) const; + bool isConnected (uint32 possibleSourceNodeId, + uint32 possibleDestNodeId) const; - bool canConnect (const uint32 sourceNodeId, const int sourceChannelIndex, - const uint32 destNodeId, const int destChannelIndex) const; + bool canConnect (uint32 sourceNodeId, int sourceChannelIndex, + uint32 destNodeId, int destChannelIndex) const; - bool addConnection (const uint32 sourceNodeId, const int sourceChannelIndex, - const uint32 destNodeId, const int destChannelIndex); + bool addConnection (uint32 sourceNodeId, int sourceChannelIndex, + uint32 destNodeId, int destChannelIndex); - void removeConnection (const int index); + void removeConnection (int index); - bool removeConnection (const uint32 sourceNodeId, const int sourceChannelIndex, - const uint32 destNodeId, const int destChannelIndex); + bool removeConnection (uint32 sourceNodeId, int sourceChannelIndex, + uint32 destNodeId, int destChannelIndex); - bool disconnectNode (const uint32 nodeId); + bool disconnectNode (uint32 nodeId); bool removeIllegalConnections(); @@ -18811,7 +18779,7 @@ public: void getStateInformation (JUCE_NAMESPACE::MemoryBlock& destData); void setStateInformation (const void* data, int sizeInBytes); - void setParentGraph (AudioProcessorGraph* const graph); + void setParentGraph (AudioProcessorGraph* graph); juce_UseDebuggingNewOperator @@ -18879,9 +18847,7 @@ private: void clearRenderingSequence(); void buildRenderingSequence(); - bool isAnInputTo (const uint32 possibleInputId, - const uint32 possibleDestinationId, - const int recursionCheck) const; + bool isAnInputTo (uint32 possibleInputId, uint32 possibleDestinationId, int recursionCheck) const; AudioProcessorGraph (const AudioProcessorGraph&); AudioProcessorGraph& operator= (const AudioProcessorGraph&); @@ -19133,9 +19099,9 @@ public: int startSample, int numSamples) = 0; - bool isPlayingChannel (const int midiChannel) const; + bool isPlayingChannel (int midiChannel) const; - void setCurrentPlaybackSampleRate (const double newRate); + void setCurrentPlaybackSampleRate (double newRate); juce_UseDebuggingNewOperator @@ -19167,23 +19133,23 @@ public: int getNumVoices() const { return voices.size(); } - SynthesiserVoice* getVoice (const int index) const; + SynthesiserVoice* getVoice (int index) const; - void addVoice (SynthesiserVoice* const newVoice); + void addVoice (SynthesiserVoice* newVoice); - void removeVoice (const int index); + void removeVoice (int index); void clearSounds(); int getNumSounds() const { return sounds.size(); } - SynthesiserSound* getSound (const int index) const { return sounds [index]; } + SynthesiserSound* getSound (int index) const { return sounds [index]; } void addSound (const SynthesiserSound::Ptr& newSound); - void removeSound (const int index); + void removeSound (int index); - void setNoteStealingEnabled (const bool shouldStealNotes); + void setNoteStealingEnabled (bool shouldStealNotes); bool isNoteStealingEnabled() const { return shouldStealNotes; } @@ -19226,11 +19192,11 @@ protected: virtual SynthesiserVoice* findFreeVoice (SynthesiserSound* soundToPlay, const bool stealIfNoneAvailable) const; - void startVoice (SynthesiserVoice* const voice, - SynthesiserSound* const sound, - const int midiChannel, - const int midiNoteNumber, - const float velocity); + void startVoice (SynthesiserVoice* voice, + SynthesiserSound* sound, + int midiChannel, + int midiNoteNumber, + float velocity); int findFreeVoice (const bool) const { return 0; } @@ -19253,10 +19219,10 @@ public: SamplerSound (const String& name, AudioFormatReader& source, const BigInteger& midiNotes, - const int midiNoteForNormalPitch, - const double attackTimeSecs, - const double releaseTimeSecs, - const double maxSampleLengthSeconds); + int midiNoteForNormalPitch, + double attackTimeSecs, + double releaseTimeSecs, + double maxSampleLengthSeconds); ~SamplerSound(); @@ -22155,14 +22121,14 @@ class JUCE_API DirectoryContentsList : public ChangeBroadcaster, { public: - DirectoryContentsList (const FileFilter* const fileFilter, + DirectoryContentsList (const FileFilter* fileFilter, TimeSliceThread& threadToUse); ~DirectoryContentsList(); void setDirectory (const File& directory, - const bool includeDirectories, - const bool includeFiles); + bool includeDirectories, + bool includeFiles); const File& getDirectory() const; @@ -22172,7 +22138,7 @@ public: bool isStillLoading() const; - void setIgnoresHiddenFiles (const bool shouldIgnoreHiddenFiles); + void setIgnoresHiddenFiles (bool shouldIgnoreHiddenFiles); bool ignoresHiddenFiles() const { return ignoreHiddenFiles; } @@ -22194,17 +22160,16 @@ public: int getNumFiles() const; - bool getFileInfo (const int index, - FileInfo& resultInfo) const; + bool getFileInfo (int index, FileInfo& resultInfo) const; - const File getFile (const int index) const; + const File getFile (int index) const; const FileFilter* getFilter() const { return fileFilter; } bool useTimeSlice(); TimeSliceThread& getTimeSliceThread() { return thread; } - static int compareElements (const DirectoryContentsList::FileInfo* const first, - const DirectoryContentsList::FileInfo* const second); + static int compareElements (const DirectoryContentsList::FileInfo* first, + const DirectoryContentsList::FileInfo* second); juce_UseDebuggingNewOperator @@ -22222,9 +22187,9 @@ private: void changed(); bool checkNextFile (bool& hasChanged); - bool addFile (const String& filename, const bool isDir, const bool isHidden, + bool addFile (const String& filename, bool isDir, bool isHidden, const int64 fileSize, const Time& modTime, - const Time& creationTime, const bool isReadOnly); + const Time& creationTime, bool isReadOnly); DirectoryContentsList (const DirectoryContentsList&); DirectoryContentsList& operator= (const DirectoryContentsList&); @@ -22268,9 +22233,9 @@ public: virtual void scrollToTop() = 0; - void addListener (FileBrowserListener* const listener) throw(); + void addListener (FileBrowserListener* listener) throw(); - void removeListener (FileBrowserListener* const listener) throw(); + void removeListener (FileBrowserListener* listener) throw(); enum ColourIds { @@ -22383,9 +22348,9 @@ public: bool isSaveMode() const throw(); - void addListener (FileBrowserListener* const listener) throw(); + void addListener (FileBrowserListener* listener) throw(); - void removeListener (FileBrowserListener* const listener) throw(); + void removeListener (FileBrowserListener* listener) throw(); void resized(); void buttonClicked (Button* b); @@ -22454,7 +22419,7 @@ public: FileChooser (const String& dialogBoxTitle, const File& initialFileOrDirectory = File::nonexistent, const String& filePatternsAllowed = String::empty, - const bool useOSNativeDialogBox = true); + bool useOSNativeDialogBox = true); ~FileChooser(); @@ -22462,7 +22427,7 @@ public: bool browseForMultipleFilesToOpen (FilePreviewComponent* previewComponent = 0); - bool browseForFileToSave (const bool warnAboutOverwritingExistingFiles); + bool browseForFileToSave (bool warnAboutOverwritingExistingFiles); bool browseForDirectory(); @@ -22480,22 +22445,13 @@ private: Array results; bool useNativeDialogBox; - bool showDialog (const bool selectsDirectories, - const bool selectsFiles, - const bool isSave, - const bool warnAboutOverwritingExistingFiles, - const bool selectMultipleFiles, - FilePreviewComponent* const previewComponent); + bool showDialog (bool selectsDirectories, bool selectsFiles, bool isSave, + bool warnAboutOverwritingExistingFiles, bool selectMultipleFiles, + FilePreviewComponent* previewComponent); - static void showPlatformDialog (Array& results, - const String& title, - const File& file, - const String& filters, - bool selectsDirectories, - bool selectsFiles, - bool isSave, - bool warnAboutOverwritingExistingFiles, - bool selectMultipleFiles, + static void showPlatformDialog (Array& results, const String& title, const File& file, + const String& filters, bool selectsDirectories, bool selectsFiles, + bool isSave, bool warnAboutOverwritingExistingFiles, bool selectMultipleFiles, FilePreviewComponent* previewComponent); }; @@ -23081,7 +23037,7 @@ public: FileChooserDialogBox (const String& title, const String& instructions, FileBrowserComponent& browserComponent, - const bool warnAboutOverwritingExistingFiles, + bool warnAboutOverwritingExistingFiles, const Colour& backgroundColour); ~FileChooserDialogBox(); @@ -23207,9 +23163,9 @@ public: FilenameComponent (const String& name, const File& currentFile, - const bool canEditFilename, - const bool isDirectory, - const bool isForSaving, + bool canEditFilename, + bool isDirectory, + bool isForSaving, const String& fileBrowserWildcard, const String& enforcedSuffix, const String& textWhenNothingSelected); @@ -23219,10 +23175,10 @@ public: const File getCurrentFile() const; void setCurrentFile (File newFile, - const bool addToRecentlyUsedList, - const bool sendChangeNotification = true); + bool addToRecentlyUsedList, + bool sendChangeNotification = true); - void setFilenameIsEditable (const bool shouldBeEditable); + void setFilenameIsEditable (bool shouldBeEditable); void setDefaultBrowseTarget (const File& newDefaultDirectory) throw(); @@ -23232,13 +23188,13 @@ public: void addRecentlyUsedFile (const File& file); - void setMaxNumberOfRecentFiles (const int newMaximum); + void setMaxNumberOfRecentFiles (int newMaximum); void setBrowseButtonText (const String& browseButtonText); - void addListener (FilenameComponentListener* const listener) throw(); + void addListener (FilenameComponentListener* listener) throw(); - void removeListener (FilenameComponentListener* const listener) throw(); + void removeListener (FilenameComponentListener* listener) throw(); void setTooltip (const String& newTooltip); @@ -28228,7 +28184,7 @@ class JUCE_API ImageConvolutionKernel { public: - ImageConvolutionKernel (const int size); + ImageConvolutionKernel (int size); ~ImageConvolutionKernel(); @@ -28238,20 +28194,17 @@ public: void setKernelValue (int x, int y, float value) throw(); - void setOverallSum (const float desiredTotalSum); + void setOverallSum (float desiredTotalSum); - void rescaleAllValues (const float multiplier); + void rescaleAllValues (float multiplier); - void createGaussianBlur (const float blurRadius); + void createGaussianBlur (float blurRadius); int getKernelSize() const { return size; } void applyToImage (Image& destImage, const Image* sourceImage, - int x, - int y, - int width, - int height) const; + const Rectangle& destinationArea) const; juce_UseDebuggingNewOperator diff --git a/src/audio/audio_file_formats/juce_AudioFormatManager.h b/src/audio/audio_file_formats/juce_AudioFormatManager.h index 78c3ae44af..c4f38db6fb 100644 --- a/src/audio/audio_file_formats/juce_AudioFormatManager.h +++ b/src/audio/audio_file_formats/juce_AudioFormatManager.h @@ -68,7 +68,7 @@ public: return this one when called. */ void registerFormat (AudioFormat* newFormat, - const bool makeThisTheDefaultFormat); + bool makeThisTheDefaultFormat); /** Handy method to make it easy to register the formats that come with Juce. @@ -83,7 +83,7 @@ public: int getNumKnownFormats() const; /** Returns one of the registered file formats. */ - AudioFormat* getKnownFormat (const int index) const; + AudioFormat* getKnownFormat (int index) const; /** Looks for which of the known formats is listed as being for a given file extension. diff --git a/src/audio/audio_file_formats/juce_AudioFormatReader.h b/src/audio/audio_file_formats/juce_AudioFormatReader.h index 5dcf2c232c..bd09f511ec 100644 --- a/src/audio/audio_file_formats/juce_AudioFormatReader.h +++ b/src/audio/audio_file_formats/juce_AudioFormatReader.h @@ -53,7 +53,7 @@ protected: @param formatName the description that will be returned by the getFormatName() method */ - AudioFormatReader (InputStream* const sourceStream, + AudioFormatReader (InputStream* sourceStream, const String& formatName); public: @@ -110,7 +110,7 @@ public: int numDestChannels, int64 startSampleInSource, int numSamplesToRead, - const bool fillLeftoverChannelsWithCopies); + bool fillLeftoverChannelsWithCopies); /** Finds the highest and lowest sample levels from a section of the audio stream. @@ -160,9 +160,9 @@ public: */ int64 searchForLevel (int64 startSample, int64 numSamplesToSearch, - const double magnitudeRangeMinimum, - const double magnitudeRangeMaximum, - const int minimumConsecutiveSamples); + double magnitudeRangeMinimum, + double magnitudeRangeMaximum, + int minimumConsecutiveSamples); //============================================================================== /** The sample-rate of the stream. */ diff --git a/src/audio/audio_file_formats/juce_AudioFormatWriter.h b/src/audio/audio_file_formats/juce_AudioFormatWriter.h index 75836af036..047aa35f87 100644 --- a/src/audio/audio_file_formats/juce_AudioFormatWriter.h +++ b/src/audio/audio_file_formats/juce_AudioFormatWriter.h @@ -60,11 +60,11 @@ protected: @param bitsPerSample the bit depth of the stream - the base class just stores this value, it doesn't do anything with it */ - AudioFormatWriter (OutputStream* const destStream, + AudioFormatWriter (OutputStream* destStream, const String& formatName, - const double sampleRate, - const unsigned int numberOfChannels, - const unsigned int bitsPerSample); + double sampleRate, + unsigned int numberOfChannels, + unsigned int bitsPerSample); public: /** Destructor. */ @@ -125,7 +125,7 @@ public: */ bool writeFromAudioSource (AudioSource& source, int numSamplesToRead, - const int samplesPerBlock = 2048); + int samplesPerBlock = 2048); //============================================================================== /** Returns the sample rate being used. */ diff --git a/src/audio/audio_file_formats/juce_AudioSubsectionReader.h b/src/audio/audio_file_formats/juce_AudioSubsectionReader.h index 63bd525c61..241d992791 100644 --- a/src/audio/audio_file_formats/juce_AudioSubsectionReader.h +++ b/src/audio/audio_file_formats/juce_AudioSubsectionReader.h @@ -57,10 +57,10 @@ public: @param deleteSourceWhenDeleted if true, the sourceReader object will be deleted when this object is deleted. */ - AudioSubsectionReader (AudioFormatReader* const sourceReader, - const int64 subsectionStartSample, - const int64 subsectionLength, - const bool deleteSourceWhenDeleted); + AudioSubsectionReader (AudioFormatReader* sourceReader, + int64 subsectionStartSample, + int64 subsectionLength, + bool deleteSourceWhenDeleted); /** Destructor. */ ~AudioSubsectionReader(); diff --git a/src/audio/audio_file_formats/juce_AudioThumbnail.h b/src/audio/audio_file_formats/juce_AudioThumbnail.h index 9c4f46ee82..5e72eb3771 100644 --- a/src/audio/audio_file_formats/juce_AudioThumbnail.h +++ b/src/audio/audio_file_formats/juce_AudioThumbnail.h @@ -74,7 +74,7 @@ public: thread and storage that is used to by the thumbnail, and the cache object can be shared between multiple thumbnails */ - AudioThumbnail (const int sourceSamplesPerThumbnailSample, + AudioThumbnail (int sourceSamplesPerThumbnailSample, AudioFormatManager& formatManagerToUse, AudioThumbnailCache& cacheToUse); @@ -94,7 +94,7 @@ public: The source that is passed in will be deleted by this object when it is no longer needed */ - void setSource (InputSource* const newSource); + void setSource (InputSource* newSource); /** Reloads the low res thumbnail data from an input stream. @@ -134,7 +134,7 @@ public: double startTimeSeconds, double endTimeSeconds, int channelNum, - const float verticalZoomFactor); + float verticalZoomFactor); /** Returns true if the low res preview is fully generated. */ @@ -165,18 +165,10 @@ private: bool cacheNeedsRefilling; void clear(); - AudioFormatReader* createReader() const; - - void generateSection (AudioFormatReader& reader, - int64 startSample, - int numSamples); - + void generateSection (AudioFormatReader& reader, int64 startSample, int numSamples); char* getChannelData (int channel) const; - - void refillCache (const int numSamples, - double startTime, - const double timePerPixel); + void refillCache (int numSamples, double startTime, double timePerPixel); friend class AudioThumbnailCache; diff --git a/src/audio/audio_file_formats/juce_AudioThumbnailCache.h b/src/audio/audio_file_formats/juce_AudioThumbnailCache.h index 4d0c72b84f..cdfed218ef 100644 --- a/src/audio/audio_file_formats/juce_AudioThumbnailCache.h +++ b/src/audio/audio_file_formats/juce_AudioThumbnailCache.h @@ -49,7 +49,7 @@ public: The maxNumThumbsToStore parameter lets you specify how many previews should be kept in memory at once. */ - AudioThumbnailCache (const int maxNumThumbsToStore); + AudioThumbnailCache (int maxNumThumbsToStore); /** Destructor. */ ~AudioThumbnailCache(); @@ -65,14 +65,14 @@ public: This is called automatically by the AudioThumbnail class, so you shouldn't normally need to call it directly. */ - bool loadThumb (AudioThumbnail& thumb, const int64 hashCode); + bool loadThumb (AudioThumbnail& thumb, int64 hashCode); /** Stores the cachable data from the specified thumb in this cache. This is called automatically by the AudioThumbnail class, so you shouldn't normally need to call it directly. */ - void storeThumb (const AudioThumbnail& thumb, const int64 hashCode); + void storeThumb (const AudioThumbnail& thumb, int64 hashCode); //============================================================================== @@ -84,8 +84,8 @@ private: int maxNumThumbsToStore; friend class AudioThumbnail; - void addThumbnail (AudioThumbnail* const thumb); - void removeThumbnail (AudioThumbnail* const thumb); + void addThumbnail (AudioThumbnail* thumb); + void removeThumbnail (AudioThumbnail* thumb); }; diff --git a/src/audio/devices/juce_AudioDeviceManager.h b/src/audio/devices/juce_AudioDeviceManager.h index 694b68c26e..fcac743dfb 100644 --- a/src/audio/devices/juce_AudioDeviceManager.h +++ b/src/audio/devices/juce_AudioDeviceManager.h @@ -174,10 +174,10 @@ public: @returns an error message if anything went wrong, or an empty string if it worked ok. */ - const String initialise (const int numInputChannelsNeeded, - const int numOutputChannelsNeeded, - const XmlElement* const savedState, - const bool selectDefaultDeviceOnFailure, + const String initialise (int numInputChannelsNeeded, + int numOutputChannelsNeeded, + const XmlElement* savedState, + bool selectDefaultDeviceOnFailure, const String& preferredDefaultDeviceName = String::empty, const AudioDeviceSetup* preferredSetupOptions = 0); @@ -215,7 +215,7 @@ public: @see getAudioDeviceSetup */ const String setAudioDeviceSetup (const AudioDeviceSetup& newSetup, - const bool treatAsChosenDevice); + bool treatAsChosenDevice); /** Returns the currently-active audio device. */ @@ -240,7 +240,7 @@ public: For a list of types, see getAvailableDeviceTypes(). */ void setCurrentAudioDeviceType (const String& type, - const bool treatAsChosenDevice); + bool treatAsChosenDevice); /** Closes the currently-open device. @@ -312,7 +312,7 @@ public: @see addMidiInputCallback, isMidiInputEnabled */ void setMidiInputEnabled (const String& midiInputDeviceName, - const bool enabled); + bool enabled); /** Returns true if a given midi input device is being used. @@ -403,7 +403,7 @@ public: only intended for giving rough feedback, and not for any kind of accurate measurement. */ - void enableInputLevelMeasurement (const bool enableMeasurement); + void enableInputLevelMeasurement (bool enableMeasurement); /** Returns the current input level. @@ -474,7 +474,7 @@ private: float** outputChannelData, int totalNumOutputChannels, int numSamples); - void audioDeviceAboutToStartInt (AudioIODevice* const device); + void audioDeviceAboutToStartInt (AudioIODevice* device); void audioDeviceStoppedInt(); void handleIncomingMidiMessageInt (MidiInput* source, const MidiMessage& message); diff --git a/src/audio/devices/juce_AudioIODeviceType.h b/src/audio/devices/juce_AudioIODeviceType.h index 3c1f3562a9..0f90f9d404 100644 --- a/src/audio/devices/juce_AudioIODeviceType.h +++ b/src/audio/devices/juce_AudioIODeviceType.h @@ -89,7 +89,7 @@ public: into inputs and outputs, this indicates whether to use the input or output name to refer to a pair of devices. */ - virtual const StringArray getDeviceNames (const bool wantInputNames = false) const = 0; + virtual const StringArray getDeviceNames (bool wantInputNames = false) const = 0; /** Returns the name of the default device. @@ -98,13 +98,13 @@ public: @param forInput if true, this means that a default input device should be returned; if false, it should return the default output */ - virtual int getDefaultDeviceIndex (const bool forInput) const = 0; + virtual int getDefaultDeviceIndex (bool forInput) const = 0; /** Returns the index of a given device in the list of device names. If asInput is true, it shows the index in the inputs list, otherwise it looks for it in the outputs list. */ - virtual int getIndexOfDevice (AudioIODevice* device, const bool asInput) const = 0; + virtual int getIndexOfDevice (AudioIODevice* device, bool asInput) const = 0; /** Returns true if two different devices can be used for the input and output. */ diff --git a/src/audio/devices/juce_MidiOutput.h b/src/audio/devices/juce_MidiOutput.h index 2f215badce..d4b2462fa1 100644 --- a/src/audio/devices/juce_MidiOutput.h +++ b/src/audio/devices/juce_MidiOutput.h @@ -128,7 +128,7 @@ public: real time. */ virtual void sendBlockOfMessages (const MidiBuffer& buffer, - const double millisecondCounterToStartAt, + double millisecondCounterToStartAt, double samplesPerSecondForBuffer); /** Gets rid of any midi messages that had been added by sendBlockOfMessages(). diff --git a/src/audio/dsp/juce_AudioDataConverters.h b/src/audio/dsp/juce_AudioDataConverters.h index e5198eecf5..fb8558bd5a 100644 --- a/src/audio/dsp/juce_AudioDataConverters.h +++ b/src/audio/dsp/juce_AudioDataConverters.h @@ -37,30 +37,30 @@ class JUCE_API AudioDataConverters { public: //============================================================================== - static void convertFloatToInt16LE (const float* source, void* dest, int numSamples, const int destBytesPerSample = 2); - static void convertFloatToInt16BE (const float* source, void* dest, int numSamples, const int destBytesPerSample = 2); + static void convertFloatToInt16LE (const float* source, void* dest, int numSamples, int destBytesPerSample = 2); + static void convertFloatToInt16BE (const float* source, void* dest, int numSamples, int destBytesPerSample = 2); - static void convertFloatToInt24LE (const float* source, void* dest, int numSamples, const int destBytesPerSample = 3); - static void convertFloatToInt24BE (const float* source, void* dest, int numSamples, const int destBytesPerSample = 3); + static void convertFloatToInt24LE (const float* source, void* dest, int numSamples, int destBytesPerSample = 3); + static void convertFloatToInt24BE (const float* source, void* dest, int numSamples, int destBytesPerSample = 3); - static void convertFloatToInt32LE (const float* source, void* dest, int numSamples, const int destBytesPerSample = 4); - static void convertFloatToInt32BE (const float* source, void* dest, int numSamples, const int destBytesPerSample = 4); + static void convertFloatToInt32LE (const float* source, void* dest, int numSamples, int destBytesPerSample = 4); + static void convertFloatToInt32BE (const float* source, void* dest, int numSamples, int destBytesPerSample = 4); - static void convertFloatToFloat32LE (const float* source, void* dest, int numSamples, const int destBytesPerSample = 4); - static void convertFloatToFloat32BE (const float* source, void* dest, int numSamples, const int destBytesPerSample = 4); + static void convertFloatToFloat32LE (const float* source, void* dest, int numSamples, int destBytesPerSample = 4); + static void convertFloatToFloat32BE (const float* source, void* dest, int numSamples, int destBytesPerSample = 4); //============================================================================== - static void convertInt16LEToFloat (const void* source, float* dest, int numSamples, const int srcBytesPerSample = 2); - static void convertInt16BEToFloat (const void* source, float* dest, int numSamples, const int srcBytesPerSample = 2); + static void convertInt16LEToFloat (const void* source, float* dest, int numSamples, int srcBytesPerSample = 2); + static void convertInt16BEToFloat (const void* source, float* dest, int numSamples, int srcBytesPerSample = 2); - static void convertInt24LEToFloat (const void* source, float* dest, int numSamples, const int srcBytesPerSample = 3); - static void convertInt24BEToFloat (const void* source, float* dest, int numSamples, const int srcBytesPerSample = 3); + static void convertInt24LEToFloat (const void* source, float* dest, int numSamples, int srcBytesPerSample = 3); + static void convertInt24BEToFloat (const void* source, float* dest, int numSamples, int srcBytesPerSample = 3); - static void convertInt32LEToFloat (const void* source, float* dest, int numSamples, const int srcBytesPerSample = 4); - static void convertInt32BEToFloat (const void* source, float* dest, int numSamples, const int srcBytesPerSample = 4); + static void convertInt32LEToFloat (const void* source, float* dest, int numSamples, int srcBytesPerSample = 4); + static void convertInt32BEToFloat (const void* source, float* dest, int numSamples, int srcBytesPerSample = 4); - static void convertFloat32LEToFloat (const void* source, float* dest, int numSamples, const int srcBytesPerSample = 4); - static void convertFloat32BEToFloat (const void* source, float* dest, int numSamples, const int srcBytesPerSample = 4); + static void convertFloat32LEToFloat (const void* source, float* dest, int numSamples, int srcBytesPerSample = 4); + static void convertFloat32BEToFloat (const void* source, float* dest, int numSamples, int srcBytesPerSample = 4); //============================================================================== enum DataFormat @@ -75,18 +75,18 @@ public: float32BE, }; - static void convertFloatToFormat (const DataFormat destFormat, + static void convertFloatToFormat (DataFormat destFormat, const float* source, void* dest, int numSamples); - static void convertFormatToFloat (const DataFormat sourceFormat, + static void convertFormatToFloat (DataFormat sourceFormat, const void* source, float* dest, int numSamples); //============================================================================== static void interleaveSamples (const float** source, float* dest, - const int numSamples, const int numChannels); + int numSamples, int numChannels); static void deinterleaveSamples (const float* source, float** dest, - const int numSamples, const int numChannels); + int numSamples, int numChannels); }; diff --git a/src/audio/dsp/juce_AudioSampleBuffer.h b/src/audio/dsp/juce_AudioSampleBuffer.h index f57b588143..367f63c110 100644 --- a/src/audio/dsp/juce_AudioSampleBuffer.h +++ b/src/audio/dsp/juce_AudioSampleBuffer.h @@ -48,8 +48,8 @@ public: The buffer will allocate its memory internally, and this will be released when the buffer is deleted. */ - AudioSampleBuffer (const int numChannels, - const int numSamples) throw(); + AudioSampleBuffer (int numChannels, + int numSamples) throw(); /** Creates a buffer using a pre-allocated block of memory. @@ -67,8 +67,8 @@ public: size of the arrays passed in */ AudioSampleBuffer (float** dataToReferTo, - const int numChannels, - const int numSamples) throw(); + int numChannels, + int numSamples) throw(); /** Copies another buffer. @@ -152,11 +152,11 @@ public: a new allocation will be done so that the buffer uses takes up the minimum amount of memory that it needs. */ - void setSize (const int newNumChannels, - const int newNumSamples, - const bool keepExistingContent = false, - const bool clearExtraSpace = false, - const bool avoidReallocating = false) throw(); + void setSize (int newNumChannels, + int newNumSamples, + bool keepExistingContent = false, + bool clearExtraSpace = false, + bool avoidReallocating = false) throw(); /** Makes this buffer point to a pre-allocated set of channel data arrays. @@ -178,8 +178,8 @@ public: size of the arrays passed in */ void setDataToReferTo (float** dataToReferTo, - const int numChannels, - const int numSamples) throw(); + int numChannels, + int numSamples) throw(); //============================================================================== /** Clears all the samples in all channels. */ @@ -190,36 +190,36 @@ public: For speed, this doesn't check whether the channel and sample number are in-range, so be careful! */ - void clear (const int startSample, - const int numSamples) throw(); + void clear (int startSample, + int numSamples) throw(); /** Clears a specified region of just one channel. For speed, this doesn't check whether the channel and sample number are in-range, so be careful! */ - void clear (const int channel, - const int startSample, - const int numSamples) throw(); + void clear (int channel, + int startSample, + int numSamples) throw(); /** Applies a gain multiple to a region of one channel. For speed, this doesn't check whether the channel and sample number are in-range, so be careful! */ - void applyGain (const int channel, - const int startSample, + void applyGain (int channel, + int startSample, int numSamples, - const float gain) throw(); + float gain) throw(); /** Applies a gain multiple to a region of all the channels. For speed, this doesn't check whether the sample numbers are in-range, so be careful! */ - void applyGain (const int startSample, - const int numSamples, - const float gain) throw(); + void applyGain (int startSample, + int numSamples, + float gain) throw(); /** Applies a range of gains to a region of a channel. @@ -230,8 +230,8 @@ public: For speed, this doesn't check whether the sample numbers are in-range, so be careful! */ - void applyGainRamp (const int channel, - const int startSample, + void applyGainRamp (int channel, + int startSample, int numSamples, float startGain, float endGain) throw(); @@ -249,13 +249,13 @@ public: @see copyFrom */ - void addFrom (const int destChannel, - const int destStartSample, + void addFrom (int destChannel, + int destStartSample, const AudioSampleBuffer& source, - const int sourceChannel, - const int sourceStartSample, + int sourceChannel, + int sourceStartSample, int numSamples, - const float gainToApplyToSource = 1.0f) throw(); + float gainToApplyToSource = 1.0f) throw(); /** Adds samples from an array of floats to one of the channels. @@ -268,11 +268,11 @@ public: @see copyFrom */ - void addFrom (const int destChannel, - const int destStartSample, + void addFrom (int destChannel, + int destStartSample, const float* source, int numSamples, - const float gainToApplyToSource = 1.0f) throw(); + float gainToApplyToSource = 1.0f) throw(); /** Adds samples from an array of floats, applying a gain ramp to them. @@ -285,8 +285,8 @@ public: @param endGain the gain to apply to the final sample. The gain is linearly interpolated between the first and last samples. */ - void addFromWithRamp (const int destChannel, - const int destStartSample, + void addFromWithRamp (int destChannel, + int destStartSample, const float* source, int numSamples, float startGain, @@ -303,11 +303,11 @@ public: @see addFrom */ - void copyFrom (const int destChannel, - const int destStartSample, + void copyFrom (int destChannel, + int destStartSample, const AudioSampleBuffer& source, - const int sourceChannel, - const int sourceStartSample, + int sourceChannel, + int sourceStartSample, int numSamples) throw(); /** Copies samples from an array of floats into one of the channels. @@ -319,8 +319,8 @@ public: @see addFrom */ - void copyFrom (const int destChannel, - const int destStartSample, + void copyFrom (int destChannel, + int destStartSample, const float* source, int numSamples) throw(); @@ -334,11 +334,11 @@ public: @see addFrom */ - void copyFrom (const int destChannel, - const int destStartSample, + void copyFrom (int destChannel, + int destStartSample, const float* source, int numSamples, - const float gain) throw(); + float gain) throw(); /** Copies samples from an array of floats into one of the channels, applying a gain ramp. @@ -353,8 +353,8 @@ public: @see addFrom */ - void copyFromWithRamp (const int destChannel, - const int destStartSample, + void copyFromWithRamp (int destChannel, + int destStartSample, const float* source, int numSamples, float startGain, @@ -369,28 +369,28 @@ public: @param minVal on return, the lowest value that was found @param maxVal on return, the highest value that was found */ - void findMinMax (const int channel, - const int startSample, + void findMinMax (int channel, + int startSample, int numSamples, float& minVal, float& maxVal) const throw(); /** Finds the highest absolute sample value within a region of a channel. */ - float getMagnitude (const int channel, - const int startSample, - const int numSamples) const throw(); + float getMagnitude (int channel, + int startSample, + int numSamples) const throw(); /** Finds the highest absolute sample value within a region on all channels. */ - float getMagnitude (const int startSample, - const int numSamples) const throw(); + float getMagnitude (int startSample, + int numSamples) const throw(); /** Returns the root mean squared level for a region of a channel. */ - float getRMSLevel (const int channel, - const int startSample, - const int numSamples) const throw(); + float getRMSLevel (int channel, + int startSample, + int numSamples) const throw(); //============================================================================== /** Fills a section of the buffer using an AudioReader as its source. @@ -403,11 +403,11 @@ public: @see writeToAudioWriter */ void readFromAudioReader (AudioFormatReader* reader, - const int startSample, - const int numSamples, - const int readerStartSample, - const bool useReaderLeftChan, - const bool useReaderRightChan) throw(); + int startSample, + int numSamples, + int readerStartSample, + bool useReaderLeftChan, + bool useReaderRightChan) throw(); /** Writes a section of this buffer to an audio writer. @@ -417,8 +417,8 @@ public: @see readFromAudioReader */ void writeToAudioWriter (AudioFormatWriter* writer, - const int startSample, - const int numSamples) const throw(); + int startSample, + int numSamples) const throw(); //============================================================================== juce_UseDebuggingNewOperator @@ -431,7 +431,7 @@ private: float* preallocatedChannelSpace [32]; void allocateData(); - void allocateChannels (float** const dataToReferTo); + void allocateChannels (float** dataToReferTo); }; diff --git a/src/audio/dsp/juce_IIRFilter.h b/src/audio/dsp/juce_IIRFilter.h index fb131bf9f0..0ae4ebaeed 100644 --- a/src/audio/dsp/juce_IIRFilter.h +++ b/src/audio/dsp/juce_IIRFilter.h @@ -65,26 +65,26 @@ public: /** Performs the filter operation on the given set of samples. */ - void processSamples (float* const samples, - const int numSamples) throw(); + void processSamples (float* samples, + int numSamples) throw(); /** Processes a single sample, without any locking or checking. Use this if you need fast processing of a single value, but be aware that this isn't thread-safe in the way that processSamples() is. */ - float processSingleSampleRaw (const float sample) throw(); + float processSingleSampleRaw (float sample) throw(); //============================================================================== /** Sets the filter up to act as a low-pass filter. */ - void makeLowPass (const double sampleRate, - const double frequency) throw(); + void makeLowPass (double sampleRate, + double frequency) throw(); /** Sets the filter up to act as a high-pass filter. */ - void makeHighPass (const double sampleRate, - const double frequency) throw(); + void makeHighPass (double sampleRate, + double frequency) throw(); //============================================================================== /** Sets the filter up to act as a low-pass shelf filter with variable Q and gain. @@ -93,10 +93,10 @@ public: greater than 1.0 will boost the low frequencies, values less than 1.0 will attenuate them. */ - void makeLowShelf (const double sampleRate, - const double cutOffFrequency, - const double Q, - const float gainFactor) throw(); + void makeLowShelf (double sampleRate, + double cutOffFrequency, + double Q, + float gainFactor) throw(); /** Sets the filter up to act as a high-pass shelf filter with variable Q and gain. @@ -104,10 +104,10 @@ public: greater than 1.0 will boost the high frequencies, values less than 1.0 will attenuate them. */ - void makeHighShelf (const double sampleRate, - const double cutOffFrequency, - const double Q, - const float gainFactor) throw(); + void makeHighShelf (double sampleRate, + double cutOffFrequency, + double Q, + float gainFactor) throw(); /** Sets the filter up to act as a band pass filter centred around a frequency, with a variable Q and gain. @@ -116,10 +116,10 @@ public: values greater than 1.0 will boost the centre frequencies, values less than 1.0 will attenuate them. */ - void makeBandPass (const double sampleRate, - const double centreFrequency, - const double Q, - const float gainFactor) throw(); + void makeBandPass (double sampleRate, + double centreFrequency, + double Q, + float gainFactor) throw(); /** Clears the filter's coefficients so that it becomes inactive. */ diff --git a/src/audio/midi/juce_MidiBuffer.cpp b/src/audio/midi/juce_MidiBuffer.cpp index 870e3059e4..134e448e8d 100644 --- a/src/audio/midi/juce_MidiBuffer.cpp +++ b/src/audio/midi/juce_MidiBuffer.cpp @@ -56,7 +56,7 @@ MidiBuffer& MidiBuffer::operator= (const MidiBuffer& other) throw() return *this; } -void MidiBuffer::swap (MidiBuffer& other) +void MidiBuffer::swapWith (MidiBuffer& other) { data.swapWith (other.data); swapVariables (bytesUsed, other.bytesUsed); @@ -140,13 +140,11 @@ void MidiBuffer::addEvent (const uint8* const newData, const int bytesToMove = bytesUsed - (int) (d - getData()); if (bytesToMove > 0) - memmove (d + numBytes + 6, - d, - bytesToMove); + memmove (d + numBytes + 6, d, bytesToMove); - *(int*) d = sampleNumber; + *reinterpret_cast (d) = sampleNumber; d += 4; - *(uint16*) d = (uint16) numBytes; + *reinterpret_cast (d) = (uint16) numBytes; d += 2; memcpy (d, newData, numBytes); @@ -187,7 +185,7 @@ int MidiBuffer::getNumEvents() const throw() while (d < end) { d += 4; - d += 2 + *(const uint16*) d; + d += 2 + *reinterpret_cast (d); ++n; } @@ -209,10 +207,10 @@ int MidiBuffer::getLastEventTime() const throw() for (;;) { - const uint8* nextOne = d + 6 + * (const uint16*) (d + 4); + const uint8* nextOne = d + 6 + *reinterpret_cast (d + 4); if (nextOne >= endData) - return *(const int*) d; + return *reinterpret_cast (d); d = nextOne; } @@ -222,10 +220,10 @@ uint8* MidiBuffer::findEventAfter (uint8* d, const int samplePosition) const thr { const uint8* const endData = getData() + bytesUsed; - while (d < endData && *(int*) d <= samplePosition) + while (d < endData && *reinterpret_cast (d) <= samplePosition) { d += 4; - d += 2 + *(uint16*) d; + d += 2 + *reinterpret_cast (d); } return d; @@ -248,23 +246,21 @@ void MidiBuffer::Iterator::setNextSamplePosition (const int samplePosition) thro data = buffer.getData(); const uint8* dataEnd = data + buffer.bytesUsed; - while (data < dataEnd && *reinterpret_cast (data) < samplePosition) + while (data < dataEnd && *reinterpret_cast (data) < samplePosition) { data += 4; data += 2 + *(uint16*) data; } } -bool MidiBuffer::Iterator::getNextEvent (const uint8* &midiData, - int& numBytes, - int& samplePosition) throw() +bool MidiBuffer::Iterator::getNextEvent (const uint8* &midiData, int& numBytes, int& samplePosition) throw() { if (data >= buffer.getData() + buffer.bytesUsed) return false; - samplePosition = *(int*) data; + samplePosition = *reinterpret_cast (data); data += 4; - numBytes = *(uint16*) data; + numBytes = *reinterpret_cast (data); data += 2; midiData = data; data += numBytes; @@ -272,8 +268,7 @@ bool MidiBuffer::Iterator::getNextEvent (const uint8* &midiData, return true; } -bool MidiBuffer::Iterator::getNextEvent (MidiMessage& result, - int& samplePosition) throw() +bool MidiBuffer::Iterator::getNextEvent (MidiMessage& result, int& samplePosition) throw() { if (data >= buffer.getData() + buffer.bytesUsed) return false; diff --git a/src/audio/midi/juce_MidiBuffer.h b/src/audio/midi/juce_MidiBuffer.h index 551d77bac4..098753fd64 100644 --- a/src/audio/midi/juce_MidiBuffer.h +++ b/src/audio/midi/juce_MidiBuffer.h @@ -155,7 +155,7 @@ public: This is a quick operation, because no memory allocating or copying is done, it just swaps the internal state of the two buffers. */ - void swap (MidiBuffer& other); + void swapWith (MidiBuffer& other); //============================================================================== /** diff --git a/src/audio/midi/juce_MidiFile.cpp b/src/audio/midi/juce_MidiFile.cpp index 614c699790..475c78d7bd 100644 --- a/src/audio/midi/juce_MidiFile.cpp +++ b/src/audio/midi/juce_MidiFile.cpp @@ -163,17 +163,17 @@ namespace MidiFileHelpers } //============================================================================== -MidiFile::MidiFile() throw() +MidiFile::MidiFile() : timeFormat ((short) (unsigned short) 0xe728) { } -MidiFile::~MidiFile() throw() +MidiFile::~MidiFile() { clear(); } -void MidiFile::clear() throw() +void MidiFile::clear() { tracks.clear(); } @@ -189,7 +189,7 @@ const MidiMessageSequence* MidiFile::getTrack (const int index) const throw() return tracks [index]; } -void MidiFile::addTrack (const MidiMessageSequence& trackSequence) throw() +void MidiFile::addTrack (const MidiMessageSequence& trackSequence) { tracks.add (new MidiMessageSequence (trackSequence)); } @@ -202,7 +202,7 @@ short MidiFile::getTimeFormat() const throw() void MidiFile::setTicksPerQuarterNote (const int ticks) throw() { - timeFormat = (short)ticks; + timeFormat = (short) ticks; } void MidiFile::setSmpteTimeFormat (const int framesPerSecond, @@ -307,7 +307,7 @@ bool MidiFile::readFrom (InputStream& sourceStream) // a comparator that puts all the note-offs before note-ons that have the same time int MidiFile::compareElements (const MidiMessageSequence::MidiEventHolder* const first, - const MidiMessageSequence::MidiEventHolder* const second) throw() + const MidiMessageSequence::MidiEventHolder* const second) { const double diff = (first->message.getTimeStamp() - second->message.getTimeStamp()); diff --git a/src/audio/midi/juce_MidiFile.h b/src/audio/midi/juce_MidiFile.h index 51ee16c977..e952015952 100644 --- a/src/audio/midi/juce_MidiFile.h +++ b/src/audio/midi/juce_MidiFile.h @@ -50,10 +50,10 @@ public: //============================================================================== /** Creates an empty MidiFile object. */ - MidiFile() throw(); + MidiFile(); /** Destructor. */ - ~MidiFile() throw(); + ~MidiFile(); //============================================================================== /** Returns the number of tracks in the file. @@ -75,13 +75,13 @@ public: @see getNumTracks, getTrack */ - void addTrack (const MidiMessageSequence& trackSequence) throw(); + void addTrack (const MidiMessageSequence& trackSequence); /** Removes all midi tracks from the file. @see getNumTracks */ - void clear() throw(); + void clear(); /** Returns the raw time format code that will be written to a stream. @@ -179,7 +179,7 @@ public: /** @internal */ static int compareElements (const MidiMessageSequence::MidiEventHolder* const first, - const MidiMessageSequence::MidiEventHolder* const second) throw(); + const MidiMessageSequence::MidiEventHolder* const second); private: OwnedArray tracks; diff --git a/src/audio/midi/juce_MidiKeyboardState.cpp b/src/audio/midi/juce_MidiKeyboardState.cpp index 85de6a3a8f..0ceaaeaf66 100644 --- a/src/audio/midi/juce_MidiKeyboardState.cpp +++ b/src/audio/midi/juce_MidiKeyboardState.cpp @@ -34,7 +34,7 @@ BEGIN_JUCE_NAMESPACE //============================================================================== MidiKeyboardState::MidiKeyboardState() { - zeromem (noteStates, sizeof (noteStates)); + zerostruct (noteStates); } MidiKeyboardState::~MidiKeyboardState() @@ -45,7 +45,7 @@ MidiKeyboardState::~MidiKeyboardState() void MidiKeyboardState::reset() { const ScopedLock sl (lock); - zeromem (noteStates, sizeof (noteStates)); + zerostruct (noteStates); eventsToAdd.clear(); } @@ -87,8 +87,7 @@ void MidiKeyboardState::noteOnInternal (const int midiChannel, const int midiNo noteStates [midiNoteNumber] |= (1 << (midiChannel - 1)); for (int i = listeners.size(); --i >= 0;) - ((MidiKeyboardStateListener*) listeners.getUnchecked(i)) - ->handleNoteOn (this, midiChannel, midiNoteNumber, velocity); + listeners.getUnchecked(i)->handleNoteOn (this, midiChannel, midiNoteNumber, velocity); } } @@ -113,8 +112,7 @@ void MidiKeyboardState::noteOffInternal (const int midiChannel, const int midiN noteStates [midiNoteNumber] &= ~(1 << (midiChannel - 1)); for (int i = listeners.size(); --i >= 0;) - ((MidiKeyboardStateListener*) listeners.getUnchecked(i)) - ->handleNoteOff (this, midiChannel, midiNoteNumber); + listeners.getUnchecked(i)->handleNoteOff (this, midiChannel, midiNoteNumber); } } diff --git a/src/audio/midi/juce_MidiKeyboardState.h b/src/audio/midi/juce_MidiKeyboardState.h index cc1944d7ba..7637b510c9 100644 --- a/src/audio/midi/juce_MidiKeyboardState.h +++ b/src/audio/midi/juce_MidiKeyboardState.h @@ -201,7 +201,7 @@ private: CriticalSection lock; uint16 noteStates [128]; MidiBuffer eventsToAdd; - VoidArray listeners; + Array listeners; void noteOnInternal (const int midiChannel, const int midiNoteNumber, const float velocity); void noteOffInternal (const int midiChannel, const int midiNoteNumber); diff --git a/src/audio/midi/juce_MidiMessage.cpp b/src/audio/midi/juce_MidiMessage.cpp index ffc90d6550..3590f3c737 100644 --- a/src/audio/midi/juce_MidiMessage.cpp +++ b/src/audio/midi/juce_MidiMessage.cpp @@ -76,9 +76,7 @@ int MidiMessage::getMessageLengthFromFirstByte (const uint8 firstByte) throw() } //============================================================================== -MidiMessage::MidiMessage (const uint8* const d, - const int dataSize, - const double t) throw() +MidiMessage::MidiMessage (const void* const d, const int dataSize, const double t) : timeStamp (t), message (0), size (dataSize) @@ -93,11 +91,11 @@ MidiMessage::MidiMessage (const uint8* const d, memcpy (data, d, dataSize); // check that the length matches the data.. - jassert (size > 3 || *d >= 0xf0 || getMessageLengthFromFirstByte (*d) == size); + jassert (size > 3 || *reinterpret_cast (d) >= 0xf0 + || getMessageLengthFromFirstByte (*reinterpret_cast (d)) == size); } -MidiMessage::MidiMessage (const int byte1, - const double t) throw() +MidiMessage::MidiMessage (const int byte1, const double t) throw() : timeStamp (t), data ((uint8*) &message), size (1) @@ -108,9 +106,7 @@ MidiMessage::MidiMessage (const int byte1, jassert (byte1 >= 0xf0 || getMessageLengthFromFirstByte ((uint8) byte1) == 1); } -MidiMessage::MidiMessage (const int byte1, - const int byte2, - const double t) throw() +MidiMessage::MidiMessage (const int byte1, const int byte2, const double t) throw() : timeStamp (t), data ((uint8*) &message), size (2) @@ -122,10 +118,7 @@ MidiMessage::MidiMessage (const int byte1, jassert (byte1 >= 0xf0 || getMessageLengthFromFirstByte ((uint8) byte1) == 2); } -MidiMessage::MidiMessage (const int byte1, - const int byte2, - const int byte3, - const double t) throw() +MidiMessage::MidiMessage (const int byte1, const int byte2, const int byte3, const double t) throw() : timeStamp (t), data ((uint8*) &message), size (3) @@ -138,7 +131,7 @@ MidiMessage::MidiMessage (const int byte1, jassert (byte1 >= 0xf0 || getMessageLengthFromFirstByte ((uint8) byte1) == 3); } -MidiMessage::MidiMessage (const MidiMessage& other) throw() +MidiMessage::MidiMessage (const MidiMessage& other) : timeStamp (other.timeStamp), message (other.message), size (other.size) @@ -154,8 +147,7 @@ MidiMessage::MidiMessage (const MidiMessage& other) throw() } } -MidiMessage::MidiMessage (const MidiMessage& other, - const double newTimeStamp) throw() +MidiMessage::MidiMessage (const MidiMessage& other, const double newTimeStamp) : timeStamp (newTimeStamp), message (other.message), size (other.size) @@ -171,15 +163,12 @@ MidiMessage::MidiMessage (const MidiMessage& other, } } -MidiMessage::MidiMessage (const uint8* src, - int sz, - int& numBytesUsed, - const uint8 lastStatusByte, - double t) throw() +MidiMessage::MidiMessage (const void* src_, int sz, int& numBytesUsed, const uint8 lastStatusByte, double t) : timeStamp (t), data ((uint8*) &message), message (0) { + const uint8* src = static_cast (src_); unsigned int byte = (unsigned int) *src; if (byte < 0x80) @@ -198,7 +187,7 @@ MidiMessage::MidiMessage (const uint8* src, { if (byte == 0xf0) { - const uint8* d = (const uint8*) src; + const uint8* d = src; while (d < src + sz) { @@ -252,7 +241,7 @@ MidiMessage::MidiMessage (const uint8* src, } } -MidiMessage& MidiMessage::operator= (const MidiMessage& other) throw() +MidiMessage& MidiMessage::operator= (const MidiMessage& other) { if (this != &other) { @@ -277,7 +266,7 @@ MidiMessage& MidiMessage::operator= (const MidiMessage& other) throw() return *this; } -MidiMessage::~MidiMessage() throw() +MidiMessage::~MidiMessage() { if (data != (uint8*) &message) juce_free (data); @@ -535,7 +524,7 @@ const MidiMessage MidiMessage::allControllersOff (const int channel) throw() return controllerEvent (channel, 121, 0); } -const MidiMessage MidiMessage::masterVolume (const float volume) throw() +const MidiMessage MidiMessage::masterVolume (const float volume) { const int vol = jlimit (0, 0x3fff, roundToInt (volume * 0x4000)); @@ -558,8 +547,7 @@ bool MidiMessage::isSysEx() const throw() return *data == 0xf0; } -const MidiMessage MidiMessage::createSysExMessage (const uint8* sysexData, - const int dataSize) throw() +const MidiMessage MidiMessage::createSysExMessage (const uint8* sysexData, const int dataSize) { MemoryBlock mm (dataSize + 2); uint8* const m = (uint8*) mm.getData(); @@ -573,14 +561,12 @@ const MidiMessage MidiMessage::createSysExMessage (const uint8* sysexData, const uint8* MidiMessage::getSysExData() const throw() { - return (isSysEx()) ? getRawData() + 1 - : 0; + return (isSysEx()) ? getRawData() + 1 : 0; } int MidiMessage::getSysExDataSize() const throw() { - return (isSysEx()) ? size - 2 - : 0; + return (isSysEx()) ? size - 2 : 0; } bool MidiMessage::isMetaEvent() const throw() @@ -638,10 +624,9 @@ bool MidiMessage::isTextMetaEvent() const throw() return t > 0 && t < 16; } -const String MidiMessage::getTextFromTextMetaEvent() const throw() +const String MidiMessage::getTextFromTextMetaEvent() const { - return String ((const char*) getMetaEventData(), - getMetaEventLength()); + return String ((const char*) getMetaEventData(), getMetaEventLength()); } bool MidiMessage::isTrackNameEvent() const throw() @@ -727,8 +712,7 @@ bool MidiMessage::isTimeSignatureMetaEvent() const throw() && (*data == (uint8) 0xff); } -void MidiMessage::getTimeSignatureInfo (int& numerator, - int& denominator) const throw() +void MidiMessage::getTimeSignatureInfo (int& numerator, int& denominator) const throw() { if (isTimeSignatureMetaEvent()) { @@ -743,8 +727,7 @@ void MidiMessage::getTimeSignatureInfo (int& numerator, } } -const MidiMessage MidiMessage::timeSignatureMetaEvent (const int numerator, - const int denominator) throw() +const MidiMessage MidiMessage::timeSignatureMetaEvent (const int numerator, const int denominator) { uint8 d[8]; d[0] = 0xff; diff --git a/src/audio/midi/juce_MidiMessage.h b/src/audio/midi/juce_MidiMessage.h index 4a79a48826..c6e2b3752a 100644 --- a/src/audio/midi/juce_MidiMessage.h +++ b/src/audio/midi/juce_MidiMessage.h @@ -47,10 +47,7 @@ public: @param timeStamp the time to give the midi message - this value doesn't use any particular units, so will be application-specific */ - MidiMessage (const int byte1, - const int byte2, - const int byte3, - const double timeStamp = 0) throw(); + MidiMessage (int byte1, int byte2, int byte3, double timeStamp = 0) throw(); /** Creates a 2-byte short midi message. @@ -59,9 +56,7 @@ public: @param timeStamp the time to give the midi message - this value doesn't use any particular units, so will be application-specific */ - MidiMessage (const int byte1, - const int byte2, - const double timeStamp = 0) throw(); + MidiMessage (int byte1, int byte2, double timeStamp = 0) throw(); /** Creates a 1-byte short midi message. @@ -69,13 +64,10 @@ public: @param timeStamp the time to give the midi message - this value doesn't use any particular units, so will be application-specific */ - MidiMessage (const int byte1, - const double timeStamp = 0) throw(); + MidiMessage (int byte1, double timeStamp = 0) throw(); /** Creates a midi message from a block of data. */ - MidiMessage (const uint8* const data, - const int dataSize, - const double timeStamp = 0) throw(); + MidiMessage (const void* data, int numBytes, double timeStamp = 0); /** Reads the next midi message from some data. @@ -84,7 +76,7 @@ public: you read a sequence of midi messages from a file or stream. @param data the data to read from - @param size the maximum number of bytes it's allowed to read + @param maxBytesToUse the maximum number of bytes it's allowed to read @param numBytesUsed returns the number of bytes that were actually needed @param lastStatusByte in a sequence of midi messages, the initial byte can be dropped from a message if it's the same as the @@ -94,24 +86,21 @@ public: @param timeStamp the time to give the midi message - this value doesn't use any particular units, so will be application-specific */ - MidiMessage (const uint8* data, - int size, - int& numBytesUsed, - uint8 lastStatusByte, - double timeStamp = 0) throw(); + MidiMessage (const void* data, int maxBytesToUse, + int& numBytesUsed, uint8 lastStatusByte, + double timeStamp = 0); /** Creates a copy of another midi message. */ - MidiMessage (const MidiMessage& other) throw(); + MidiMessage (const MidiMessage& other); /** Creates a copy of another midi message, with a different timestamp. */ - MidiMessage (const MidiMessage& other, - const double newTimeStamp) throw(); + MidiMessage (const MidiMessage& other, double newTimeStamp); /** Destructor. */ - ~MidiMessage() throw(); + ~MidiMessage(); /** Copies this message from another one. */ - MidiMessage& operator= (const MidiMessage& other) throw(); + MidiMessage& operator= (const MidiMessage& other); //============================================================================== /** Returns a pointer to the raw midi data. @@ -151,13 +140,13 @@ public: @see addToTimeStamp, getTimeStamp */ - void setTimeStamp (const double newTimestamp) throw() { timeStamp = newTimestamp; } + void setTimeStamp (double newTimestamp) throw() { timeStamp = newTimestamp; } /** Adds a value to the message's timestamp. The units for the timestamp will be application-specific. */ - void addToTimeStamp (const double delta) throw() { timeStamp += delta; } + void addToTimeStamp (double delta) throw() { timeStamp += delta; } //============================================================================== /** Returns the midi channel associated with the message. @@ -173,7 +162,7 @@ public: @param channelNumber the channel number to look for, in the range 1 to 16 @see getChannel, setChannel */ - bool isForChannel (const int channelNumber) const throw(); + bool isForChannel (int channelNumber) const throw(); /** Changes the message's midi channel. @@ -181,7 +170,7 @@ public: @param newChannelNumber the channel number to change it to, in the range 1 to 16 */ - void setChannel (const int newChannelNumber) throw(); + void setChannel (int newChannelNumber) throw(); //============================================================================== /** Returns true if this is a system-exclusive message. @@ -215,7 +204,7 @@ public: @see isNoteOff, getNoteNumber, getVelocity, noteOn */ - bool isNoteOn (const bool returnTrueForVelocity0 = false) const throw(); + bool isNoteOn (bool returnTrueForVelocity0 = false) const throw(); /** Creates a key-down message (using a floating-point velocity). @@ -224,9 +213,7 @@ public: @param velocity in the range 0 to 1.0 @see isNoteOn */ - static const MidiMessage noteOn (const int channel, - const int noteNumber, - const float velocity) throw(); + static const MidiMessage noteOn (int channel, int noteNumber, float velocity) throw(); /** Creates a key-down message (using an integer velocity). @@ -235,9 +222,7 @@ public: @param velocity in the range 0 to 127 @see isNoteOn */ - static const MidiMessage noteOn (const int channel, - const int noteNumber, - const uint8 velocity) throw(); + static const MidiMessage noteOn (int channel, int noteNumber, uint8 velocity) throw(); /** Returns true if this message is a 'key-up' event. @@ -246,7 +231,7 @@ public: @see isNoteOn, getNoteNumber, getVelocity, noteOff */ - bool isNoteOff (const bool returnTrueForNoteOnVelocity0 = true) const throw(); + bool isNoteOff (bool returnTrueForNoteOnVelocity0 = true) const throw(); /** Creates a key-up message. @@ -254,8 +239,7 @@ public: @param noteNumber the key number, 0 to 127 @see isNoteOff */ - static const MidiMessage noteOff (const int channel, - const int noteNumber) throw(); + static const MidiMessage noteOff (int channel, int noteNumber) throw(); /** Returns true if this message is a 'key-down' or 'key-up' event. @@ -276,7 +260,7 @@ public: If the message isn't a note on or off, this will do nothing. */ - void setNoteNumber (const int newNoteNumber) throw(); + void setNoteNumber (int newNoteNumber) throw(); //============================================================================== /** Returns the velocity of a note-on or note-off message. @@ -306,7 +290,7 @@ public: @param newVelocity the new velocity, in the range 0 to 1.0 @see getFloatVelocity, multiplyVelocity */ - void setVelocity (const float newVelocity) throw(); + void setVelocity (float newVelocity) throw(); /** Multiplies the velocity of a note-on or note-off message by a given amount. @@ -315,7 +299,7 @@ public: @param scaleFactor the value by which to multiply the velocity @see setVelocity */ - void multiplyVelocity (const float scaleFactor) throw(); + void multiplyVelocity (float scaleFactor) throw(); //============================================================================== /** Returns true if the message is a program (patch) change message. @@ -339,8 +323,7 @@ public: @param programNumber the midi program number, 0 to 127 @see isProgramChange, getGMInstrumentName */ - static const MidiMessage programChange (const int channel, - const int programNumber) throw(); + static const MidiMessage programChange (int channel, int programNumber) throw(); //============================================================================== /** Returns true if the message is a pitch-wheel move. @@ -365,8 +348,7 @@ public: @param position the wheel position, in the range 0 to 16383 @see isPitchWheel */ - static const MidiMessage pitchWheel (const int channel, - const int position) throw(); + static const MidiMessage pitchWheel (int channel, int position) throw(); //============================================================================== /** Returns true if the message is an aftertouch event. @@ -395,9 +377,9 @@ public: @param aftertouchAmount the amount of aftertouch, 0 to 127 @see isAftertouch */ - static const MidiMessage aftertouchChange (const int channel, - const int noteNumber, - const int aftertouchAmount) throw(); + static const MidiMessage aftertouchChange (int channel, + int noteNumber, + int aftertouchAmount) throw(); /** Returns true if the message is a channel-pressure change event. @@ -422,8 +404,7 @@ public: @param pressure the pressure, 0 to 127 @see isChannelPressure */ - static const MidiMessage channelPressureChange (const int channel, - const int pressure) throw(); + static const MidiMessage channelPressureChange (int channel, int pressure) throw(); //============================================================================== /** Returns true if this is a midi controller message. @@ -459,9 +440,9 @@ public: @param value the controller value @see isController */ - static const MidiMessage controllerEvent (const int channel, - const int controllerType, - const int value) throw(); + static const MidiMessage controllerEvent (int channel, + int controllerType, + int value) throw(); /** Checks whether this message is an all-notes-off message. @@ -480,20 +461,20 @@ public: @param channel the midi channel, in the range 1 to 16 @see isAllNotesOff */ - static const MidiMessage allNotesOff (const int channel) throw(); + static const MidiMessage allNotesOff (int channel) throw(); /** Creates an all-sound-off message. @param channel the midi channel, in the range 1 to 16 @see isAllSoundOff */ - static const MidiMessage allSoundOff (const int channel) throw(); + static const MidiMessage allSoundOff (int channel) throw(); /** Creates an all-controllers-off message. @param channel the midi channel, in the range 1 to 16 */ - static const MidiMessage allControllersOff (const int channel) throw(); + static const MidiMessage allControllersOff (int channel) throw(); //============================================================================== /** Returns true if this event is a meta-event. @@ -557,7 +538,7 @@ public: @see isTextMetaEvent */ - const String getTextFromTextMetaEvent() const throw(); + const String getTextFromTextMetaEvent() const; //============================================================================== /** Returns true if this is a 'tempo' meta-event. @@ -572,7 +553,7 @@ public: @returns the tick length (in seconds). @see isTempoMetaEvent */ - double getTempoMetaEventTickLength (const short timeFormat) const throw(); + double getTempoMetaEventTickLength (short timeFormat) const throw(); /** Calculates the seconds-per-quarter-note from a tempo meta-event. @@ -584,7 +565,7 @@ public: @see isTempoMetaEvent */ - static const MidiMessage tempoMetaEvent (const int microsecondsPerQuarterNote) throw(); + static const MidiMessage tempoMetaEvent (int microsecondsPerQuarterNote) throw(); //============================================================================== /** Returns true if this is a 'time-signature' meta-event. @@ -597,15 +578,13 @@ public: @see isTimeSignatureMetaEvent */ - void getTimeSignatureInfo (int& numerator, - int& denominator) const throw(); + void getTimeSignatureInfo (int& numerator, int& denominator) const throw(); /** Creates a time-signature meta-event. @see isTimeSignatureMetaEvent */ - static const MidiMessage timeSignatureMetaEvent (const int numerator, - const int denominator) throw(); + static const MidiMessage timeSignatureMetaEvent (int numerator, int denominator); //============================================================================== /** Returns true if this is a 'key-signature' meta-event. @@ -642,7 +621,7 @@ public: @param channel the midi channel, in the range 1 to 16 @see isMidiChannelMetaEvent */ - static const MidiMessage midiChannelMetaEvent (const int channel) throw(); + static const MidiMessage midiChannelMetaEvent (int channel) throw(); //============================================================================== /** Returns true if this is an active-sense message. */ @@ -705,7 +684,7 @@ public: @see isSongPositionPointer, getSongPositionPointerMidiBeat */ - static const MidiMessage songPositionPointer (const int positionInMidiBeats) throw(); + static const MidiMessage songPositionPointer (int positionInMidiBeats) throw(); //============================================================================== /** Returns true if this is a quarter-frame midi timecode message. @@ -734,8 +713,7 @@ public: @param sequenceNumber a value 0 to 7 for the upper nybble of the message's data byte @param value a value 0 to 15 for the lower nybble of the message's data byte */ - static const MidiMessage quarterFrame (const int sequenceNumber, - const int value) throw(); + static const MidiMessage quarterFrame (int sequenceNumber, int value) throw(); /** SMPTE timecode types. @@ -766,10 +744,10 @@ public: /** Creates a full-frame MTC message. */ - static const MidiMessage fullFrame (const int hours, - const int minutes, - const int seconds, - const int frames, + static const MidiMessage fullFrame (int hours, + int minutes, + int seconds, + int frames, SmpteTimecodeType timecodeType); //============================================================================== @@ -833,7 +811,7 @@ public: @param volume the volume, 0 to 1.0 */ - static const MidiMessage masterVolume (const float volume) throw(); + static const MidiMessage masterVolume (float volume); //============================================================================== /** Creates a system-exclusive message. @@ -841,7 +819,7 @@ public: The data passed in is wrapped with header and tail bytes of 0xf0 and 0xf7. */ static const MidiMessage createSysExMessage (const uint8* sysexData, - const int dataSize) throw(); + int dataSize); //============================================================================== diff --git a/src/audio/midi/juce_MidiMessageCollector.h b/src/audio/midi/juce_MidiMessageCollector.h index bf06045dd3..780ad5cb9f 100644 --- a/src/audio/midi/juce_MidiMessageCollector.h +++ b/src/audio/midi/juce_MidiMessageCollector.h @@ -56,7 +56,7 @@ public: You need to call this method before starting to use the collector, so that it knows the correct sample rate to use. */ - void reset (const double sampleRate); + void reset (double sampleRate); /** Takes an incoming real-time message and adds it to the queue. @@ -80,8 +80,7 @@ public: This method is fully thread-safe when overlapping calls are made with addMessageToQueue(). */ - void removeNextBlockOfMessages (MidiBuffer& destBuffer, - const int numSamples); + void removeNextBlockOfMessages (MidiBuffer& destBuffer, int numSamples); //============================================================================== diff --git a/src/audio/midi/juce_MidiMessageSequence.h b/src/audio/midi/juce_MidiMessageSequence.h index 0f4630fe30..63c876699b 100644 --- a/src/audio/midi/juce_MidiMessageSequence.h +++ b/src/audio/midi/juce_MidiMessageSequence.h @@ -101,7 +101,7 @@ public: int getNumEvents() const; /** Returns a pointer to one of the events. */ - MidiEventHolder* getEventPointer (const int index) const; + MidiEventHolder* getEventPointer (int index) const; /** Returns the time of the note-up that matches the note-on at this index. @@ -109,7 +109,7 @@ public: @see MidiMessageSequence::MidiEventHolder::noteOffObject */ - double getTimeOfMatchingKeyUp (const int index) const; + double getTimeOfMatchingKeyUp (int index) const; /** Returns the index of the note-up that matches the note-on at this index. @@ -117,17 +117,17 @@ public: @see MidiMessageSequence::MidiEventHolder::noteOffObject */ - int getIndexOfMatchingKeyUp (const int index) const; + int getIndexOfMatchingKeyUp (int index) const; /** Returns the index of an event. */ - int getIndexOf (MidiEventHolder* const event) const; + int getIndexOf (MidiEventHolder* event) const; /** Returns the index of the first event on or after the given timestamp. If the time is beyond the end of the sequence, this will return the number of events. */ - int getNextIndexAtTime (const double timeStamp) const; + int getNextIndexAtTime (double timeStamp) const; //============================================================================== /** Returns the timestamp of the first event in the sequence. @@ -146,7 +146,7 @@ public: If the index is out-of-range, this will return 0.0 */ - double getEventTime (const int index) const; + double getEventTime (int index) const; //============================================================================== /** Inserts a midi message into the sequence. @@ -172,8 +172,7 @@ public: @param deleteMatchingNoteUp whether to also remove the matching note-off if the event you're removing is a note-on */ - void deleteEvent (const int index, - const bool deleteMatchingNoteUp); + void deleteEvent (int index, bool deleteMatchingNoteUp); /** Merges another sequence into this one. @@ -213,9 +212,9 @@ public: channel) will also be copied across. @see extractSysExMessages */ - void extractMidiChannelMessages (const int channelNumberToExtract, + void extractMidiChannelMessages (int channelNumberToExtract, MidiMessageSequence& destSequence, - const bool alsoIncludeMetaEvents) const; + bool alsoIncludeMetaEvents) const; /** Copies all midi sys-ex messages to another sequence. @@ -229,7 +228,7 @@ public: @param channelNumberToRemove the midi channel to look for, in the range 1 to 16 */ - void deleteMidiChannelMessages (const int channelNumberToRemove); + void deleteMidiChannelMessages (int channelNumberToRemove); /** Removes any sys-ex messages from this sequence. */ @@ -239,7 +238,7 @@ public: @param deltaTime the amount to add to each timestamp. */ - void addTimeToMessages (const double deltaTime); + void addTimeToMessages (double deltaTime); //============================================================================== /** Scans through the sequence to determine the state of any midi controllers at @@ -261,8 +260,7 @@ public: will be the minimum number of controller changes to recreate the state at the required time. */ - void createControllerUpdatesForTime (const int channelNumber, - const double time, + void createControllerUpdatesForTime (int channelNumber, double time, OwnedArray& resultMessages); //============================================================================== @@ -273,8 +271,8 @@ public: juce_UseDebuggingNewOperator /** @internal */ - static int compareElements (const MidiMessageSequence::MidiEventHolder* const first, - const MidiMessageSequence::MidiEventHolder* const second) throw(); + static int compareElements (const MidiMessageSequence::MidiEventHolder* first, + const MidiMessageSequence::MidiEventHolder* second) throw(); private: //============================================================================== diff --git a/src/audio/plugins/formats/juce_AudioUnitPluginFormat.h b/src/audio/plugins/formats/juce_AudioUnitPluginFormat.h index 7848904033..5031403fce 100644 --- a/src/audio/plugins/formats/juce_AudioUnitPluginFormat.h +++ b/src/audio/plugins/formats/juce_AudioUnitPluginFormat.h @@ -47,7 +47,7 @@ public: AudioPluginInstance* createInstanceFromDescription (const PluginDescription& desc); bool fileMightContainThisPluginType (const String& fileOrIdentifier); const String getNameOfPluginFromIdentifier (const String& fileOrIdentifier); - const StringArray searchPathsForPlugins (const FileSearchPath& directoriesToSearch, const bool recursive); + const StringArray searchPathsForPlugins (const FileSearchPath& directoriesToSearch, bool recursive); bool doesPluginStillExist (const PluginDescription& desc); const FileSearchPath getDefaultLocationsToSearch(); diff --git a/src/audio/plugins/formats/juce_VSTPluginFormat.h b/src/audio/plugins/formats/juce_VSTPluginFormat.h index 00f0f3f489..58f407de6b 100644 --- a/src/audio/plugins/formats/juce_VSTPluginFormat.h +++ b/src/audio/plugins/formats/juce_VSTPluginFormat.h @@ -48,7 +48,7 @@ public: AudioPluginInstance* createInstanceFromDescription (const PluginDescription& desc); bool fileMightContainThisPluginType (const String& fileOrIdentifier); const String getNameOfPluginFromIdentifier (const String& fileOrIdentifier); - const StringArray searchPathsForPlugins (const FileSearchPath& directoriesToSearch, const bool recursive); + const StringArray searchPathsForPlugins (const FileSearchPath& directoriesToSearch, bool recursive); bool doesPluginStillExist (const PluginDescription& desc); const FileSearchPath getDefaultLocationsToSearch(); diff --git a/src/audio/plugins/juce_AudioPluginFormat.h b/src/audio/plugins/juce_AudioPluginFormat.h index 1e20c8eb27..34b46b101d 100644 --- a/src/audio/plugins/juce_AudioPluginFormat.h +++ b/src/audio/plugins/juce_AudioPluginFormat.h @@ -95,7 +95,7 @@ public: than manually. */ virtual const StringArray searchPathsForPlugins (const FileSearchPath& directoriesToSearch, - const bool recursive) = 0; + bool recursive) = 0; /** Returns the typical places to look for this kind of plugin. diff --git a/src/audio/plugins/juce_KnownPluginList.h b/src/audio/plugins/juce_KnownPluginList.h index 2a8371f5e1..ee685df518 100644 --- a/src/audio/plugins/juce_KnownPluginList.h +++ b/src/audio/plugins/juce_KnownPluginList.h @@ -64,7 +64,7 @@ public: /** Returns one of the types. @see getNumTypes */ - PluginDescription* getType (const int index) const throw() { return types [index]; } + PluginDescription* getType (int index) const throw() { return types [index]; } /** Looks for a type in the list which comes from this file. */ @@ -81,7 +81,7 @@ public: bool addType (const PluginDescription& type); /** Removes a type. */ - void removeType (const int index) throw(); + void removeType (int index) throw(); /** Looks for all types that can be loaded from a given file, and adds them to the list. @@ -96,7 +96,7 @@ public: in the array. */ bool scanAndAddFile (const String& possiblePluginFileOrIdentifier, - const bool dontRescanIfAlreadyInList, + bool dontRescanIfAlreadyInList, OwnedArray & typesFound, AudioPluginFormat& formatToUse); @@ -141,7 +141,7 @@ public: @see addToMenu */ - int getIndexChosenByMenu (const int menuResultCode) const; + int getIndexChosenByMenu (int menuResultCode) const; //============================================================================== /** Sorts the list. */ diff --git a/src/audio/plugins/juce_PluginDirectoryScanner.h b/src/audio/plugins/juce_PluginDirectoryScanner.h index da7f9b3363..540e611176 100644 --- a/src/audio/plugins/juce_PluginDirectoryScanner.h +++ b/src/audio/plugins/juce_PluginDirectoryScanner.h @@ -65,7 +65,7 @@ public: PluginDirectoryScanner (KnownPluginList& listToAddResultsTo, AudioPluginFormat& formatToLookFor, FileSearchPath directoriesToSearch, - const bool searchRecursively, + bool searchRecursively, const File& deadMansPedalFile); /** Destructor. */ @@ -81,7 +81,7 @@ public: Returns false when there are no more files to try. */ - bool scanNextFile (const bool dontRescanIfAlreadyInList); + bool scanNextFile (bool dontRescanIfAlreadyInList); /** Returns the description of the plugin that will be scanned during the next call to scanNextFile(). diff --git a/src/audio/plugins/juce_PluginListComponent.h b/src/audio/plugins/juce_PluginListComponent.h index 96a065c5bc..fa451d29f2 100644 --- a/src/audio/plugins/juce_PluginListComponent.h +++ b/src/audio/plugins/juce_PluginListComponent.h @@ -55,7 +55,7 @@ public: */ PluginListComponent (KnownPluginList& listToRepresent, const File& deadMansPedalFile, - PropertiesFile* const propertiesToUse); + PropertiesFile* propertiesToUse); /** Destructor. */ ~PluginListComponent(); diff --git a/src/audio/processors/juce_AudioProcessorGraph.h b/src/audio/processors/juce_AudioProcessorGraph.h index 80592a6c55..123aa95ca0 100644 --- a/src/audio/processors/juce_AudioProcessorGraph.h +++ b/src/audio/processors/juce_AudioProcessorGraph.h @@ -106,9 +106,9 @@ public: bool isPrepared; - Node (const uint32 id, AudioProcessor* const processor); + Node (uint32 id, AudioProcessor* processor); - void prepare (const double sampleRate, const int blockSize, AudioProcessorGraph* const graph); + void prepare (double sampleRate, int blockSize, AudioProcessorGraph* graph); void unprepare(); Node (const Node&); @@ -193,66 +193,65 @@ public: If this succeeds, it returns a pointer to the newly-created node. */ - Node* addNode (AudioProcessor* const newProcessor, - uint32 nodeId = 0); + Node* addNode (AudioProcessor* newProcessor, uint32 nodeId = 0); /** Deletes a node within the graph which has the specified ID. This will also delete any connections that are attached to this node. */ - bool removeNode (const uint32 nodeId); + bool removeNode (uint32 nodeId); //============================================================================== /** Returns the number of connections in the graph. */ int getNumConnections() const { return connections.size(); } /** Returns a pointer to one of the connections in the graph. */ - const Connection* getConnection (const int index) const { return connections [index]; } + const Connection* getConnection (int index) const { return connections [index]; } /** Searches for a connection between some specified channels. If no such connection is found, this returns 0. */ - const Connection* getConnectionBetween (const uint32 sourceNodeId, - const int sourceChannelIndex, - const uint32 destNodeId, - const int destChannelIndex) const; + const Connection* getConnectionBetween (uint32 sourceNodeId, + int sourceChannelIndex, + uint32 destNodeId, + int destChannelIndex) const; /** Returns true if there is a connection between any of the channels of two specified nodes. */ - bool isConnected (const uint32 possibleSourceNodeId, - const uint32 possibleDestNodeId) const; + bool isConnected (uint32 possibleSourceNodeId, + uint32 possibleDestNodeId) const; /** Returns true if it would be legal to connect the specified points. */ - bool canConnect (const uint32 sourceNodeId, const int sourceChannelIndex, - const uint32 destNodeId, const int destChannelIndex) const; + bool canConnect (uint32 sourceNodeId, int sourceChannelIndex, + uint32 destNodeId, int destChannelIndex) const; /** Attempts to connect two specified channels of two nodes. If this isn't allowed (e.g. because you're trying to connect a midi channel to an audio one or other such nonsense), then it'll return false. */ - bool addConnection (const uint32 sourceNodeId, const int sourceChannelIndex, - const uint32 destNodeId, const int destChannelIndex); + bool addConnection (uint32 sourceNodeId, int sourceChannelIndex, + uint32 destNodeId, int destChannelIndex); /** Deletes the connection with the specified index. Returns true if a connection was actually deleted. */ - void removeConnection (const int index); + void removeConnection (int index); /** Deletes any connection between two specified points. Returns true if a connection was actually deleted. */ - bool removeConnection (const uint32 sourceNodeId, const int sourceChannelIndex, - const uint32 destNodeId, const int destChannelIndex); + bool removeConnection (uint32 sourceNodeId, int sourceChannelIndex, + uint32 destNodeId, int destChannelIndex); /** Removes all connections from the specified node. */ - bool disconnectNode (const uint32 nodeId); + bool disconnectNode (uint32 nodeId); /** Performs a sanity checks of all the connections. @@ -354,7 +353,7 @@ public: void setStateInformation (const void* data, int sizeInBytes); /** @internal */ - void setParentGraph (AudioProcessorGraph* const graph); + void setParentGraph (AudioProcessorGraph* graph); juce_UseDebuggingNewOperator @@ -425,9 +424,7 @@ private: void clearRenderingSequence(); void buildRenderingSequence(); - bool isAnInputTo (const uint32 possibleInputId, - const uint32 possibleDestinationId, - const int recursionCheck) const; + bool isAnInputTo (uint32 possibleInputId, uint32 possibleDestinationId, int recursionCheck) const; AudioProcessorGraph (const AudioProcessorGraph&); AudioProcessorGraph& operator= (const AudioProcessorGraph&); diff --git a/src/audio/synthesisers/juce_Sampler.h b/src/audio/synthesisers/juce_Sampler.h index 8f8e5b0c5d..7a8c217886 100644 --- a/src/audio/synthesisers/juce_Sampler.h +++ b/src/audio/synthesisers/juce_Sampler.h @@ -67,10 +67,10 @@ public: SamplerSound (const String& name, AudioFormatReader& source, const BigInteger& midiNotes, - const int midiNoteForNormalPitch, - const double attackTimeSecs, - const double releaseTimeSecs, - const double maxSampleLengthSeconds); + int midiNoteForNormalPitch, + double attackTimeSecs, + double releaseTimeSecs, + double maxSampleLengthSeconds); /** Destructor. */ ~SamplerSound(); diff --git a/src/audio/synthesisers/juce_Synthesiser.h b/src/audio/synthesisers/juce_Synthesiser.h index aaf3f23452..5d933d24e5 100644 --- a/src/audio/synthesisers/juce_Synthesiser.h +++ b/src/audio/synthesisers/juce_Synthesiser.h @@ -186,7 +186,7 @@ public: If it's not currently playing, this will return false. */ - bool isPlayingChannel (const int midiChannel) const; + bool isPlayingChannel (int midiChannel) const; /** Changes the voice's reference sample rate. @@ -196,7 +196,7 @@ public: This method is called by the synth, and subclasses can access the current rate with the currentSampleRate member. */ - void setCurrentPlaybackSampleRate (const double newRate); + void setCurrentPlaybackSampleRate (double newRate); //============================================================================== @@ -281,7 +281,7 @@ public: int getNumVoices() const { return voices.size(); } /** Returns one of the voices that have been added. */ - SynthesiserVoice* getVoice (const int index) const; + SynthesiserVoice* getVoice (int index) const; /** Adds a new voice to the synth. @@ -291,10 +291,10 @@ public: it later on when no longer needed. The caller should not retain a pointer to the voice. */ - void addVoice (SynthesiserVoice* const newVoice); + void addVoice (SynthesiserVoice* newVoice); /** Deletes one of the voices. */ - void removeVoice (const int index); + void removeVoice (int index); //============================================================================== /** Deletes all sounds. */ @@ -304,7 +304,7 @@ public: int getNumSounds() const { return sounds.size(); } /** Returns one of the sounds. */ - SynthesiserSound* getSound (const int index) const { return sounds [index]; } + SynthesiserSound* getSound (int index) const { return sounds [index]; } /** Adds a new sound to the synthesiser. @@ -314,7 +314,7 @@ public: void addSound (const SynthesiserSound::Ptr& newSound); /** Removes and deletes one of the sounds. */ - void removeSound (const int index); + void removeSound (int index); //============================================================================== /** If set to true, then the synth will try to take over an existing voice if @@ -323,7 +323,7 @@ public: The value of this boolean is passed into findFreeVoice(), so the result will depend on the implementation of this method. */ - void setNoteStealingEnabled (const bool shouldStealNotes); + void setNoteStealingEnabled (bool shouldStealNotes); /** Returns true if note-stealing is enabled. @see setNoteStealingEnabled @@ -462,11 +462,11 @@ protected: You'll probably never need to call this, it's used internally by noteOn(), but may be needed by subclasses for custom behaviours. */ - void startVoice (SynthesiserVoice* const voice, - SynthesiserSound* const sound, - const int midiChannel, - const int midiNoteNumber, - const float velocity); + void startVoice (SynthesiserVoice* voice, + SynthesiserSound* sound, + int midiChannel, + int midiNoteNumber, + float velocity); /** xxx Temporary method here to cause a compiler error - note the new parameters for this method. */ int findFreeVoice (const bool) const { return 0; } diff --git a/src/core/juce_Uuid.cpp b/src/core/juce_Uuid.cpp index 34306699a3..6391e349c8 100644 --- a/src/core/juce_Uuid.cpp +++ b/src/core/juce_Uuid.cpp @@ -82,7 +82,8 @@ Uuid& Uuid::operator= (const Uuid& other) bool Uuid::operator== (const Uuid& other) const { - return memcmp (value.asBytes, other.value.asBytes, 16) == 0; + return value.asInt64[0] == other.value.asInt64[0] + && value.asInt64[1] == other.value.asInt64[1]; } bool Uuid::operator!= (const Uuid& other) const diff --git a/src/gui/components/filebrowser/juce_DirectoryContentsDisplayComponent.h b/src/gui/components/filebrowser/juce_DirectoryContentsDisplayComponent.h index 3021aa23dd..ea9f8e5b04 100644 --- a/src/gui/components/filebrowser/juce_DirectoryContentsDisplayComponent.h +++ b/src/gui/components/filebrowser/juce_DirectoryContentsDisplayComponent.h @@ -68,13 +68,13 @@ public: @see removeListener */ - void addListener (FileBrowserListener* const listener) throw(); + void addListener (FileBrowserListener* listener) throw(); /** Removes a listener. @see addListener */ - void removeListener (FileBrowserListener* const listener) throw(); + void removeListener (FileBrowserListener* listener) throw(); //============================================================================== diff --git a/src/gui/components/filebrowser/juce_DirectoryContentsList.h b/src/gui/components/filebrowser/juce_DirectoryContentsList.h index 8e2fb99c91..2e1c95d543 100644 --- a/src/gui/components/filebrowser/juce_DirectoryContentsList.h +++ b/src/gui/components/filebrowser/juce_DirectoryContentsList.h @@ -66,7 +66,7 @@ public: that the thread you give it has been started, or you won't get any files! */ - DirectoryContentsList (const FileFilter* const fileFilter, + DirectoryContentsList (const FileFilter* fileFilter, TimeSliceThread& threadToUse); /** Destructor. */ @@ -80,8 +80,8 @@ public: also start the background thread scanning it for files. */ void setDirectory (const File& directory, - const bool includeDirectories, - const bool includeFiles); + bool includeDirectories, + bool includeFiles); /** Returns the directory that's currently being used. */ const File& getDirectory() const; @@ -99,7 +99,7 @@ public: By default these are ignored. */ - void setIgnoresHiddenFiles (const bool shouldIgnoreHiddenFiles); + void setIgnoresHiddenFiles (bool shouldIgnoreHiddenFiles); /** Returns true if hidden files are ignored. @see setIgnoresHiddenFiles @@ -166,8 +166,7 @@ public: @see getNumFiles, getFile */ - bool getFileInfo (const int index, - FileInfo& resultInfo) const; + bool getFileInfo (int index, FileInfo& resultInfo) const; /** Returns one of the files in the list. @@ -175,7 +174,7 @@ public: return value will be File::nonexistent @see getNumFiles, getFileInfo */ - const File getFile (const int index) const; + const File getFile (int index) const; /** Returns the file filter being used. @@ -189,8 +188,8 @@ public: /** @internal */ TimeSliceThread& getTimeSliceThread() { return thread; } /** @internal */ - static int compareElements (const DirectoryContentsList::FileInfo* const first, - const DirectoryContentsList::FileInfo* const second); + static int compareElements (const DirectoryContentsList::FileInfo* first, + const DirectoryContentsList::FileInfo* second); juce_UseDebuggingNewOperator @@ -208,9 +207,9 @@ private: void changed(); bool checkNextFile (bool& hasChanged); - bool addFile (const String& filename, const bool isDir, const bool isHidden, + bool addFile (const String& filename, bool isDir, bool isHidden, const int64 fileSize, const Time& modTime, - const Time& creationTime, const bool isReadOnly); + const Time& creationTime, bool isReadOnly); DirectoryContentsList (const DirectoryContentsList&); DirectoryContentsList& operator= (const DirectoryContentsList&); diff --git a/src/gui/components/filebrowser/juce_FileBrowserComponent.h b/src/gui/components/filebrowser/juce_FileBrowserComponent.h index 3283299f1a..fbb5eb4281 100644 --- a/src/gui/components/filebrowser/juce_FileBrowserComponent.h +++ b/src/gui/components/filebrowser/juce_FileBrowserComponent.h @@ -160,13 +160,13 @@ public: @see removeListener */ - void addListener (FileBrowserListener* const listener) throw(); + void addListener (FileBrowserListener* listener) throw(); /** Removes a listener. @see addListener */ - void removeListener (FileBrowserListener* const listener) throw(); + void removeListener (FileBrowserListener* listener) throw(); //============================================================================== diff --git a/src/gui/components/filebrowser/juce_FileChooser.h b/src/gui/components/filebrowser/juce_FileChooser.h index ff467733a4..36a4572cf1 100644 --- a/src/gui/components/filebrowser/juce_FileChooser.h +++ b/src/gui/components/filebrowser/juce_FileChooser.h @@ -81,7 +81,7 @@ public: FileChooser (const String& dialogBoxTitle, const File& initialFileOrDirectory = File::nonexistent, const String& filePatternsAllowed = String::empty, - const bool useOSNativeDialogBox = true); + bool useOSNativeDialogBox = true); /** Destructor. */ ~FileChooser(); @@ -122,7 +122,7 @@ public: if they cancelled instead. @see browseForFileToOpen, browseForDirectory */ - bool browseForFileToSave (const bool warnAboutOverwritingExistingFiles); + bool browseForFileToSave (bool warnAboutOverwritingExistingFiles); /** Shows a dialog box to choose a directory. @@ -178,22 +178,13 @@ private: Array results; bool useNativeDialogBox; - bool showDialog (const bool selectsDirectories, - const bool selectsFiles, - const bool isSave, - const bool warnAboutOverwritingExistingFiles, - const bool selectMultipleFiles, - FilePreviewComponent* const previewComponent); + bool showDialog (bool selectsDirectories, bool selectsFiles, bool isSave, + bool warnAboutOverwritingExistingFiles, bool selectMultipleFiles, + FilePreviewComponent* previewComponent); - static void showPlatformDialog (Array& results, - const String& title, - const File& file, - const String& filters, - bool selectsDirectories, - bool selectsFiles, - bool isSave, - bool warnAboutOverwritingExistingFiles, - bool selectMultipleFiles, + static void showPlatformDialog (Array& results, const String& title, const File& file, + const String& filters, bool selectsDirectories, bool selectsFiles, + bool isSave, bool warnAboutOverwritingExistingFiles, bool selectMultipleFiles, FilePreviewComponent* previewComponent); }; diff --git a/src/gui/components/filebrowser/juce_FileChooserDialogBox.h b/src/gui/components/filebrowser/juce_FileChooserDialogBox.h index 0e3cfadf90..485657e45e 100644 --- a/src/gui/components/filebrowser/juce_FileChooserDialogBox.h +++ b/src/gui/components/filebrowser/juce_FileChooserDialogBox.h @@ -89,7 +89,7 @@ public: FileChooserDialogBox (const String& title, const String& instructions, FileBrowserComponent& browserComponent, - const bool warnAboutOverwritingExistingFiles, + bool warnAboutOverwritingExistingFiles, const Colour& backgroundColour); /** Destructor. */ diff --git a/src/gui/components/filebrowser/juce_FilenameComponent.h b/src/gui/components/filebrowser/juce_FilenameComponent.h index d05ecedd48..67994f7410 100644 --- a/src/gui/components/filebrowser/juce_FilenameComponent.h +++ b/src/gui/components/filebrowser/juce_FilenameComponent.h @@ -97,9 +97,9 @@ public: */ FilenameComponent (const String& name, const File& currentFile, - const bool canEditFilename, - const bool isDirectory, - const bool isForSaving, + bool canEditFilename, + bool isDirectory, + bool isForSaving, const String& fileBrowserWildcard, const String& enforcedSuffix, const String& textWhenNothingSelected); @@ -120,12 +120,12 @@ public: change. */ void setCurrentFile (File newFile, - const bool addToRecentlyUsedList, - const bool sendChangeNotification = true); + bool addToRecentlyUsedList, + bool sendChangeNotification = true); /** Changes whether the use can type into the filename box. */ - void setFilenameIsEditable (const bool shouldBeEditable); + void setFilenameIsEditable (bool shouldBeEditable); /** Sets a file or directory to be the default starting point for the browser to show. @@ -162,7 +162,7 @@ public: /** Changes the limit for the number of files that will be stored in the recent-file list. */ - void setMaxNumberOfRecentFiles (const int newMaximum); + void setMaxNumberOfRecentFiles (int newMaximum); /** Changes the text shown on the 'browse' button. @@ -174,10 +174,10 @@ public: //============================================================================== /** Adds a listener that will be called when the selected file is changed. */ - void addListener (FilenameComponentListener* const listener) throw(); + void addListener (FilenameComponentListener* listener) throw(); /** Removes a previously-registered listener. */ - void removeListener (FilenameComponentListener* const listener) throw(); + void removeListener (FilenameComponentListener* listener) throw(); /** Gives the component a tooltip. */ void setTooltip (const String& newTooltip); diff --git a/src/gui/components/special/juce_DropShadower.cpp b/src/gui/components/special/juce_DropShadower.cpp index c29fb8cd28..adad8b75a4 100644 --- a/src/gui/components/special/juce_DropShadower.cpp +++ b/src/gui/components/special/juce_DropShadower.cpp @@ -252,10 +252,8 @@ void DropShadower::updateShadows() blurKernel.createGaussianBlur (blurRadius); blurKernel.applyToImage (*bigIm, 0, - xOffset, - yOffset, - bigIm->getWidth(), - bigIm->getHeight()); + Rectangle (xOffset, yOffset, + bigIm->getWidth(), bigIm->getHeight())); ImageCache::addImageToCache (bigIm, hash); } diff --git a/src/gui/graphics/effects/juce_GlowEffect.cpp b/src/gui/graphics/effects/juce_GlowEffect.cpp index eaa062ae77..64fa8dc2a5 100644 --- a/src/gui/graphics/effects/juce_GlowEffect.cpp +++ b/src/gui/graphics/effects/juce_GlowEffect.cpp @@ -51,17 +51,14 @@ void GlowEffect::setGlowProperties (const float newRadius, void GlowEffect::applyEffect (Image& image, Graphics& g) { - const int w = image.getWidth(); - const int h = image.getHeight(); - - Image temp (image.getFormat(), w, h, true); + Image temp (image.getFormat(), image.getWidth(), image.getHeight(), true); ImageConvolutionKernel blurKernel (roundToInt (radius * 2.0f)); blurKernel.createGaussianBlur (radius); blurKernel.rescaleAllValues (radius); - blurKernel.applyToImage (temp, &image, 0, 0, w, h); + blurKernel.applyToImage (temp, &image, image.getBounds()); g.setColour (colour); g.drawImageAt (&temp, 0, 0, true); diff --git a/src/gui/graphics/geometry/juce_Path.cpp b/src/gui/graphics/geometry/juce_Path.cpp index 5075973c2b..9d2cb00153 100644 --- a/src/gui/graphics/geometry/juce_Path.cpp +++ b/src/gui/graphics/geometry/juce_Path.cpp @@ -1360,7 +1360,7 @@ const String Path::toString() const { MemoryOutputStream s (2048, 2048); if (! useNonZeroWinding) - s << "a "; + s << 'a'; size_t i = 0; float lastMarker = 0.0f; @@ -1399,36 +1399,31 @@ const String Path::toString() const if (marker != lastMarker) { - s << markerChar << ' '; + if (s.getDataSize() != 0) + s << ' '; + + s << markerChar; lastMarker = marker; } while (--numCoords >= 0 && i < numElements) { - String n (data.elements [i++], 3); + String coord (data.elements [i++], 3); - if (n.endsWithChar ('0')) - { - do - { - n = n.dropLastCharacters (1); - } while (n.endsWithChar ('0')); + while (coord.endsWithChar ('0') && coord != "0") + coord = coord.dropLastCharacters (1); - if (n.endsWithChar ('.')) - n = n.dropLastCharacters (1); - } + if (coord.endsWithChar ('.')) + coord = coord.dropLastCharacters (1); - s << n << ' '; + if (s.getDataSize() != 0) + s << ' '; + + s << coord; } } - const char* const result = (const char*) s.getData(); - size_t len = s.getDataSize(); - - while (len > 0 && CharacterFunctions::isWhitespace (result [len - 1])) - --len; - - return String (result, len); + return s.toUTF8(); } void Path::restoreFromString (const String& stringVersion) @@ -1444,7 +1439,7 @@ void Path::restoreFromString (const String& stringVersion) while (*t != 0) { const String token (PathHelpers::nextToken (t)); - const tchar firstChar = token[0]; + const juce_wchar firstChar = token[0]; int startNum = 0; if (firstChar == 'm' || firstChar == 'l') diff --git a/src/gui/graphics/imaging/juce_ImageConvolutionKernel.cpp b/src/gui/graphics/imaging/juce_ImageConvolutionKernel.cpp index cc0eb65dc4..526be1f803 100644 --- a/src/gui/graphics/imaging/juce_ImageConvolutionKernel.cpp +++ b/src/gui/graphics/imaging/juce_ImageConvolutionKernel.cpp @@ -115,10 +115,7 @@ void ImageConvolutionKernel::createGaussianBlur (const float radius) //============================================================================== void ImageConvolutionKernel::applyToImage (Image& destImage, const Image* sourceImage, - int dx, - int dy, - int dw, - int dh) const + const Rectangle& destinationArea) const { ScopedPointer imageCreated; @@ -138,34 +135,27 @@ void ImageConvolutionKernel::applyToImage (Image& destImage, return; } - const int imageWidth = destImage.getWidth(); - const int imageHeight = destImage.getHeight(); + const Rectangle area (destinationArea.getIntersection (destImage.getBounds())); - if (dx >= imageWidth || dy >= imageHeight) + if (area.isEmpty()) return; - if (dx + dw > imageWidth) - dw = imageWidth - dx; + const int right = area.getRight(); + const int bottom = area.getBottom(); - if (dy + dh > imageHeight) - dh = imageHeight - dy; - - const int dx2 = dx + dw; - const int dy2 = dy + dh; - - const Image::BitmapData destData (destImage, dx, dy, dw, dh, true); + const Image::BitmapData destData (destImage, area.getX(), area.getY(), area.getWidth(), area.getHeight(), true); uint8* line = destData.data; const Image::BitmapData srcData (*sourceImage, 0, 0, sourceImage->getWidth(), sourceImage->getHeight()); if (destData.pixelStride == 4) { - for (int y = dy; y < dy2; ++y) + for (int y = area.getY(); y < bottom; ++y) { uint8* dest = line; line += destData.lineStride; - for (int x = dx; x < dx2; ++x) + for (int x = area.getX(); x < right; ++x) { float c1 = 0; float c2 = 0; @@ -176,7 +166,7 @@ void ImageConvolutionKernel::applyToImage (Image& destImage, { const int sy = y + yy - (size >> 1); - if (sy >= imageHeight) + if (sy >= srcData.height) break; if (sy >= 0) @@ -186,7 +176,7 @@ void ImageConvolutionKernel::applyToImage (Image& destImage, for (int xx = 0; xx < size; ++xx) { - if (sx >= imageWidth) + if (sx >= srcData.width) break; if (sx >= 0) @@ -216,12 +206,12 @@ void ImageConvolutionKernel::applyToImage (Image& destImage, } else if (destData.pixelStride == 3) { - for (int y = dy; y < dy2; ++y) + for (int y = area.getY(); y < bottom; ++y) { uint8* dest = line; line += destData.lineStride; - for (int x = dx; x < dx2; ++x) + for (int x = area.getX(); x < right; ++x) { float c1 = 0; float c2 = 0; @@ -231,7 +221,7 @@ void ImageConvolutionKernel::applyToImage (Image& destImage, { const int sy = y + yy - (size >> 1); - if (sy >= imageHeight) + if (sy >= srcData.height) break; if (sy >= 0) @@ -241,7 +231,7 @@ void ImageConvolutionKernel::applyToImage (Image& destImage, for (int xx = 0; xx < size; ++xx) { - if (sx >= imageWidth) + if (sx >= srcData.width) break; if (sx >= 0) diff --git a/src/gui/graphics/imaging/juce_ImageConvolutionKernel.h b/src/gui/graphics/imaging/juce_ImageConvolutionKernel.h index 3d663f8cbe..7125e7fcd1 100644 --- a/src/gui/graphics/imaging/juce_ImageConvolutionKernel.h +++ b/src/gui/graphics/imaging/juce_ImageConvolutionKernel.h @@ -44,7 +44,7 @@ public: @param size the length of each dimension of the kernel, so e.g. if the size is 5, it will create a 5x5 kernel */ - ImageConvolutionKernel (const int size); + ImageConvolutionKernel (int size); /** Destructor. */ ~ImageConvolutionKernel(); @@ -68,10 +68,10 @@ public: This will multiply all values in the kernel by (desiredTotalSum / currentTotalSum). */ - void setOverallSum (const float desiredTotalSum); + void setOverallSum (float desiredTotalSum); /** Multiplies all values in the kernel by a value. */ - void rescaleAllValues (const float multiplier); + void rescaleAllValues (float multiplier); /** Intialises the kernel for a gaussian blur. @@ -80,7 +80,7 @@ public: edges. Ideally the kernel should be just larger than (blurRadius * 2). */ - void createGaussianBlur (const float blurRadius); + void createGaussianBlur (float blurRadius); //============================================================================== /** Returns the size of the kernel. @@ -97,17 +97,11 @@ public: destination image will be used as the source. If an image is specified, it must be exactly the same size and type as the destination image. - @param x the region of the image to apply the filter to - @param y the region of the image to apply the filter to - @param width the region of the image to apply the filter to - @param height the region of the image to apply the filter to + @param destinationArea the region of the image to apply the filter to */ void applyToImage (Image& destImage, const Image* sourceImage, - int x, - int y, - int width, - int height) const; + const Rectangle& destinationArea) const; //============================================================================== juce_UseDebuggingNewOperator diff --git a/src/io/streams/juce_MemoryOutputStream.cpp b/src/io/streams/juce_MemoryOutputStream.cpp index ab012d1924..ea1d6fcf34 100644 --- a/src/io/streams/juce_MemoryOutputStream.cpp +++ b/src/io/streams/juce_MemoryOutputStream.cpp @@ -96,16 +96,6 @@ const char* MemoryOutputStream::getData() const throw() return d; } -size_t MemoryOutputStream::getDataSize() const throw() -{ - return size; -} - -int64 MemoryOutputStream::getPosition() -{ - return position; -} - bool MemoryOutputStream::setPosition (int64 newPosition) { if (newPosition <= (int64) size) @@ -121,4 +111,9 @@ bool MemoryOutputStream::setPosition (int64 newPosition) } } +const String MemoryOutputStream::toUTF8() const +{ + return String (getData(), getDataSize()); +} + END_JUCE_NAMESPACE diff --git a/src/io/streams/juce_MemoryOutputStream.h b/src/io/streams/juce_MemoryOutputStream.h index 87169214bc..4b4fc9c95d 100644 --- a/src/io/streams/juce_MemoryOutputStream.h +++ b/src/io/streams/juce_MemoryOutputStream.h @@ -71,15 +71,18 @@ public: @see getData */ - size_t getDataSize() const throw(); + size_t getDataSize() const throw() { return size; } /** Resets the stream, clearing any data that has been written to it so far. */ void reset() throw(); + /** Returns a String created from the (UTF8) data that has been written to the stream. */ + const String toUTF8() const; + //============================================================================== void flush(); bool write (const void* buffer, int howMany); - int64 getPosition(); + int64 getPosition() { return position; } bool setPosition (int64 newPosition); diff --git a/src/native/linux/juce_linux_Audio.cpp b/src/native/linux/juce_linux_Audio.cpp index c88d58f336..5832595d30 100644 --- a/src/native/linux/juce_linux_Audio.cpp +++ b/src/native/linux/juce_linux_Audio.cpp @@ -912,14 +912,14 @@ public: outputNames.appendNumbersToDuplicates (false, true); } - const StringArray getDeviceNames (const bool wantInputNames) const + const StringArray getDeviceNames (bool wantInputNames) const { jassert (hasScanned); // need to call scanForDevices() before doing this return wantInputNames ? inputNames : outputNames; } - int getDefaultDeviceIndex (const bool forInput) const + int getDefaultDeviceIndex (bool forInput) const { jassert (hasScanned); // need to call scanForDevices() before doing this return 0; @@ -927,11 +927,11 @@ public: bool hasSeparateInputsAndOutputs() const { return true; } - int getIndexOfDevice (AudioIODevice* device, const bool asInput) const + int getIndexOfDevice (AudioIODevice* device, bool asInput) const { jassert (hasScanned); // need to call scanForDevices() before doing this - ALSAAudioIODevice* const d = dynamic_cast (device); + ALSAAudioIODevice* d = dynamic_cast (device); if (d == 0) return -1; diff --git a/src/native/linux/juce_linux_FileChooser.cpp b/src/native/linux/juce_linux_FileChooser.cpp index 4b7975cdd8..027972e102 100644 --- a/src/native/linux/juce_linux_FileChooser.cpp +++ b/src/native/linux/juce_linux_FileChooser.cpp @@ -81,13 +81,12 @@ void FileChooser::showPlatformDialog (Array& results, if (status == 0) { - String resultString (String::fromUTF8 (result.getData(), result.getDataSize())); StringArray tokens; if (selectMultipleFiles) - tokens.addTokens (resultString, separator, String::empty); + tokens.addTokens (result.toUTF8(), separator, String::empty); else - tokens.add (resultString); + tokens.add (result.toUTF8()); for (int i = 0; i < tokens.size(); i++) results.add (File (tokens[i])); diff --git a/src/native/linux/juce_linux_JackAudio.cpp b/src/native/linux/juce_linux_JackAudio.cpp index f5854da293..5b9837173f 100644 --- a/src/native/linux/juce_linux_JackAudio.cpp +++ b/src/native/linux/juce_linux_JackAudio.cpp @@ -543,13 +543,13 @@ public: } } - const StringArray getDeviceNames (const bool wantInputNames) const + const StringArray getDeviceNames (bool wantInputNames) const { jassert (hasScanned); // need to call scanForDevices() before doing this return wantInputNames ? inputNames : outputNames; } - int getDefaultDeviceIndex (const bool forInput) const + int getDefaultDeviceIndex (bool forInput) const { jassert (hasScanned); // need to call scanForDevices() before doing this return 0; @@ -557,11 +557,11 @@ public: bool hasSeparateInputsAndOutputs() const { return true; } - int getIndexOfDevice (AudioIODevice* device, const bool asInput) const + int getIndexOfDevice (AudioIODevice* device, bool asInput) const { jassert (hasScanned); // need to call scanForDevices() before doing this - JackAudioIODevice* const d = dynamic_cast (device); + JackAudioIODevice* d = dynamic_cast (device); if (d == 0) return -1; diff --git a/src/native/mac/juce_iphone_Audio.cpp b/src/native/mac/juce_iphone_Audio.cpp index 1827bc82ef..b0bdd6a494 100644 --- a/src/native/mac/juce_iphone_Audio.cpp +++ b/src/native/mac/juce_iphone_Audio.cpp @@ -541,19 +541,19 @@ public: { } - const StringArray getDeviceNames (const bool wantInputNames) const + const StringArray getDeviceNames (bool wantInputNames) const { StringArray s; s.add ("iPhone Audio"); return s; } - int getDefaultDeviceIndex (const bool forInput) const + int getDefaultDeviceIndex (bool forInput) const { return 0; } - int getIndexOfDevice (AudioIODevice* device, const bool asInput) const + int getIndexOfDevice (AudioIODevice* device, bool asInput) const { return device != 0 ? 0 : -1; } diff --git a/src/native/mac/juce_mac_CoreAudio.cpp b/src/native/mac/juce_mac_CoreAudio.cpp index 0c5c219f10..b24dfb68b5 100644 --- a/src/native/mac/juce_mac_CoreAudio.cpp +++ b/src/native/mac/juce_mac_CoreAudio.cpp @@ -1190,7 +1190,7 @@ public: outputDeviceNames.appendNumbersToDuplicates (false, true); } - const StringArray getDeviceNames (const bool wantInputNames) const + const StringArray getDeviceNames (bool wantInputNames) const { jassert (hasScanned); // need to call scanForDevices() before doing this @@ -1200,7 +1200,7 @@ public: return outputDeviceNames; } - int getDefaultDeviceIndex (const bool forInput) const + int getDefaultDeviceIndex (bool forInput) const { jassert (hasScanned); // need to call scanForDevices() before doing this @@ -1234,7 +1234,7 @@ public: return 0; } - int getIndexOfDevice (AudioIODevice* device, const bool asInput) const + int getIndexOfDevice (AudioIODevice* device, bool asInput) const { jassert (hasScanned); // need to call scanForDevices() before doing this diff --git a/src/native/windows/juce_win32_ASIO.cpp b/src/native/windows/juce_win32_ASIO.cpp index c2172bedf7..773c1493c1 100644 --- a/src/native/windows/juce_win32_ASIO.cpp +++ b/src/native/windows/juce_win32_ASIO.cpp @@ -1756,14 +1756,14 @@ public: } } - const StringArray getDeviceNames (const bool /*wantInputNames*/) const + const StringArray getDeviceNames (bool /*wantInputNames*/) const { jassert (hasScanned); // need to call scanForDevices() before doing this return deviceNames; } - int getDefaultDeviceIndex (const bool) const + int getDefaultDeviceIndex (bool) const { jassert (hasScanned); // need to call scanForDevices() before doing this @@ -1791,7 +1791,7 @@ public: return -1; } - int getIndexOfDevice (AudioIODevice* d, const bool /*asInput*/) const + int getIndexOfDevice (AudioIODevice* d, bool /*asInput*/) const { jassert (hasScanned); // need to call scanForDevices() before doing this diff --git a/src/native/windows/juce_win32_AudioCDReader.cpp b/src/native/windows/juce_win32_AudioCDReader.cpp index 313dacef75..6753499856 100644 --- a/src/native/windows/juce_win32_AudioCDReader.cpp +++ b/src/native/windows/juce_win32_AudioCDReader.cpp @@ -1142,7 +1142,7 @@ bool CDController::readAudio (CDReadBuffer* rb, CDReadBuffer* overlapBuffer) for (int i = 0; i < maxToCheck; ++i) { - if (!memcmp (p, rb->buffer + i, checkLen)) + if (memcmp (p, rb->buffer + i, checkLen) == 0) { i += checkLen; rb->dataStartOffset = i; diff --git a/src/native/windows/juce_win32_DirectSound.cpp b/src/native/windows/juce_win32_DirectSound.cpp index 6014c38553..4007821f99 100644 --- a/src/native/windows/juce_win32_DirectSound.cpp +++ b/src/native/windows/juce_win32_DirectSound.cpp @@ -1361,7 +1361,7 @@ public: } } - const StringArray getDeviceNames (const bool wantInputNames) const + const StringArray getDeviceNames (bool wantInputNames) const { jassert (hasScanned); // need to call scanForDevices() before doing this @@ -1369,13 +1369,13 @@ public: : outputDeviceNames; } - int getDefaultDeviceIndex (const bool /*forInput*/) const + int getDefaultDeviceIndex (bool /*forInput*/) const { jassert (hasScanned); // need to call scanForDevices() before doing this return 0; } - int getIndexOfDevice (AudioIODevice* device, const bool asInput) const + int getIndexOfDevice (AudioIODevice* device, bool asInput) const { jassert (hasScanned); // need to call scanForDevices() before doing this diff --git a/src/native/windows/juce_win32_WASAPI.cpp b/src/native/windows/juce_win32_WASAPI.cpp index f4a5674403..f9e4e85908 100644 --- a/src/native/windows/juce_win32_WASAPI.cpp +++ b/src/native/windows/juce_win32_WASAPI.cpp @@ -1030,7 +1030,7 @@ public: outputDeviceNames.appendNumbersToDuplicates (false, false); } - const StringArray getDeviceNames (const bool wantInputNames) const + const StringArray getDeviceNames (bool wantInputNames) const { jassert (hasScanned); // need to call scanForDevices() before doing this @@ -1038,13 +1038,13 @@ public: : outputDeviceNames; } - int getDefaultDeviceIndex (const bool /*forInput*/) const + int getDefaultDeviceIndex (bool /*forInput*/) const { jassert (hasScanned); // need to call scanForDevices() before doing this return 0; } - int getIndexOfDevice (AudioIODevice* device, const bool asInput) const + int getIndexOfDevice (AudioIODevice* device, bool asInput) const { jassert (hasScanned); // need to call scanForDevices() before doing this WASAPIAudioIODevice* const d = dynamic_cast (device); diff --git a/src/text/juce_XmlElement.cpp b/src/text/juce_XmlElement.cpp index eebef93ad0..fb26b12c97 100644 --- a/src/text/juce_XmlElement.cpp +++ b/src/text/juce_XmlElement.cpp @@ -390,7 +390,7 @@ const String XmlElement::createDocument (const String& dtdToUse, MemoryOutputStream mem (2048, 4096); writeToStream (mem, dtdToUse, allOnOneLine, includeXmlHeader, encodingType, lineWrapLength); - return String (mem.getData(), mem.getDataSize()); + return mem.toUTF8(); } void XmlElement::writeToStream (OutputStream& output,