mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-02-05 03:50:07 +00:00
Updated the amalgamated files
This commit is contained in:
parent
a126b1918a
commit
796848eb8b
2 changed files with 500 additions and 424 deletions
|
|
@ -16440,8 +16440,9 @@ class ValueTreeChildChangeAction : public UndoableAction
|
|||
public:
|
||||
ValueTreeChildChangeAction (const ValueTree::SharedObjectPtr& target_, const int childIndex_,
|
||||
const ValueTree::SharedObjectPtr& newChild_) throw()
|
||||
: target (target_), childIndex (childIndex_),
|
||||
: target (target_),
|
||||
child (newChild_ != 0 ? newChild_ : target_->children [childIndex_]),
|
||||
childIndex (childIndex_),
|
||||
isDeleting (newChild_ == 0)
|
||||
{
|
||||
jassert (child != 0);
|
||||
|
|
@ -26641,24 +26642,24 @@ END_JUCE_NAMESPACE
|
|||
BEGIN_JUCE_NAMESPACE
|
||||
|
||||
MidiBuffer::MidiBuffer() throw()
|
||||
: ArrayAllocationBase <uint8> (32),
|
||||
: data (32),
|
||||
bytesUsed (0)
|
||||
{
|
||||
}
|
||||
|
||||
MidiBuffer::MidiBuffer (const MidiMessage& message) throw()
|
||||
: ArrayAllocationBase <uint8> (32),
|
||||
: data (32),
|
||||
bytesUsed (0)
|
||||
{
|
||||
addEvent (message, 0);
|
||||
}
|
||||
|
||||
MidiBuffer::MidiBuffer (const MidiBuffer& other) throw()
|
||||
: ArrayAllocationBase <uint8> (32),
|
||||
: data (32),
|
||||
bytesUsed (other.bytesUsed)
|
||||
{
|
||||
ensureAllocatedSize (bytesUsed);
|
||||
memcpy (elements, other.elements, bytesUsed);
|
||||
data.ensureAllocatedSize (bytesUsed);
|
||||
memcpy (data.elements, other.data.elements, bytesUsed);
|
||||
}
|
||||
|
||||
const MidiBuffer& MidiBuffer::operator= (const MidiBuffer& other) throw()
|
||||
|
|
@ -26666,10 +26667,10 @@ const MidiBuffer& MidiBuffer::operator= (const MidiBuffer& other) throw()
|
|||
if (this != &other)
|
||||
{
|
||||
bytesUsed = other.bytesUsed;
|
||||
ensureAllocatedSize (bytesUsed);
|
||||
data.ensureAllocatedSize (bytesUsed);
|
||||
|
||||
if (bytesUsed > 0)
|
||||
memcpy (elements, other.elements, bytesUsed);
|
||||
memcpy (data.elements, other.data.elements, bytesUsed);
|
||||
}
|
||||
|
||||
return *this;
|
||||
|
|
@ -26677,9 +26678,9 @@ const MidiBuffer& MidiBuffer::operator= (const MidiBuffer& other) throw()
|
|||
|
||||
void MidiBuffer::swap (MidiBuffer& other)
|
||||
{
|
||||
swapVariables <uint8*> (this->elements, other.elements);
|
||||
swapVariables <int> (this->numAllocated, other.numAllocated);
|
||||
swapVariables <int> (this->bytesUsed, other.bytesUsed);
|
||||
swapVariables <uint8*> (data.elements, other.data.elements);
|
||||
swapVariables <int> (data.numAllocated, other.data.numAllocated);
|
||||
swapVariables <int> (bytesUsed, other.bytesUsed);
|
||||
}
|
||||
|
||||
MidiBuffer::~MidiBuffer() throw()
|
||||
|
|
@ -26694,12 +26695,12 @@ void MidiBuffer::clear() throw()
|
|||
void MidiBuffer::clear (const int startSample,
|
||||
const int numSamples) throw()
|
||||
{
|
||||
uint8* const start = findEventAfter (elements, startSample - 1);
|
||||
uint8* const start = findEventAfter (data.elements, startSample - 1);
|
||||
uint8* const end = findEventAfter (start, startSample + numSamples - 1);
|
||||
|
||||
if (end > start)
|
||||
{
|
||||
const size_t bytesToMove = (size_t) (bytesUsed - (end - elements));
|
||||
const size_t bytesToMove = (size_t) (bytesUsed - (end - data.elements));
|
||||
|
||||
if (bytesToMove > 0)
|
||||
memmove (start, end, bytesToMove);
|
||||
|
|
@ -26753,10 +26754,10 @@ void MidiBuffer::addEvent (const uint8* const newData,
|
|||
|
||||
if (numBytes > 0)
|
||||
{
|
||||
ensureAllocatedSize (bytesUsed + numBytes + 6);
|
||||
data.ensureAllocatedSize (bytesUsed + numBytes + 6);
|
||||
|
||||
uint8* d = findEventAfter (elements, sampleNumber);
|
||||
const size_t bytesToMove = (size_t) (bytesUsed - (d - elements));
|
||||
uint8* d = findEventAfter (data.elements, sampleNumber);
|
||||
const size_t bytesToMove = (size_t) (bytesUsed - (d - data.elements));
|
||||
|
||||
if (bytesToMove > 0)
|
||||
memmove (d + numBytes + 6,
|
||||
|
|
@ -26800,8 +26801,8 @@ bool MidiBuffer::isEmpty() const throw()
|
|||
int MidiBuffer::getNumEvents() const throw()
|
||||
{
|
||||
int n = 0;
|
||||
const uint8* d = elements;
|
||||
const uint8* const end = elements + bytesUsed;
|
||||
const uint8* d = data.elements;
|
||||
const uint8* const end = data.elements + bytesUsed;
|
||||
|
||||
while (d < end)
|
||||
{
|
||||
|
|
@ -26815,7 +26816,7 @@ int MidiBuffer::getNumEvents() const throw()
|
|||
|
||||
int MidiBuffer::getFirstEventTime() const throw()
|
||||
{
|
||||
return (bytesUsed > 0) ? *(const int*) elements : 0;
|
||||
return (bytesUsed > 0) ? *(const int*) data.elements : 0;
|
||||
}
|
||||
|
||||
int MidiBuffer::getLastEventTime() const throw()
|
||||
|
|
@ -26823,7 +26824,7 @@ int MidiBuffer::getLastEventTime() const throw()
|
|||
if (bytesUsed == 0)
|
||||
return 0;
|
||||
|
||||
const uint8* d = elements;
|
||||
const uint8* d = data.elements;
|
||||
const uint8* const endData = d + bytesUsed;
|
||||
|
||||
for (;;)
|
||||
|
|
@ -26839,7 +26840,7 @@ int MidiBuffer::getLastEventTime() const throw()
|
|||
|
||||
uint8* MidiBuffer::findEventAfter (uint8* d, const int samplePosition) const throw()
|
||||
{
|
||||
const uint8* const endData = elements + bytesUsed;
|
||||
const uint8* const endData = data.elements + bytesUsed;
|
||||
|
||||
while (d < endData && *(int*) d <= samplePosition)
|
||||
{
|
||||
|
|
@ -26852,7 +26853,7 @@ uint8* MidiBuffer::findEventAfter (uint8* d, const int samplePosition) const thr
|
|||
|
||||
MidiBuffer::Iterator::Iterator (const MidiBuffer& buffer_) throw()
|
||||
: buffer (buffer_),
|
||||
data (buffer_.elements)
|
||||
data (buffer_.data.elements)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -26862,8 +26863,8 @@ MidiBuffer::Iterator::~Iterator() throw()
|
|||
|
||||
void MidiBuffer::Iterator::setNextSamplePosition (const int samplePosition) throw()
|
||||
{
|
||||
data = buffer.elements;
|
||||
const uint8* dataEnd = buffer.elements + buffer.bytesUsed;
|
||||
data = buffer.data.elements;
|
||||
const uint8* dataEnd = buffer.data.elements + buffer.bytesUsed;
|
||||
|
||||
while (data < dataEnd && *(int*) data < samplePosition)
|
||||
{
|
||||
|
|
@ -26876,7 +26877,7 @@ bool MidiBuffer::Iterator::getNextEvent (const uint8* &midiData,
|
|||
int& numBytes,
|
||||
int& samplePosition) throw()
|
||||
{
|
||||
if (data >= buffer.elements + buffer.bytesUsed)
|
||||
if (data >= buffer.data.elements + buffer.bytesUsed)
|
||||
return false;
|
||||
|
||||
samplePosition = *(int*) data;
|
||||
|
|
@ -26892,7 +26893,7 @@ bool MidiBuffer::Iterator::getNextEvent (const uint8* &midiData,
|
|||
bool MidiBuffer::Iterator::getNextEvent (MidiMessage& result,
|
||||
int& samplePosition) throw()
|
||||
{
|
||||
if (data >= buffer.elements + buffer.bytesUsed)
|
||||
if (data >= buffer.data.elements + buffer.bytesUsed)
|
||||
return false;
|
||||
|
||||
samplePosition = *(int*) data;
|
||||
|
|
@ -44316,16 +44317,16 @@ bool CodeDocument::Iterator::isEOF() const throw()
|
|||
}
|
||||
|
||||
CodeDocument::Position::Position() throw()
|
||||
: owner (0), line (0), indexInLine (0),
|
||||
characterPos (0), positionMaintained (false)
|
||||
: owner (0), characterPos (0), line (0),
|
||||
indexInLine (0), positionMaintained (false)
|
||||
{
|
||||
}
|
||||
|
||||
CodeDocument::Position::Position (const CodeDocument* const ownerDocument,
|
||||
const int line_, const int indexInLine_) throw()
|
||||
: owner (const_cast <CodeDocument*> (ownerDocument)),
|
||||
line (line_), indexInLine (indexInLine_),
|
||||
characterPos (0), positionMaintained (false)
|
||||
characterPos (0), line (line_),
|
||||
indexInLine (indexInLine_), positionMaintained (false)
|
||||
{
|
||||
setLineAndIndex (line_, indexInLine_);
|
||||
}
|
||||
|
|
@ -44339,9 +44340,8 @@ CodeDocument::Position::Position (const CodeDocument* const ownerDocument,
|
|||
}
|
||||
|
||||
CodeDocument::Position::Position (const Position& other) throw()
|
||||
: owner (other.owner), line (other.line),
|
||||
indexInLine (other.indexInLine), characterPos (other.characterPos),
|
||||
positionMaintained (false)
|
||||
: owner (other.owner), characterPos (other.characterPos), line (other.line),
|
||||
indexInLine (other.indexInLine), positionMaintained (false)
|
||||
{
|
||||
jassert (*this == other);
|
||||
}
|
||||
|
|
@ -45251,16 +45251,16 @@ private:
|
|||
CodeEditorComponent::CodeEditorComponent (CodeDocument& document_,
|
||||
CodeTokeniser* const codeTokeniser_)
|
||||
: document (document_),
|
||||
codeTokeniser (codeTokeniser_),
|
||||
firstLineOnScreen (0),
|
||||
gutter (5),
|
||||
spacesPerTab (4),
|
||||
lineHeight (0),
|
||||
firstLineOnScreen (0),
|
||||
linesOnScreen (0),
|
||||
columnsOnScreen (0),
|
||||
scrollbarThickness (16),
|
||||
useSpacesForTabs (false),
|
||||
xOffset (0),
|
||||
useSpacesForTabs (false)
|
||||
codeTokeniser (codeTokeniser_)
|
||||
{
|
||||
caretPos = CodeDocument::Position (&document_, 0, 0);
|
||||
caretPos.setPositionMaintained (true);
|
||||
|
|
@ -55900,6 +55900,14 @@ TreeViewItem* TreeView::getItemAt (int y) const throw()
|
|||
return tc->findItemAt (y, pos);
|
||||
}
|
||||
|
||||
TreeViewItem* TreeView::findItemFromIdentifierString (const String& identifierString) const
|
||||
{
|
||||
if (rootItem == 0)
|
||||
return 0;
|
||||
|
||||
return rootItem->findItemFromIdentifierString (identifierString);
|
||||
}
|
||||
|
||||
XmlElement* TreeView::getOpennessState (const bool alsoIncludeScrollPosition) const
|
||||
{
|
||||
XmlElement* e = 0;
|
||||
|
|
@ -57006,6 +57014,44 @@ TreeViewItem* TreeViewItem::getNextVisibleItem (const bool recurse) const throw(
|
|||
return 0;
|
||||
}
|
||||
|
||||
const String TreeViewItem::getItemIdentifierString() const
|
||||
{
|
||||
String s;
|
||||
|
||||
if (parentItem != 0)
|
||||
s = parentItem->getItemIdentifierString();
|
||||
|
||||
return s + T("/") + getUniqueName().replaceCharacter (T('/'), T('\\'));
|
||||
}
|
||||
|
||||
TreeViewItem* TreeViewItem::findItemFromIdentifierString (const String& identifierString)
|
||||
{
|
||||
const String uid (getUniqueName());
|
||||
|
||||
if (uid == identifierString)
|
||||
return this;
|
||||
|
||||
if (identifierString.startsWith (uid + T("/")))
|
||||
{
|
||||
const String remainingPath (identifierString.substring (uid.length() + 1));
|
||||
|
||||
bool wasOpen = isOpen();
|
||||
setOpen (true);
|
||||
|
||||
for (int i = subItems.size(); --i >= 0;)
|
||||
{
|
||||
TreeViewItem* item = subItems.getUnchecked(i)->findItemFromIdentifierString (remainingPath);
|
||||
|
||||
if (item != 0)
|
||||
return item;
|
||||
}
|
||||
|
||||
setOpen (wasOpen);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void TreeViewItem::restoreOpennessState (const XmlElement& e) throw()
|
||||
{
|
||||
if (e.hasTagName (T("CLOSED")))
|
||||
|
|
@ -64306,7 +64352,8 @@ LookAndFeel::LookAndFeel()
|
|||
{
|
||||
TextButton::buttonColourId, textButtonColour,
|
||||
TextButton::buttonOnColourId, 0xff4444ff,
|
||||
TextButton::textColourId, 0xff000000,
|
||||
TextButton::textColourOnId, 0xff000000,
|
||||
TextButton::textColourOffId, 0xff000000,
|
||||
|
||||
ComboBox::buttonColourId, 0xffbbbbff,
|
||||
ComboBox::outlineColourId, standardOutlineColour,
|
||||
|
|
@ -64572,7 +64619,8 @@ void LookAndFeel::drawButtonText (Graphics& g, TextButton& button,
|
|||
{
|
||||
Font font (getFontForTextButton (button));
|
||||
g.setFont (font);
|
||||
g.setColour (button.findColour (TextButton::textColourId)
|
||||
g.setColour (button.findColour (button.getToggleState() ? TextButton::textColourOnId
|
||||
: TextButton::textColourOffId)
|
||||
.withMultipliedAlpha (button.isEnabled() ? 1.0f : 0.5f));
|
||||
|
||||
const int yIndent = jmin (4, button.proportionOfHeight (0.3f));
|
||||
|
|
@ -88304,7 +88352,7 @@ const float Path::closeSubPathMarker = 100005.0f;
|
|||
static const int defaultGranularity = 32;
|
||||
|
||||
Path::Path() throw()
|
||||
: ArrayAllocationBase <float> (defaultGranularity),
|
||||
: data (defaultGranularity),
|
||||
numElements (0),
|
||||
pathXMin (0),
|
||||
pathXMax (0),
|
||||
|
|
@ -88319,7 +88367,7 @@ Path::~Path() throw()
|
|||
}
|
||||
|
||||
Path::Path (const Path& other) throw()
|
||||
: ArrayAllocationBase <float> (defaultGranularity),
|
||||
: data (defaultGranularity),
|
||||
numElements (other.numElements),
|
||||
pathXMin (other.pathXMin),
|
||||
pathXMax (other.pathXMax),
|
||||
|
|
@ -88329,8 +88377,8 @@ Path::Path (const Path& other) throw()
|
|||
{
|
||||
if (numElements > 0)
|
||||
{
|
||||
setAllocatedSize (numElements);
|
||||
memcpy (elements, other.elements, numElements * sizeof (float));
|
||||
data.setAllocatedSize (numElements);
|
||||
memcpy (data.elements, other.data.elements, numElements * sizeof (float));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -88338,7 +88386,7 @@ const Path& Path::operator= (const Path& other) throw()
|
|||
{
|
||||
if (this != &other)
|
||||
{
|
||||
ensureAllocatedSize (other.numElements);
|
||||
data.ensureAllocatedSize (other.numElements);
|
||||
|
||||
numElements = other.numElements;
|
||||
pathXMin = other.pathXMin;
|
||||
|
|
@ -88348,7 +88396,7 @@ const Path& Path::operator= (const Path& other) throw()
|
|||
useNonZeroWinding = other.useNonZeroWinding;
|
||||
|
||||
if (numElements > 0)
|
||||
memcpy (elements, other.elements, numElements * sizeof (float));
|
||||
memcpy (data.elements, other.data.elements, numElements * sizeof (float));
|
||||
}
|
||||
|
||||
return *this;
|
||||
|
|
@ -88365,14 +88413,14 @@ void Path::clear() throw()
|
|||
|
||||
void Path::swapWithPath (Path& other)
|
||||
{
|
||||
swapVariables <int> (this->numAllocated, other.numAllocated);
|
||||
swapVariables <float*> (this->elements, other.elements);
|
||||
swapVariables <int> (this->numElements, other.numElements);
|
||||
swapVariables <float> (this->pathXMin, other.pathXMin);
|
||||
swapVariables <float> (this->pathXMax, other.pathXMax);
|
||||
swapVariables <float> (this->pathYMin, other.pathYMin);
|
||||
swapVariables <float> (this->pathYMax, other.pathYMax);
|
||||
swapVariables <bool> (this->useNonZeroWinding, other.useNonZeroWinding);
|
||||
swapVariables <int> (data.numAllocated, other.data.numAllocated);
|
||||
swapVariables <float*> (data.elements, other.data.elements);
|
||||
swapVariables <int> (numElements, other.numElements);
|
||||
swapVariables <float> (pathXMin, other.pathXMin);
|
||||
swapVariables <float> (pathXMax, other.pathXMax);
|
||||
swapVariables <float> (pathYMin, other.pathYMin);
|
||||
swapVariables <float> (pathYMax, other.pathYMax);
|
||||
swapVariables <bool> (useNonZeroWinding, other.useNonZeroWinding);
|
||||
}
|
||||
|
||||
void Path::setUsingNonZeroWinding (const bool isNonZero) throw()
|
||||
|
|
@ -88392,7 +88440,7 @@ bool Path::isEmpty() const throw()
|
|||
|
||||
while (i < numElements)
|
||||
{
|
||||
const float type = elements [i++];
|
||||
const float type = data.elements [i++];
|
||||
|
||||
if (type == moveMarker)
|
||||
{
|
||||
|
|
@ -88462,11 +88510,11 @@ void Path::startNewSubPath (const float x,
|
|||
pathYMax = jmax (pathYMax, y);
|
||||
}
|
||||
|
||||
ensureAllocatedSize (numElements + 3);
|
||||
data.ensureAllocatedSize (numElements + 3);
|
||||
|
||||
elements [numElements++] = moveMarker;
|
||||
elements [numElements++] = x;
|
||||
elements [numElements++] = y;
|
||||
data.elements [numElements++] = moveMarker;
|
||||
data.elements [numElements++] = x;
|
||||
data.elements [numElements++] = y;
|
||||
}
|
||||
|
||||
void Path::lineTo (const float x, const float y) throw()
|
||||
|
|
@ -88476,11 +88524,11 @@ void Path::lineTo (const float x, const float y) throw()
|
|||
if (numElements == 0)
|
||||
startNewSubPath (0, 0);
|
||||
|
||||
ensureAllocatedSize (numElements + 3);
|
||||
data.ensureAllocatedSize (numElements + 3);
|
||||
|
||||
elements [numElements++] = lineMarker;
|
||||
elements [numElements++] = x;
|
||||
elements [numElements++] = y;
|
||||
data.elements [numElements++] = lineMarker;
|
||||
data.elements [numElements++] = x;
|
||||
data.elements [numElements++] = y;
|
||||
|
||||
pathXMin = jmin (pathXMin, x);
|
||||
pathXMax = jmax (pathXMax, x);
|
||||
|
|
@ -88497,13 +88545,13 @@ void Path::quadraticTo (const float x1, const float y1,
|
|||
if (numElements == 0)
|
||||
startNewSubPath (0, 0);
|
||||
|
||||
ensureAllocatedSize (numElements + 5);
|
||||
data.ensureAllocatedSize (numElements + 5);
|
||||
|
||||
elements [numElements++] = quadMarker;
|
||||
elements [numElements++] = x1;
|
||||
elements [numElements++] = y1;
|
||||
elements [numElements++] = x2;
|
||||
elements [numElements++] = y2;
|
||||
data.elements [numElements++] = quadMarker;
|
||||
data.elements [numElements++] = x1;
|
||||
data.elements [numElements++] = y1;
|
||||
data.elements [numElements++] = x2;
|
||||
data.elements [numElements++] = y2;
|
||||
|
||||
pathXMin = jmin (pathXMin, x1, x2);
|
||||
pathXMax = jmax (pathXMax, x1, x2);
|
||||
|
|
@ -88522,15 +88570,15 @@ void Path::cubicTo (const float x1, const float y1,
|
|||
if (numElements == 0)
|
||||
startNewSubPath (0, 0);
|
||||
|
||||
ensureAllocatedSize (numElements + 7);
|
||||
data.ensureAllocatedSize (numElements + 7);
|
||||
|
||||
elements [numElements++] = cubicMarker;
|
||||
elements [numElements++] = x1;
|
||||
elements [numElements++] = y1;
|
||||
elements [numElements++] = x2;
|
||||
elements [numElements++] = y2;
|
||||
elements [numElements++] = x3;
|
||||
elements [numElements++] = y3;
|
||||
data.elements [numElements++] = cubicMarker;
|
||||
data.elements [numElements++] = x1;
|
||||
data.elements [numElements++] = y1;
|
||||
data.elements [numElements++] = x2;
|
||||
data.elements [numElements++] = y2;
|
||||
data.elements [numElements++] = x3;
|
||||
data.elements [numElements++] = y3;
|
||||
|
||||
pathXMin = jmin (pathXMin, x1, x2, x3);
|
||||
pathXMax = jmax (pathXMax, x1, x2, x3);
|
||||
|
|
@ -88541,10 +88589,10 @@ void Path::cubicTo (const float x1, const float y1,
|
|||
void Path::closeSubPath() throw()
|
||||
{
|
||||
if (numElements > 0
|
||||
&& elements [numElements - 1] != closeSubPathMarker)
|
||||
&& data.elements [numElements - 1] != closeSubPathMarker)
|
||||
{
|
||||
ensureAllocatedSize (numElements + 1);
|
||||
elements [numElements++] = closeSubPathMarker;
|
||||
data.ensureAllocatedSize (numElements + 1);
|
||||
data.elements [numElements++] = closeSubPathMarker;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -88552,11 +88600,11 @@ const Point Path::getCurrentPosition() const
|
|||
{
|
||||
int i = numElements - 1;
|
||||
|
||||
if (i > 0 && elements[i] == closeSubPathMarker)
|
||||
if (i > 0 && data.elements[i] == closeSubPathMarker)
|
||||
{
|
||||
while (i >= 0)
|
||||
{
|
||||
if (elements[i] == moveMarker)
|
||||
if (data.elements[i] == moveMarker)
|
||||
{
|
||||
i += 2;
|
||||
break;
|
||||
|
|
@ -88567,7 +88615,7 @@ const Point Path::getCurrentPosition() const
|
|||
}
|
||||
|
||||
if (i > 0)
|
||||
return Point (elements [i - 1], elements [i]);
|
||||
return Point (data.elements [i - 1], data.elements [i]);
|
||||
|
||||
return Point (0.0f, 0.0f);
|
||||
}
|
||||
|
|
@ -88583,7 +88631,7 @@ void Path::addRectangle (const float x, const float y,
|
|||
if (h < 0)
|
||||
swapVariables (y1, y2);
|
||||
|
||||
ensureAllocatedSize (numElements + 13);
|
||||
data.ensureAllocatedSize (numElements + 13);
|
||||
|
||||
if (numElements == 0)
|
||||
{
|
||||
|
|
@ -88600,19 +88648,19 @@ void Path::addRectangle (const float x, const float y,
|
|||
pathYMax = jmax (pathYMax, y2);
|
||||
}
|
||||
|
||||
elements [numElements++] = moveMarker;
|
||||
elements [numElements++] = x1;
|
||||
elements [numElements++] = y2;
|
||||
elements [numElements++] = lineMarker;
|
||||
elements [numElements++] = x1;
|
||||
elements [numElements++] = y1;
|
||||
elements [numElements++] = lineMarker;
|
||||
elements [numElements++] = x2;
|
||||
elements [numElements++] = y1;
|
||||
elements [numElements++] = lineMarker;
|
||||
elements [numElements++] = x2;
|
||||
elements [numElements++] = y2;
|
||||
elements [numElements++] = closeSubPathMarker;
|
||||
data.elements [numElements++] = moveMarker;
|
||||
data.elements [numElements++] = x1;
|
||||
data.elements [numElements++] = y2;
|
||||
data.elements [numElements++] = lineMarker;
|
||||
data.elements [numElements++] = x1;
|
||||
data.elements [numElements++] = y1;
|
||||
data.elements [numElements++] = lineMarker;
|
||||
data.elements [numElements++] = x2;
|
||||
data.elements [numElements++] = y1;
|
||||
data.elements [numElements++] = lineMarker;
|
||||
data.elements [numElements++] = x2;
|
||||
data.elements [numElements++] = y2;
|
||||
data.elements [numElements++] = closeSubPathMarker;
|
||||
}
|
||||
|
||||
void Path::addRectangle (const Rectangle& rectangle) throw()
|
||||
|
|
@ -89041,38 +89089,38 @@ void Path::addPath (const Path& other) throw()
|
|||
|
||||
while (i < other.numElements)
|
||||
{
|
||||
const float type = other.elements [i++];
|
||||
const float type = other.data.elements [i++];
|
||||
|
||||
if (type == moveMarker)
|
||||
{
|
||||
startNewSubPath (other.elements [i],
|
||||
other.elements [i + 1]);
|
||||
startNewSubPath (other.data.elements [i],
|
||||
other.data.elements [i + 1]);
|
||||
|
||||
i += 2;
|
||||
}
|
||||
else if (type == lineMarker)
|
||||
{
|
||||
lineTo (other.elements [i],
|
||||
other.elements [i + 1]);
|
||||
lineTo (other.data.elements [i],
|
||||
other.data.elements [i + 1]);
|
||||
|
||||
i += 2;
|
||||
}
|
||||
else if (type == quadMarker)
|
||||
{
|
||||
quadraticTo (other.elements [i],
|
||||
other.elements [i + 1],
|
||||
other.elements [i + 2],
|
||||
other.elements [i + 3]);
|
||||
quadraticTo (other.data.elements [i],
|
||||
other.data.elements [i + 1],
|
||||
other.data.elements [i + 2],
|
||||
other.data.elements [i + 3]);
|
||||
i += 4;
|
||||
}
|
||||
else if (type == cubicMarker)
|
||||
{
|
||||
cubicTo (other.elements [i],
|
||||
other.elements [i + 1],
|
||||
other.elements [i + 2],
|
||||
other.elements [i + 3],
|
||||
other.elements [i + 4],
|
||||
other.elements [i + 5]);
|
||||
cubicTo (other.data.elements [i],
|
||||
other.data.elements [i + 1],
|
||||
other.data.elements [i + 2],
|
||||
other.data.elements [i + 3],
|
||||
other.data.elements [i + 4],
|
||||
other.data.elements [i + 5]);
|
||||
|
||||
i += 6;
|
||||
}
|
||||
|
|
@ -89095,7 +89143,7 @@ void Path::addPath (const Path& other,
|
|||
|
||||
while (i < other.numElements)
|
||||
{
|
||||
const float type = other.elements [i++];
|
||||
const float type = other.data.elements [i++];
|
||||
|
||||
if (type == closeSubPathMarker)
|
||||
{
|
||||
|
|
@ -89103,8 +89151,8 @@ void Path::addPath (const Path& other,
|
|||
}
|
||||
else
|
||||
{
|
||||
float x = other.elements [i++];
|
||||
float y = other.elements [i++];
|
||||
float x = other.data.elements [i++];
|
||||
float y = other.data.elements [i++];
|
||||
transformToApply.transformPoint (x, y);
|
||||
|
||||
if (type == moveMarker)
|
||||
|
|
@ -89117,18 +89165,18 @@ void Path::addPath (const Path& other,
|
|||
}
|
||||
else if (type == quadMarker)
|
||||
{
|
||||
float x2 = other.elements [i++];
|
||||
float y2 = other.elements [i++];
|
||||
float x2 = other.data.elements [i++];
|
||||
float y2 = other.data.elements [i++];
|
||||
transformToApply.transformPoint (x2, y2);
|
||||
|
||||
quadraticTo (x, y, x2, y2);
|
||||
}
|
||||
else if (type == cubicMarker)
|
||||
{
|
||||
float x2 = other.elements [i++];
|
||||
float y2 = other.elements [i++];
|
||||
float x3 = other.elements [i++];
|
||||
float y3 = other.elements [i++];
|
||||
float x2 = other.data.elements [i++];
|
||||
float y2 = other.data.elements [i++];
|
||||
float x3 = other.data.elements [i++];
|
||||
float y3 = other.data.elements [i++];
|
||||
transformToApply.transformPoint (x2, y2);
|
||||
transformToApply.transformPoint (x3, y3);
|
||||
|
||||
|
|
@ -89152,24 +89200,24 @@ void Path::applyTransform (const AffineTransform& transform) throw()
|
|||
|
||||
while (i < numElements)
|
||||
{
|
||||
const float type = elements [i++];
|
||||
const float type = data.elements [i++];
|
||||
|
||||
if (type == moveMarker)
|
||||
{
|
||||
transform.transformPoint (elements [i],
|
||||
elements [i + 1]);
|
||||
transform.transformPoint (data.elements [i],
|
||||
data.elements [i + 1]);
|
||||
|
||||
if (setMaxMin)
|
||||
{
|
||||
pathXMin = jmin (pathXMin, elements [i]);
|
||||
pathXMax = jmax (pathXMax, elements [i]);
|
||||
pathYMin = jmin (pathYMin, elements [i + 1]);
|
||||
pathYMax = jmax (pathYMax, elements [i + 1]);
|
||||
pathXMin = jmin (pathXMin, data.elements [i]);
|
||||
pathXMax = jmax (pathXMax, data.elements [i]);
|
||||
pathYMin = jmin (pathYMin, data.elements [i + 1]);
|
||||
pathYMax = jmax (pathYMax, data.elements [i + 1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
pathXMin = pathXMax = elements [i];
|
||||
pathYMin = pathYMax = elements [i + 1];
|
||||
pathXMin = pathXMax = data.elements [i];
|
||||
pathYMin = pathYMax = data.elements [i + 1];
|
||||
setMaxMin = true;
|
||||
}
|
||||
|
||||
|
|
@ -89177,46 +89225,46 @@ void Path::applyTransform (const AffineTransform& transform) throw()
|
|||
}
|
||||
else if (type == lineMarker)
|
||||
{
|
||||
transform.transformPoint (elements [i],
|
||||
elements [i + 1]);
|
||||
transform.transformPoint (data.elements [i],
|
||||
data.elements [i + 1]);
|
||||
|
||||
pathXMin = jmin (pathXMin, elements [i]);
|
||||
pathXMax = jmax (pathXMax, elements [i]);
|
||||
pathYMin = jmin (pathYMin, elements [i + 1]);
|
||||
pathYMax = jmax (pathYMax, elements [i + 1]);
|
||||
pathXMin = jmin (pathXMin, data.elements [i]);
|
||||
pathXMax = jmax (pathXMax, data.elements [i]);
|
||||
pathYMin = jmin (pathYMin, data.elements [i + 1]);
|
||||
pathYMax = jmax (pathYMax, data.elements [i + 1]);
|
||||
|
||||
i += 2;
|
||||
}
|
||||
else if (type == quadMarker)
|
||||
{
|
||||
transform.transformPoint (elements [i],
|
||||
elements [i + 1]);
|
||||
transform.transformPoint (data.elements [i],
|
||||
data.elements [i + 1]);
|
||||
|
||||
transform.transformPoint (elements [i + 2],
|
||||
elements [i + 3]);
|
||||
transform.transformPoint (data.elements [i + 2],
|
||||
data.elements [i + 3]);
|
||||
|
||||
pathXMin = jmin (pathXMin, elements [i], elements [i + 2]);
|
||||
pathXMax = jmax (pathXMax, elements [i], elements [i + 2]);
|
||||
pathYMin = jmin (pathYMin, elements [i + 1], elements [i + 3]);
|
||||
pathYMax = jmax (pathYMax, elements [i + 1], elements [i + 3]);
|
||||
pathXMin = jmin (pathXMin, data.elements [i], data.elements [i + 2]);
|
||||
pathXMax = jmax (pathXMax, data.elements [i], data.elements [i + 2]);
|
||||
pathYMin = jmin (pathYMin, data.elements [i + 1], data.elements [i + 3]);
|
||||
pathYMax = jmax (pathYMax, data.elements [i + 1], data.elements [i + 3]);
|
||||
|
||||
i += 4;
|
||||
}
|
||||
else if (type == cubicMarker)
|
||||
{
|
||||
transform.transformPoint (elements [i],
|
||||
elements [i + 1]);
|
||||
transform.transformPoint (data.elements [i],
|
||||
data.elements [i + 1]);
|
||||
|
||||
transform.transformPoint (elements [i + 2],
|
||||
elements [i + 3]);
|
||||
transform.transformPoint (data.elements [i + 2],
|
||||
data.elements [i + 3]);
|
||||
|
||||
transform.transformPoint (elements [i + 4],
|
||||
elements [i + 5]);
|
||||
transform.transformPoint (data.elements [i + 4],
|
||||
data.elements [i + 5]);
|
||||
|
||||
pathXMin = jmin (pathXMin, elements [i], elements [i + 2], elements [i + 4]);
|
||||
pathXMax = jmax (pathXMax, elements [i], elements [i + 2], elements [i + 4]);
|
||||
pathYMin = jmin (pathYMin, elements [i + 1], elements [i + 3], elements [i + 5]);
|
||||
pathYMax = jmax (pathYMax, elements [i + 1], elements [i + 3], elements [i + 5]);
|
||||
pathXMin = jmin (pathXMin, data.elements [i], data.elements [i + 2], data.elements [i + 4]);
|
||||
pathXMax = jmax (pathXMax, data.elements [i], data.elements [i + 2], data.elements [i + 4]);
|
||||
pathYMin = jmin (pathYMin, data.elements [i + 1], data.elements [i + 3], data.elements [i + 5]);
|
||||
pathYMax = jmax (pathYMax, data.elements [i + 1], data.elements [i + 3], data.elements [i + 5]);
|
||||
|
||||
i += 6;
|
||||
}
|
||||
|
|
@ -89343,17 +89391,17 @@ const Path Path::createPathWithRoundedCorners (const float cornerRadius) const t
|
|||
|
||||
while (n < numElements)
|
||||
{
|
||||
const float type = elements [n++];
|
||||
const float type = data.elements [n++];
|
||||
|
||||
if (type == moveMarker)
|
||||
{
|
||||
indexOfPathStart = p.numElements;
|
||||
indexOfPathStartThis = n - 1;
|
||||
const float x = elements [n++];
|
||||
const float y = elements [n++];
|
||||
const float x = data.elements [n++];
|
||||
const float y = data.elements [n++];
|
||||
p.startNewSubPath (x, y);
|
||||
lastWasLine = false;
|
||||
firstWasLine = (elements [n] == lineMarker);
|
||||
firstWasLine = (data.elements [n] == lineMarker);
|
||||
}
|
||||
else if (type == lineMarker || type == closeSubPathMarker)
|
||||
{
|
||||
|
|
@ -89361,28 +89409,28 @@ const Path Path::createPathWithRoundedCorners (const float cornerRadius) const t
|
|||
|
||||
if (type == lineMarker)
|
||||
{
|
||||
endX = elements [n++];
|
||||
endY = elements [n++];
|
||||
endX = data.elements [n++];
|
||||
endY = data.elements [n++];
|
||||
|
||||
if (n > 8)
|
||||
{
|
||||
startX = elements [n - 8];
|
||||
startY = elements [n - 7];
|
||||
joinX = elements [n - 5];
|
||||
joinY = elements [n - 4];
|
||||
startX = data.elements [n - 8];
|
||||
startY = data.elements [n - 7];
|
||||
joinX = data.elements [n - 5];
|
||||
joinY = data.elements [n - 4];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
endX = elements [indexOfPathStartThis + 1];
|
||||
endY = elements [indexOfPathStartThis + 2];
|
||||
endX = data.elements [indexOfPathStartThis + 1];
|
||||
endY = data.elements [indexOfPathStartThis + 2];
|
||||
|
||||
if (n > 6)
|
||||
{
|
||||
startX = elements [n - 6];
|
||||
startY = elements [n - 5];
|
||||
joinX = elements [n - 3];
|
||||
joinY = elements [n - 2];
|
||||
startX = data.elements [n - 6];
|
||||
startY = data.elements [n - 5];
|
||||
joinX = data.elements [n - 3];
|
||||
joinY = data.elements [n - 2];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -89395,8 +89443,8 @@ const Path Path::createPathWithRoundedCorners (const float cornerRadius) const t
|
|||
{
|
||||
const double propNeeded = jmin (0.5, cornerRadius / len1);
|
||||
|
||||
p.elements [p.numElements - 2] = (float) (joinX - (joinX - startX) * propNeeded);
|
||||
p.elements [p.numElements - 1] = (float) (joinY - (joinY - startY) * propNeeded);
|
||||
p.data.elements [p.numElements - 2] = (float) (joinX - (joinX - startX) * propNeeded);
|
||||
p.data.elements [p.numElements - 1] = (float) (joinY - (joinY - startY) * propNeeded);
|
||||
}
|
||||
|
||||
const double len2 = juce_hypot (endX - joinX,
|
||||
|
|
@ -89423,12 +89471,12 @@ const Path Path::createPathWithRoundedCorners (const float cornerRadius) const t
|
|||
{
|
||||
if (firstWasLine)
|
||||
{
|
||||
startX = elements [n - 3];
|
||||
startY = elements [n - 2];
|
||||
startX = data.elements [n - 3];
|
||||
startY = data.elements [n - 2];
|
||||
joinX = endX;
|
||||
joinY = endY;
|
||||
endX = elements [indexOfPathStartThis + 4];
|
||||
endY = elements [indexOfPathStartThis + 5];
|
||||
endX = data.elements [indexOfPathStartThis + 4];
|
||||
endY = data.elements [indexOfPathStartThis + 5];
|
||||
|
||||
const double len1 = juce_hypot (startX - joinX,
|
||||
startY - joinY);
|
||||
|
|
@ -89437,8 +89485,8 @@ const Path Path::createPathWithRoundedCorners (const float cornerRadius) const t
|
|||
{
|
||||
const double propNeeded = jmin (0.5, cornerRadius / len1);
|
||||
|
||||
p.elements [p.numElements - 2] = (float) (joinX - (joinX - startX) * propNeeded);
|
||||
p.elements [p.numElements - 1] = (float) (joinY - (joinY - startY) * propNeeded);
|
||||
p.data.elements [p.numElements - 2] = (float) (joinX - (joinX - startX) * propNeeded);
|
||||
p.data.elements [p.numElements - 1] = (float) (joinY - (joinY - startY) * propNeeded);
|
||||
}
|
||||
|
||||
const double len2 = juce_hypot (endX - joinX,
|
||||
|
|
@ -89453,8 +89501,8 @@ const Path Path::createPathWithRoundedCorners (const float cornerRadius) const t
|
|||
|
||||
p.quadraticTo (joinX, joinY, endX, endY);
|
||||
|
||||
p.elements [indexOfPathStart + 1] = endX;
|
||||
p.elements [indexOfPathStart + 2] = endY;
|
||||
p.data.elements [indexOfPathStart + 1] = endX;
|
||||
p.data.elements [indexOfPathStart + 2] = endY;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -89464,21 +89512,21 @@ const Path Path::createPathWithRoundedCorners (const float cornerRadius) const t
|
|||
else if (type == quadMarker)
|
||||
{
|
||||
lastWasLine = false;
|
||||
const float x1 = elements [n++];
|
||||
const float y1 = elements [n++];
|
||||
const float x2 = elements [n++];
|
||||
const float y2 = elements [n++];
|
||||
const float x1 = data.elements [n++];
|
||||
const float y1 = data.elements [n++];
|
||||
const float x2 = data.elements [n++];
|
||||
const float y2 = data.elements [n++];
|
||||
p.quadraticTo (x1, y1, x2, y2);
|
||||
}
|
||||
else if (type == cubicMarker)
|
||||
{
|
||||
lastWasLine = false;
|
||||
const float x1 = elements [n++];
|
||||
const float y1 = elements [n++];
|
||||
const float x2 = elements [n++];
|
||||
const float y2 = elements [n++];
|
||||
const float x3 = elements [n++];
|
||||
const float y3 = elements [n++];
|
||||
const float x1 = data.elements [n++];
|
||||
const float y1 = data.elements [n++];
|
||||
const float x2 = data.elements [n++];
|
||||
const float y2 = data.elements [n++];
|
||||
const float x3 = data.elements [n++];
|
||||
const float y3 = data.elements [n++];
|
||||
p.cubicTo (x1, y1, x2, y2, x3, y3);
|
||||
}
|
||||
}
|
||||
|
|
@ -89566,37 +89614,37 @@ void Path::writePathToStream (OutputStream& dest) const
|
|||
int i = 0;
|
||||
while (i < numElements)
|
||||
{
|
||||
const float type = elements [i++];
|
||||
const float type = data.elements [i++];
|
||||
|
||||
if (type == moveMarker)
|
||||
{
|
||||
dest.writeByte ('m');
|
||||
dest.writeFloat (elements [i++]);
|
||||
dest.writeFloat (elements [i++]);
|
||||
dest.writeFloat (data.elements [i++]);
|
||||
dest.writeFloat (data.elements [i++]);
|
||||
}
|
||||
else if (type == lineMarker)
|
||||
{
|
||||
dest.writeByte ('l');
|
||||
dest.writeFloat (elements [i++]);
|
||||
dest.writeFloat (elements [i++]);
|
||||
dest.writeFloat (data.elements [i++]);
|
||||
dest.writeFloat (data.elements [i++]);
|
||||
}
|
||||
else if (type == quadMarker)
|
||||
{
|
||||
dest.writeByte ('q');
|
||||
dest.writeFloat (elements [i++]);
|
||||
dest.writeFloat (elements [i++]);
|
||||
dest.writeFloat (elements [i++]);
|
||||
dest.writeFloat (elements [i++]);
|
||||
dest.writeFloat (data.elements [i++]);
|
||||
dest.writeFloat (data.elements [i++]);
|
||||
dest.writeFloat (data.elements [i++]);
|
||||
dest.writeFloat (data.elements [i++]);
|
||||
}
|
||||
else if (type == cubicMarker)
|
||||
{
|
||||
dest.writeByte ('b');
|
||||
dest.writeFloat (elements [i++]);
|
||||
dest.writeFloat (elements [i++]);
|
||||
dest.writeFloat (elements [i++]);
|
||||
dest.writeFloat (elements [i++]);
|
||||
dest.writeFloat (elements [i++]);
|
||||
dest.writeFloat (elements [i++]);
|
||||
dest.writeFloat (data.elements [i++]);
|
||||
dest.writeFloat (data.elements [i++]);
|
||||
dest.writeFloat (data.elements [i++]);
|
||||
dest.writeFloat (data.elements [i++]);
|
||||
dest.writeFloat (data.elements [i++]);
|
||||
dest.writeFloat (data.elements [i++]);
|
||||
}
|
||||
else if (type == closeSubPathMarker)
|
||||
{
|
||||
|
|
@ -89619,7 +89667,7 @@ const String Path::toString() const
|
|||
|
||||
while (i < numElements)
|
||||
{
|
||||
const float marker = elements [i++];
|
||||
const float marker = data.elements [i++];
|
||||
tchar markerChar = 0;
|
||||
int numCoords = 0;
|
||||
|
||||
|
|
@ -89657,7 +89705,7 @@ const String Path::toString() const
|
|||
|
||||
while (--numCoords >= 0 && i < numElements)
|
||||
{
|
||||
String n (elements [i++], 3);
|
||||
String n (data.elements [i++], 3);
|
||||
|
||||
while (n.endsWithChar (T('0')))
|
||||
n = n.dropLastCharacters (1);
|
||||
|
|
@ -89784,7 +89832,7 @@ Path::Iterator::~Iterator()
|
|||
|
||||
bool Path::Iterator::next()
|
||||
{
|
||||
const float* const elements = path.elements;
|
||||
const float* const elements = path.data.elements;
|
||||
|
||||
if (index < path.numElements)
|
||||
{
|
||||
|
|
@ -89851,7 +89899,7 @@ PathFlatteningIterator::PathFlatteningIterator (const Path& path_,
|
|||
subPathIndex (-1),
|
||||
path (path_),
|
||||
transform (transform_),
|
||||
points (path_.elements),
|
||||
points (path_.data.elements),
|
||||
tolerence (tolerence_ * tolerence_),
|
||||
subPathCloseX (0),
|
||||
subPathCloseY (0),
|
||||
|
|
@ -247774,10 +247822,20 @@ public:
|
|||
return true;
|
||||
|
||||
DWORD playCursor, writeCursor;
|
||||
HRESULT hr = pOutputBuffer->GetCurrentPosition (&playCursor, &writeCursor);
|
||||
|
||||
if (hr != S_OK)
|
||||
for (;;)
|
||||
{
|
||||
HRESULT hr = pOutputBuffer->GetCurrentPosition (&playCursor, &writeCursor);
|
||||
|
||||
if (hr == MAKE_HRESULT (1, 0x878, 150)) // DSERR_BUFFERLOST
|
||||
{
|
||||
pOutputBuffer->Restore();
|
||||
continue;
|
||||
}
|
||||
|
||||
if (hr == S_OK)
|
||||
break;
|
||||
|
||||
logError (hr);
|
||||
jassertfalse
|
||||
return true;
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue