kopia lustrzana https://github.com/jameshball/osci-render
Fix bug with audioplayercomponent
rodzic
b88269825c
commit
fb1db3c886
|
@ -28,6 +28,10 @@ AudioPlayerComponent::AudioPlayerComponent(CommonAudioProcessor& processor)
|
||||||
audioProcessor.wavParser.setLooping(shouldRepeat);
|
audioProcessor.wavParser.setLooping(shouldRepeat);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
isActive = [this]() {
|
||||||
|
return audioProcessor.wavParser.isInitialised();
|
||||||
|
};
|
||||||
|
|
||||||
playButton.setTooltip("Play audio file");
|
playButton.setTooltip("Play audio file");
|
||||||
pauseButton.setTooltip("Pause audio file");
|
pauseButton.setTooltip("Pause audio file");
|
||||||
stopButton.setTooltip("Stop and close audio file");
|
stopButton.setTooltip("Stop and close audio file");
|
||||||
|
|
|
@ -72,8 +72,13 @@ double TimelineComponent::getValue() const
|
||||||
|
|
||||||
void TimelineComponent::setPlaying(bool shouldBePlaying)
|
void TimelineComponent::setPlaying(bool shouldBePlaying)
|
||||||
{
|
{
|
||||||
playButton.setVisible(!shouldBePlaying);
|
if (isActive != nullptr && !isActive()) {
|
||||||
pauseButton.setVisible(shouldBePlaying);
|
playButton.setVisible(false);
|
||||||
|
pauseButton.setVisible(false);
|
||||||
|
} else {
|
||||||
|
playButton.setVisible(!shouldBePlaying);
|
||||||
|
pauseButton.setVisible(shouldBePlaying);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TimelineComponent::isPlaying() const
|
bool TimelineComponent::isPlaying() const
|
||||||
|
|
|
@ -17,6 +17,7 @@ public:
|
||||||
std::function<void()> onPause;
|
std::function<void()> onPause;
|
||||||
std::function<void()> onStop;
|
std::function<void()> onStop;
|
||||||
std::function<void(bool)> onRepeatChanged;
|
std::function<void(bool)> onRepeatChanged;
|
||||||
|
std::function<bool(void)> isActive;
|
||||||
|
|
||||||
// Public interface
|
// Public interface
|
||||||
void setValue(double value, juce::NotificationType notification);
|
void setValue(double value, juce::NotificationType notification);
|
||||||
|
|
Ładowanie…
Reference in New Issue