mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-18 00:54:19 +00:00
Fixed a bug in the InterAppAudioEffect demo
This commit is contained in:
parent
f204a99c6f
commit
f503ca2701
2 changed files with 17 additions and 8 deletions
|
|
@ -96,6 +96,11 @@ public:
|
|||
startTimerHz (60);
|
||||
}
|
||||
|
||||
~IAAEffectEditor()
|
||||
{
|
||||
processor.removeMeterListener (*this);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void paint (Graphics& g) override
|
||||
{
|
||||
|
|
@ -145,6 +150,7 @@ private:
|
|||
{
|
||||
auto timeInfoSuccess = processor.updateCurrentTimeInfoFromHost (lastPosInfo);
|
||||
transportText.setVisible (timeInfoSuccess);
|
||||
|
||||
if (timeInfoSuccess)
|
||||
updateTransportTextDisplay();
|
||||
|
||||
|
|
@ -157,6 +163,7 @@ private:
|
|||
void buttonClicked (Button* b) override
|
||||
{
|
||||
auto playHead = processor.getPlayHead();
|
||||
|
||||
if (playHead != nullptr && playHead->canControlTransport())
|
||||
{
|
||||
if (b == &rewindButton)
|
||||
|
|
@ -215,10 +222,10 @@ private:
|
|||
MemoryOutputStream displayText;
|
||||
|
||||
displayText << "[" << SystemStats::getJUCEVersion() << "]\n"
|
||||
<< String (lastPosInfo.bpm, 2) << " bpm\n"
|
||||
<< lastPosInfo.timeSigNumerator << '/' << lastPosInfo.timeSigDenominator << "\n"
|
||||
<< timeToTimecodeString (lastPosInfo.timeInSeconds) << "\n"
|
||||
<< quarterNotePositionToBarsBeatsString (lastPosInfo.ppqPosition,
|
||||
<< String (lastPosInfo.bpm, 2) << " bpm\n"
|
||||
<< lastPosInfo.timeSigNumerator << '/' << lastPosInfo.timeSigDenominator << "\n"
|
||||
<< timeToTimecodeString (lastPosInfo.timeInSeconds) << "\n"
|
||||
<< quarterNotePositionToBarsBeatsString (lastPosInfo.ppqPosition,
|
||||
lastPosInfo.timeSigNumerator,
|
||||
lastPosInfo.timeSigDenominator) << "\n";
|
||||
|
||||
|
|
@ -257,13 +264,15 @@ private:
|
|||
void updateSwitchToHostDisplay()
|
||||
{
|
||||
PluginHostType hostType;
|
||||
const bool visible = hostType.isInterAppAudioConnected();
|
||||
auto visible = hostType.isInterAppAudioConnected();
|
||||
|
||||
if (switchToHostButtonLabel.isVisible() != visible)
|
||||
{
|
||||
switchToHostButtonLabel.setVisible (visible);
|
||||
switchToHostButton.setVisible (visible);
|
||||
if (visible) {
|
||||
|
||||
if (visible)
|
||||
{
|
||||
auto icon = hostType.getHostIcon (buttonSize);
|
||||
switchToHostButton.setImages(false, true, true,
|
||||
icon, 1.0, Colours::transparentBlack,
|
||||
|
|
@ -283,13 +292,12 @@ private:
|
|||
ShapeButton recordButton {"Record", defaultButtonColour, defaultButtonColour, defaultButtonColour};
|
||||
|
||||
Slider gainSlider;
|
||||
AudioProcessorValueTreeState::SliderAttachment gainAttachment = {parameters, "gain", gainSlider};
|
||||
AudioProcessorValueTreeState::SliderAttachment gainAttachment = { parameters, "gain", gainSlider };
|
||||
|
||||
std::array<SimpleMeter, 2> meters;
|
||||
|
||||
ImageButton switchToHostButton;
|
||||
Label transportText, switchToHostButtonLabel;
|
||||
Image hostImage;
|
||||
|
||||
AudioPlayHead::CurrentPositionInfo lastPosInfo;
|
||||
|
||||
|
|
|
|||
|
|
@ -72,6 +72,7 @@ private:
|
|||
auto callbackLevel = maxLevel.exchange (0.0);
|
||||
|
||||
auto decayFactor = 0.95;
|
||||
|
||||
if (callbackLevel > level)
|
||||
level = callbackLevel;
|
||||
else if (level > 0.001)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue