Audacity 3.2.0
Public Member Functions | Private Attributes | List of all members
AnalyzedWaveClip Class Reference

#include <AnalyzedWaveClip.h>

Inheritance diagram for AnalyzedWaveClip:
[legend]
Collaboration diagram for AnalyzedWaveClip:
[legend]

Public Member Functions

 AnalyzedWaveClip (std::shared_ptr< ClipMirAudioReader > reader, std::optional< MIR::ProjectSyncInfo > syncInfo)
 
const std::optional< MIR::ProjectSyncInfo > & GetSyncInfo () const override
 
void SetRawAudioTempo (double tempo) override
 
void Synchronize () override
 
- Public Member Functions inherited from MIR::AnalyzedAudioClip
virtual const std::optional< MIR::ProjectSyncInfo > & GetSyncInfo () const =0
 
virtual void SetRawAudioTempo (double tempo)=0
 
virtual void Synchronize ()=0
 
virtual ~AnalyzedAudioClip ()=default
 

Private Attributes

const std::shared_ptr< ClipMirAudioReadermReader
 
const std::optional< MIR::ProjectSyncInfomSyncInfo
 

Detailed Description

Definition at line 18 of file AnalyzedWaveClip.h.

Constructor & Destructor Documentation

◆ AnalyzedWaveClip()

AnalyzedWaveClip::AnalyzedWaveClip ( std::shared_ptr< ClipMirAudioReader reader,
std::optional< MIR::ProjectSyncInfo syncInfo 
)

Audacity: A Digital Audio Editor

AnalyzedWaveClip.cpp

Matthieu Hodgkinson

Definition at line 16 of file AnalyzedWaveClip.cpp.

19 : mReader { std::move(reader) }
20 , mSyncInfo { syncInfo }
21{
22 assert(mReader);
23}
const std::shared_ptr< ClipMirAudioReader > mReader
const std::optional< MIR::ProjectSyncInfo > mSyncInfo

References mReader.

Member Function Documentation

◆ GetSyncInfo()

const std::optional< MIR::ProjectSyncInfo > & AnalyzedWaveClip::GetSyncInfo ( ) const
overridevirtual

Implements MIR::AnalyzedAudioClip.

Definition at line 25 of file AnalyzedWaveClip.cpp.

26{
27 return mSyncInfo;
28}

References mSyncInfo.

◆ SetRawAudioTempo()

void AnalyzedWaveClip::SetRawAudioTempo ( double  tempo)
overridevirtual

Implements MIR::AnalyzedAudioClip.

Definition at line 30 of file AnalyzedWaveClip.cpp.

31{
32 if (mReader)
33 mReader->clip->SetRawAudioTempo(tempo);
34}

References mReader.

◆ Synchronize()

void AnalyzedWaveClip::Synchronize ( )
overridevirtual

Implements MIR::AnalyzedAudioClip.

Definition at line 36 of file AnalyzedWaveClip.cpp.

37{
38 if (!mReader || !mSyncInfo)
39 return;
40 auto& clip = *mReader->clip;
41 clip.SetRawAudioTempo(mSyncInfo->rawAudioTempo);
42 clip.TrimQuarternotesFromRight(mSyncInfo->excessDurationInQuarternotes);
43 clip.StretchBy(mSyncInfo->stretchMinimizingPowOfTwo);
44}

References mReader, and mSyncInfo.

Member Data Documentation

◆ mReader

const std::shared_ptr<ClipMirAudioReader> AnalyzedWaveClip::mReader
private

Definition at line 30 of file AnalyzedWaveClip.h.

Referenced by AnalyzedWaveClip(), SetRawAudioTempo(), and Synchronize().

◆ mSyncInfo

const std::optional<MIR::ProjectSyncInfo> AnalyzedWaveClip::mSyncInfo
private

Definition at line 31 of file AnalyzedWaveClip.h.

Referenced by GetSyncInfo(), and Synchronize().


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