Skip to content

Commit a03c89a

Browse files
committed
Fix an issue where graphs are not refreshed before playing in Logic Pro
1 parent 946bfb3 commit a03c89a

File tree

8 files changed

+26
-56
lines changed

8 files changed

+26
-56
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ SoundCloud: [Wings](https://soundcloud.com/jerry-876742699)
105105

106106
1. Fix a crash when turn on HQ mode in mono channel mode in Logic Pro.
107107
2. Improve graphs in mono channel mode.
108+
3. Fix an issue where graphs are not refreshed before playing in Logic Pro.
108109

109110
### 2022-2-5 (version 0.9.5)
110111

Source/Panels/ControlPanel/Graph Components/Oscilloscope.cpp

Lines changed: 5 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Oscilloscope::Oscilloscope(FireAudioProcessor &p) : processor(p)
1717
{
1818
// In your constructor, you should add any child components, and
1919
// initialise any special settings that your component needs.
20+
startTimerHz(60);
2021
}
2122

2223
Oscilloscope::~Oscilloscope()
@@ -134,45 +135,7 @@ void Oscilloscope::paint (juce::Graphics& g)
134135
}
135136
}
136137

137-
//void Oscilloscope::resized()
138-
//{
139-
// // This method is where you should set the bounds of any child
140-
// // components that your component contains..
141-
//}
142-
//
143-
//void Oscilloscope::setScale(float scale)
144-
//{
145-
// this->scale = scale;
146-
//}
147-
//
148-
//bool Oscilloscope::getZoomState()
149-
//{
150-
// return mZoomState;
151-
//}
152-
//
153-
//void Oscilloscope::setZoomState(bool zoomState)
154-
//{
155-
// mZoomState = zoomState;
156-
//}
157-
//
158-
//void Oscilloscope::mouseDown(const juce::MouseEvent &e)
159-
//{
160-
// if (mZoomState)
161-
// {
162-
// mZoomState = false;
163-
// }
164-
// else
165-
// {
166-
// mZoomState = true;
167-
// }
168-
//}
169-
//
170-
//void Oscilloscope::mouseEnter(const juce::MouseEvent &e)
171-
//{
172-
// isMouseOn = true;
173-
//}
174-
//
175-
//void Oscilloscope::mouseExit(const juce::MouseEvent &e)
176-
//{
177-
// isMouseOn = false;
178-
//}
138+
void Oscilloscope::timerCallback()
139+
{
140+
repaint();
141+
}

Source/Panels/ControlPanel/Graph Components/Oscilloscope.h

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,30 +17,20 @@
1717
//==============================================================================
1818
/*
1919
*/
20-
class Oscilloscope : public GraphTemplate//, private juce::Timer
20+
class Oscilloscope : public GraphTemplate, juce::Timer
2121
{
2222
public:
2323
Oscilloscope(FireAudioProcessor &);
2424
~Oscilloscope() override;
2525

2626
void paint (juce::Graphics&) override;
27-
// void resized() override;
28-
// void setScale(float scale);
29-
// bool getZoomState();
30-
// void setZoomState(bool zoomState);
31-
// void mouseDown(const juce::MouseEvent &e) override;
32-
// void mouseEnter(const juce::MouseEvent &e) override;
33-
// void mouseExit(const juce::MouseEvent &e) override;
27+
void timerCallback() override;
3428

3529
private:
3630
FireAudioProcessor &processor;
3731

3832
juce::Array<float> historyL;
3933
juce::Array<float> historyR;
4034
juce::Image historyImage;
41-
42-
// float scale = 1.0f;
43-
// bool mZoomState = false;
44-
// bool isMouseOn = false;
4535
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Oscilloscope)
4636
};

Source/Panels/ControlPanel/Graph Components/VUMeter.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class VUMeter : public juce::Component, juce::Timer
2828
void timerCallback() override;
2929
float getLeftChannelLevel();
3030
float getRightChannelLevel();
31+
3132
private:
3233
FireAudioProcessor* mProcessor;
3334
bool mIsInput;

Source/Panels/ControlPanel/Graph Components/VUPanel.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ VUPanel::VUPanel(FireAudioProcessor &p) : processor(p), vuMeterIn(&p), vuMeterOu
2222

2323
addAndMakeVisible(vuMeterIn);
2424
addAndMakeVisible(vuMeterOut);
25+
26+
startTimerHz(60);
2527
}
2628

2729
VUPanel::~VUPanel()
@@ -143,3 +145,8 @@ void VUPanel::setFocusBandNum(int num)
143145
{
144146
focusBandNum = num;
145147
}
148+
149+
void VUPanel::timerCallback()
150+
{
151+
repaint();
152+
}

Source/Panels/ControlPanel/Graph Components/VUPanel.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
//==============================================================================
1919
/*
2020
*/
21-
class VUPanel : public GraphTemplate
21+
class VUPanel : public GraphTemplate, juce::Timer
2222
{
2323
public:
2424
VUPanel(FireAudioProcessor &);
@@ -27,6 +27,7 @@ class VUPanel : public GraphTemplate
2727
void paint (juce::Graphics&) override;
2828
void resized() override;
2929
void setFocusBandNum(int num);
30+
void timerCallback() override;
3031

3132
private:
3233
FireAudioProcessor &processor;

Source/Panels/ControlPanel/Graph Components/WidthGraph.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ WidthGraph::WidthGraph(FireAudioProcessor &p) : processor(p)
1717
{
1818
// In your constructor, you should add any child components, and
1919
// initialise any special settings that your component needs.
20+
startTimerHz(60);
2021
}
2122

2223
WidthGraph::~WidthGraph()
@@ -94,3 +95,8 @@ void WidthGraph::paint (juce::Graphics& g)
9495
g.fillAll();
9596
}
9697
}
98+
99+
void WidthGraph::timerCallback()
100+
{
101+
repaint();
102+
}

Source/Panels/ControlPanel/Graph Components/WidthGraph.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@
1717
//==============================================================================
1818
/*
1919
*/
20-
class WidthGraph : public GraphTemplate
20+
class WidthGraph : public GraphTemplate, juce::Timer
2121
{
2222
public:
2323
WidthGraph(FireAudioProcessor &);
2424
~WidthGraph() override;
2525

2626
void paint (juce::Graphics&) override;
27+
void timerCallback() override;
2728

2829
private:
2930
FireAudioProcessor &processor;

0 commit comments

Comments
 (0)