mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-02 17:09:26 +02:00
Remove Effect::mWarper, and stack-allocate warpers instead
This commit is contained in:
parent
b9e4aa01eb
commit
08b99c533b
@ -810,7 +810,7 @@ bool WaveTrack::ClearAndPaste(double t0, // Start of time to clear
|
|||||||
const Track *src, // What to paste
|
const Track *src, // What to paste
|
||||||
bool preserve, // Whether to reinsert splits/cuts
|
bool preserve, // Whether to reinsert splits/cuts
|
||||||
bool merge, // Whether to remove 'extra' splits
|
bool merge, // Whether to remove 'extra' splits
|
||||||
TimeWarper *effectWarper // How does time change
|
const TimeWarper *effectWarper // How does time change
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
double dur = wxMin(t1 - t0, src->GetEndTime());
|
double dur = wxMin(t1 - t0, src->GetEndTime());
|
||||||
@ -824,12 +824,7 @@ bool WaveTrack::ClearAndPaste(double t0, // Start of time to clear
|
|||||||
|
|
||||||
// If provided time warper was NULL, use a default one that does nothing
|
// If provided time warper was NULL, use a default one that does nothing
|
||||||
IdentityTimeWarper localWarper;
|
IdentityTimeWarper localWarper;
|
||||||
TimeWarper *warper = NULL;
|
const TimeWarper *warper = (effectWarper ? effectWarper : &localWarper);
|
||||||
if (effectWarper != NULL) {
|
|
||||||
warper = effectWarper;
|
|
||||||
} else {
|
|
||||||
warper = &localWarper;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Align to a sample
|
// Align to a sample
|
||||||
t0 = LongSamplesToTime(TimeToLongSamples(t0));
|
t0 = LongSamplesToTime(TimeToLongSamples(t0));
|
||||||
|
@ -175,7 +175,7 @@ class AUDACITY_DLL_API WaveTrack final : public Track {
|
|||||||
const Track *src,
|
const Track *src,
|
||||||
bool preserve = true,
|
bool preserve = true,
|
||||||
bool merge = true,
|
bool merge = true,
|
||||||
TimeWarper *effectWarper = NULL) /* not override */;
|
const TimeWarper *effectWarper = NULL) /* not override */;
|
||||||
|
|
||||||
bool Silence(double t0, double t1) override;
|
bool Silence(double t0, double t1) override;
|
||||||
bool InsertSilence(double t, double len) override;
|
bool InsertSilence(double t, double len) override;
|
||||||
|
@ -194,7 +194,7 @@ bool EffectChangePitch::Process()
|
|||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
mSoundTouch = std::make_unique<SoundTouch>();
|
mSoundTouch = std::make_unique<SoundTouch>();
|
||||||
SetTimeWarper(std::make_unique<IdentityTimeWarper>());
|
IdentityTimeWarper warper;
|
||||||
mSoundTouch->setPitchSemiTones((float)(m_dSemitonesChange));
|
mSoundTouch->setPitchSemiTones((float)(m_dSemitonesChange));
|
||||||
#ifdef USE_MIDI
|
#ifdef USE_MIDI
|
||||||
// Pitch shifting note tracks is currently only supported by SoundTouchEffect
|
// Pitch shifting note tracks is currently only supported by SoundTouchEffect
|
||||||
@ -209,7 +209,7 @@ bool EffectChangePitch::Process()
|
|||||||
// eliminate the next line:
|
// eliminate the next line:
|
||||||
mSemitones = m_dSemitonesChange;
|
mSemitones = m_dSemitonesChange;
|
||||||
#endif
|
#endif
|
||||||
return EffectSoundTouch::Process();
|
return EffectSoundTouch::ProcessWithTimeWarper(warper);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -455,10 +455,10 @@ bool EffectChangeSpeed::TransferDataFromWindow()
|
|||||||
// the region are shifted along according to how the region size changed.
|
// the region are shifted along according to how the region size changed.
|
||||||
bool EffectChangeSpeed::ProcessLabelTrack(LabelTrack *lt)
|
bool EffectChangeSpeed::ProcessLabelTrack(LabelTrack *lt)
|
||||||
{
|
{
|
||||||
SetTimeWarper(std::make_unique<RegionTimeWarper>(mT0, mT1,
|
RegionTimeWarper warper { mT0, mT1,
|
||||||
std::make_unique<LinearTimeWarper>(mT0, mT0,
|
std::make_unique<LinearTimeWarper>(mT0, mT0,
|
||||||
mT1, mT0 + (mT1-mT0)*mFactor)));
|
mT1, mT0 + (mT1-mT0)*mFactor) };
|
||||||
lt->WarpLabels(*GetTimeWarper());
|
lt->WarpLabels(warper);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -542,8 +542,9 @@ bool EffectChangeSpeed::ProcessOne(WaveTrack * track,
|
|||||||
double newLength = outputTrack->GetEndTime();
|
double newLength = outputTrack->GetEndTime();
|
||||||
if (bResult)
|
if (bResult)
|
||||||
{
|
{
|
||||||
SetTimeWarper(std::make_unique<LinearTimeWarper>(mCurT0, mCurT0, mCurT1, mCurT0 + newLength));
|
LinearTimeWarper warper { mCurT0, mCurT0, mCurT1, mCurT0 + newLength };
|
||||||
bResult = track->ClearAndPaste(mCurT0, mCurT1, outputTrack.get(), true, false, GetTimeWarper());
|
bResult = track->ClearAndPaste(
|
||||||
|
mCurT0, mCurT1, outputTrack.get(), true, false, &warper);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newLength > mMaxNewLength)
|
if (newLength > mMaxNewLength)
|
||||||
|
@ -183,9 +183,9 @@ bool EffectChangeTempo::Process()
|
|||||||
mSoundTouch = std::make_unique<SoundTouch>();
|
mSoundTouch = std::make_unique<SoundTouch>();
|
||||||
mSoundTouch->setTempoChange(m_PercentChange);
|
mSoundTouch->setTempoChange(m_PercentChange);
|
||||||
double mT1Dashed = mT0 + (mT1 - mT0)/(m_PercentChange/100.0 + 1.0);
|
double mT1Dashed = mT0 + (mT1 - mT0)/(m_PercentChange/100.0 + 1.0);
|
||||||
SetTimeWarper(std::make_unique<RegionTimeWarper>(mT0, mT1,
|
RegionTimeWarper warper{ mT0, mT1,
|
||||||
std::make_unique<LinearTimeWarper>(mT0, mT0, mT1, mT1Dashed )));
|
std::make_unique<LinearTimeWarper>(mT0, mT0, mT1, mT1Dashed ) };
|
||||||
success = EffectSoundTouch::Process();
|
success = EffectSoundTouch::ProcessWithTimeWarper(warper);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(success)
|
if(success)
|
||||||
|
@ -91,8 +91,6 @@ Effect::Effect()
|
|||||||
|
|
||||||
mClient = NULL;
|
mClient = NULL;
|
||||||
|
|
||||||
mWarper = NULL;
|
|
||||||
|
|
||||||
mTracks = NULL;
|
mTracks = NULL;
|
||||||
mOutputTracksType = Track::None;
|
mOutputTracksType = Track::None;
|
||||||
mT0 = 0.0;
|
mT0 = 0.0;
|
||||||
@ -2036,18 +2034,6 @@ void Effect::GetSamples(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Effect::SetTimeWarper(std::unique_ptr<TimeWarper> &&warper)
|
|
||||||
{
|
|
||||||
wxASSERT(warper);
|
|
||||||
mWarper = std::move(warper);
|
|
||||||
}
|
|
||||||
|
|
||||||
TimeWarper *Effect::GetTimeWarper()
|
|
||||||
{
|
|
||||||
wxASSERT(mWarper);
|
|
||||||
return mWarper.get();
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// private methods
|
// private methods
|
||||||
//
|
//
|
||||||
|
@ -46,7 +46,6 @@ class ShuttleGui;
|
|||||||
class AudacityProject;
|
class AudacityProject;
|
||||||
class LabelTrack;
|
class LabelTrack;
|
||||||
class SelectedRegion;
|
class SelectedRegion;
|
||||||
class TimeWarper;
|
|
||||||
class EffectUIHost;
|
class EffectUIHost;
|
||||||
class Track;
|
class Track;
|
||||||
class TrackList;
|
class TrackList;
|
||||||
@ -330,9 +329,6 @@ protected:
|
|||||||
void GetSamples(
|
void GetSamples(
|
||||||
const WaveTrack *track, sampleCount *start, sampleCount *len);
|
const WaveTrack *track, sampleCount *start, sampleCount *len);
|
||||||
|
|
||||||
void SetTimeWarper(std::unique_ptr<TimeWarper> &&warper);
|
|
||||||
TimeWarper *GetTimeWarper();
|
|
||||||
|
|
||||||
// Previewing linear effect can be optimised by pre-mixing. However this
|
// Previewing linear effect can be optimised by pre-mixing. However this
|
||||||
// should not be used for non-linear effects such as dynamic processors
|
// should not be used for non-linear effects such as dynamic processors
|
||||||
// To allow pre-mixing before Preview, set linearEffectFlag to true.
|
// To allow pre-mixing before Preview, set linearEffectFlag to true.
|
||||||
@ -446,7 +442,6 @@ protected:
|
|||||||
double mF0;
|
double mF0;
|
||||||
double mF1;
|
double mF1;
|
||||||
#endif
|
#endif
|
||||||
std::unique_ptr<TimeWarper> mWarper;
|
|
||||||
wxArrayString mPresetNames;
|
wxArrayString mPresetNames;
|
||||||
wxArrayString mPresetValues;
|
wxArrayString mPresetValues;
|
||||||
int mPass;
|
int mPass;
|
||||||
|
@ -78,9 +78,10 @@ bool Generator::Process()
|
|||||||
else {
|
else {
|
||||||
// Transfer the data from the temporary track to the actual one
|
// Transfer the data from the temporary track to the actual one
|
||||||
tmp->Flush();
|
tmp->Flush();
|
||||||
SetTimeWarper(std::make_unique<StepTimeWarper>(mT0+GetDuration(), GetDuration()-(mT1-mT0)));
|
StepTimeWarper warper{
|
||||||
bGoodResult = track->ClearAndPaste(p->GetSel0(), p->GetSel1(), &*tmp, true,
|
mT0+GetDuration(), GetDuration()-(mT1-mT0) };
|
||||||
false, GetTimeWarper());
|
bGoodResult = track->ClearAndPaste(
|
||||||
|
p->GetSel0(), p->GetSel1(), &*tmp, true, false, &warper);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!bGoodResult) {
|
if (!bGoodResult) {
|
||||||
|
@ -187,9 +187,9 @@ std::unique_ptr<TimeWarper> createTimeWarper(double t0, double t1, double durati
|
|||||||
// it are shifted along appropriately.
|
// it are shifted along appropriately.
|
||||||
bool EffectSBSMS::ProcessLabelTrack(LabelTrack *lt)
|
bool EffectSBSMS::ProcessLabelTrack(LabelTrack *lt)
|
||||||
{
|
{
|
||||||
auto warper = createTimeWarper(mT0,mT1,(mT1-mT0)*mTotalStretch,rateStart,rateEnd,rateSlideType);
|
auto warper1 = createTimeWarper(mT0,mT1,(mT1-mT0)*mTotalStretch,rateStart,rateEnd,rateSlideType);
|
||||||
SetTimeWarper(std::make_unique<RegionTimeWarper>(mT0, mT1, std::move(warper)));
|
RegionTimeWarper warper{ mT0, mT1, std::move(warper1) };
|
||||||
lt->WarpLabels(*GetTimeWarper());
|
lt->WarpLabels(warper);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -372,7 +372,6 @@ bool EffectSBSMS::Process()
|
|||||||
maxDuration = duration;
|
maxDuration = duration;
|
||||||
|
|
||||||
auto warper = createTimeWarper(mCurT0,mCurT1,maxDuration,rateStart,rateEnd,rateSlideType);
|
auto warper = createTimeWarper(mCurT0,mCurT1,maxDuration,rateStart,rateEnd,rateSlideType);
|
||||||
SetTimeWarper(std::move(warper));
|
|
||||||
|
|
||||||
rb.outputLeftTrack = mFactory->NewWaveTrack(leftTrack->GetSampleFormat(),
|
rb.outputLeftTrack = mFactory->NewWaveTrack(leftTrack->GetSampleFormat(),
|
||||||
leftTrack->GetRate());
|
leftTrack->GetRate());
|
||||||
@ -419,7 +418,7 @@ bool EffectSBSMS::Process()
|
|||||||
|
|
||||||
bool bResult =
|
bool bResult =
|
||||||
leftTrack->ClearAndPaste(mCurT0, mCurT1, rb.outputLeftTrack.get(),
|
leftTrack->ClearAndPaste(mCurT0, mCurT1, rb.outputLeftTrack.get(),
|
||||||
true, false, GetTimeWarper());
|
true, false, warper.get());
|
||||||
wxASSERT(bResult); // TO DO: Actually handle this.
|
wxASSERT(bResult); // TO DO: Actually handle this.
|
||||||
wxUnusedVar(bResult);
|
wxUnusedVar(bResult);
|
||||||
|
|
||||||
@ -427,7 +426,7 @@ bool EffectSBSMS::Process()
|
|||||||
{
|
{
|
||||||
bResult =
|
bResult =
|
||||||
rightTrack->ClearAndPaste(mCurT0, mCurT1, rb.outputRightTrack.get(),
|
rightTrack->ClearAndPaste(mCurT0, mCurT1, rb.outputRightTrack.get(),
|
||||||
true, false, GetTimeWarper());
|
true, false, warper.get());
|
||||||
wxASSERT(bResult); // TO DO: Actually handle this.
|
wxASSERT(bResult); // TO DO: Actually handle this.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,24 +25,25 @@ effect that uses SoundTouch to do its processing (ChangeTempo
|
|||||||
#include "TimeWarper.h"
|
#include "TimeWarper.h"
|
||||||
#include "../NoteTrack.h"
|
#include "../NoteTrack.h"
|
||||||
|
|
||||||
bool EffectSoundTouch::ProcessLabelTrack(LabelTrack *lt)
|
bool EffectSoundTouch::ProcessLabelTrack(
|
||||||
|
LabelTrack *lt, const TimeWarper &warper)
|
||||||
{
|
{
|
||||||
// SetTimeWarper(std::make_unique<RegionTimeWarper>(mCurT0, mCurT1,
|
// SetTimeWarper(std::make_unique<RegionTimeWarper>(mCurT0, mCurT1,
|
||||||
// std::make_unique<LinearTimeWarper>(mCurT0, mCurT0,
|
// std::make_unique<LinearTimeWarper>(mCurT0, mCurT0,
|
||||||
// mCurT1, mCurT0 + (mCurT1-mCurT0)*mFactor)));
|
// mCurT1, mCurT0 + (mCurT1-mCurT0)*mFactor)));
|
||||||
lt->WarpLabels(*GetTimeWarper());
|
lt->WarpLabels(warper);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_MIDI
|
#ifdef USE_MIDI
|
||||||
bool EffectSoundTouch::ProcessNoteTrack(NoteTrack *nt)
|
bool EffectSoundTouch::ProcessNoteTrack(NoteTrack *nt, const TimeWarper &warper)
|
||||||
{
|
{
|
||||||
nt->WarpAndTransposeNotes(mCurT0, mCurT1, *GetTimeWarper(), mSemitones);
|
nt->WarpAndTransposeNotes(mCurT0, mCurT1, warper, mSemitones);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool EffectSoundTouch::Process()
|
bool EffectSoundTouch::ProcessWithTimeWarper(const TimeWarper &warper)
|
||||||
{
|
{
|
||||||
// Assumes that mSoundTouch has already been initialized
|
// Assumes that mSoundTouch has already been initialized
|
||||||
// by the subclass for subclass-specific parameters. The
|
// by the subclass for subclass-specific parameters. The
|
||||||
@ -51,7 +52,7 @@ bool EffectSoundTouch::Process()
|
|||||||
// Check if this effect will alter the selection length; if so, we need
|
// Check if this effect will alter the selection length; if so, we need
|
||||||
// to operate on sync-lock selected tracks.
|
// to operate on sync-lock selected tracks.
|
||||||
bool mustSync = true;
|
bool mustSync = true;
|
||||||
if (mT1 == GetTimeWarper()->Warp(mT1)) {
|
if (mT1 == warper.Warp(mT1)) {
|
||||||
mustSync = false;
|
mustSync = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -70,7 +71,7 @@ bool EffectSoundTouch::Process()
|
|||||||
if (t->GetKind() == Track::Label &&
|
if (t->GetKind() == Track::Label &&
|
||||||
(t->GetSelected() || (mustSync && t->IsSyncLockSelected())) )
|
(t->GetSelected() || (mustSync && t->IsSyncLockSelected())) )
|
||||||
{
|
{
|
||||||
if (!ProcessLabelTrack(static_cast<LabelTrack*>(t)))
|
if (!ProcessLabelTrack(static_cast<LabelTrack*>(t), warper))
|
||||||
{
|
{
|
||||||
bGoodResult = false;
|
bGoodResult = false;
|
||||||
break;
|
break;
|
||||||
@ -80,7 +81,7 @@ bool EffectSoundTouch::Process()
|
|||||||
else if (t->GetKind() == Track::Note &&
|
else if (t->GetKind() == Track::Note &&
|
||||||
(t->GetSelected() || (mustSync && t->IsSyncLockSelected())))
|
(t->GetSelected() || (mustSync && t->IsSyncLockSelected())))
|
||||||
{
|
{
|
||||||
if (!ProcessNoteTrack(static_cast<NoteTrack*>(t)))
|
if (!ProcessNoteTrack(static_cast<NoteTrack*>(t), warper))
|
||||||
{
|
{
|
||||||
bGoodResult = false;
|
bGoodResult = false;
|
||||||
break;
|
break;
|
||||||
@ -123,7 +124,7 @@ bool EffectSoundTouch::Process()
|
|||||||
mSoundTouch->setChannels(2);
|
mSoundTouch->setChannels(2);
|
||||||
|
|
||||||
//ProcessStereo() (implemented below) processes a stereo track
|
//ProcessStereo() (implemented below) processes a stereo track
|
||||||
if (!ProcessStereo(leftTrack, rightTrack, start, end))
|
if (!ProcessStereo(leftTrack, rightTrack, start, end, warper))
|
||||||
{
|
{
|
||||||
bGoodResult = false;
|
bGoodResult = false;
|
||||||
break;
|
break;
|
||||||
@ -138,7 +139,7 @@ bool EffectSoundTouch::Process()
|
|||||||
mSoundTouch->setChannels(1);
|
mSoundTouch->setChannels(1);
|
||||||
|
|
||||||
//ProcessOne() (implemented below) processes a single track
|
//ProcessOne() (implemented below) processes a single track
|
||||||
if (!ProcessOne(leftTrack, start, end))
|
if (!ProcessOne(leftTrack, start, end, warper))
|
||||||
{
|
{
|
||||||
bGoodResult = false;
|
bGoodResult = false;
|
||||||
break;
|
break;
|
||||||
@ -148,7 +149,7 @@ bool EffectSoundTouch::Process()
|
|||||||
mCurTrackNum++;
|
mCurTrackNum++;
|
||||||
}
|
}
|
||||||
else if (mustSync && t->IsSyncLockSelected()) {
|
else if (mustSync && t->IsSyncLockSelected()) {
|
||||||
t->SyncLockAdjust(mT1, GetTimeWarper()->Warp(mT1));
|
t->SyncLockAdjust(mT1, warper.Warp(mT1));
|
||||||
}
|
}
|
||||||
|
|
||||||
//Iterate to the next track
|
//Iterate to the next track
|
||||||
@ -169,7 +170,8 @@ bool EffectSoundTouch::Process()
|
|||||||
//ProcessOne() takes a track, transforms it to bunch of buffer-blocks,
|
//ProcessOne() takes a track, transforms it to bunch of buffer-blocks,
|
||||||
//and executes ProcessSoundTouch on these blocks
|
//and executes ProcessSoundTouch on these blocks
|
||||||
bool EffectSoundTouch::ProcessOne(WaveTrack *track,
|
bool EffectSoundTouch::ProcessOne(WaveTrack *track,
|
||||||
sampleCount start, sampleCount end)
|
sampleCount start, sampleCount end,
|
||||||
|
const TimeWarper &warper)
|
||||||
{
|
{
|
||||||
mSoundTouch->setSampleRate((unsigned int)(track->GetRate()+0.5));
|
mSoundTouch->setSampleRate((unsigned int)(track->GetRate()+0.5));
|
||||||
|
|
||||||
@ -234,7 +236,7 @@ bool EffectSoundTouch::ProcessOne(WaveTrack *track,
|
|||||||
|
|
||||||
// Take the output track and insert it in place of the original
|
// Take the output track and insert it in place of the original
|
||||||
// sample data
|
// sample data
|
||||||
track->ClearAndPaste(mCurT0, mCurT1, outputTrack.get(), true, false, GetTimeWarper());
|
track->ClearAndPaste(mCurT0, mCurT1, outputTrack.get(), true, false, &warper);
|
||||||
|
|
||||||
double newLength = outputTrack->GetEndTime();
|
double newLength = outputTrack->GetEndTime();
|
||||||
m_maxNewLength = wxMax(m_maxNewLength, newLength);
|
m_maxNewLength = wxMax(m_maxNewLength, newLength);
|
||||||
@ -243,8 +245,9 @@ bool EffectSoundTouch::ProcessOne(WaveTrack *track,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EffectSoundTouch::ProcessStereo(WaveTrack* leftTrack, WaveTrack* rightTrack,
|
bool EffectSoundTouch::ProcessStereo(
|
||||||
sampleCount start, sampleCount end)
|
WaveTrack* leftTrack, WaveTrack* rightTrack,
|
||||||
|
sampleCount start, sampleCount end, const TimeWarper &warper)
|
||||||
{
|
{
|
||||||
mSoundTouch->setSampleRate((unsigned int)(leftTrack->GetRate()+0.5));
|
mSoundTouch->setSampleRate((unsigned int)(leftTrack->GetRate()+0.5));
|
||||||
|
|
||||||
@ -335,8 +338,10 @@ bool EffectSoundTouch::ProcessStereo(WaveTrack* leftTrack, WaveTrack* rightTrack
|
|||||||
|
|
||||||
// Take the output tracks and insert in place of the original
|
// Take the output tracks and insert in place of the original
|
||||||
// sample data.
|
// sample data.
|
||||||
leftTrack->ClearAndPaste(mCurT0, mCurT1, outputLeftTrack.get(), true, false, GetTimeWarper());
|
leftTrack->ClearAndPaste(
|
||||||
rightTrack->ClearAndPaste(mCurT0, mCurT1, outputRightTrack.get(), true, false, GetTimeWarper());
|
mCurT0, mCurT1, outputLeftTrack.get(), true, false, &warper);
|
||||||
|
rightTrack->ClearAndPaste(
|
||||||
|
mCurT0, mCurT1, outputRightTrack.get(), true, false, &warper);
|
||||||
|
|
||||||
// Track the longest result length
|
// Track the longest result length
|
||||||
double newLength = outputLeftTrack->GetEndTime();
|
double newLength = outputLeftTrack->GetEndTime();
|
||||||
|
@ -32,16 +32,13 @@
|
|||||||
using namespace soundtouch;
|
using namespace soundtouch;
|
||||||
|
|
||||||
|
|
||||||
|
class TimeWarper;
|
||||||
class WaveTrack;
|
class WaveTrack;
|
||||||
|
|
||||||
class EffectSoundTouch /* not final */ : public Effect
|
class EffectSoundTouch /* not final */ : public Effect
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Effect implementation
|
|
||||||
|
|
||||||
bool Process() override;
|
|
||||||
|
|
||||||
// EffectSoundTouch implementation
|
// EffectSoundTouch implementation
|
||||||
|
|
||||||
#ifdef USE_MIDI
|
#ifdef USE_MIDI
|
||||||
@ -50,18 +47,25 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
// Effect implementation
|
||||||
|
|
||||||
|
bool ProcessWithTimeWarper(const TimeWarper &warper);
|
||||||
|
|
||||||
std::unique_ptr<SoundTouch> mSoundTouch;
|
std::unique_ptr<SoundTouch> mSoundTouch;
|
||||||
double mCurT0;
|
double mCurT0;
|
||||||
double mCurT1;
|
double mCurT1;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool ProcessLabelTrack(LabelTrack *track);
|
bool ProcessLabelTrack(LabelTrack *track, const TimeWarper &warper);
|
||||||
#ifdef USE_MIDI
|
#ifdef USE_MIDI
|
||||||
bool ProcessNoteTrack(NoteTrack *track);
|
bool ProcessNoteTrack(NoteTrack *track, const TimeWarper &warper);
|
||||||
#endif
|
#endif
|
||||||
bool ProcessOne(WaveTrack * t, sampleCount start, sampleCount end);
|
bool ProcessOne(
|
||||||
|
WaveTrack * t, sampleCount start, sampleCount end,
|
||||||
|
const TimeWarper &warper);
|
||||||
bool ProcessStereo(WaveTrack* leftTrack, WaveTrack* rightTrack,
|
bool ProcessStereo(WaveTrack* leftTrack, WaveTrack* rightTrack,
|
||||||
sampleCount start, sampleCount end);
|
sampleCount start, sampleCount end,
|
||||||
|
const TimeWarper &warper);
|
||||||
bool ProcessStereoResults(const unsigned int outputCount,
|
bool ProcessStereoResults(const unsigned int outputCount,
|
||||||
WaveTrack* outputLeftTrack,
|
WaveTrack* outputLeftTrack,
|
||||||
WaveTrack* outputRightTrack);
|
WaveTrack* outputRightTrack);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user