MCPcopy Create free account
hub / github.com/audacity/audacity / Update_TimeCtrl_ToLength

Method Update_TimeCtrl_ToLength

src/effects/ChangeSpeed.cpp:455–467  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

453}
454
455void EffectChangeSpeed::Update_TimeCtrl_ToLength()
456// Update ToLength control from percent change.
457{
458 mToLength = (mFromLength * 100.0) / (100.0 + m_PercentChange);
459
460 // Set the format first so we can get sample accuracy.
461 mpToLengthCtrl->SetFormatName(mFormat);
462 // Negative times do not make sense.
463 // 359999 = 99h:59m:59s which is a little less disturbing than overflow characters
464 // though it may still look a bit strange with some formats.
465 mToLength = std::clamp<double>(mToLength, 0.0, 359999.0);
466 mpToLengthCtrl->SetValue(mToLength);
467}
468
469void EffectChangeSpeed::UpdateUI()
470// Disable OK and Preview if not in sensible range.

Callers

nothing calls this directly

Calls 2

SetFormatNameMethod · 0.45
SetValueMethod · 0.45

Tested by

no test coverage detected