1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-25 08:58:06 +02:00

Variable cleanup

This commit is contained in:
Daniel Winzen 2015-04-23 18:30:38 +02:00
parent 759ff8cd0d
commit 92d522132e
14 changed files with 12 additions and 21 deletions

View File

@ -2283,7 +2283,7 @@ void AudioIO::StopStream()
}
if( appendRecord )
{ // append-recording
bool bResult = true;
bool bResult;
if (recordingOffset < 0)
bResult = track->Clear(mT0, mT0 - recordingOffset); // cut the latency out
else
@ -4115,7 +4115,6 @@ int audacityAudioCallback(const void *inputBuffer, void *outputBuffer,
bool selected = false;
int group = 0;
int chanCnt = 0;
float rate = 0.0;
int maxLen = 0;
for (t = 0; t < numPlaybackTracks; t++)
{
@ -4136,7 +4135,6 @@ int audacityAudioCallback(const void *inputBuffer, void *outputBuffer,
if (vt->GetMute() && !vt->GetSolo())
cut = true;
rate = vt->GetRate();
linkFlag = vt->GetLinked();
selected = vt->GetSelected();

View File

@ -1292,14 +1292,14 @@ static double SolveIntegrateInverseInterpolated(double y1, double y2, double tim
else if(1.0 + a * y1 * l <= 0.0)
res = 1.0;
else
res = log(1.0 + a * y1 * l) / l;
res = log1p(a * y1 * l) / l;
}
else
{
if(fabs(y2 - y1) < 1.0e-5) // fall back to average
res = a * (y1 + y2) * 0.5;
else
res = y1 * (exp(a * (y2 - y1)) - 1.0) / (y2 - y1);
res = y1 * expm1(a * (y2 - y1)) / (y2 - y1);
}
return std::max(0.0, std::min(1.0, res)) * time;
}

View File

@ -1064,7 +1064,6 @@ bool SpectrumAnalyst::Calculate(Algorithm alg, int windowFunc,
mProcessed[i] = float(0.0);
float *in = new float[mWindowSize];
float *in2 = new float[mWindowSize];
float *out = new float[mWindowSize];
float *out2 = new float[mWindowSize];
float *win = new float[mWindowSize];
@ -1277,7 +1276,6 @@ bool SpectrumAnalyst::Calculate(Algorithm alg, int windowFunc,
}
delete[]in;
delete[]in2;
delete[]out;
delete[]out2;
delete[]win;

View File

@ -2199,7 +2199,6 @@ void TrackArtist::DrawClipSpectrum(WaveTrack *track,
}
}
int it=0;
int oldBin0=-1;
bool inMaximum = false;
#endif //EXPERIMENTAL_FIND_NOTES

View File

@ -7187,7 +7187,7 @@ void TrackPanel::DrawTracks(wxDC * dc)
*dc, region, tracksRect, clip, mViewInfo,
envelopeFlag, samplesFlag, sliderFlag);
DrawEverythingElse(dc, region, panelRect, clip);
DrawEverythingElse(dc, region, clip);
}
/// Draws 'Everything else'. In particular it draws:
@ -7196,7 +7196,6 @@ void TrackPanel::DrawTracks(wxDC * dc)
/// - Fills in space below the tracks.
void TrackPanel::DrawEverythingElse(wxDC * dc,
const wxRegion &region,
const wxRect & WXUNUSED(panelRect),
const wxRect & clip)
{
// We draw everything else

View File

@ -522,7 +522,7 @@ protected:
virtual void DrawTracks(wxDC * dc);
virtual void DrawEverythingElse(wxDC *dc, const wxRegion & region,
const wxRect & panelRect, const wxRect & clip);
const wxRect & clip);
virtual void DrawOutside(Track *t, wxDC *dc, const wxRect & rec,
const wxRect &trackRect);
void DrawScrubSpeed(wxDC &dc);

View File

@ -955,7 +955,6 @@ bool EffectEqualization::TransferDataFromWindow()
int m = 2 * mMSlider->GetValue() + 1; // odd numbers only
if (m != mM) {
rr = true;
mM = m;
mPanel->ForceRecalc();

View File

@ -283,7 +283,6 @@ void EffectLeveller::CalcLevellerFactors()
limit = gLimit[f];
prevAdjLimit = gAdjLimit[prev];
addOnValue = prevAdjLimit - (adjFactor * prevLimit);
upperAdjLimit = (adjFactor * limit) + addOnValue;
gAddOnValue[f] = addOnValue;
gAdjLimit[f] = (adjFactor * limit) + addOnValue;

View File

@ -157,7 +157,7 @@ sampleCount EffectPhaser::ProcessBlock(float **inBlock, float **outBlock, sample
gain = (1.0 + cos(skipcount * lfoskip + phase)) / 2.0;
// change lfo shape
gain = (exp(gain * phaserlfoshape) - 1.0) / (exp(phaserlfoshape) - 1.0);
gain = expm1(gain * phaserlfoshape) / expm1(phaserlfoshape);
// attenuate the lfo
gain = 1.0 - gain / 255.0 * mDepth;

View File

@ -121,7 +121,7 @@ GeometricInputTimeWarper::GeometricInputTimeWarper(double tStart, double tEnd,
double GeometricOutputTimeWarper::Warp(double originalTime) const
{
double scaledTime = mTimeWarper.Warp(originalTime);
return mTStart + mScale*log(mC0 * scaledTime + 1.0);
return mTStart + mScale*log1p(mC0 * scaledTime);
}
GeometricOutputTimeWarper::GeometricOutputTimeWarper(double tStart, double tEnd,

View File

@ -778,6 +778,11 @@ int FFmpegImportFileHandle::WriteData(streamContext *sc)
default:
wxLogError(wxT("Stream %d has unrecognized sample format %d."), streamid, sc->m_samplefmt);
for (int chn=0; chn < nChannels; chn++)
{
free(tmp[chn]);
}
free(tmp);
return 1;
break;
}

View File

@ -304,8 +304,6 @@ int ODFFmpegDecoder::Decode(samplePtr & data, sampleFormat & format, sampleCount
samplePtr bufStart = data;
streamContext* sc = NULL;
int nChannels;
// printf("start %llu len %llu\n", start, len);
//TODO update this to work with seek - this only works linearly now.
if(mCurrentPos > start && mCurrentPos <= start+len + kDecodeSampleAllowance)
@ -370,7 +368,6 @@ int ODFFmpegDecoder::Decode(samplePtr & data, sampleFormat & format, sampleCount
// ReadNextFrame returns 1 if stream is not to be imported
if (sc != (streamContext*)1)
{
nChannels = sc->m_stream->codec->channels < sc->m_initialchannels ? sc->m_stream->codec->channels : sc->m_initialchannels;
//find out the dts we've seekd to. can't use the stream->cur_dts because it is faulty. also note that until we do the first seek, pkt.dts can be false and will change for the same samples after the initial seek.
sampleCount actualDecodeStart = mCurrentPos;

View File

@ -237,9 +237,7 @@ void MeterToolBar::OnSize( wxSizeEvent & event) //WXUNUSED(event) )
bool MeterToolBar::Expose( bool show )
{
bool updated = false;
if( show ) {
Meter *meter;
if( mPlayMeter ) {
mProject->SetPlaybackMeter( mPlayMeter );
}

View File

@ -867,7 +867,6 @@ void Ruler::TickCustom(int labelIdx, bool major, bool minor)
}
else {
//strTop =-strH-mLead;
strTop = mTop- mLead+4;// More space was needed...
mMaxHeight = max(mMaxHeight, strH + 6);
}