Audacity 3.2.0
Functions | Variables
WaveTrackUtilities Namespace Reference


WAVE_TRACK_API bool HasPitchOrSpeed (const WaveTrack &track, double t0, double t1)
WAVE_TRACK_API void WithClipRenderingProgress (std::function< void(const ProgressReporter &)> action, TranslatableString title=defaultStretchRenderingTitle, TranslatableString message=XO("Rendering Clip"))


WAVE_TRACK_API const TranslatableString defaultStretchRenderingTitle

Function Documentation

◆ HasPitchOrSpeed()

bool WaveTrackUtilities::HasPitchOrSpeed ( const WaveTrack track,
double  t0,
double  t1 

Whether any clips, whose play regions intersect the interval, have non-unit stretch ratio

Definition at line 21 of file WaveTrackUtilities.cpp.

24 auto &clips = track.GetClips();
25 return any_of(clips.begin(), clips.end(), [&](auto& pClip) {
26 return pClip->IntersectsPlayRegion(t0, t1) && pClip->HasPitchOrSpeed();
27 });
WaveClipHolders & GetClips()
Definition: WaveTrack.h:699

References WaveTrack::GetClips().

Referenced by EffectOutputTracks::EffectOutputTracks(), WaveTrack::Interval::GetRenderedCopy(), EffectAmplify::Init(), EffectAutoDuck::Process(), and EffectRepair::Process().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WithClipRenderingProgress()

void WaveTrackUtilities::WithClipRenderingProgress ( std::function< void(const ProgressReporter &)>  action,
TranslatableString  title = defaultStretchRenderingTitle,
TranslatableString  message = XO("Rendering Clip") 

Definition at line 30 of file WaveTrackUtilities.cpp.

34 using namespace BasicUI;
35 auto progress =
36 MakeProgress(std::move(title), std::move(message), ProgressShowCancel);
37 const auto reportProgress = [&](double progressFraction) {
38 const auto result = progress->Poll(progressFraction * 1000, 1000);
39 if (result != ProgressResult::Success)
40 throw UserException {};
41 };
42 action(reportProgress);
static const auto title
Can be thrown when user cancels operations, as with a progress dialog. Delayed handler does nothing.
Definition: UserException.h:17
@ ProgressShowCancel
Definition: BasicUI.h:142
std::unique_ptr< ProgressDialog > MakeProgress(const TranslatableString &title, const TranslatableString &message, unsigned flags=(ProgressShowStop|ProgressShowCancel), const TranslatableString &remainingLabelText={})
Create and display a progress dialog.
Definition: BasicUI.h:292

References BasicUI::MakeProgress(), BasicUI::ProgressShowCancel, BasicUI::Success, and title.

Referenced by EffectOutputTracks::EffectOutputTracks(), anonymous_namespace{EditMenus.cpp}::OnJoin(), anonymous_namespace{LabelMenus.cpp}::OnJoinLabels(), WaveTrackAffordanceControls::OnRenderClipStretching(), anonymous_namespace{EditMenus.cpp}::OnSilence(), and EffectAutoDuck::Process().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ defaultStretchRenderingTitle

const TranslatableString WaveTrackUtilities::defaultStretchRenderingTitle
Initial value:

Audacity: A Digital Audio Editor


Paul Licameli

Definition at line 18 of file WaveTrackUtilities.cpp.

Referenced by EffectAutoDuck::Process().