| @@ -401,7 +401,7 @@ void MidiFile::writeTrack (OutputStream& mainOut, const int trackNum) | |||||
| ++data; | ++data; | ||||
| --dataSize; | --dataSize; | ||||
| } | } | ||||
| else if ((statusByte & 0xf0) == 0xf0) // Write sysex message with length bytes. | |||||
| else if (statusByte == 0xf0) // Write sysex message with length bytes. | |||||
| { | { | ||||
| out.writeByte ((char) statusByte); | out.writeByte ((char) statusByte); | ||||
| @@ -919,11 +919,15 @@ public: | |||||
| int getDefaultBufferSize() | int getDefaultBufferSize() | ||||
| { | { | ||||
| for (int i = 0; i < getNumBufferSizesAvailable(); ++i) | |||||
| if (getBufferSizeSamples(i) >= 512) | |||||
| return getBufferSizeSamples(i); | |||||
| int best = 0; | |||||
| return 512; | |||||
| for (int i = 0; best < 512 && i < getNumBufferSizesAvailable(); ++i) | |||||
| best = getBufferSizeSamples(i); | |||||
| if (best == 0) | |||||
| best = 512; | |||||
| return best; | |||||
| } | } | ||||
| String open (const BigInteger& inputChannels, | String open (const BigInteger& inputChannels, | ||||
| @@ -54,7 +54,7 @@ | |||||
| void addToFifo (const int* someData, int numItems) | void addToFifo (const int* someData, int numItems) | ||||
| { | { | ||||
| int start1, size1, start2, size2; | int start1, size1, start2, size2; | ||||
| prepareToWrite (numItems, start1, size1, start2, size2); | |||||
| abstractFifo.prepareToWrite (numItems, start1, size1, start2, size2); | |||||
| if (size1 > 0) | if (size1 > 0) | ||||
| copySomeData (myBuffer + start1, someData, size1); | copySomeData (myBuffer + start1, someData, size1); | ||||
| @@ -62,13 +62,13 @@ | |||||
| if (size2 > 0) | if (size2 > 0) | ||||
| copySomeData (myBuffer + start2, someData + size1, size2); | copySomeData (myBuffer + start2, someData + size1, size2); | ||||
| finishedWrite (size1 + size2); | |||||
| abstractFifo.finishedWrite (size1 + size2); | |||||
| } | } | ||||
| void readFromFifo (int* someData, int numItems) | void readFromFifo (int* someData, int numItems) | ||||
| { | { | ||||
| int start1, size1, start2, size2; | int start1, size1, start2, size2; | ||||
| prepareToRead (numSamples, start1, size1, start2, size2); | |||||
| abstractFifo.prepareToRead (numSamples, start1, size1, start2, size2); | |||||
| if (size1 > 0) | if (size1 > 0) | ||||
| copySomeData (someData, myBuffer + start1, size1); | copySomeData (someData, myBuffer + start1, size1); | ||||
| @@ -76,7 +76,7 @@ | |||||
| if (size2 > 0) | if (size2 > 0) | ||||
| copySomeData (someData + size1, myBuffer + start2, size2); | copySomeData (someData + size1, myBuffer + start2, size2); | ||||
| finishedRead (size1 + size2); | |||||
| abstractFifo.finishedRead (size1 + size2); | |||||
| } | } | ||||
| private: | private: | ||||
| @@ -94,14 +94,14 @@ namespace LookAndFeelHelpers | |||||
| return baseColour; | return baseColour; | ||||
| } | } | ||||
| TextLayout layoutTooltipText (const String& text) noexcept | |||||
| TextLayout layoutTooltipText (const String& text, const Colour& colour) noexcept | |||||
| { | { | ||||
| const float tooltipFontSize = 13.0f; | const float tooltipFontSize = 13.0f; | ||||
| const int maxToolTipWidth = 400; | const int maxToolTipWidth = 400; | ||||
| AttributedString s; | AttributedString s; | ||||
| s.setJustification (Justification::centred); | s.setJustification (Justification::centred); | ||||
| s.append (text, Font (tooltipFontSize, Font::bold)); | |||||
| s.append (text, Font (tooltipFontSize, Font::bold), colour); | |||||
| TextLayout tl; | TextLayout tl; | ||||
| tl.createLayoutWithBalancedLineLengths (s, (float) maxToolTipWidth); | tl.createLayoutWithBalancedLineLengths (s, (float) maxToolTipWidth); | ||||
| @@ -1653,7 +1653,7 @@ ImageEffectFilter* LookAndFeel::getSliderEffect() | |||||
| //============================================================================== | //============================================================================== | ||||
| void LookAndFeel::getTooltipSize (const String& tipText, int& width, int& height) | void LookAndFeel::getTooltipSize (const String& tipText, int& width, int& height) | ||||
| { | { | ||||
| const TextLayout tl (LookAndFeelHelpers::layoutTooltipText (tipText)); | |||||
| const TextLayout tl (LookAndFeelHelpers::layoutTooltipText (tipText, Colours::black)); | |||||
| width = (int) (tl.getWidth() + 14.0f); | width = (int) (tl.getWidth() + 14.0f); | ||||
| height = (int) (tl.getHeight() + 6.0f); | height = (int) (tl.getHeight() + 6.0f); | ||||
| @@ -1668,10 +1668,8 @@ void LookAndFeel::drawTooltip (Graphics& g, const String& text, int width, int h | |||||
| g.drawRect (0, 0, width, height, 1); | g.drawRect (0, 0, width, height, 1); | ||||
| #endif | #endif | ||||
| const TextLayout tl (LookAndFeelHelpers::layoutTooltipText (text)); | |||||
| g.setColour (findColour (TooltipWindow::textColourId)); | |||||
| tl.draw (g, Rectangle<float> (0.0f, 0.0f, (float) width, (float) height)); | |||||
| const TextLayout tl (LookAndFeelHelpers::layoutTooltipText (text, findColour (TooltipWindow::textColourId))); | |||||
| tl.draw (g, Rectangle<float> ((float) width, (float) height)); | |||||
| } | } | ||||
| //============================================================================== | //============================================================================== | ||||
| @@ -457,6 +457,7 @@ public: | |||||
| // TODO | // TODO | ||||
| } | } | ||||
| #if USE_ANDROID_CANVAS | |||||
| StringArray getAvailableRenderingEngines() | StringArray getAvailableRenderingEngines() | ||||
| { | { | ||||
| StringArray s (ComponentPeer::getAvailableRenderingEngines()); | StringArray s (ComponentPeer::getAvailableRenderingEngines()); | ||||
| @@ -464,7 +465,6 @@ public: | |||||
| return s; | return s; | ||||
| } | } | ||||
| #if USE_ANDROID_CANVAS | |||||
| int getCurrentRenderingEngine() const | int getCurrentRenderingEngine() const | ||||
| { | { | ||||
| return usingAndroidGraphics ? 1 : 0; | return usingAndroidGraphics ? 1 : 0; | ||||
| @@ -1753,9 +1753,7 @@ void TextEditor::paintOverChildren (Graphics& g) | |||||
| else | else | ||||
| { | { | ||||
| g.drawText (textToShowWhenEmpty, | g.drawText (textToShowWhenEmpty, | ||||
| leftIndent, topIndent, | |||||
| viewport->getWidth() - leftIndent, | |||||
| viewport->getHeight() - topIndent, | |||||
| leftIndent, 0, viewport->getWidth() - leftIndent, getHeight(), | |||||
| Justification::centredLeft, true); | Justification::centredLeft, true); | ||||
| } | } | ||||
| } | } | ||||