mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Simplified some demo plugin code to avoid a display update problem
This commit is contained in:
parent
09d6409644
commit
2c3a2eae63
2 changed files with 13 additions and 20 deletions
|
|
@ -165,25 +165,20 @@ static String quarterNotePositionToBarsBeatsString (double quarterNotes, int num
|
|||
// Updates the text in our position label.
|
||||
void JuceDemoPluginAudioProcessorEditor::updateTimecodeDisplay (AudioPlayHead::CurrentPositionInfo pos)
|
||||
{
|
||||
if (lastDisplayedPosition != pos)
|
||||
{
|
||||
lastDisplayedPosition = pos;
|
||||
MemoryOutputStream displayText;
|
||||
|
||||
MemoryOutputStream displayText;
|
||||
displayText << "[" << SystemStats::getJUCEVersion() << "] "
|
||||
<< String (pos.bpm, 2) << " bpm, "
|
||||
<< pos.timeSigNumerator << '/' << pos.timeSigDenominator
|
||||
<< " - " << timeToTimecodeString (pos.timeInSeconds)
|
||||
<< " - " << quarterNotePositionToBarsBeatsString (pos.ppqPosition,
|
||||
pos.timeSigNumerator,
|
||||
pos.timeSigDenominator);
|
||||
|
||||
displayText << "[" << SystemStats::getJUCEVersion() << "] "
|
||||
<< String (pos.bpm, 2) << " bpm, "
|
||||
<< pos.timeSigNumerator << '/' << pos.timeSigDenominator
|
||||
<< " - " << timeToTimecodeString (pos.timeInSeconds)
|
||||
<< " - " << quarterNotePositionToBarsBeatsString (pos.ppqPosition,
|
||||
pos.timeSigNumerator,
|
||||
pos.timeSigDenominator);
|
||||
if (pos.isRecording)
|
||||
displayText << " (recording)";
|
||||
else if (pos.isPlaying)
|
||||
displayText << " (playing)";
|
||||
|
||||
if (pos.isRecording)
|
||||
displayText << " (recording)";
|
||||
else if (pos.isPlaying)
|
||||
displayText << " (playing)";
|
||||
|
||||
timecodeDisplayLabel.setText (displayText.toString(), dontSendNotification);
|
||||
}
|
||||
timecodeDisplayLabel.setText (displayText.toString(), dontSendNotification);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,8 +39,6 @@ private:
|
|||
ScopedPointer<ResizableCornerComponent> resizer;
|
||||
ComponentBoundsConstrainer resizeLimits;
|
||||
|
||||
AudioPlayHead::CurrentPositionInfo lastDisplayedPosition;
|
||||
|
||||
//==============================================================================
|
||||
JuceDemoPluginAudioProcessor& getProcessor() const
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue