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
 
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 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:1023
const std::shared_ptr< WaveClip > mpClip
Definition: WaveTrack.h:1021

◆ 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}
Interval(const ChannelGroup &group, const std::shared_ptr< WaveClip > &pClip, const std::shared_ptr< WaveClip > &pClip1)
Definition: WaveTrack.cpp:184
static RegisteredToolbarFactory factory

◆ ~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:1009
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 974 of file WaveTrack.h.

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

◆ Channels() [2/2]

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

Definition at line 977 of file WaveTrack.h.

977 { return
978 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 522 of file WaveTrack.cpp.

523{
524 if (iChannel < NChannels()) {
525 // TODO wide wave tracks: there will be only one, wide clip
526 const auto pClip = (iChannel == 0 ? mpClip : mpClip1);
527 return std::make_shared<WaveChannelInterval>(*mpClip,
528 *pClip, iChannel);
529 }
530 return {};
531}

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:511

◆ ForEachClip()

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

Definition at line 511 of file WaveTrack.cpp.

512{
513 for(unsigned channel = 0,
514 channelCount = NChannels();
515 channel < channelCount; ++channel)
516 {
517 op(*GetClip(channel));
518 }
519}

References WaveTrack::NChannels().

Here is the call graph for this function:

◆ GetCentShift()

int WaveTrack::Interval::GetCentShift ( ) const

Definition at line 449 of file WaveTrack.cpp.

450{
451 return mpClip->GetCentShift();
452}

◆ GetChannel() [1/2]

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

Definition at line 969 of file WaveTrack.h.

969 { return
970 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 971 of file WaveTrack.h.

971 { return
972 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 1011 of file WaveTrack.h.

1012 { 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

Definition at line 1009 of file WaveTrack.h.

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

References anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel.

Referenced by WaveTrackShifter::AdjustFit(), WaveTrackShifter::AdjustT0(), WaveTrackShifter::Detach(), SpectrumView::DoDraw(), WaveformView::DoDraw(), WaveTrackShifter::DoHorizontalOffset(), HasEqualPitchAndSpeed(), WaveTrackShifter::SelectInterval(), and WaveChannelView::WideClipContains().

Here is the caller graph for this function:

◆ GetColorIndex()

int WaveTrack::Interval::GetColorIndex ( ) const

Definition at line 407 of file WaveTrack.cpp.

408{
409 //TODO wide wave tracks: assuming that all 'narrow' clips share common color index
410 return mpClip->GetColourIndex();
411}

◆ GetEnvelope()

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

Definition at line 501 of file WaveTrack.cpp.

502{
503 return *mpClip->GetEnvelope();
504}

◆ GetName()

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

Definition at line 396 of file WaveTrack.cpp.

397{
398 //TODO wide wave tracks: assuming that all 'narrow' clips share common name
399 return mpClip->GetName();
400}

◆ GetPlayEndTime()

double WaveTrack::Interval::GetPlayEndTime ( ) const

Definition at line 424 of file WaveTrack.cpp.

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

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

Here is the caller graph for this function:

◆ GetPlayStartTime()

double WaveTrack::Interval::GetPlayStartTime ( ) const

Definition at line 418 of file WaveTrack.cpp.

419{
420 //TODO wide wave tracks: assuming that all 'narrow' clips share common beginning
421 return mpClip->GetPlayStartTime();
422}

Referenced by anonymous_namespace{ClipOverflowButtonHandle.cpp}::SelectInterval(), and anonymous_namespace{WaveTrackAffordanceControls.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 287 of file WaveTrack.cpp.

290{
291 if (!HasPitchOrSpeed())
292 return std::make_shared<Interval>(group, mpClip, mpClip1);
293
294 const auto dst = std::make_shared<Interval>(
295 group, NChannels(), factory, mpClip->GetRate(), format);
296
297 const auto originalPlayStartTime = GetPlayStartTime();
298 const auto originalPlayEndTime = GetPlayEndTime();
299 const auto stretchRatio = GetStretchRatio();
300
301 auto success = false;
302 Finally Do { [&] {
303 if (!success)
304 {
305 TrimLeftTo(originalPlayStartTime);
306 TrimRightTo(originalPlayEndTime);
307 }
308 } };
309
310 // Leave 1 second of raw, unstretched audio before and after visible region
311 // to give the algorithm a chance to be in a steady state when reaching the
312 // play boundaries.
313 const auto tmpPlayStartTime =
314 std::max(GetSequenceStartTime(), originalPlayStartTime - stretchRatio);
315 const auto tmpPlayEndTime =
316 std::min(GetSequenceEndTime(), originalPlayEndTime + stretchRatio);
317 TrimLeftTo(tmpPlayStartTime);
318 TrimRightTo(tmpPlayEndTime);
319
320 WideClip wideClip { mpClip, mpClip1 };
321
322 constexpr auto sourceDurationToDiscard = 0.;
323 constexpr auto blockSize = 1024;
324 const auto numChannels = NChannels();
325 ClipTimeAndPitchSource stretcherSource { wideClip, sourceDurationToDiscard,
328 params.timeRatio = stretchRatio;
329 params.pitchRatio = std::pow(2., mpClip->GetCentShift() / 1200.);
330 StaffPadTimeAndPitch stretcher { mpClip->GetRate(), numChannels,
331 stretcherSource, std::move(params) };
332
333 // Post-rendering sample counts, i.e., stretched units
334 const auto totalNumOutSamples =
335 sampleCount { wideClip.GetVisibleSampleCount().as_double() *
336 stretchRatio };
337
338 sampleCount numOutSamples { 0 };
339 AudioContainer container(blockSize, numChannels);
340
341 while (numOutSamples < totalNumOutSamples)
342 {
343 const auto numSamplesToGet =
344 limitSampleBufferSize(blockSize, totalNumOutSamples - numOutSamples);
345 stretcher.GetSamples(container.Get(), numSamplesToGet);
346 constSamplePtr data[2];
347 data[0] = reinterpret_cast<constSamplePtr>(container.Get()[0]);
348 if (NChannels() == 2)
349 data[1] = reinterpret_cast<constSamplePtr>(container.Get()[1]);
350 dst->Append(data, floatSample, numSamplesToGet);
351 numOutSamples += numSamplesToGet;
352 if (reportProgress)
353 reportProgress(
354 numOutSamples.as_double() / totalNumOutSamples.as_double());
355 }
356 dst->Flush();
357
358 // Now we're all like `this` except unstretched. We can clear leading and
359 // trailing, stretching transient parts.
360 dst->SetPlayStartTime(tmpPlayStartTime);
361 dst->ClearLeft(originalPlayStartTime);
362 dst->ClearRight(originalPlayEndTime);
363
364 // We don't preserve cutlines but the relevant part of the envelope.
365 Envelope dstEnvelope = GetEnvelope();
366 const auto samplePeriod = 1. / mpClip->GetRate();
367 dstEnvelope.CollapseRegion(
368 originalPlayEndTime, GetSequenceEndTime() + samplePeriod, samplePeriod);
369 dstEnvelope.CollapseRegion(0, originalPlayStartTime, samplePeriod);
370 dstEnvelope.SetOffset(originalPlayStartTime);
371 dst->SetEnvelope(dstEnvelope);
372
373 success = true;
374
375 assert(!dst->HasPitchOrSpeed());
376 return dst;
377}
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:418
double GetPlayEndTime() const
Definition: WaveTrack.cpp:424
double GetStretchRatio() const
Definition: WaveTrack.cpp:443
void TrimRightTo(double t)
Definition: WaveTrack.cpp:225
double GetSequenceStartTime() const
Definition: WaveTrack.cpp:469
const Envelope & GetEnvelope() const
Definition: WaveTrack.cpp:501
bool HasPitchOrSpeed() const
Definition: WaveTrack.cpp:379
double GetSequenceEndTime() const
Definition: WaveTrack.cpp:479
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:172

References sampleCount::as_double(), Envelope::CollapseRegion(), cloud::factory, floatSample, anonymous_namespace{ExportPCM.cpp}::format, forward, AudioContainer::Get(), WaveTrackUtilities::HasPitchOrSpeed(), limitSampleBufferSize(), min(), WaveTrack::NChannels(), 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 479 of file WaveTrack.cpp.

480{
481 return mpClip->GetSequenceEndTime();
482}

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 469 of file WaveTrack.cpp.

470{
471 return mpClip->GetSequenceStartTime();
472}

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 443 of file WaveTrack.cpp.

444{
445 //TODO wide wave tracks: assuming that all 'narrow' clips share common stretch ratio
446 return mpClip->GetStretchRatio();
447}

◆ GetTrimLeft()

double WaveTrack::Interval::GetTrimLeft ( ) const

Definition at line 484 of file WaveTrack.cpp.

485{
486 //TODO wide wave tracks: assuming that all 'narrow' clips share common trims
487 return mpClip->GetTrimLeft();
488}

◆ GetTrimRight()

double WaveTrack::Interval::GetTrimRight ( ) const

Definition at line 490 of file WaveTrack.cpp.

491{
492 //TODO wide wave tracks: assuming that all 'narrow' clips share common trims
493 return mpClip->GetTrimRight();
494}

◆ HasEqualPitchAndSpeed()

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

Definition at line 385 of file WaveTrack.cpp.

386{
387 // Assuming equal pitch and speed on both channels
388 return GetClip(0u)->HasEqualPitchAndSpeed(*other.GetClip(0u));
389}

References GetClip().

Here is the call graph for this function:

◆ HasPitchOrSpeed()

bool WaveTrack::Interval::HasPitchOrSpeed ( ) const

Definition at line 379 of file WaveTrack.cpp.

380{
381 // Assuming equal pitch and speed on both channels
382 return GetClip(0u)->HasPitchOrSpeed();
383}

◆ IntersectsPlayRegion()

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

Definition at line 431 of file WaveTrack.cpp.

432{
433 // TODO wide wave tracks: assuming that all 'narrow' clips share common
434 // boundaries
435 return mpClip->IntersectsPlayRegion(t0, t1);
436}

◆ IsPlaceholder()

bool WaveTrack::Interval::IsPlaceholder ( ) const

Definition at line 496 of file WaveTrack.cpp.

497{
498 return mpClip->GetIsPlaceholder();
499}

◆ SamplesToTime()

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

Definition at line 464 of file WaveTrack.cpp.

465{
466 return mpClip->SamplesToTime(s);
467}

◆ 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().

Referenced by PitchAndSpeedDialog::SetSemitoneShift().

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

◆ SetColorIndex()

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

Definition at line 402 of file WaveTrack.cpp.

403{
404 ForEachClip([&](auto& clip) { clip.SetColourIndex(index); });
405}

◆ SetEnvelope()

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

Definition at line 506 of file WaveTrack.cpp.

507{
508 mpClip->SetEnvelope(std::make_unique<Envelope>(envelope));
509}

◆ SetName()

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

Definition at line 391 of file WaveTrack.cpp.

392{
393 ForEachClip([&](auto& clip) { clip.SetName(name); });
394}
const TranslatableString name
Definition: Distortion.cpp:76

References name.

◆ SetPlayStartTime()

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

Definition at line 413 of file WaveTrack.cpp.

414{
415 ForEachClip([&](auto& clip) { clip.SetPlayStartTime(time); });
416}

◆ SetRawAudioTempo()

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

Definition at line 454 of file WaveTrack.cpp.

455{
456 ForEachClip([&](auto& clip) { clip.SetRawAudioTempo(tempo); });
457}

◆ SetSequenceStartTime()

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

Definition at line 474 of file WaveTrack.cpp.

475{
476 ForEachClip([t](auto& clip) { clip.SetSequenceStartTime(t); });
477}

◆ 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 PitchAndSpeedDialog::SetClipSpeedFromDialog(), 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 459 of file WaveTrack.cpp.

460{
461 return mpClip->TimeToSamples(time);
462}

◆ 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 438 of file WaveTrack.cpp.

439{
440 return mpClip->WithinPlayRegion(t);
441}

Member Data Documentation

◆ mpClip

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

Definition at line 1021 of file WaveTrack.h.

◆ mpClip1

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

TODO wide wave tracks: eliminate this.

Definition at line 1023 of file WaveTrack.h.


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