Don't endlessly set position, volume, speed, or tempo in QT UI
This commit is contained in:
parent
6fe53addb3
commit
efbe0e8717
2 changed files with 10 additions and 5 deletions
|
@ -5,7 +5,7 @@ void LooperWindow::Pulse() {
|
|||
auto len = playback->GetLength();
|
||||
auto pos = playback->GetPosition();
|
||||
this->slider->SetLimits(0.0, len);
|
||||
if (!this->slider->IsPressed()) this->slider->SetValue(pos);
|
||||
if (!this->slider->IsPressed()) this->slider->SetValueNoSignal(pos);
|
||||
auto component_count = TimeToComponentCount(len);
|
||||
bool enable_ui = !playback->IsStopped();
|
||||
if (enable_ui) {
|
||||
|
@ -24,10 +24,10 @@ void LooperWindow::Pulse() {
|
|||
auto pitch = playback->GetPitch();
|
||||
auto speed = playback->GetSpeed();
|
||||
auto tempo = playback->GetTempo();
|
||||
if (!volume_slider->IsPressed()) volume_slider->SetValue(volume);
|
||||
if (!pitch_slider->IsPressed()) pitch_slider->SetValue(pitch);
|
||||
if (!speed_slider->IsPressed()) speed_slider->SetValue(speed);
|
||||
if (!tempo_slider->IsPressed()) tempo_slider->SetValue(tempo);
|
||||
if (!volume_slider->IsPressed()) volume_slider->SetValueNoSignal(volume);
|
||||
if (!pitch_slider->IsPressed()) pitch_slider->SetValueNoSignal(pitch);
|
||||
if (!speed_slider->IsPressed()) speed_slider->SetValueNoSignal(speed);
|
||||
if (!tempo_slider->IsPressed()) tempo_slider->SetValueNoSignal(tempo);
|
||||
volume_slider->SetLabel(fmt::format("Volume: {}%", (int)volume).c_str());
|
||||
pitch_slider->SetLabel(fmt::format("Pitch {:.02f}x", pitch).c_str());
|
||||
speed_slider->SetLabel(fmt::format("Speed: {:.02f}x", speed).c_str());
|
||||
|
|
|
@ -76,6 +76,11 @@ void LooperSlider::set_value(double value) {
|
|||
void LooperSlider::SetValue(double value) {
|
||||
set_value(value);
|
||||
}
|
||||
void LooperSlider::SetValueNoSignal(double value) {
|
||||
this->slider_value_updating = true;
|
||||
set_value(value);
|
||||
this->slider_value_updating = false;
|
||||
}
|
||||
void LooperSlider::set_min(double min) {
|
||||
settings_changed = true;
|
||||
this->min = min;
|
||||
|
|
Loading…
Reference in a new issue