| @@ -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(); | |||
| } | |||
| @@ -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(); | |||
| } | |||
| @@ -766,7 +766,7 @@ public: | |||
| { | |||
| const ScopedLock sl (incomingMidiLock); | |||
| midiEvents.clear(); | |||
| incomingEvents.swap (midiEvents); | |||
| incomingEvents.swapWith (midiEvents); | |||
| } | |||
| { | |||
| @@ -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 <int> (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 <int*> (d) = sampleNumber; | |||
| d += 4; | |||
| *(uint16*) d = (uint16) numBytes; | |||
| *reinterpret_cast <uint16*> (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 <const uint16*> (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 <const uint16*> (d + 4); | |||
| if (nextOne >= endData) | |||
| return *(const int*) d; | |||
| return *reinterpret_cast <const int*> (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 <const int*> (d) <= samplePosition) | |||
| { | |||
| d += 4; | |||
| d += 2 + *(uint16*) d; | |||
| d += 2 + *reinterpret_cast <const uint16*> (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<const int*> (data) < samplePosition) | |||
| while (data < dataEnd && *reinterpret_cast <const int*> (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 <const int*> (data); | |||
| data += 4; | |||
| numBytes = *(uint16*) data; | |||
| numBytes = *reinterpret_cast <const uint16*> (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<const uint8*> (d) >= 0xf0 | |||
| || getMessageLengthFromFirstByte (*reinterpret_cast<const uint8*> (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 <const uint8*> (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<int> (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); | |||
| if (s.getDataSize() != 0) | |||
| s << ' '; | |||
| s << n << ' '; | |||
| 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<int>& destinationArea) const | |||
| { | |||
| ScopedPointer <Image> imageCreated; | |||
| @@ -91523,34 +91482,27 @@ void ImageConvolutionKernel::applyToImage (Image& destImage, | |||
| return; | |||
| } | |||
| const int imageWidth = destImage.getWidth(); | |||
| const int imageHeight = destImage.getHeight(); | |||
| const Rectangle<int> area (destinationArea.getIntersection (destImage.getBounds())); | |||
| if (dx >= imageWidth || dy >= imageHeight) | |||
| if (area.isEmpty()) | |||
| return; | |||
| if (dx + dw > imageWidth) | |||
| dw = imageWidth - dx; | |||
| if (dy + dh > imageHeight) | |||
| dh = imageHeight - dy; | |||
| const int dx2 = dx + dw; | |||
| const int dy2 = dy + dh; | |||
| const int right = area.getRight(); | |||
| const int bottom = area.getBottom(); | |||
| 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 <WASAPIAudioIODevice*> (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 <ALSAAudioIODevice*> (device); | |||
| ALSAAudioIODevice* d = dynamic_cast <ALSAAudioIODevice*> (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 <JackAudioIODevice*> (device); | |||
| JackAudioIODevice* d = dynamic_cast <JackAudioIODevice*> (device); | |||
| if (d == 0) | |||
| return -1; | |||
| @@ -236404,13 +236356,12 @@ void FileChooser::showPlatformDialog (Array<File>& 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 | |||
| @@ -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. | |||
| @@ -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. */ | |||
| @@ -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. */ | |||
| @@ -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(); | |||
| @@ -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; | |||
| @@ -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); | |||
| }; | |||
| @@ -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); | |||
| @@ -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. | |||
| */ | |||
| @@ -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(). | |||
| @@ -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); | |||
| }; | |||
| @@ -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); | |||
| }; | |||
| @@ -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. | |||
| */ | |||
| @@ -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 <int> (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 <int*> (d) = sampleNumber; | |||
| d += 4; | |||
| *(uint16*) d = (uint16) numBytes; | |||
| *reinterpret_cast <uint16*> (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 <const uint16*> (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 <const uint16*> (d + 4); | |||
| if (nextOne >= endData) | |||
| return *(const int*) d; | |||
| return *reinterpret_cast <const int*> (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 <const int*> (d) <= samplePosition) | |||
| { | |||
| d += 4; | |||
| d += 2 + *(uint16*) d; | |||
| d += 2 + *reinterpret_cast <const uint16*> (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<const int*> (data) < samplePosition) | |||
| while (data < dataEnd && *reinterpret_cast <const int*> (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 <const int*> (data); | |||
| data += 4; | |||
| numBytes = *(uint16*) data; | |||
| numBytes = *reinterpret_cast <const uint16*> (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; | |||
| @@ -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); | |||
| //============================================================================== | |||
| /** | |||
| @@ -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()); | |||
| @@ -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 <MidiMessageSequence> tracks; | |||
| @@ -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); | |||
| } | |||
| } | |||
| @@ -201,7 +201,7 @@ private: | |||
| CriticalSection lock; | |||
| uint16 noteStates [128]; | |||
| MidiBuffer eventsToAdd; | |||
| VoidArray listeners; | |||
| Array <MidiKeyboardStateListener*> listeners; | |||
| void noteOnInternal (const int midiChannel, const int midiNoteNumber, const float velocity); | |||
| void noteOffInternal (const int midiChannel, const int midiNoteNumber); | |||
| @@ -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<const uint8*> (d) >= 0xf0 | |||
| || getMessageLengthFromFirstByte (*reinterpret_cast<const uint8*> (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 <const uint8*> (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; | |||
| @@ -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); | |||
| //============================================================================== | |||
| @@ -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); | |||
| //============================================================================== | |||
| @@ -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<MidiMessage>& 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: | |||
| //============================================================================== | |||
| @@ -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(); | |||
| @@ -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(); | |||
| @@ -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. | |||
| @@ -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 <PluginDescription>& typesFound, | |||
| AudioPluginFormat& formatToUse); | |||
| @@ -141,7 +141,7 @@ public: | |||
| @see addToMenu | |||
| */ | |||
| int getIndexChosenByMenu (const int menuResultCode) const; | |||
| int getIndexChosenByMenu (int menuResultCode) const; | |||
| //============================================================================== | |||
| /** Sorts the list. */ | |||
| @@ -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(). | |||
| @@ -55,7 +55,7 @@ public: | |||
| */ | |||
| PluginListComponent (KnownPluginList& listToRepresent, | |||
| const File& deadMansPedalFile, | |||
| PropertiesFile* const propertiesToUse); | |||
| PropertiesFile* propertiesToUse); | |||
| /** Destructor. */ | |||
| ~PluginListComponent(); | |||
| @@ -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&); | |||
| @@ -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(); | |||
| @@ -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; } | |||
| @@ -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 | |||
| @@ -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(); | |||
| //============================================================================== | |||
| @@ -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&); | |||
| @@ -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(); | |||
| //============================================================================== | |||
| @@ -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<File> results; | |||
| bool useNativeDialogBox; | |||
| bool showDialog (const bool selectsDirectories, | |||
| const bool selectsFiles, | |||
| const bool isSave, | |||
| const bool warnAboutOverwritingExistingFiles, | |||
| const bool selectMultipleFiles, | |||
| FilePreviewComponent* const previewComponent); | |||
| static void showPlatformDialog (Array<File>& results, | |||
| const String& title, | |||
| const File& file, | |||
| const String& filters, | |||
| bool selectsDirectories, | |||
| bool selectsFiles, | |||
| bool isSave, | |||
| bool warnAboutOverwritingExistingFiles, | |||
| bool selectMultipleFiles, | |||
| bool showDialog (bool selectsDirectories, bool selectsFiles, bool isSave, | |||
| bool warnAboutOverwritingExistingFiles, bool selectMultipleFiles, | |||
| FilePreviewComponent* previewComponent); | |||
| static void showPlatformDialog (Array<File>& results, const String& title, const File& file, | |||
| const String& filters, bool selectsDirectories, bool selectsFiles, | |||
| bool isSave, bool warnAboutOverwritingExistingFiles, bool selectMultipleFiles, | |||
| FilePreviewComponent* previewComponent); | |||
| }; | |||
| @@ -89,7 +89,7 @@ public: | |||
| FileChooserDialogBox (const String& title, | |||
| const String& instructions, | |||
| FileBrowserComponent& browserComponent, | |||
| const bool warnAboutOverwritingExistingFiles, | |||
| bool warnAboutOverwritingExistingFiles, | |||
| const Colour& backgroundColour); | |||
| /** Destructor. */ | |||
| @@ -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); | |||
| @@ -252,10 +252,8 @@ void DropShadower::updateShadows() | |||
| blurKernel.createGaussianBlur (blurRadius); | |||
| blurKernel.applyToImage (*bigIm, 0, | |||
| xOffset, | |||
| yOffset, | |||
| bigIm->getWidth(), | |||
| bigIm->getHeight()); | |||
| Rectangle<int> (xOffset, yOffset, | |||
| bigIm->getWidth(), bigIm->getHeight())); | |||
| ImageCache::addImageToCache (bigIm, hash); | |||
| } | |||
| @@ -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); | |||
| @@ -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') | |||
| @@ -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<int>& destinationArea) const | |||
| { | |||
| ScopedPointer <Image> imageCreated; | |||
| @@ -138,34 +135,27 @@ void ImageConvolutionKernel::applyToImage (Image& destImage, | |||
| return; | |||
| } | |||
| const int imageWidth = destImage.getWidth(); | |||
| const int imageHeight = destImage.getHeight(); | |||
| const Rectangle<int> 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) | |||
| @@ -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<int>& destinationArea) const; | |||
| //============================================================================== | |||
| juce_UseDebuggingNewOperator | |||
| @@ -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 | |||
| @@ -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); | |||
| @@ -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 <ALSAAudioIODevice*> (device); | |||
| ALSAAudioIODevice* d = dynamic_cast <ALSAAudioIODevice*> (device); | |||
| if (d == 0) | |||
| return -1; | |||
| @@ -81,13 +81,12 @@ void FileChooser::showPlatformDialog (Array<File>& 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])); | |||
| @@ -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 <JackAudioIODevice*> (device); | |||
| JackAudioIODevice* d = dynamic_cast <JackAudioIODevice*> (device); | |||
| if (d == 0) | |||
| return -1; | |||
| @@ -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; | |||
| } | |||
| @@ -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 | |||
| @@ -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 | |||
| @@ -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; | |||
| @@ -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 | |||
| @@ -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 <WASAPIAudioIODevice*> (device); | |||
| @@ -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, | |||