mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-31 03:00:05 +00:00
Added an alertwindow font setting to the lookandfeel class. Made sure the ComponentListener::componentChildrenChanged is called when component z-order changes. Fix for CoreMidi output timestamps.
This commit is contained in:
parent
7478c7f9ab
commit
e2ef26e91c
14 changed files with 124 additions and 105 deletions
|
|
@ -88,15 +88,20 @@ void ResamplingAudioSource::releaseResources()
|
|||
|
||||
void ResamplingAudioSource::getNextAudioBlock (const AudioSourceChannelInfo& info)
|
||||
{
|
||||
const ScopedLock sl (ratioLock);
|
||||
float localRatio;
|
||||
|
||||
if (lastRatio != ratio)
|
||||
{
|
||||
createLowPass (ratio);
|
||||
lastRatio = ratio;
|
||||
const ScopedLock sl (ratioLock);
|
||||
localRatio = ratio;
|
||||
}
|
||||
|
||||
const int sampsNeeded = roundToInt (info.numSamples * ratio) + 2;
|
||||
if (lastRatio != localRatio)
|
||||
{
|
||||
createLowPass (localRatio);
|
||||
lastRatio = localRatio;
|
||||
}
|
||||
|
||||
const int sampsNeeded = roundToInt (info.numSamples * localRatio) + 2;
|
||||
|
||||
int bufferSize = buffer.getNumSamples();
|
||||
|
||||
|
|
@ -126,7 +131,7 @@ void ResamplingAudioSource::getNextAudioBlock (const AudioSourceChannelInfo& inf
|
|||
|
||||
input->getNextAudioBlock (readInfo);
|
||||
|
||||
if (ratio > 1.0001)
|
||||
if (localRatio > 1.0001)
|
||||
{
|
||||
// for down-sampling, pre-apply the filter..
|
||||
|
||||
|
|
@ -153,7 +158,7 @@ void ResamplingAudioSource::getNextAudioBlock (const AudioSourceChannelInfo& inf
|
|||
for (int channel = 0; channel < channelsToProcess; ++channel)
|
||||
*destBuffers[channel]++ = srcBuffers[channel][bufferPos] * invAlpha + srcBuffers[channel][nextPos] * alpha;
|
||||
|
||||
subSampleOffset += ratio;
|
||||
subSampleOffset += localRatio;
|
||||
|
||||
jassert (sampsInBuffer > 0);
|
||||
|
||||
|
|
@ -169,13 +174,13 @@ void ResamplingAudioSource::getNextAudioBlock (const AudioSourceChannelInfo& inf
|
|||
}
|
||||
}
|
||||
|
||||
if (ratio < 0.9999)
|
||||
if (localRatio < 0.9999)
|
||||
{
|
||||
// for up-sampling, apply the filter after transposing..
|
||||
for (int i = channelsToProcess; --i >= 0;)
|
||||
applyFilter (info.buffer->getSampleData (i, info.startSample), info.numSamples, filterStates[i]);
|
||||
}
|
||||
else if (ratio <= 1.0001)
|
||||
else if (localRatio <= 1.0001)
|
||||
{
|
||||
// if the filter's not currently being applied, keep it stoked with the last couple of samples to avoid discontinuities
|
||||
for (int i = channelsToProcess; --i >= 0;)
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
*/
|
||||
#define JUCE_MAJOR_VERSION 1
|
||||
#define JUCE_MINOR_VERSION 53
|
||||
#define JUCE_BUILDNUMBER 7
|
||||
#define JUCE_BUILDNUMBER 8
|
||||
|
||||
/** Current Juce version number.
|
||||
|
||||
|
|
|
|||
|
|
@ -732,6 +732,21 @@ void Component::setBufferedToImage (const bool shouldBeBuffered)
|
|||
}
|
||||
|
||||
//==============================================================================
|
||||
void Component::moveChildInternal (const int sourceIndex, const int destIndex)
|
||||
{
|
||||
if (sourceIndex != destIndex)
|
||||
{
|
||||
Component* const c = childComponentList.getUnchecked (sourceIndex);
|
||||
jassert (c != 0);
|
||||
c->repaintParent();
|
||||
|
||||
childComponentList.move (sourceIndex, destIndex);
|
||||
|
||||
sendFakeMouseMove();
|
||||
internalChildrenChanged();
|
||||
}
|
||||
}
|
||||
|
||||
void Component::toFront (const bool setAsForeground)
|
||||
{
|
||||
// if component methods are being called from threads other than the message
|
||||
|
|
@ -752,7 +767,7 @@ void Component::toFront (const bool setAsForeground)
|
|||
}
|
||||
else if (parentComponent != 0)
|
||||
{
|
||||
Array<Component*>& childList = parentComponent->childComponentList;
|
||||
const Array<Component*>& childList = parentComponent->childComponentList;
|
||||
|
||||
if (childList.getLast() != this)
|
||||
{
|
||||
|
|
@ -770,13 +785,7 @@ void Component::toFront (const bool setAsForeground)
|
|||
--insertIndex;
|
||||
}
|
||||
|
||||
if (index != insertIndex)
|
||||
{
|
||||
childList.move (index, insertIndex);
|
||||
sendFakeMouseMove();
|
||||
|
||||
repaintParent();
|
||||
}
|
||||
parentComponent->moveChildInternal (index, insertIndex);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -797,8 +806,7 @@ void Component::toBehind (Component* const other)
|
|||
|
||||
if (parentComponent != 0)
|
||||
{
|
||||
Array<Component*>& childList = parentComponent->childComponentList;
|
||||
|
||||
const Array<Component*>& childList = parentComponent->childComponentList;
|
||||
const int index = childList.indexOf (this);
|
||||
|
||||
if (index >= 0 && childList [index + 1] != other)
|
||||
|
|
@ -810,10 +818,7 @@ void Component::toBehind (Component* const other)
|
|||
if (index < otherIndex)
|
||||
--otherIndex;
|
||||
|
||||
childList.move (index, otherIndex);
|
||||
|
||||
sendFakeMouseMove();
|
||||
repaintParent();
|
||||
parentComponent->moveChildInternal (index, otherIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -836,35 +841,27 @@ void Component::toBehind (Component* const other)
|
|||
|
||||
void Component::toBack()
|
||||
{
|
||||
Array<Component*>& childList = parentComponent->childComponentList;
|
||||
|
||||
if (isOnDesktop())
|
||||
{
|
||||
jassertfalse; //xxx need to add this to native window
|
||||
}
|
||||
else if (parentComponent != 0 && childList.getFirst() != this)
|
||||
else if (parentComponent != 0)
|
||||
{
|
||||
const int index = childList.indexOf (this);
|
||||
const Array<Component*>& childList = parentComponent->childComponentList;
|
||||
|
||||
if (index > 0)
|
||||
if (childList.getFirst() != this)
|
||||
{
|
||||
int insertIndex = 0;
|
||||
const int index = childList.indexOf (this);
|
||||
|
||||
if (flags.alwaysOnTopFlag)
|
||||
if (index > 0)
|
||||
{
|
||||
while (insertIndex < childList.size()
|
||||
&& ! childList.getUnchecked (insertIndex)->isAlwaysOnTop())
|
||||
{
|
||||
++insertIndex;
|
||||
}
|
||||
}
|
||||
int insertIndex = 0;
|
||||
|
||||
if (index != insertIndex)
|
||||
{
|
||||
childList.move (index, insertIndex);
|
||||
if (flags.alwaysOnTopFlag)
|
||||
while (insertIndex < childList.size() && ! childList.getUnchecked (insertIndex)->isAlwaysOnTop())
|
||||
++insertIndex;
|
||||
|
||||
sendFakeMouseMove();
|
||||
repaintParent();
|
||||
parentComponent->moveChildInternal (index, insertIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2239,7 +2239,8 @@ private:
|
|||
void internalModifierKeysChanged();
|
||||
void internalChildrenChanged();
|
||||
void internalHierarchyChanged();
|
||||
Component* removeChildComponent (const int index, bool sendParentEvents, bool sendChildEvents);
|
||||
Component* removeChildComponent (int index, bool sendParentEvents, bool sendChildEvents);
|
||||
void moveChildInternal (int sourceIndex, int destIndex);
|
||||
void paintComponentAndChildren (Graphics& g);
|
||||
void paintComponent (Graphics& g);
|
||||
void paintWithinParentContext (Graphics& g);
|
||||
|
|
|
|||
|
|
@ -685,6 +685,11 @@ int LookAndFeel::getAlertWindowButtonHeight()
|
|||
return 28;
|
||||
}
|
||||
|
||||
const Font LookAndFeel::getAlertWindowMessageFont()
|
||||
{
|
||||
return Font (15.0f);
|
||||
}
|
||||
|
||||
const Font LookAndFeel::getAlertWindowFont()
|
||||
{
|
||||
return Font (12.0f);
|
||||
|
|
|
|||
|
|
@ -199,6 +199,7 @@ public:
|
|||
|
||||
virtual int getAlertWindowButtonHeight();
|
||||
|
||||
virtual const Font getAlertWindowMessageFont();
|
||||
virtual const Font getAlertWindowFont();
|
||||
|
||||
/** Draws a progress bar.
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ void AlertWindow::setMessage (const String& message)
|
|||
{
|
||||
text = newMessage;
|
||||
|
||||
font.setHeight (15.0f);
|
||||
font = getLookAndFeel().getAlertWindowMessageFont();
|
||||
|
||||
Font titleFont (font.getHeight() * 1.1f, Font::bold);
|
||||
textLayout.setText (getName() + "\n\n", titleFont);
|
||||
|
|
|
|||
|
|
@ -38,8 +38,7 @@
|
|||
|
||||
@see Drawable
|
||||
*/
|
||||
class JUCE_API DrawableComposite : public Drawable//,
|
||||
// public Expression::EvaluationContext
|
||||
class JUCE_API DrawableComposite : public Drawable
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
|
|
|
|||
|
|
@ -624,7 +624,7 @@ public:
|
|||
the file first and then re-writing it, it creates a new temporary file,
|
||||
writes the data to that, and then moves the new file to replace the existing
|
||||
file. This means that if the power gets pulled out or something crashes,
|
||||
you're a lot less likely to end up with an empty file..
|
||||
you're a lot less likely to end up with a corrupted or unfinished file..
|
||||
|
||||
Returns true if the operation succeeds, or false if it fails.
|
||||
|
||||
|
|
|
|||
|
|
@ -399,7 +399,7 @@ void MidiOutput::sendMessageNow (const MidiMessage& message)
|
|||
|
||||
for (int i = 0; i < numPackets; ++i)
|
||||
{
|
||||
p->timeStamp = 0;
|
||||
p->timeStamp = AudioGetCurrentHostTime();
|
||||
p->length = jmin (maxPacketSize, bytesLeft);
|
||||
memcpy (p->data, message.getRawData() + pos, p->length);
|
||||
pos += p->length;
|
||||
|
|
@ -413,7 +413,7 @@ void MidiOutput::sendMessageNow (const MidiMessage& message)
|
|||
{
|
||||
MIDIPacketList packets;
|
||||
packets.numPackets = 1;
|
||||
packets.packet[0].timeStamp = 0;
|
||||
packets.packet[0].timeStamp = AudioGetCurrentHostTime();
|
||||
packets.packet[0].length = message.getRawDataSize();
|
||||
*(int*) (packets.packet[0].data) = *(const int*) message.getRawData();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue