Audacity 3.2.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
WaveTrack::Interval Class Referencefinal

#include <WaveTrack.h>

Inheritance diagram for WaveTrack::Interval:
[legend]
Collaboration diagram for WaveTrack::Interval:
[legend]

Public Member Functions

 Interval (const ChannelGroup &group, const std::shared_ptr< WaveClip > &pClip, const std::shared_ptr< WaveClip > &pClip1)
 
 Interval (const ChannelGroup &group, size_t width, const SampleBlockFactoryPtr &factory, int rate, sampleFormat storedSampleFormat)
 
 ~Interval () override
 
void Append (constSamplePtr buffer[], sampleFormat format, size_t len)
 
void Flush ()
 
void SetName (const wxString &name)
 
const wxString & GetName () const
 
void SetColorIndex (int index)
 
int GetColorIndex () const
 
void SetPlayStartTime (double time)
 
double GetPlayStartTime () const
 
double GetPlayEndTime () const
 
bool IntersectsPlayRegion (double t0, double t1) const
 
bool WithinPlayRegion (double t) const
 
double GetStretchRatio () const
 
int GetCentShift () const
 
PitchAndSpeedPreset GetPitchAndSpeedPreset () const
 
void SetRawAudioTempo (double tempo)
 
sampleCount TimeToSamples (double time) const
 
double SamplesToTime (sampleCount s) const
 
double GetSequenceStartTime () const
 
double GetSequenceEndTime () const
 
double GetTrimLeft () const
 
double GetTrimRight () const
 
auto GetChannel (size_t iChannel)
 
auto GetChannel (size_t iChannel) const
 
auto Channels ()
 
auto Channels () const
 
bool IsPlaceholder () const
 
void SetSequenceStartTime (double t)
 
void TrimLeftTo (double t)
 
void TrimRightTo (double t)
 
void TrimQuarternotesFromRight (double numQuarternotes)
 
void StretchLeftTo (double t)
 
void StretchRightTo (double t)
 
void StretchBy (double ratio)
 
bool SetCentShift (int cents)
 
void SetPitchAndSpeedPreset (PitchAndSpeedPreset preset)
 
void SetTrimLeft (double t)
 
void SetTrimRight (double t)
 
void ClearLeft (double t)
 
void ClearRight (double t)
 
std::shared_ptr< IntervalGetRenderedCopy (const std::function< void(double)> &reportProgress, const ChannelGroup &group, const SampleBlockFactoryPtr &factory, sampleFormat format)
 
bool HasPitchOrSpeed () const
 
bool HasEqualPitchAndSpeed (const Interval &other) const
 
std::shared_ptr< const WaveClipGetClip (size_t iChannel) const
 
const std::shared_ptr< WaveClip > & GetClip (size_t iChannel)
 
- Public Member Functions inherited from WideChannelGroupInterval
 WideChannelGroupInterval (const ChannelGroup &group, double start, double end)
 
 ~WideChannelGroupInterval () override
 
size_t NChannels () const
 Report the number of channels. More...
 
template<typename IntervalType = ChannelInterval>
std::shared_ptr< IntervalType > GetChannel (size_t iChannel)
 Retrieve a channel, cast to the given type. More...
 
template<typename IntervalType = const ChannelInterval>
auto GetChannel (size_t iChannel) const -> std::enable_if_t< std::is_const_v< IntervalType >, std::shared_ptr< IntervalType > >
 
template<typename IntervalType = ChannelInterval>
IteratorRange< ChannelIterator< IntervalType > > Channels ()
 Get range of ChannelInterval objects with mutative access. More...
 
template<typename IntervalType = const ChannelInterval>
auto Channels () const -> std::enable_if_t< std::is_const_v< IntervalType >, IteratorRange< ChannelIterator< IntervalType > > >
 Get range of channels with read-only access. More...
 
- Public Member Functions inherited from ChannelGroupInterval
 ChannelGroupInterval (double start, double end)
 
virtual ~ChannelGroupInterval ()
 
double Start () const
 
double End () const
 

Private Member Functions

const EnvelopeGetEnvelope () const
 
void SetEnvelope (const Envelope &envelope)
 
void ForEachClip (const std::function< void(WaveClip &)> &op)
 
std::shared_ptr< ChannelIntervalDoGetChannel (size_t iChannel) override
 Retrieve a channel. More...
 

Private Attributes

const std::shared_ptr< WaveClipmpClip
 
const std::shared_ptr< WaveClipmpClip1
 TODO wide wave tracks: eliminate this. More...
 

Additional Inherited Members

virtual std::shared_ptr< ChannelIntervalDoGetChannel (size_t iChannel)=0
 Retrieve a channel. More...
 

Detailed Description

Definition at line 927 of file WaveTrack.h.

Constructor & Destructor Documentation

◆ Interval() [1/2]

WaveTrack::Interval::Interval ( const ChannelGroup group,
const std::shared_ptr< WaveClip > &  pClip,
const std::shared_ptr< WaveClip > &  pClip1 
)
Precondition
pClip != nullptr

Definition at line 184 of file WaveTrack.cpp.

188 pClip->GetPlayStartTime(), pClip->GetPlayEndTime() }
189 , mpClip{ pClip }
190 , mpClip1{ pClip1 }
191{
192}
const std::shared_ptr< WaveClip > mpClip1
TODO wide wave tracks: eliminate this.
Definition: WaveTrack.h:1025
const std::shared_ptr< WaveClip > mpClip
Definition: WaveTrack.h:1023

◆ Interval() [2/2]

WaveTrack::Interval::Interval ( const ChannelGroup group,
size_t  width,
const SampleBlockFactoryPtr factory,
int  rate,
sampleFormat  storedSampleFormat 
)

Definition at line 194 of file WaveTrack.cpp.

197 : Interval(
198 group, std::make_shared<WaveClip>(1, factory, format, rate, 0),
199 width == 2 ?
200 std::make_shared<WaveClip>(1, factory, format, rate, 0) :
201 nullptr)
202{
203}
static RegisteredToolbarFactory factory
Interval(const ChannelGroup &group, const std::shared_ptr< WaveClip > &pClip, const std::shared_ptr< WaveClip > &pClip1)
Definition: WaveTrack.cpp:184

◆ ~Interval()

WaveTrack::Interval::~Interval ( )
overridedefault

Member Function Documentation

◆ Append()

void WaveTrack::Interval::Append ( constSamplePtr  buffer[],
sampleFormat  format,
size_t  len 
)

Definition at line 207 of file WaveTrack.cpp.

209{
210 for (unsigned channel = 0; channel < NChannels(); ++channel)
211 GetClip(channel)->AppendNewBlock(buffer[channel], format, len);
212}
std::shared_ptr< const WaveClip > GetClip(size_t iChannel) const
Definition: WaveTrack.h:1011
size_t NChannels() const
Report the number of channels.
Definition: Channel.h:80

References anonymous_namespace{ExportPCM.cpp}::format, and WaveTrack::NChannels().

Here is the call graph for this function:

◆ Channels() [1/2]

auto WaveTrack::Interval::Channels ( )
inline

Definition at line 975 of file WaveTrack.h.

975 { return
976 WideChannelGroupInterval::Channels<WaveChannelInterval>(); }

◆ Channels() [2/2]

auto WaveTrack::Interval::Channels ( ) const
inline

Definition at line 978 of file WaveTrack.h.

978 { return
979 WideChannelGroupInterval::Channels<const WaveChannelInterval>(); }

◆ ClearLeft()

void WaveTrack::Interval::ClearLeft ( double  t)

Definition at line 249 of file WaveTrack.cpp.

250{
251 for(unsigned channel = 0; channel < NChannels(); ++channel)
252 GetClip(channel)->ClearLeft(t);
253}

References WaveTrack::NChannels().

Here is the call graph for this function:

◆ ClearRight()

void WaveTrack::Interval::ClearRight ( double  t)

Definition at line 255 of file WaveTrack.cpp.

256{
257 for(unsigned channel = 0; channel < NChannels(); ++channel)
258 GetClip(channel)->ClearRight(t);
259}

References WaveTrack::NChannels().

Here is the call graph for this function:

◆ DoGetChannel()

std::shared_ptr< ChannelInterval > WaveTrack::Interval::DoGetChannel ( size_t  iChannel)
overrideprivatevirtual

Retrieve a channel.

Postcondition
result: !(iChannel < NChannels()) || result

Implements WideChannelGroupInterval.

Definition at line 535 of file WaveTrack.cpp.

536{
537 if (iChannel < NChannels()) {
538 // TODO wide wave tracks: there will be only one, wide clip
539 const auto pClip = (iChannel == 0 ? mpClip : mpClip1);
540 return std::make_shared<WaveChannelInterval>(*mpClip,
541 *pClip, iChannel);
542 }
543 return {};
544}

References anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel, and WaveTrack::NChannels().

Here is the call graph for this function:

◆ Flush()

void WaveTrack::Interval::Flush ( )

Definition at line 214 of file WaveTrack.cpp.

215{
216 ForEachClip([](auto& clip) { clip.Flush(); });
217}
void ForEachClip(const std::function< void(WaveClip &)> &op)
Definition: WaveTrack.cpp:524

◆ ForEachClip()

void WaveTrack::Interval::ForEachClip ( const std::function< void(WaveClip &)> &  op)
private

Definition at line 524 of file WaveTrack.cpp.

525{
526 for(unsigned channel = 0,
527 channelCount = NChannels();
528 channel < channelCount; ++channel)
529 {
530 op(*GetClip(channel));
531 }
532}

References WaveTrack::NChannels().

Here is the call graph for this function:

◆ GetCentShift()

int WaveTrack::Interval::GetCentShift ( ) const

Definition at line 457 of file WaveTrack.cpp.

458{
459 return mpClip->GetCentShift();
460}

◆ GetChannel() [1/2]

auto WaveTrack::Interval::GetChannel ( size_t  iChannel)
inline

Definition at line 970 of file WaveTrack.h.

970 { return
971 WideChannelGroupInterval::GetChannel<WaveChannelInterval>(iChannel); }

References anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel.

◆ GetChannel() [2/2]

auto WaveTrack::Interval::GetChannel ( size_t  iChannel) const
inline

Definition at line 972 of file WaveTrack.h.

972 { return
973 WideChannelGroupInterval::GetChannel<const WaveChannelInterval>(iChannel); }

References anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel.

◆ GetClip() [1/2]

const std::shared_ptr< WaveClip > & WaveTrack::Interval::GetClip ( size_t  iChannel)
inline

Definition at line 1013 of file WaveTrack.h.

1014 { return iChannel == 0 ? mpClip : mpClip1; }

References anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel.

◆ GetClip() [2/2]

std::shared_ptr< const WaveClip > WaveTrack::Interval::GetClip ( size_t  iChannel) const
inline

◆ GetColorIndex()

int WaveTrack::Interval::GetColorIndex ( ) const

Definition at line 415 of file WaveTrack.cpp.

416{
417 //TODO wide wave tracks: assuming that all 'narrow' clips share common color index
418 return mpClip->GetColourIndex();
419}

◆ GetEnvelope()

const Envelope & WaveTrack::Interval::GetEnvelope ( ) const
private

Definition at line 514 of file WaveTrack.cpp.

515{
516 return *mpClip->GetEnvelope();
517}

◆ GetName()

const wxString & WaveTrack::Interval::GetName ( ) const

Definition at line 404 of file WaveTrack.cpp.

405{
406 //TODO wide wave tracks: assuming that all 'narrow' clips share common name
407 return mpClip->GetName();
408}

◆ GetPitchAndSpeedPreset()

PitchAndSpeedPreset WaveTrack::Interval::GetPitchAndSpeedPreset ( ) const

Definition at line 462 of file WaveTrack.cpp.

463{
464 return mpClip->GetPitchAndSpeedPreset();
465}

◆ GetPlayEndTime()

double WaveTrack::Interval::GetPlayEndTime ( ) const

Definition at line 432 of file WaveTrack.cpp.

433{
434 // TODO wide wave tracks: assuming that all 'narrow' clips share common
435 // beginning
436 return mpClip->GetPlayEndTime();
437}

Referenced by WaveClipUtilities::SelectClip(), and anonymous_namespace{ClipOverflowButtonHandle.cpp}::SelectInterval().

Here is the caller graph for this function:

◆ GetPlayStartTime()

double WaveTrack::Interval::GetPlayStartTime ( ) const

Definition at line 426 of file WaveTrack.cpp.

427{
428 //TODO wide wave tracks: assuming that all 'narrow' clips share common beginning
429 return mpClip->GetPlayStartTime();
430}

Referenced by WaveClipUtilities::SelectClip(), and anonymous_namespace{ClipOverflowButtonHandle.cpp}::SelectInterval().

Here is the caller graph for this function:

◆ GetRenderedCopy()

WaveTrack::IntervalHolder WaveTrack::Interval::GetRenderedCopy ( const std::function< void(double)> &  reportProgress,
const ChannelGroup group,
const SampleBlockFactoryPtr factory,
sampleFormat  format 
)
Postcondition
result: result->GetStretchRatio() == 1

Definition at line 293 of file WaveTrack.cpp.

296{
297 if (!HasPitchOrSpeed())
298 return std::make_shared<Interval>(group, mpClip, mpClip1);
299
300 const auto dst = std::make_shared<Interval>(
301 group, NChannels(), factory, mpClip->GetRate(), format);
302
303 const auto originalPlayStartTime = GetPlayStartTime();
304 const auto originalPlayEndTime = GetPlayEndTime();
305 const auto stretchRatio = GetStretchRatio();
306
307 auto success = false;
308 Finally Do { [&] {
309 if (!success)
310 {
311 TrimLeftTo(originalPlayStartTime);
312 TrimRightTo(originalPlayEndTime);
313 }
314 } };
315
316 // Leave 1 second of raw, unstretched audio before and after visible region
317 // to give the algorithm a chance to be in a steady state when reaching the
318 // play boundaries.
319 const auto tmpPlayStartTime =
320 std::max(GetSequenceStartTime(), originalPlayStartTime - stretchRatio);
321 const auto tmpPlayEndTime =
322 std::min(GetSequenceEndTime(), originalPlayEndTime + stretchRatio);
323 TrimLeftTo(tmpPlayStartTime);
324 TrimRightTo(tmpPlayEndTime);
325
326 WideClip wideClip { mpClip, mpClip1 };
327
328 constexpr auto sourceDurationToDiscard = 0.;
329 constexpr auto blockSize = 1024;
330 const auto numChannels = NChannels();
331 ClipTimeAndPitchSource stretcherSource { wideClip, sourceDurationToDiscard,
334 params.timeRatio = stretchRatio;
335 params.pitchRatio = std::pow(2., mpClip->GetCentShift() / 1200.);
336 params.preserveFormants =
337 mpClip->GetPitchAndSpeedPreset() == PitchAndSpeedPreset::OptimizeForVoice;
338 StaffPadTimeAndPitch stretcher { mpClip->GetRate(), numChannels,
339 stretcherSource, std::move(params) };
340
341 // Post-rendering sample counts, i.e., stretched units
342 const auto totalNumOutSamples =
343 sampleCount { wideClip.GetVisibleSampleCount().as_double() *
344 stretchRatio };
345
346 sampleCount numOutSamples { 0 };
347 AudioContainer container(blockSize, numChannels);
348
349 while (numOutSamples < totalNumOutSamples)
350 {
351 const auto numSamplesToGet =
352 limitSampleBufferSize(blockSize, totalNumOutSamples - numOutSamples);
353 stretcher.GetSamples(container.Get(), numSamplesToGet);
354 constSamplePtr data[2];
355 data[0] = reinterpret_cast<constSamplePtr>(container.Get()[0]);
356 if (NChannels() == 2)
357 data[1] = reinterpret_cast<constSamplePtr>(container.Get()[1]);
358 dst->Append(data, floatSample, numSamplesToGet);
359 numOutSamples += numSamplesToGet;
360 if (reportProgress)
361 reportProgress(
362 numOutSamples.as_double() / totalNumOutSamples.as_double());
363 }
364 dst->Flush();
365
366 // Now we're all like `this` except unstretched. We can clear leading and
367 // trailing, stretching transient parts.
368 dst->SetPlayStartTime(tmpPlayStartTime);
369 dst->ClearLeft(originalPlayStartTime);
370 dst->ClearRight(originalPlayEndTime);
371
372 // We don't preserve cutlines but the relevant part of the envelope.
373 Envelope dstEnvelope = GetEnvelope();
374 const auto samplePeriod = 1. / mpClip->GetRate();
375 dstEnvelope.CollapseRegion(
376 originalPlayEndTime, GetSequenceEndTime() + samplePeriod, samplePeriod);
377 dstEnvelope.CollapseRegion(0, originalPlayStartTime, samplePeriod);
378 dstEnvelope.SetOffset(originalPlayStartTime);
379 dst->SetEnvelope(dstEnvelope);
380
381 success = true;
382
383 assert(!dst->HasPitchOrSpeed());
384 return dst;
385}
int min(int a, int b)
EffectDistortionSettings params
Definition: Distortion.cpp:77
size_t limitSampleBufferSize(size_t bufferSize, sampleCount limit)
Definition: SampleCount.cpp:22
const char * constSamplePtr
Definition: SampleFormat.h:58
Piecewise linear or piecewise exponential function from double to double.
Definition: Envelope.h:72
void SetOffset(double newOffset)
Definition: Envelope.cpp:787
void CollapseRegion(double t0, double t1, double sampleDur)
Definition: Envelope.cpp:378
double GetPlayStartTime() const
Definition: WaveTrack.cpp:426
double GetPlayEndTime() const
Definition: WaveTrack.cpp:432
double GetStretchRatio() const
Definition: WaveTrack.cpp:451
void TrimRightTo(double t)
Definition: WaveTrack.cpp:225
double GetSequenceStartTime() const
Definition: WaveTrack.cpp:482
const Envelope & GetEnvelope() const
Definition: WaveTrack.cpp:514
bool HasPitchOrSpeed() const
Definition: WaveTrack.cpp:387
double GetSequenceEndTime() const
Definition: WaveTrack.cpp:492
void TrimLeftTo(double t)
Definition: WaveTrack.cpp:219
Positions or offsets within audio files need a wide type.
Definition: SampleCount.h:19
double as_double() const
Definition: SampleCount.h:46
"finally" as in The C++ Programming Language, 4th ed., p. 358 Useful for defining ad-hoc RAII actions...
Definition: MemoryX.h:174

References sampleCount::as_double(), Envelope::CollapseRegion(), factory, floatSample, anonymous_namespace{ExportPCM.cpp}::format, forward, AudioContainer::Get(), WaveTrackUtilities::HasPitchOrSpeed(), limitSampleBufferSize(), min(), WaveTrack::NChannels(), OptimizeForVoice, params, Envelope::SetOffset(), anonymous_namespace{WaveClipAdjustBorderHandle.cpp}::TrimLeftTo(), and anonymous_namespace{WaveClipAdjustBorderHandle.cpp}::TrimRightTo().

Here is the call graph for this function:

◆ GetSequenceEndTime()

double WaveTrack::Interval::GetSequenceEndTime ( ) const

Definition at line 492 of file WaveTrack.cpp.

493{
494 return mpClip->GetSequenceEndTime();
495}

Referenced by anonymous_namespace{WaveClipAdjustBorderHandle.cpp}::GetLeftAdjustLimit(), and anonymous_namespace{WaveClipAdjustBorderHandle.cpp}::GetRightAdjustLimit().

Here is the caller graph for this function:

◆ GetSequenceStartTime()

double WaveTrack::Interval::GetSequenceStartTime ( ) const

Definition at line 482 of file WaveTrack.cpp.

483{
484 return mpClip->GetSequenceStartTime();
485}

Referenced by anonymous_namespace{WaveClipAdjustBorderHandle.cpp}::GetLeftAdjustLimit(), and anonymous_namespace{WaveClipAdjustBorderHandle.cpp}::GetRightAdjustLimit().

Here is the caller graph for this function:

◆ GetStretchRatio()

double WaveTrack::Interval::GetStretchRatio ( ) const

Definition at line 451 of file WaveTrack.cpp.

452{
453 //TODO wide wave tracks: assuming that all 'narrow' clips share common stretch ratio
454 return mpClip->GetStretchRatio();
455}

Referenced by WaveTrackUtilities::SetClipStretchRatio().

Here is the caller graph for this function:

◆ GetTrimLeft()

double WaveTrack::Interval::GetTrimLeft ( ) const

Definition at line 497 of file WaveTrack.cpp.

498{
499 //TODO wide wave tracks: assuming that all 'narrow' clips share common trims
500 return mpClip->GetTrimLeft();
501}

◆ GetTrimRight()

double WaveTrack::Interval::GetTrimRight ( ) const

Definition at line 503 of file WaveTrack.cpp.

504{
505 //TODO wide wave tracks: assuming that all 'narrow' clips share common trims
506 return mpClip->GetTrimRight();
507}

◆ HasEqualPitchAndSpeed()

bool WaveTrack::Interval::HasEqualPitchAndSpeed ( const Interval other) const

Definition at line 393 of file WaveTrack.cpp.

394{
395 // Assuming equal pitch and speed on both channels
396 return GetClip(0u)->HasEqualPitchAndSpeed(*other.GetClip(0u));
397}

References GetClip().

Here is the call graph for this function:

◆ HasPitchOrSpeed()

bool WaveTrack::Interval::HasPitchOrSpeed ( ) const

Definition at line 387 of file WaveTrack.cpp.

388{
389 // Assuming equal pitch and speed on both channels
390 return GetClip(0u)->HasPitchOrSpeed();
391}

◆ IntersectsPlayRegion()

bool WaveTrack::Interval::IntersectsPlayRegion ( double  t0,
double  t1 
) const

Definition at line 439 of file WaveTrack.cpp.

440{
441 // TODO wide wave tracks: assuming that all 'narrow' clips share common
442 // boundaries
443 return mpClip->IntersectsPlayRegion(t0, t1);
444}

◆ IsPlaceholder()

bool WaveTrack::Interval::IsPlaceholder ( ) const

Definition at line 509 of file WaveTrack.cpp.

510{
511 return mpClip->GetIsPlaceholder();
512}

◆ SamplesToTime()

double WaveTrack::Interval::SamplesToTime ( sampleCount  s) const

Definition at line 477 of file WaveTrack.cpp.

478{
479 return mpClip->SamplesToTime(s);
480}

◆ SetCentShift()

bool WaveTrack::Interval::SetCentShift ( int  cents)

Definition at line 279 of file WaveTrack.cpp.

280{
281 for (unsigned channel = 0; channel < NChannels(); ++channel)
282 if (!GetClip(channel)->SetCentShift(cents))
283 return false;
284 return true;
285}

References WaveTrack::NChannels().

Here is the call graph for this function:

◆ SetColorIndex()

void WaveTrack::Interval::SetColorIndex ( int  index)

Definition at line 410 of file WaveTrack.cpp.

411{
412 ForEachClip([&](auto& clip) { clip.SetColourIndex(index); });
413}

◆ SetEnvelope()

void WaveTrack::Interval::SetEnvelope ( const Envelope envelope)
private

Definition at line 519 of file WaveTrack.cpp.

520{
521 mpClip->SetEnvelope(std::make_unique<Envelope>(envelope));
522}

◆ SetName()

void WaveTrack::Interval::SetName ( const wxString &  name)

Definition at line 399 of file WaveTrack.cpp.

400{
401 ForEachClip([&](auto& clip) { clip.SetName(name); });
402}
const TranslatableString name
Definition: Distortion.cpp:76

References name.

◆ SetPitchAndSpeedPreset()

void WaveTrack::Interval::SetPitchAndSpeedPreset ( PitchAndSpeedPreset  preset)

Definition at line 287 of file WaveTrack.cpp.

288{
289 for (unsigned channel = 0; channel < NChannels(); ++channel)
290 GetClip(channel)->SetPitchAndSpeedPreset(preset);
291}
EffectReverbSettings preset
Definition: Reverb.cpp:44

References WaveTrack::NChannels(), and preset.

Here is the call graph for this function:

◆ SetPlayStartTime()

void WaveTrack::Interval::SetPlayStartTime ( double  time)

Definition at line 421 of file WaveTrack.cpp.

422{
423 ForEachClip([&](auto& clip) { clip.SetPlayStartTime(time); });
424}

◆ SetRawAudioTempo()

void WaveTrack::Interval::SetRawAudioTempo ( double  tempo)

Definition at line 467 of file WaveTrack.cpp.

468{
469 ForEachClip([&](auto& clip) { clip.SetRawAudioTempo(tempo); });
470}

◆ SetSequenceStartTime()

void WaveTrack::Interval::SetSequenceStartTime ( double  t)

Definition at line 487 of file WaveTrack.cpp.

488{
489 ForEachClip([t](auto& clip) { clip.SetSequenceStartTime(t); });
490}

◆ SetTrimLeft()

void WaveTrack::Interval::SetTrimLeft ( double  t)

Definition at line 237 of file WaveTrack.cpp.

238{
239 for(unsigned channel = 0; channel < NChannels(); ++channel)
240 GetClip(channel)->SetTrimLeft(t);
241}

References WaveTrack::NChannels().

Here is the call graph for this function:

◆ SetTrimRight()

void WaveTrack::Interval::SetTrimRight ( double  t)

Definition at line 243 of file WaveTrack.cpp.

244{
245 for(unsigned channel = 0; channel < NChannels(); ++channel)
246 GetClip(channel)->SetTrimRight(t);
247}

References WaveTrack::NChannels().

Here is the call graph for this function:

◆ StretchBy()

void WaveTrack::Interval::StretchBy ( double  ratio)

Definition at line 273 of file WaveTrack.cpp.

274{
275 for (unsigned channel = 0; channel < NChannels(); ++channel)
276 GetClip(channel)->StretchBy(ratio);
277}

References WaveTrack::NChannels().

Here is the call graph for this function:

◆ StretchLeftTo()

void WaveTrack::Interval::StretchLeftTo ( double  t)

Definition at line 261 of file WaveTrack.cpp.

262{
263 for(unsigned channel = 0; channel < NChannels(); ++channel)
264 GetClip(channel)->StretchLeftTo(t);
265}

References WaveTrack::NChannels().

Referenced by anonymous_namespace{WaveClipAdjustBorderHandle.cpp}::StretchLeftTo().

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

◆ StretchRightTo()

void WaveTrack::Interval::StretchRightTo ( double  t)

Definition at line 267 of file WaveTrack.cpp.

268{
269 for(unsigned channel = 0; channel < NChannels(); ++channel)
270 GetClip(channel)->StretchRightTo(t);
271}

References WaveTrack::NChannels().

Referenced by WaveTrackUtilities::ExpandClipTillNextOne(), WaveTrackUtilities::SetClipStretchRatio(), and anonymous_namespace{WaveClipAdjustBorderHandle.cpp}::StretchRightTo().

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

◆ TimeToSamples()

sampleCount WaveTrack::Interval::TimeToSamples ( double  time) const

Definition at line 472 of file WaveTrack.cpp.

473{
474 return mpClip->TimeToSamples(time);
475}

◆ TrimLeftTo()

void WaveTrack::Interval::TrimLeftTo ( double  t)

Definition at line 219 of file WaveTrack.cpp.

220{
221 for(unsigned channel = 0; channel < NChannels(); ++channel)
222 GetClip(channel)->TrimLeftTo(t);
223}

References WaveTrack::NChannels().

Referenced by anonymous_namespace{WaveClipAdjustBorderHandle.cpp}::TrimLeftTo().

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

◆ TrimQuarternotesFromRight()

void WaveTrack::Interval::TrimQuarternotesFromRight ( double  numQuarternotes)

Definition at line 231 of file WaveTrack.cpp.

232{
234 [quarters](auto& clip) { clip.TrimQuarternotesFromRight(quarters); });
235}

◆ TrimRightTo()

void WaveTrack::Interval::TrimRightTo ( double  t)

Definition at line 225 of file WaveTrack.cpp.

226{
227 for(unsigned channel = 0; channel < NChannels(); ++channel)
228 GetClip(channel)->TrimRightTo(t);
229}

References WaveTrack::NChannels().

Referenced by anonymous_namespace{WaveClipAdjustBorderHandle.cpp}::TrimRightTo().

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

◆ WithinPlayRegion()

bool WaveTrack::Interval::WithinPlayRegion ( double  t) const

Definition at line 446 of file WaveTrack.cpp.

447{
448 return mpClip->WithinPlayRegion(t);
449}

Member Data Documentation

◆ mpClip

const std::shared_ptr<WaveClip> WaveTrack::Interval::mpClip
private

Definition at line 1023 of file WaveTrack.h.

◆ mpClip1

const std::shared_ptr<WaveClip> WaveTrack::Interval::mpClip1
private

TODO wide wave tracks: eliminate this.

Definition at line 1025 of file WaveTrack.h.


The documentation for this class was generated from the following files: