Audacity 3.2.0
Functions
anonymous_namespace{WaveClipAdjustBorderHandle.cpp} Namespace Reference

Functions

void TrimLeftTo (WaveTrack::Interval &interval, double t)
 
void TrimRightTo (WaveTrack::Interval &interval, double t)
 
void StretchLeftTo (WaveTrack::Interval &interval, double t)
 
void StretchRightTo (WaveTrack::Interval &interval, double t)
 
double GetLeftAdjustLimit (const WaveTrack::Interval &interval, const WaveTrack &track, bool adjustingLeftBorder, bool isStretchMode)
 
double GetRightAdjustLimit (const WaveTrack::Interval &interval, const WaveTrack &track, bool adjustingLeftBorder, bool isStretchMode)
 

Detailed Description


Audacity: A Digital Audio Editor

WaveClipAdjustBorderHandle.cpp

Vitaly Sverchinsky

Function Documentation

◆ GetLeftAdjustLimit()

double anonymous_namespace{WaveClipAdjustBorderHandle.cpp}::GetLeftAdjustLimit ( const WaveTrack::Interval interval,
const WaveTrack track,
bool  adjustingLeftBorder,
bool  isStretchMode 
)

Definition at line 82 of file WaveClipAdjustBorderHandle.cpp.

86{
87 if (!adjustingLeftBorder)
88 return std::min(
89 interval.GetSequenceEndTime(),
90 interval.Start() + 1.0 / track.GetRate()
91 );
92
93 const auto prevInterval = track.GetNextInterval(interval, PlaybackDirection::backward);
94 if(isStretchMode)
95 return prevInterval ? prevInterval->End() :
96 std::numeric_limits<double>::lowest();
97 if(prevInterval)
98 return std::max(interval.GetSequenceStartTime(),
99 prevInterval->End());
100 return interval.GetSequenceStartTime();
101}
int min(int a, int b)
double GetSequenceStartTime() const noexcept
Definition: WaveClip.cpp:1863
double Start() const override
Definition: WaveClip.cpp:340
double GetSequenceEndTime() const
Definition: WaveClip.cpp:1876
IntervalConstHolder GetNextInterval(const Interval &interval, PlaybackDirection searchDirection) const
Definition: WaveTrack.cpp:175
double GetRate() const override
Definition: WaveTrack.cpp:798

References backward, WaveTrack::GetNextInterval(), WaveTrack::GetRate(), WaveClip::GetSequenceEndTime(), WaveClip::GetSequenceStartTime(), min(), and WaveClip::Start().

Here is the call graph for this function:

◆ GetRightAdjustLimit()

double anonymous_namespace{WaveClipAdjustBorderHandle.cpp}::GetRightAdjustLimit ( const WaveTrack::Interval interval,
const WaveTrack track,
bool  adjustingLeftBorder,
bool  isStretchMode 
)

Definition at line 103 of file WaveClipAdjustBorderHandle.cpp.

106{
107 if (adjustingLeftBorder)
108 return std::max(
109 interval.GetSequenceStartTime(),
110 interval.End() - 1.0 / track.GetRate()
111 );
112
113 const auto nextInterval = track.GetNextInterval(interval, PlaybackDirection::forward);
114 if (isStretchMode)
115 return nextInterval ? nextInterval->Start() :
116 std::numeric_limits<double>::max();
117
118 if(nextInterval)
119 return std::min(interval.GetSequenceEndTime(),
120 nextInterval->Start());
121 return interval.GetSequenceEndTime();
122}
double End() const override
Definition: WaveClip.cpp:345

References WaveClip::End(), forward, WaveTrack::GetNextInterval(), WaveTrack::GetRate(), WaveClip::GetSequenceEndTime(), WaveClip::GetSequenceStartTime(), and min().

Here is the call graph for this function:

◆ StretchLeftTo()

void anonymous_namespace{WaveClipAdjustBorderHandle.cpp}::StretchLeftTo ( WaveTrack::Interval interval,
double  t 
)

Definition at line 45 of file WaveClipAdjustBorderHandle.cpp.

46 {
47 interval.StretchLeftTo(t);
48 }
void StretchLeftTo(double to)
Stretches from left to the absolute time (if in expected range)
Definition: WaveClip.cpp:569

References WaveClip::StretchLeftTo().

Referenced by WaveClipAdjustBorderHandle::HitAnywhere().

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

◆ StretchRightTo()

void anonymous_namespace{WaveClipAdjustBorderHandle.cpp}::StretchRightTo ( WaveTrack::Interval interval,
double  t 
)

Definition at line 50 of file WaveClipAdjustBorderHandle.cpp.

51 {
52 interval.StretchRightTo(t);
53 }
void StretchRightTo(double to)
Sets from the right to the absolute time (if in expected range)
Definition: WaveClip.cpp:588

References WaveClip::StretchRightTo().

Referenced by WaveClipAdjustBorderHandle::HitAnywhere().

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

◆ TrimLeftTo()

void anonymous_namespace{WaveClipAdjustBorderHandle.cpp}::TrimLeftTo ( WaveTrack::Interval interval,
double  t 
)

Definition at line 35 of file WaveClipAdjustBorderHandle.cpp.

36 {
37 interval.TrimLeftTo(t);
38 }
void TrimLeftTo(double to)
Sets the the left trimming to the absolute time (if that is in bounds)
Definition: WaveClip.cpp:1850

References WaveClip::TrimLeftTo().

Referenced by WaveClipAdjustBorderHandle::HitAnywhere().

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

◆ TrimRightTo()

void anonymous_namespace{WaveClipAdjustBorderHandle.cpp}::TrimRightTo ( WaveTrack::Interval interval,
double  t 
)

Definition at line 40 of file WaveClipAdjustBorderHandle.cpp.

41 {
42 interval.TrimRightTo(t);
43 }
void TrimRightTo(double to)
Sets the the right trimming to the absolute time (if that is in bounds)
Definition: WaveClip.cpp:1857

References WaveClip::TrimRightTo().

Referenced by WaveClipAdjustBorderHandle::HitAnywhere().

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