Browse Source

tags/2021-05-28
jules 18 years ago
parent
commit
7ee377a45d
3 changed files with 12 additions and 8 deletions
  1. +1
    -1
      src/juce_appframework/audio/synthesisers/juce_Synthesiser.cpp
  2. +6
    -4
      src/juce_core/containers/juce_Array.h
  3. +5
    -3
      src/juce_core/containers/juce_OwnedArray.h

+ 1
- 1
src/juce_appframework/audio/synthesisers/juce_Synthesiser.cpp View File

@@ -161,7 +161,7 @@ void Synthesiser::renderNextBlock (AudioSampleBuffer& outputBuffer,
MidiBuffer::Iterator midiIterator (midiData); MidiBuffer::Iterator midiIterator (midiData);
midiIterator.setNextSamplePosition (startSample); midiIterator.setNextSamplePosition (startSample);
MidiMessage m (0x90, 0.0);
MidiMessage m (0xf4, 0.0);
while (numSamples > 0) while (numSamples > 0)
{ {


+ 6
- 4
src/juce_core/containers/juce_Array.h View File

@@ -311,6 +311,8 @@ public:
*/ */
int indexOf (const ElementType elementToLookFor) const throw() int indexOf (const ElementType elementToLookFor) const throw()
{ {
int result = -1;
lock.enter(); lock.enter();
const ElementType* e = this->elements; const ElementType* e = this->elements;
@@ -318,15 +320,15 @@ public:
{ {
if (elementToLookFor == *e) if (elementToLookFor == *e)
{ {
lock.exit();
return (int)(e - this->elements);
result = (int) (e - this->elements);
break;
} }
++e; ++e;
} }
lock.exit(); lock.exit();
return -1;
return result;
} }
/** Returns true if the array contains at least one occurrence of an object. /** Returns true if the array contains at least one occurrence of an object.
@@ -830,7 +832,7 @@ public:
@param howManyToRemove how many elements to remove from the end of the array @param howManyToRemove how many elements to remove from the end of the array
@see remove, removeValue, removeRange @see remove, removeValue, removeRange
*/ */
void removeLast (int howManyToRemove = 1) throw()
void removeLast (const int howManyToRemove = 1) throw()
{ {
lock.enter(); lock.enter();
numUsed = jmax (0, numUsed - howManyToRemove); numUsed = jmax (0, numUsed - howManyToRemove);


+ 5
- 3
src/juce_core/containers/juce_OwnedArray.h View File

@@ -183,6 +183,8 @@ public:
*/ */
int indexOf (const ObjectClass* const objectToLookFor) const throw() int indexOf (const ObjectClass* const objectToLookFor) const throw()
{ {
int result = -1;
lock.enter(); lock.enter();
ObjectClass* const* e = this->elements; ObjectClass* const* e = this->elements;
@@ -190,15 +192,15 @@ public:
{ {
if (objectToLookFor == *e) if (objectToLookFor == *e)
{ {
lock.exit();
return (int) (e - this->elements);
result = (int) (e - this->elements);
break;
} }
++e; ++e;
} }
lock.exit(); lock.exit();
return -1;
return result;
} }
/** Returns true if the array contains a specified object. /** Returns true if the array contains a specified object.


Loading…
Cancel
Save