mirror of
https://github.com/cookiengineer/audacity
synced 2026-03-02 09:54:42 +01:00
Consolidate multiple names for the same feature: sticky/linked/sync/synchro/grouped -> sync-lock.
This commit is contained in:
@@ -24,32 +24,29 @@
|
||||
class WaveTrack;
|
||||
|
||||
// The only purpose for EffectSimplePairedTwoTrackBase is to provide virtual function
|
||||
// that EffectSimplePairedTwoTrack and its derived classes can use. I couldn't
|
||||
// figure out how to do it otherwise.
|
||||
// that EffectSimplePairedTwoTrack and its derived classes can use. I couldn't
|
||||
// figure out how to do it otherwise.
|
||||
// The unfortunate side effect of this base class is that it doesn't know the data types!
|
||||
|
||||
class EffectSimplePairedTwoTrackBase : public Effect
|
||||
{
|
||||
public:
|
||||
virtual ~EffectSimplePairedTwoTrackBase() {};
|
||||
virtual ~EffectSimplePairedTwoTrackBase() {};
|
||||
|
||||
// Override this method to actually process audio
|
||||
virtual bool ProcessSimplePairedTwoTrack(/*_DataType*/void *bufferLeft,
|
||||
/*_DataType*/void *bufferRight, // may be 0
|
||||
sampleCount len)
|
||||
{ return false; };
|
||||
// Override this method to actually process audio
|
||||
virtual bool ProcessSimplePairedTwoTrack(/*_DataType*/void *bufferLeft,
|
||||
/*_DataType*/void *bufferRight, // may be 0
|
||||
sampleCount len)
|
||||
{ return false; };
|
||||
};
|
||||
|
||||
|
||||
// This class is a template. We can do:
|
||||
|
||||
// typedef EffectSimplePairedTwoTrack<short int,int16Sample> EffectSimplePairedTwoTrack
|
||||
|
||||
// and similarly for other types.
|
||||
|
||||
// typedef EffectSimplePairedTwoTrack<short int,int16Sample> EffectSimplePairedTwoTrack
|
||||
// and similarly for other types.
|
||||
template<class _DataType,sampleFormat _xxxSample>
|
||||
class EffectSimplePairedTwoTrack:public EffectSimplePairedTwoTrackBase
|
||||
class EffectSimplePairedTwoTrack : public EffectSimplePairedTwoTrackBase
|
||||
{
|
||||
|
||||
public:
|
||||
// It is not usually necessary to override this method
|
||||
virtual bool Process();
|
||||
@@ -61,9 +58,9 @@ protected:
|
||||
virtual bool Init();
|
||||
|
||||
// It is not usually necessary to override this method
|
||||
virtual bool ProcessTwo( int count, WaveTrack *left, WaveTrack *right,
|
||||
sampleCount lstart,
|
||||
sampleCount rstart, sampleCount len);
|
||||
virtual bool ProcessTwo(int count, WaveTrack *left, WaveTrack *right,
|
||||
sampleCount lstart,
|
||||
sampleCount rstart, sampleCount len);
|
||||
|
||||
// It is not usually necessary to override this method
|
||||
void End();
|
||||
@@ -72,12 +69,12 @@ protected:
|
||||
|
||||
// Other useful information
|
||||
|
||||
sampleCount mnBlockSize; // 0 if no processing done, thus no buffers allocated
|
||||
sampleCount mnBlockSize; // 0 if no processing done, thus no buffers allocated
|
||||
|
||||
_DataType *mLeftBuffer;
|
||||
_DataType *mRightBuffer;
|
||||
|
||||
int mnTracks; // either 1 or 2, set in Init
|
||||
int mnTracks; // either 1 or 2, set in Init
|
||||
};
|
||||
|
||||
/**********************************************************************
|
||||
@@ -88,7 +85,7 @@ protected:
|
||||
#include <wx/defs.h>
|
||||
#include <wx/msgdlg.h>
|
||||
|
||||
#include "../WaveTrack.h" /*WAVETRACK*/
|
||||
#include "../WaveTrack.h" /*WAVETRACK*/
|
||||
|
||||
template<class _DataType,sampleFormat _xxxSample>
|
||||
bool EffectSimplePairedTwoTrack<_DataType,_xxxSample>::Init()
|
||||
@@ -99,7 +96,7 @@ bool EffectSimplePairedTwoTrack<_DataType,_xxxSample>::Init()
|
||||
TrackListIterator iter(mTracks);
|
||||
WaveTrack *left = (WaveTrack*)(iter.First());
|
||||
if ( left == 0 )
|
||||
return false; // we need an existing track
|
||||
return false; // Must have an existing track.
|
||||
|
||||
while(left) {
|
||||
sampleCount lstart, rstart;
|
||||
@@ -107,14 +104,14 @@ bool EffectSimplePairedTwoTrack<_DataType,_xxxSample>::Init()
|
||||
GetSamples((WaveTrack *)left, &lstart, &llen);
|
||||
|
||||
if (left->GetLinked()) {
|
||||
mnTracks = 2;
|
||||
mnTracks = 2;
|
||||
WaveTrack *right = (WaveTrack*)(iter.Next());
|
||||
GetSamples((WaveTrack *)right, &rstart, &rlen);
|
||||
|
||||
if (llen != rlen || ((WaveTrack *)left)->GetRate() != ((WaveTrack *)right)->GetRate()) {
|
||||
wxMessageBox(_("Sorry, this effect cannot be performed on stereo tracks where the individual channels of the track do not match."));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
left = (WaveTrack*)(iter.Next());
|
||||
@@ -163,20 +160,20 @@ bool EffectSimplePairedTwoTrack<_DataType,_xxxSample>::Process()
|
||||
|
||||
template<class _DataType,sampleFormat _xxxSample>
|
||||
bool EffectSimplePairedTwoTrack<_DataType,_xxxSample>::ProcessTwo(int count,
|
||||
WaveTrack *left,
|
||||
WaveTrack *right,
|
||||
sampleCount lstart,
|
||||
sampleCount rstart,
|
||||
sampleCount len)
|
||||
WaveTrack *left,
|
||||
WaveTrack *right,
|
||||
sampleCount lstart,
|
||||
sampleCount rstart,
|
||||
sampleCount len)
|
||||
{
|
||||
if (mnBlockSize == 0) {
|
||||
mnBlockSize = left->GetMaxBlockSize();
|
||||
|
||||
mLeftBuffer = new _DataType[mnBlockSize];
|
||||
if ( mnTracks > 1 )
|
||||
mRightBuffer = new _DataType[mnBlockSize];
|
||||
else
|
||||
mRightBuffer = 0;
|
||||
if ( mnTracks > 1 )
|
||||
mRightBuffer = new _DataType[mnBlockSize];
|
||||
else
|
||||
mRightBuffer = 0;
|
||||
}
|
||||
|
||||
// Get both buffers here
|
||||
@@ -194,7 +191,7 @@ bool EffectSimplePairedTwoTrack<_DataType,_xxxSample>::ProcessTwo(int count,
|
||||
right->Get((samplePtr)mRightBuffer, _xxxSample, rs, block);
|
||||
}
|
||||
|
||||
// The derived class process the tracks here
|
||||
// The derived class process the tracks here
|
||||
ProcessSimplePairedTwoTrack(mLeftBuffer, mRightBuffer, block);
|
||||
|
||||
left->Set((samplePtr)mLeftBuffer, _xxxSample, ls, block);
|
||||
|
||||
@@ -531,7 +531,7 @@ bool EffectNyquist::Process()
|
||||
}
|
||||
|
||||
// Check whether we're in the same group as the last selected track
|
||||
TrackGroupIterator gIter(mOutputTracks);
|
||||
SyncLockedTracksIterator gIter(mOutputTracks);
|
||||
Track *gt = gIter.First(mCurTrack[0]);
|
||||
mFirstInGroup = !gtLast || (gtLast != gt);
|
||||
gtLast = gt;
|
||||
@@ -780,7 +780,7 @@ bool EffectNyquist::ProcessOne()
|
||||
mCurTrack[i]->ClearAndPaste(mT0, mT1, out, false, false);
|
||||
// If we were first in the group adjust non-selected group tracks
|
||||
if (mFirstInGroup) {
|
||||
TrackGroupIterator git(mOutputTracks);
|
||||
SyncLockedTracksIterator git(mOutputTracks);
|
||||
Track *t;
|
||||
for (t = git.First(mCurTrack[i]); t; t = git.Next())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user