mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-26 01:18:06 +02:00
Variable cleanup
This commit is contained in:
parent
759ff8cd0d
commit
92d522132e
@ -2283,7 +2283,7 @@ void AudioIO::StopStream()
|
|||||||
}
|
}
|
||||||
if( appendRecord )
|
if( appendRecord )
|
||||||
{ // append-recording
|
{ // append-recording
|
||||||
bool bResult = true;
|
bool bResult;
|
||||||
if (recordingOffset < 0)
|
if (recordingOffset < 0)
|
||||||
bResult = track->Clear(mT0, mT0 - recordingOffset); // cut the latency out
|
bResult = track->Clear(mT0, mT0 - recordingOffset); // cut the latency out
|
||||||
else
|
else
|
||||||
@ -4115,7 +4115,6 @@ int audacityAudioCallback(const void *inputBuffer, void *outputBuffer,
|
|||||||
bool selected = false;
|
bool selected = false;
|
||||||
int group = 0;
|
int group = 0;
|
||||||
int chanCnt = 0;
|
int chanCnt = 0;
|
||||||
float rate = 0.0;
|
|
||||||
int maxLen = 0;
|
int maxLen = 0;
|
||||||
for (t = 0; t < numPlaybackTracks; t++)
|
for (t = 0; t < numPlaybackTracks; t++)
|
||||||
{
|
{
|
||||||
@ -4136,7 +4135,6 @@ int audacityAudioCallback(const void *inputBuffer, void *outputBuffer,
|
|||||||
if (vt->GetMute() && !vt->GetSolo())
|
if (vt->GetMute() && !vt->GetSolo())
|
||||||
cut = true;
|
cut = true;
|
||||||
|
|
||||||
rate = vt->GetRate();
|
|
||||||
linkFlag = vt->GetLinked();
|
linkFlag = vt->GetLinked();
|
||||||
selected = vt->GetSelected();
|
selected = vt->GetSelected();
|
||||||
|
|
||||||
|
@ -1292,14 +1292,14 @@ static double SolveIntegrateInverseInterpolated(double y1, double y2, double tim
|
|||||||
else if(1.0 + a * y1 * l <= 0.0)
|
else if(1.0 + a * y1 * l <= 0.0)
|
||||||
res = 1.0;
|
res = 1.0;
|
||||||
else
|
else
|
||||||
res = log(1.0 + a * y1 * l) / l;
|
res = log1p(a * y1 * l) / l;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(fabs(y2 - y1) < 1.0e-5) // fall back to average
|
if(fabs(y2 - y1) < 1.0e-5) // fall back to average
|
||||||
res = a * (y1 + y2) * 0.5;
|
res = a * (y1 + y2) * 0.5;
|
||||||
else
|
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;
|
return std::max(0.0, std::min(1.0, res)) * time;
|
||||||
}
|
}
|
||||||
|
@ -1064,7 +1064,6 @@ bool SpectrumAnalyst::Calculate(Algorithm alg, int windowFunc,
|
|||||||
mProcessed[i] = float(0.0);
|
mProcessed[i] = float(0.0);
|
||||||
|
|
||||||
float *in = new float[mWindowSize];
|
float *in = new float[mWindowSize];
|
||||||
float *in2 = new float[mWindowSize];
|
|
||||||
float *out = new float[mWindowSize];
|
float *out = new float[mWindowSize];
|
||||||
float *out2 = new float[mWindowSize];
|
float *out2 = new float[mWindowSize];
|
||||||
float *win = new float[mWindowSize];
|
float *win = new float[mWindowSize];
|
||||||
@ -1277,7 +1276,6 @@ bool SpectrumAnalyst::Calculate(Algorithm alg, int windowFunc,
|
|||||||
}
|
}
|
||||||
|
|
||||||
delete[]in;
|
delete[]in;
|
||||||
delete[]in2;
|
|
||||||
delete[]out;
|
delete[]out;
|
||||||
delete[]out2;
|
delete[]out2;
|
||||||
delete[]win;
|
delete[]win;
|
||||||
|
@ -2199,7 +2199,6 @@ void TrackArtist::DrawClipSpectrum(WaveTrack *track,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
int it=0;
|
int it=0;
|
||||||
int oldBin0=-1;
|
|
||||||
bool inMaximum = false;
|
bool inMaximum = false;
|
||||||
#endif //EXPERIMENTAL_FIND_NOTES
|
#endif //EXPERIMENTAL_FIND_NOTES
|
||||||
|
|
||||||
|
@ -7187,7 +7187,7 @@ void TrackPanel::DrawTracks(wxDC * dc)
|
|||||||
*dc, region, tracksRect, clip, mViewInfo,
|
*dc, region, tracksRect, clip, mViewInfo,
|
||||||
envelopeFlag, samplesFlag, sliderFlag);
|
envelopeFlag, samplesFlag, sliderFlag);
|
||||||
|
|
||||||
DrawEverythingElse(dc, region, panelRect, clip);
|
DrawEverythingElse(dc, region, clip);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Draws 'Everything else'. In particular it draws:
|
/// Draws 'Everything else'. In particular it draws:
|
||||||
@ -7196,7 +7196,6 @@ void TrackPanel::DrawTracks(wxDC * dc)
|
|||||||
/// - Fills in space below the tracks.
|
/// - Fills in space below the tracks.
|
||||||
void TrackPanel::DrawEverythingElse(wxDC * dc,
|
void TrackPanel::DrawEverythingElse(wxDC * dc,
|
||||||
const wxRegion ®ion,
|
const wxRegion ®ion,
|
||||||
const wxRect & WXUNUSED(panelRect),
|
|
||||||
const wxRect & clip)
|
const wxRect & clip)
|
||||||
{
|
{
|
||||||
// We draw everything else
|
// We draw everything else
|
||||||
|
@ -522,7 +522,7 @@ protected:
|
|||||||
virtual void DrawTracks(wxDC * dc);
|
virtual void DrawTracks(wxDC * dc);
|
||||||
|
|
||||||
virtual void DrawEverythingElse(wxDC *dc, const wxRegion & region,
|
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,
|
virtual void DrawOutside(Track *t, wxDC *dc, const wxRect & rec,
|
||||||
const wxRect &trackRect);
|
const wxRect &trackRect);
|
||||||
void DrawScrubSpeed(wxDC &dc);
|
void DrawScrubSpeed(wxDC &dc);
|
||||||
|
@ -955,7 +955,6 @@ bool EffectEqualization::TransferDataFromWindow()
|
|||||||
|
|
||||||
int m = 2 * mMSlider->GetValue() + 1; // odd numbers only
|
int m = 2 * mMSlider->GetValue() + 1; // odd numbers only
|
||||||
if (m != mM) {
|
if (m != mM) {
|
||||||
rr = true;
|
|
||||||
mM = m;
|
mM = m;
|
||||||
mPanel->ForceRecalc();
|
mPanel->ForceRecalc();
|
||||||
|
|
||||||
|
@ -283,7 +283,6 @@ void EffectLeveller::CalcLevellerFactors()
|
|||||||
limit = gLimit[f];
|
limit = gLimit[f];
|
||||||
prevAdjLimit = gAdjLimit[prev];
|
prevAdjLimit = gAdjLimit[prev];
|
||||||
addOnValue = prevAdjLimit - (adjFactor * prevLimit);
|
addOnValue = prevAdjLimit - (adjFactor * prevLimit);
|
||||||
upperAdjLimit = (adjFactor * limit) + addOnValue;
|
|
||||||
|
|
||||||
gAddOnValue[f] = addOnValue;
|
gAddOnValue[f] = addOnValue;
|
||||||
gAdjLimit[f] = (adjFactor * limit) + addOnValue;
|
gAdjLimit[f] = (adjFactor * limit) + addOnValue;
|
||||||
|
@ -157,7 +157,7 @@ sampleCount EffectPhaser::ProcessBlock(float **inBlock, float **outBlock, sample
|
|||||||
gain = (1.0 + cos(skipcount * lfoskip + phase)) / 2.0;
|
gain = (1.0 + cos(skipcount * lfoskip + phase)) / 2.0;
|
||||||
|
|
||||||
// change lfo shape
|
// change lfo shape
|
||||||
gain = (exp(gain * phaserlfoshape) - 1.0) / (exp(phaserlfoshape) - 1.0);
|
gain = expm1(gain * phaserlfoshape) / expm1(phaserlfoshape);
|
||||||
|
|
||||||
// attenuate the lfo
|
// attenuate the lfo
|
||||||
gain = 1.0 - gain / 255.0 * mDepth;
|
gain = 1.0 - gain / 255.0 * mDepth;
|
||||||
|
@ -121,7 +121,7 @@ GeometricInputTimeWarper::GeometricInputTimeWarper(double tStart, double tEnd,
|
|||||||
double GeometricOutputTimeWarper::Warp(double originalTime) const
|
double GeometricOutputTimeWarper::Warp(double originalTime) const
|
||||||
{
|
{
|
||||||
double scaledTime = mTimeWarper.Warp(originalTime);
|
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,
|
GeometricOutputTimeWarper::GeometricOutputTimeWarper(double tStart, double tEnd,
|
||||||
|
@ -778,6 +778,11 @@ int FFmpegImportFileHandle::WriteData(streamContext *sc)
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
wxLogError(wxT("Stream %d has unrecognized sample format %d."), streamid, sc->m_samplefmt);
|
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;
|
return 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -304,8 +304,6 @@ int ODFFmpegDecoder::Decode(samplePtr & data, sampleFormat & format, sampleCount
|
|||||||
samplePtr bufStart = data;
|
samplePtr bufStart = data;
|
||||||
streamContext* sc = NULL;
|
streamContext* sc = NULL;
|
||||||
|
|
||||||
int nChannels;
|
|
||||||
|
|
||||||
// printf("start %llu len %llu\n", start, len);
|
// printf("start %llu len %llu\n", start, len);
|
||||||
//TODO update this to work with seek - this only works linearly now.
|
//TODO update this to work with seek - this only works linearly now.
|
||||||
if(mCurrentPos > start && mCurrentPos <= start+len + kDecodeSampleAllowance)
|
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
|
// ReadNextFrame returns 1 if stream is not to be imported
|
||||||
if (sc != (streamContext*)1)
|
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.
|
//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;
|
sampleCount actualDecodeStart = mCurrentPos;
|
||||||
|
|
||||||
|
@ -237,9 +237,7 @@ void MeterToolBar::OnSize( wxSizeEvent & event) //WXUNUSED(event) )
|
|||||||
|
|
||||||
bool MeterToolBar::Expose( bool show )
|
bool MeterToolBar::Expose( bool show )
|
||||||
{
|
{
|
||||||
bool updated = false;
|
|
||||||
if( show ) {
|
if( show ) {
|
||||||
Meter *meter;
|
|
||||||
if( mPlayMeter ) {
|
if( mPlayMeter ) {
|
||||||
mProject->SetPlaybackMeter( mPlayMeter );
|
mProject->SetPlaybackMeter( mPlayMeter );
|
||||||
}
|
}
|
||||||
|
@ -867,7 +867,6 @@ void Ruler::TickCustom(int labelIdx, bool major, bool minor)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
//strTop =-strH-mLead;
|
|
||||||
strTop = mTop- mLead+4;// More space was needed...
|
strTop = mTop- mLead+4;// More space was needed...
|
||||||
mMaxHeight = max(mMaxHeight, strH + 6);
|
mMaxHeight = max(mMaxHeight, strH + 6);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user