mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-02 08:59:28 +02:00
Regularize casts as (int), so they are easier to find and review
This commit is contained in:
parent
8e1b084f01
commit
f993f1eadf
@ -642,7 +642,7 @@ void AColor::PreComputeGradient() {
|
|||||||
{float(1.00), float(1.00), float(1.00)} // white
|
{float(1.00), float(1.00), float(1.00)} // white
|
||||||
};
|
};
|
||||||
|
|
||||||
int left = int (value * gsteps);
|
int left = (int)(value * gsteps);
|
||||||
int right = (left == gsteps ? gsteps : left + 1);
|
int right = (left == gsteps ? gsteps : left + 1);
|
||||||
|
|
||||||
float rweight = (value * gsteps) - left;
|
float rweight = (value * gsteps) - left;
|
||||||
|
@ -352,7 +352,7 @@ visit our [[http://forum.audacityteam.org/|forum]].");
|
|||||||
const float fScale = 0.5f;// smaller size.
|
const float fScale = 0.5f;// smaller size.
|
||||||
wxImage RescaledImage(logo.ConvertToImage());
|
wxImage RescaledImage(logo.ConvertToImage());
|
||||||
// wxIMAGE_QUALITY_HIGH not supported by wxWidgets 2.6.1, or we would use it here.
|
// wxIMAGE_QUALITY_HIGH not supported by wxWidgets 2.6.1, or we would use it here.
|
||||||
RescaledImage.Rescale(int(LOGOWITHNAME_WIDTH * fScale), int(LOGOWITHNAME_HEIGHT *fScale));
|
RescaledImage.Rescale((int)(LOGOWITHNAME_WIDTH * fScale), (int)(LOGOWITHNAME_HEIGHT *fScale));
|
||||||
wxBitmap RescaledBitmap(RescaledImage);
|
wxBitmap RescaledBitmap(RescaledImage);
|
||||||
|
|
||||||
icon =
|
icon =
|
||||||
@ -362,7 +362,7 @@ visit our [[http://forum.audacityteam.org/|forum]].");
|
|||||||
//v theTheme.Bitmap(bmpAudacityLogoWithName),
|
//v theTheme.Bitmap(bmpAudacityLogoWithName),
|
||||||
RescaledBitmap,
|
RescaledBitmap,
|
||||||
wxDefaultPosition,
|
wxDefaultPosition,
|
||||||
wxSize(int(LOGOWITHNAME_WIDTH*fScale), int(LOGOWITHNAME_HEIGHT*fScale)));
|
wxSize((int)(LOGOWITHNAME_WIDTH*fScale), (int)(LOGOWITHNAME_HEIGHT*fScale)));
|
||||||
}
|
}
|
||||||
S.Prop(0).AddWindow( icon );
|
S.Prop(0).AddWindow( icon );
|
||||||
|
|
||||||
|
@ -202,7 +202,7 @@ void Envelope::DrawPoints(wxDC & dc, const wxRect & r, const ZoomInfo &zoomInfo,
|
|||||||
}
|
}
|
||||||
|
|
||||||
double v = mEnv[i].GetVal();
|
double v = mEnv[i].GetVal();
|
||||||
int x = int(position);
|
int x = (int)(position);
|
||||||
int y, y2;
|
int y, y2;
|
||||||
|
|
||||||
y = GetWaveYPos(v, zoomMin, zoomMax, r.height, dB,
|
y = GetWaveYPos(v, zoomMin, zoomMax, r.height, dB,
|
||||||
@ -361,7 +361,7 @@ bool Envelope::HandleMouseButtonDown(wxMouseEvent & event, wxRect & r,
|
|||||||
const wxInt64 position = zoomInfo.TimeToPosition(time);
|
const wxInt64 position = zoomInfo.TimeToPosition(time);
|
||||||
if (position >= 0 && position < r.width) {
|
if (position >= 0 && position < r.width) {
|
||||||
|
|
||||||
int x = int (position);
|
int x = (int)(position);
|
||||||
int y[4];
|
int y[4];
|
||||||
int numControlPoints;
|
int numControlPoints;
|
||||||
|
|
||||||
@ -1012,7 +1012,7 @@ void Envelope::BinarySearchForTime( int &Lo, int &Hi, double t ) const
|
|||||||
// Optimizations for the usual pattern of repeated calls with
|
// Optimizations for the usual pattern of repeated calls with
|
||||||
// small increases of t.
|
// small increases of t.
|
||||||
{
|
{
|
||||||
if (mSearchGuess >= 0 && mSearchGuess < int(mEnv.size()) - 1) {
|
if (mSearchGuess >= 0 && mSearchGuess < (int)(mEnv.size()) - 1) {
|
||||||
if (t >= mEnv[mSearchGuess].GetT() &&
|
if (t >= mEnv[mSearchGuess].GetT() &&
|
||||||
t < mEnv[1 + mSearchGuess].GetT()) {
|
t < mEnv[1 + mSearchGuess].GetT()) {
|
||||||
Lo = mSearchGuess;
|
Lo = mSearchGuess;
|
||||||
@ -1022,7 +1022,7 @@ void Envelope::BinarySearchForTime( int &Lo, int &Hi, double t ) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
++mSearchGuess;
|
++mSearchGuess;
|
||||||
if (mSearchGuess >= 0 && mSearchGuess < int(mEnv.size()) - 1) {
|
if (mSearchGuess >= 0 && mSearchGuess < (int)(mEnv.size()) - 1) {
|
||||||
if (t >= mEnv[mSearchGuess].GetT() &&
|
if (t >= mEnv[mSearchGuess].GetT() &&
|
||||||
t < mEnv[1 + mSearchGuess].GetT()) {
|
t < mEnv[1 + mSearchGuess].GetT()) {
|
||||||
Lo = mSearchGuess;
|
Lo = mSearchGuess;
|
||||||
|
@ -942,9 +942,9 @@ bool FFmpegLibs::InitLibs(const wxString &libpath_format, bool WXUNUSED(showerr)
|
|||||||
avuver,mAVUtilVersion.c_str(), LIBAVUTIL_VERSION_INT,
|
avuver,mAVUtilVersion.c_str(), LIBAVUTIL_VERSION_INT,
|
||||||
wxString::FromUTF8(AV_STRINGIFY(LIBAVUTIL_VERSION)).c_str());
|
wxString::FromUTF8(AV_STRINGIFY(LIBAVUTIL_VERSION)).c_str());
|
||||||
|
|
||||||
int avcverdiff = (avcver >> 16 & 0xFF) - int(LIBAVCODEC_VERSION_MAJOR);
|
int avcverdiff = (avcver >> 16 & 0xFF) - (int)(LIBAVCODEC_VERSION_MAJOR);
|
||||||
int avfverdiff = (avfver >> 16 & 0xFF) - int(LIBAVFORMAT_VERSION_MAJOR);
|
int avfverdiff = (avfver >> 16 & 0xFF) - (int)(LIBAVFORMAT_VERSION_MAJOR);
|
||||||
int avuverdiff = (avuver >> 16 & 0xFF) - int(LIBAVUTIL_VERSION_MAJOR);
|
int avuverdiff = (avuver >> 16 & 0xFF) - (int)(LIBAVUTIL_VERSION_MAJOR);
|
||||||
if (avcverdiff != 0)
|
if (avcverdiff != 0)
|
||||||
wxLogError(wxT("AVCodec version mismatch = %d"), avcverdiff);
|
wxLogError(wxT("AVCodec version mismatch = %d"), avcverdiff);
|
||||||
if (avfverdiff != 0)
|
if (avfverdiff != 0)
|
||||||
|
@ -755,7 +755,7 @@ void FreqWindow::DrawPlot()
|
|||||||
|
|
||||||
float ynorm = (y - yMin) / yTotal;
|
float ynorm = (y - yMin) / yTotal;
|
||||||
|
|
||||||
int lineheight = int (ynorm * (r.height - 1));
|
int lineheight = (int)(ynorm * (r.height - 1));
|
||||||
|
|
||||||
if (lineheight > r.height - 2)
|
if (lineheight > r.height - 2)
|
||||||
lineheight = r.height - 2;
|
lineheight = r.height - 2;
|
||||||
@ -894,9 +894,9 @@ void FreqWindow::PlotPaint(wxPaintEvent & event)
|
|||||||
|
|
||||||
int px;
|
int px;
|
||||||
if (mLogAxis)
|
if (mLogAxis)
|
||||||
px = int (log(bestpeak / xMin) / log(xStep));
|
px = (int)(log(bestpeak / xMin) / log(xStep));
|
||||||
else
|
else
|
||||||
px = int ((bestpeak - xMin) * width / (xMax - xMin));
|
px = (int)((bestpeak - xMin) * width / (xMax - xMin));
|
||||||
|
|
||||||
dc.SetPen(wxPen(wxColour(160,160,160), 1, wxSOLID));
|
dc.SetPen(wxPen(wxColour(160,160,160), 1, wxSOLID));
|
||||||
AColor::Line(dc, r.x + 1 + px, r.y, r.x + 1 + px, r.y + r.height);
|
AColor::Line(dc, r.x + 1 + px, r.y, r.x + 1 + px, r.y + r.height);
|
||||||
@ -926,8 +926,8 @@ void FreqWindow::PlotPaint(wxPaintEvent & event)
|
|||||||
xp = xpitch.c_str();
|
xp = xpitch.c_str();
|
||||||
pp = peakpitch.c_str();
|
pp = peakpitch.c_str();
|
||||||
/* i18n-hint: The %d's are replaced by numbers, the %s by musical notes, e.g. A#*/
|
/* i18n-hint: The %d's are replaced by numbers, the %s by musical notes, e.g. A#*/
|
||||||
cursor.Printf(_("%d Hz (%s) = %d dB"), int (xPos + 0.5), xp, int (value + 0.5));
|
cursor.Printf(_("%d Hz (%s) = %d dB"), (int)(xPos + 0.5), xp, (int)(value + 0.5));
|
||||||
peak.Printf(_("%d Hz (%s) = %.1f dB"), int (bestpeak + 0.5), pp, bestValue);
|
peak.Printf(_("%d Hz (%s) = %.1f dB"), (int)(bestpeak + 0.5), pp, bestValue);
|
||||||
} else if (xPos > 0.0 && bestpeak > 0.0) {
|
} else if (xPos > 0.0 && bestpeak > 0.0) {
|
||||||
xpitch = PitchName_Absolute(FreqToMIDInote(1.0 / xPos));
|
xpitch = PitchName_Absolute(FreqToMIDInote(1.0 / xPos));
|
||||||
peakpitch = PitchName_Absolute(FreqToMIDInote(1.0 / bestpeak));
|
peakpitch = PitchName_Absolute(FreqToMIDInote(1.0 / bestpeak));
|
||||||
@ -936,9 +936,9 @@ void FreqWindow::PlotPaint(wxPaintEvent & event)
|
|||||||
/* i18n-hint: The %d's are replaced by numbers, the %s by musical notes, e.g. A#
|
/* i18n-hint: The %d's are replaced by numbers, the %s by musical notes, e.g. A#
|
||||||
* the %.4f are numbers, and 'sec' should be an abbreviation for seconds */
|
* the %.4f are numbers, and 'sec' should be an abbreviation for seconds */
|
||||||
cursor.Printf(_("%.4f sec (%d Hz) (%s) = %f"),
|
cursor.Printf(_("%.4f sec (%d Hz) (%s) = %f"),
|
||||||
xPos, int (1.0 / xPos + 0.5), xp, value);
|
xPos, (int)(1.0 / xPos + 0.5), xp, value);
|
||||||
peak.Printf(_("%.4f sec (%d Hz) (%s) = %.3f"),
|
peak.Printf(_("%.4f sec (%d Hz) (%s) = %.3f"),
|
||||||
bestpeak, int (1.0 / bestpeak + 0.5), pp, bestValue);
|
bestpeak, (int)(1.0 / bestpeak + 0.5), pp, bestValue);
|
||||||
}
|
}
|
||||||
mCursorText->SetValue(cursor);
|
mCursorText->SetValue(cursor);
|
||||||
mPeakText->SetValue(peak);
|
mPeakText->SetValue(peak);
|
||||||
@ -1447,7 +1447,7 @@ float SpectrumAnalyst::GetProcessedValue(float freq0, float freq1) const
|
|||||||
|
|
||||||
if (binwidth < 1.0) {
|
if (binwidth < 1.0) {
|
||||||
float binmid = (bin0 + bin1) / 2.0;
|
float binmid = (bin0 + bin1) / 2.0;
|
||||||
int ibin = int (binmid) - 1;
|
int ibin = (int)(binmid) - 1;
|
||||||
if (ibin < 1)
|
if (ibin < 1)
|
||||||
ibin = 1;
|
ibin = 1;
|
||||||
if (ibin >= GetProcessedSize() - 3)
|
if (ibin >= GetProcessedSize() - 3)
|
||||||
@ -1464,14 +1464,14 @@ float SpectrumAnalyst::GetProcessedValue(float freq0, float freq1) const
|
|||||||
if (bin1 >= GetProcessedSize())
|
if (bin1 >= GetProcessedSize())
|
||||||
bin1 = GetProcessedSize() - 1;
|
bin1 = GetProcessedSize() - 1;
|
||||||
|
|
||||||
if (int (bin1) > int (bin0))
|
if ((int)(bin1) > (int)(bin0))
|
||||||
value += mProcessed[int (bin0)] * (int (bin0) + 1 - bin0);
|
value += mProcessed[(int)(bin0)] * ((int)(bin0) + 1 - bin0);
|
||||||
bin0 = 1 + int (bin0);
|
bin0 = 1 + (int)(bin0);
|
||||||
while (bin0 < int (bin1)) {
|
while (bin0 < (int)(bin1)) {
|
||||||
value += mProcessed[int (bin0)];
|
value += mProcessed[(int)(bin0)];
|
||||||
bin0 += 1.0;
|
bin0 += 1.0;
|
||||||
}
|
}
|
||||||
value += mProcessed[int (bin1)] * (bin1 - int (bin1));
|
value += mProcessed[(int)(bin1)] * (bin1 - (int)(bin1));
|
||||||
|
|
||||||
value /= binwidth;
|
value /= binwidth;
|
||||||
}
|
}
|
||||||
|
@ -6189,7 +6189,7 @@ class ASAProgress final : public SAProgress {
|
|||||||
work = (is_audio[0] ? AUDIO_WORK_UNIT : MIDI_WORK_UNIT) * mFrames[0] +
|
work = (is_audio[0] ? AUDIO_WORK_UNIT : MIDI_WORK_UNIT) * mFrames[0] +
|
||||||
(is_audio[1] ? AUDIO_WORK_UNIT : MIDI_WORK_UNIT) * f;
|
(is_audio[1] ? AUDIO_WORK_UNIT : MIDI_WORK_UNIT) * f;
|
||||||
}
|
}
|
||||||
int updateResult = mProgress->Update(int(work), int(mTotalWork));
|
int updateResult = mProgress->Update((int)(work), (int)(mTotalWork));
|
||||||
return (updateResult == eProgressSuccess);
|
return (updateResult == eProgressSuccess);
|
||||||
}
|
}
|
||||||
bool set_matrix_progress(int cells) override {
|
bool set_matrix_progress(int cells) override {
|
||||||
@ -6198,7 +6198,7 @@ class ASAProgress final : public SAProgress {
|
|||||||
(is_audio[0] ? AUDIO_WORK_UNIT : MIDI_WORK_UNIT) * mFrames[0] +
|
(is_audio[0] ? AUDIO_WORK_UNIT : MIDI_WORK_UNIT) * mFrames[0] +
|
||||||
(is_audio[1] ? AUDIO_WORK_UNIT : MIDI_WORK_UNIT) * mFrames[1];
|
(is_audio[1] ? AUDIO_WORK_UNIT : MIDI_WORK_UNIT) * mFrames[1];
|
||||||
work += mCellCount * MATRIX_WORK_UNIT;
|
work += mCellCount * MATRIX_WORK_UNIT;
|
||||||
int updateResult = mProgress->Update(int(work), int(mTotalWork));
|
int updateResult = mProgress->Update((int)(work), (int)(mTotalWork));
|
||||||
return (updateResult == eProgressSuccess);
|
return (updateResult == eProgressSuccess);
|
||||||
}
|
}
|
||||||
bool set_smoothing_progress(int i) override {
|
bool set_smoothing_progress(int i) override {
|
||||||
@ -6208,7 +6208,7 @@ class ASAProgress final : public SAProgress {
|
|||||||
(is_audio[1] ? AUDIO_WORK_UNIT : MIDI_WORK_UNIT) * mFrames[1] +
|
(is_audio[1] ? AUDIO_WORK_UNIT : MIDI_WORK_UNIT) * mFrames[1] +
|
||||||
MATRIX_WORK_UNIT * mFrames[0] * mFrames[1];
|
MATRIX_WORK_UNIT * mFrames[0] * mFrames[1];
|
||||||
work += i * wxMax(mFrames[0], mFrames[1]) * SMOOTHING_WORK_UNIT;
|
work += i * wxMax(mFrames[0], mFrames[1]) * SMOOTHING_WORK_UNIT;
|
||||||
int updateResult = mProgress->Update(int(work), int(mTotalWork));
|
int updateResult = mProgress->Update((int)(work), (int)(mTotalWork));
|
||||||
return (updateResult == eProgressSuccess);
|
return (updateResult == eProgressSuccess);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -7069,7 +7069,7 @@ void AudacityProject::SeekLeftOrRight
|
|||||||
? GridMove(t1, multiplier)
|
? GridMove(t1, multiplier)
|
||||||
: quietStepIsPixels
|
: quietStepIsPixels
|
||||||
? mViewInfo.OffsetTimeByPixels(
|
? mViewInfo.OffsetTimeByPixels(
|
||||||
t1, int(multiplier * quietSeekStepPositive))
|
t1, (int)(multiplier * quietSeekStepPositive))
|
||||||
: t1 + multiplier * quietSeekStepPositive
|
: t1 + multiplier * quietSeekStepPositive
|
||||||
));
|
));
|
||||||
|
|
||||||
@ -7084,7 +7084,7 @@ void AudacityProject::SeekLeftOrRight
|
|||||||
? GridMove(t0, multiplier)
|
? GridMove(t0, multiplier)
|
||||||
: quietStepIsPixels
|
: quietStepIsPixels
|
||||||
? mViewInfo.OffsetTimeByPixels(
|
? mViewInfo.OffsetTimeByPixels(
|
||||||
t0, int(multiplier * quietSeekStepPositive))
|
t0, (int)(multiplier * quietSeekStepPositive))
|
||||||
: t0 + multiplier * quietSeekStepPositive
|
: t0 + multiplier * quietSeekStepPositive
|
||||||
));
|
));
|
||||||
|
|
||||||
@ -7114,7 +7114,7 @@ void AudacityProject::SeekLeftOrRight
|
|||||||
if (audioStepIsPixels) {
|
if (audioStepIsPixels) {
|
||||||
const double streamTime = gAudioIO->GetStreamTime();
|
const double streamTime = gAudioIO->GetStreamTime();
|
||||||
const double newTime =
|
const double newTime =
|
||||||
mViewInfo.OffsetTimeByPixels(streamTime, int(audioSeekStepPositive));
|
mViewInfo.OffsetTimeByPixels(streamTime, (int)(audioSeekStepPositive));
|
||||||
seconds = newTime - streamTime;
|
seconds = newTime - streamTime;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -7136,7 +7136,7 @@ void AudacityProject::SeekLeftOrRight
|
|||||||
? GridMove(t0, multiplier)
|
? GridMove(t0, multiplier)
|
||||||
: quietStepIsPixels
|
: quietStepIsPixels
|
||||||
? mViewInfo.OffsetTimeByPixels(
|
? mViewInfo.OffsetTimeByPixels(
|
||||||
t0, int(multiplier * quietSeekStepPositive))
|
t0, (int)(multiplier * quietSeekStepPositive))
|
||||||
: t0 + multiplier * quietSeekStepPositive
|
: t0 + multiplier * quietSeekStepPositive
|
||||||
));
|
));
|
||||||
|
|
||||||
@ -7152,7 +7152,7 @@ void AudacityProject::SeekLeftOrRight
|
|||||||
? GridMove(t1, multiplier)
|
? GridMove(t1, multiplier)
|
||||||
: quietStepIsPixels
|
: quietStepIsPixels
|
||||||
? mViewInfo.OffsetTimeByPixels(
|
? mViewInfo.OffsetTimeByPixels(
|
||||||
t1, int(multiplier * quietSeekStepPositive))
|
t1, (int)(multiplier * quietSeekStepPositive))
|
||||||
: t1 + multiplier * quietSeekStepPositive
|
: t1 + multiplier * quietSeekStepPositive
|
||||||
));
|
));
|
||||||
|
|
||||||
@ -7179,7 +7179,7 @@ void AudacityProject::SeekLeftOrRight
|
|||||||
? GridMove(t0, multiplier)
|
? GridMove(t0, multiplier)
|
||||||
: quietStepIsPixels
|
: quietStepIsPixels
|
||||||
? mViewInfo.OffsetTimeByPixels(
|
? mViewInfo.OffsetTimeByPixels(
|
||||||
t0, int(multiplier * quietSeekStepPositive))
|
t0, (int)(multiplier * quietSeekStepPositive))
|
||||||
: t0 + multiplier * quietSeekStepPositive)),
|
: t0 + multiplier * quietSeekStepPositive)),
|
||||||
false // do not swap selection boundaries
|
false // do not swap selection boundaries
|
||||||
);
|
);
|
||||||
|
@ -686,7 +686,7 @@ Alg_seq *NoteTrack::MakeExportableSeq(std::unique_ptr<Alg_seq> &cleanup)
|
|||||||
double measures = beat / 4.0;
|
double measures = beat / 4.0;
|
||||||
double imeasures = ROUND(measures);
|
double imeasures = ROUND(measures);
|
||||||
if (!within(measures, imeasures, ALG_EPS)) {
|
if (!within(measures, imeasures, ALG_EPS)) {
|
||||||
double bar_offset = (int(measures) + 1) * 4.0 - beat;
|
double bar_offset = ((int)(measures) + 1) * 4.0 - beat;
|
||||||
seq->set_time_sig(bar_offset, 4, 4);
|
seq->set_time_sig(bar_offset, 4, 4);
|
||||||
}
|
}
|
||||||
// This case should never be true because if i == 0, either there
|
// This case should never be true because if i == 0, either there
|
||||||
@ -705,7 +705,7 @@ Alg_seq *NoteTrack::MakeExportableSeq(std::unique_ptr<Alg_seq> &cleanup)
|
|||||||
// beat is not on a measure, so we need to insert a time sig
|
// beat is not on a measure, so we need to insert a time sig
|
||||||
// to force a bar line at the first measure location after
|
// to force a bar line at the first measure location after
|
||||||
// beat
|
// beat
|
||||||
double bar = tsp->beat + beats_per_measure * (int(measures) + 1);
|
double bar = tsp->beat + beats_per_measure * ((int)(measures) + 1);
|
||||||
double bar_offset = bar - beat;
|
double bar_offset = bar - beat;
|
||||||
// insert NEW time signature at bar_offset in NEW sequence
|
// insert NEW time signature at bar_offset in NEW sequence
|
||||||
// It will have the same time signature, but the position will
|
// It will have the same time signature, but the position will
|
||||||
|
@ -1734,7 +1734,7 @@ void AudacityProject::SetHorizontalThumb(double scrollto)
|
|||||||
const int pos =
|
const int pos =
|
||||||
std::min(max,
|
std::min(max,
|
||||||
std::max(0,
|
std::max(0,
|
||||||
int(floor(0.5 + unscaled * mViewInfo.sbarScale))));
|
(int)(floor(0.5 + unscaled * mViewInfo.sbarScale))));
|
||||||
mHsbar->SetThumbPosition(pos);
|
mHsbar->SetThumbPosition(pos);
|
||||||
mViewInfo.sbarH = floor(0.5 + unscaled - PixelWidthBeforeTime(0.0));
|
mViewInfo.sbarH = floor(0.5 + unscaled - PixelWidthBeforeTime(0.0));
|
||||||
mViewInfo.sbarH = std::max(mViewInfo.sbarH,
|
mViewInfo.sbarH = std::max(mViewInfo.sbarH,
|
||||||
@ -1915,7 +1915,7 @@ void AudacityProject::FixScrollbars()
|
|||||||
int scaledSbarScreen = (int)(mViewInfo.sbarScreen * mViewInfo.sbarScale);
|
int scaledSbarScreen = (int)(mViewInfo.sbarScreen * mViewInfo.sbarScale);
|
||||||
int scaledSbarTotal = (int)(mViewInfo.sbarTotal * mViewInfo.sbarScale);
|
int scaledSbarTotal = (int)(mViewInfo.sbarTotal * mViewInfo.sbarScale);
|
||||||
const int offset =
|
const int offset =
|
||||||
int(floor(0.5 + mViewInfo.sbarScale * PixelWidthBeforeTime(0.0)));
|
(int)(floor(0.5 + mViewInfo.sbarScale * PixelWidthBeforeTime(0.0)));
|
||||||
|
|
||||||
mHsbar->SetScrollbar(scaledSbarH + offset, scaledSbarScreen, scaledSbarTotal,
|
mHsbar->SetScrollbar(scaledSbarH + offset, scaledSbarScreen, scaledSbarTotal,
|
||||||
scaledSbarScreen, TRUE);
|
scaledSbarScreen, TRUE);
|
||||||
@ -4857,7 +4857,7 @@ void AudacityProject::EditClipboardByLabel( EditDestFunction action )
|
|||||||
{
|
{
|
||||||
WaveTrack *wt = ( WaveTrack* )n;
|
WaveTrack *wt = ( WaveTrack* )n;
|
||||||
Track::Holder merged;
|
Track::Holder merged;
|
||||||
for( int i = ( int )regions.size() - 1; i >= 0; i-- )
|
for( int i = (int)regions.size() - 1; i >= 0; i-- )
|
||||||
{
|
{
|
||||||
const Region ®ion = regions.at(i);
|
const Region ®ion = regions.at(i);
|
||||||
auto dest = ( wt->*action )( region.start, region.end );
|
auto dest = ( wt->*action )( region.start, region.end );
|
||||||
|
@ -91,14 +91,14 @@ void SplashDialog::Populate( ShuttleGui & S )
|
|||||||
const float fScale=0.5f;// smaller size.
|
const float fScale=0.5f;// smaller size.
|
||||||
wxImage RescaledImage( m_pLogo->ConvertToImage() );
|
wxImage RescaledImage( m_pLogo->ConvertToImage() );
|
||||||
// wxIMAGE_QUALITY_HIGH not supported by wxWidgets 2.6.1, or we would use it here.
|
// wxIMAGE_QUALITY_HIGH not supported by wxWidgets 2.6.1, or we would use it here.
|
||||||
RescaledImage.Rescale( int(LOGOWITHNAME_WIDTH * fScale), int(LOGOWITHNAME_HEIGHT *fScale) );
|
RescaledImage.Rescale( (int)(LOGOWITHNAME_WIDTH * fScale), (int)(LOGOWITHNAME_HEIGHT *fScale) );
|
||||||
wxBitmap RescaledBitmap( RescaledImage );
|
wxBitmap RescaledBitmap( RescaledImage );
|
||||||
wxStaticBitmap *const icon =
|
wxStaticBitmap *const icon =
|
||||||
safenew wxStaticBitmap(S.GetParent(), -1,
|
safenew wxStaticBitmap(S.GetParent(), -1,
|
||||||
//*m_pLogo, //v theTheme.Bitmap(bmpAudacityLogoWithName),
|
//*m_pLogo, //v theTheme.Bitmap(bmpAudacityLogoWithName),
|
||||||
RescaledBitmap,
|
RescaledBitmap,
|
||||||
wxDefaultPosition,
|
wxDefaultPosition,
|
||||||
wxSize(int(LOGOWITHNAME_WIDTH*fScale), int(LOGOWITHNAME_HEIGHT*fScale)));
|
wxSize((int)(LOGOWITHNAME_WIDTH*fScale), (int)(LOGOWITHNAME_HEIGHT*fScale)));
|
||||||
|
|
||||||
S.Prop(0).AddWindow( icon );
|
S.Prop(0).AddWindow( icon );
|
||||||
|
|
||||||
|
@ -865,7 +865,7 @@ void TrackArtist::UpdateVRuler(const Track *t, wxRect & rect)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// use Hz
|
// use Hz
|
||||||
vruler->SetRange(int(maxFreq), int(minFreq));
|
vruler->SetRange((int)(maxFreq), (int)(minFreq));
|
||||||
vruler->SetUnits(wxT(""));
|
vruler->SetUnits(wxT(""));
|
||||||
}
|
}
|
||||||
vruler->SetLog(false);
|
vruler->SetLog(false);
|
||||||
@ -1127,8 +1127,8 @@ void TrackArtist::DrawWaveformBackground(wxDC &dc, int leftOffset, const wxRect
|
|||||||
|
|
||||||
// If sync-lock selected, draw in linked graphics.
|
// If sync-lock selected, draw in linked graphics.
|
||||||
if (bIsSyncLockSelected && t0 < t1) {
|
if (bIsSyncLockSelected && t0 < t1) {
|
||||||
const int begin = std::max(0, std::min(rect.width, int(zoomInfo.TimeToPosition(t0, -leftOffset))));
|
const int begin = std::max(0, std::min(rect.width, (int)(zoomInfo.TimeToPosition(t0, -leftOffset))));
|
||||||
const int end = std::max(0, std::min(rect.width, int(zoomInfo.TimeToPosition(t1, -leftOffset))));
|
const int end = std::max(0, std::min(rect.width, (int)(zoomInfo.TimeToPosition(t1, -leftOffset))));
|
||||||
DrawSyncLockTiles(&dc, wxRect(rect.x + begin, rect.y, end - 1 - begin, rect.height));
|
DrawSyncLockTiles(&dc, wxRect(rect.x + begin, rect.y, end - 1 - begin, rect.height));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1347,7 +1347,7 @@ void TrackArtist::DrawIndividualSamples(wxDC &dc, int leftOffset, const wxRect &
|
|||||||
const double time = toffset + (s + s0).as_double() / rate;
|
const double time = toffset + (s + s0).as_double() / rate;
|
||||||
const int xx = // An offset into the rectangle rect
|
const int xx = // An offset into the rectangle rect
|
||||||
std::max(-10000, std::min(10000,
|
std::max(-10000, std::min(10000,
|
||||||
int(zoomInfo.TimeToPosition(time, -leftOffset))));
|
(int)(zoomInfo.TimeToPosition(time, -leftOffset))));
|
||||||
xpos[s] = xx;
|
xpos[s] = xx;
|
||||||
|
|
||||||
const double tt = buffer[s] * clip->GetEnvelope()->GetValue(time);
|
const double tt = buffer[s] * clip->GetEnvelope()->GetValue(time);
|
||||||
@ -1711,7 +1711,7 @@ void FindWavePortions
|
|||||||
prev = it++;
|
prev = it++;
|
||||||
if (it == end)
|
if (it == end)
|
||||||
break;
|
break;
|
||||||
const int right = std::max(left, int(it->position));
|
const int right = std::max(left, (int)(it->position));
|
||||||
const int width = right - left;
|
const int width = right - left;
|
||||||
if (width > 0)
|
if (width > 0)
|
||||||
portions.push_back(
|
portions.push_back(
|
||||||
@ -2029,23 +2029,23 @@ static inline float findValue
|
|||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
// Averaging method
|
// Averaging method
|
||||||
if (int(bin1) == int(bin0)) {
|
if ((int)(bin1) == (int)(bin0)) {
|
||||||
value = spectrum[int(bin0)];
|
value = spectrum[(int)(bin0)];
|
||||||
} else {
|
} else {
|
||||||
float binwidth= bin1 - bin0;
|
float binwidth= bin1 - bin0;
|
||||||
value = spectrum[int(bin0)] * (1.f - bin0 + (int)bin0);
|
value = spectrum[(int)(bin0)] * (1.f - bin0 + (int)bin0);
|
||||||
|
|
||||||
bin0 = 1 + int (bin0);
|
bin0 = 1 + (int)(bin0);
|
||||||
while (bin0 < int(bin1)) {
|
while (bin0 < (int)(bin1)) {
|
||||||
value += spectrum[int(bin0)];
|
value += spectrum[(int)(bin0)];
|
||||||
bin0 += 1.0;
|
bin0 += 1.0;
|
||||||
}
|
}
|
||||||
// Do not reference past end of freq array.
|
// Do not reference past end of freq array.
|
||||||
if (int(bin1) >= (int)half) {
|
if ((int)(bin1) >= (int)half) {
|
||||||
bin1 -= 1.0;
|
bin1 -= 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
value += spectrum[int(bin1)] * (bin1 - int(bin1));
|
value += spectrum[(int)(bin1)] * (bin1 - (int)(bin1));
|
||||||
value /= binwidth;
|
value /= binwidth;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
@ -2063,8 +2063,8 @@ static inline float findValue
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
index = std::min<int>(half - 1, int(floor(0.5 + bin0)));
|
index = std::min<int>(half - 1, (int)(floor(0.5 + bin0)));
|
||||||
limitIndex = std::min<int>(half, int(floor(0.5 + bin1)));
|
limitIndex = std::min<int>(half, (int)(floor(0.5 + bin1)));
|
||||||
}
|
}
|
||||||
value = spectrum[index];
|
value = spectrum[index];
|
||||||
while (++index < limitIndex)
|
while (++index < limitIndex)
|
||||||
@ -2307,9 +2307,9 @@ void TrackArtist::DrawClipSpectrum(WaveTrackCache &waveTrackCache,
|
|||||||
indexes[i] = -1;
|
indexes[i] = -1;
|
||||||
|
|
||||||
// Build a table of (most) values, put the index in it.
|
// Build a table of (most) values, put the index in it.
|
||||||
for (int i = int(i0); i < int(i1); i++) {
|
for (int i = (int)(i0); i < (int)(i1); i++) {
|
||||||
float freqi = freq[x0 + int(i)];
|
float freqi = freq[x0 + (int)(i)];
|
||||||
int value = int((freqi + gain + range) / range*(maxTableSize - 1));
|
int value = (int)((freqi + gain + range) / range*(maxTableSize - 1));
|
||||||
if (value < 0)
|
if (value < 0)
|
||||||
value = 0;
|
value = 0;
|
||||||
if (value >= maxTableSize)
|
if (value >= maxTableSize)
|
||||||
@ -2350,7 +2350,7 @@ void TrackArtist::DrawClipSpectrum(WaveTrackCache &waveTrackCache,
|
|||||||
float f = float(index)*bin2f;
|
float f = float(index)*bin2f;
|
||||||
if (findNotesQuantize)
|
if (findNotesQuantize)
|
||||||
{
|
{
|
||||||
f = expf(int(log(f / 440) / log2 * 12 - 0.5) / 12.0f*log2) * 440;
|
f = expf((int)(log(f / 440) / log2 * 12 - 0.5) / 12.0f*log2) * 440;
|
||||||
maxima[i] = f*f2bin;
|
maxima[i] = f*f2bin;
|
||||||
}
|
}
|
||||||
float f0 = expf((log(f / 440) / log2 * 24 - 1) / 24.0f*log2) * 440;
|
float f0 = expf((log(f / 440) / log2 * 24 - 1) / 24.0f*log2) * 440;
|
||||||
@ -2414,10 +2414,10 @@ void TrackArtist::DrawClipSpectrum(WaveTrackCache &waveTrackCache,
|
|||||||
const bool hidden = (ZoomInfo::HIDDEN == zoomInfo.GetFisheyeState());
|
const bool hidden = (ZoomInfo::HIDDEN == zoomInfo.GetFisheyeState());
|
||||||
const int begin = hidden
|
const int begin = hidden
|
||||||
? 0
|
? 0
|
||||||
: std::max(0, int(zoomInfo.GetFisheyeLeftBoundary(-leftOffset)));
|
: std::max(0, (int)(zoomInfo.GetFisheyeLeftBoundary(-leftOffset)));
|
||||||
const int end = hidden
|
const int end = hidden
|
||||||
? 0
|
? 0
|
||||||
: std::min(mid.width, int(zoomInfo.GetFisheyeRightBoundary(-leftOffset)));
|
: std::min(mid.width, (int)(zoomInfo.GetFisheyeRightBoundary(-leftOffset)));
|
||||||
const size_t numPixels = std::max(0, end - begin);
|
const size_t numPixels = std::max(0, end - begin);
|
||||||
const size_t zeroPaddingFactor = autocorrelation ? 1 : settings.ZeroPaddingFactor();
|
const size_t zeroPaddingFactor = autocorrelation ? 1 : settings.ZeroPaddingFactor();
|
||||||
SpecCache specCache
|
SpecCache specCache
|
||||||
@ -2688,7 +2688,7 @@ const char *LookupAtomAttribute(Alg_note_ptr note, Alg_attribute attr, char *def
|
|||||||
#define GREEN(i) ( unsigned char )( (((i) >> 8) & 0xff) )
|
#define GREEN(i) ( unsigned char )( (((i) >> 8) & 0xff) )
|
||||||
#define BLUE(i) ( unsigned char )( ((i) & 0xff) )
|
#define BLUE(i) ( unsigned char )( ((i) & 0xff) )
|
||||||
|
|
||||||
//#define PITCH_TO_Y(p) (rect.y + rect.height - int(pitchht * ((p) + 0.5 - pitch0) + 0.5))
|
//#define PITCH_TO_Y(p) (rect.y + rect.height - (int)(pitchht * ((p) + 0.5 - pitch0) + 0.5))
|
||||||
|
|
||||||
/*
|
/*
|
||||||
int PitchToY(double p, int bottom)
|
int PitchToY(double p, int bottom)
|
||||||
@ -3032,11 +3032,11 @@ void TrackArtist::DrawNoteTrack(const NoteTrack *track,
|
|||||||
// extreme zooms caues problems under windows, so we have to do some
|
// extreme zooms caues problems under windows, so we have to do some
|
||||||
// clipping before calling display routine
|
// clipping before calling display routine
|
||||||
if (xx < h) { // clip line on left
|
if (xx < h) { // clip line on left
|
||||||
yy = int((yy + (y1 - yy) * (h - xx) / (x1 - xx)) + 0.5);
|
yy = (int)((yy + (y1 - yy) * (h - xx) / (x1 - xx)) + 0.5);
|
||||||
xx = h;
|
xx = h;
|
||||||
}
|
}
|
||||||
if (x1 > h1) { // clip line on right
|
if (x1 > h1) { // clip line on right
|
||||||
y1 = int((yy + (y1 - yy) * (h1 - xx) / (x1 - xx)) + 0.5);
|
y1 = (int)((yy + (y1 - yy) * (h1 - xx) / (x1 - xx)) + 0.5);
|
||||||
x1 = h1;
|
x1 = h1;
|
||||||
}
|
}
|
||||||
AColor::Line(dc, TIME_TO_X(xx), yy, TIME_TO_X(x1), y1);
|
AColor::Line(dc, TIME_TO_X(xx), yy, TIME_TO_X(x1), y1);
|
||||||
@ -3352,7 +3352,7 @@ void TrackArtist::DrawBackgroundWithSelection(wxDC *dc, const wxRect &rect,
|
|||||||
wxRect within = rect;
|
wxRect within = rect;
|
||||||
wxRect after = rect;
|
wxRect after = rect;
|
||||||
|
|
||||||
before.width = int(zoomInfo.TimeToPosition(sel0) + 2);
|
before.width = (int)(zoomInfo.TimeToPosition(sel0) + 2);
|
||||||
if (before.GetRight() > rect.GetRight()) {
|
if (before.GetRight() > rect.GetRight()) {
|
||||||
before.width = rect.width;
|
before.width = rect.width;
|
||||||
}
|
}
|
||||||
@ -3363,7 +3363,7 @@ void TrackArtist::DrawBackgroundWithSelection(wxDC *dc, const wxRect &rect,
|
|||||||
|
|
||||||
within.x = 1 + before.GetRight();
|
within.x = 1 + before.GetRight();
|
||||||
}
|
}
|
||||||
within.width = rect.x + int(zoomInfo.TimeToPosition(sel1) + 2) - within.x;
|
within.width = rect.x + (int)(zoomInfo.TimeToPosition(sel1) + 2) - within.x;
|
||||||
|
|
||||||
if (within.GetRight() > rect.GetRight()) {
|
if (within.GetRight() > rect.GetRight()) {
|
||||||
within.width = 1 + rect.GetRight() - within.x;
|
within.width = 1 + rect.GetRight() - within.x;
|
||||||
|
@ -2990,13 +2990,13 @@ bool mayDragWidth, bool onlyWithinSnapDistance,
|
|||||||
const wxInt64 topSel = (f1 >= 0)
|
const wxInt64 topSel = (f1 >= 0)
|
||||||
? FrequencyToPosition(wt, f1, rect.y, rect.height)
|
? FrequencyToPosition(wt, f1, rect.y, rect.height)
|
||||||
: rect.y;
|
: rect.y;
|
||||||
wxInt64 signedBottomDist = int(event.m_y - bottomSel);
|
wxInt64 signedBottomDist = (int)(event.m_y - bottomSel);
|
||||||
wxInt64 verticalDist = std::abs(signedBottomDist);
|
wxInt64 verticalDist = std::abs(signedBottomDist);
|
||||||
if (bottomSel == topSel)
|
if (bottomSel == topSel)
|
||||||
// Top and bottom are too close to resolve on screen
|
// Top and bottom are too close to resolve on screen
|
||||||
chooseBottom = (signedBottomDist >= 0);
|
chooseBottom = (signedBottomDist >= 0);
|
||||||
else {
|
else {
|
||||||
const wxInt64 topDist = abs(int(event.m_y - topSel));
|
const wxInt64 topDist = abs((int)(event.m_y - topSel));
|
||||||
if (topDist < verticalDist)
|
if (topDist < verticalDist)
|
||||||
chooseBottom = false, verticalDist = topDist;
|
chooseBottom = false, verticalDist = topDist;
|
||||||
}
|
}
|
||||||
@ -3007,7 +3007,7 @@ bool mayDragWidth, bool onlyWithinSnapDistance,
|
|||||||
) {
|
) {
|
||||||
const wxInt64 centerSel =
|
const wxInt64 centerSel =
|
||||||
FrequencyToPosition(wt, fc, rect.y, rect.height);
|
FrequencyToPosition(wt, fc, rect.y, rect.height);
|
||||||
const wxInt64 centerDist = abs(int(event.m_y - centerSel));
|
const wxInt64 centerDist = abs((int)(event.m_y - centerSel));
|
||||||
if (centerDist < verticalDist)
|
if (centerDist < verticalDist)
|
||||||
chooseCenter = true, verticalDist = centerDist,
|
chooseCenter = true, verticalDist = centerDist,
|
||||||
ratio = f1 / fc;
|
ratio = f1 / fc;
|
||||||
@ -6309,7 +6309,7 @@ bool TrackPanel::IsOverCutline(WaveTrack * track, wxRect &rect, const wxMouseEve
|
|||||||
if (x >= 0 && x < rect.width)
|
if (x >= 0 && x < rect.width)
|
||||||
{
|
{
|
||||||
wxRect locRect;
|
wxRect locRect;
|
||||||
locRect.x = int(rect.x + x) - 5;
|
locRect.x = (int)(rect.x + x) - 5;
|
||||||
locRect.width = 11;
|
locRect.width = 11;
|
||||||
locRect.y = rect.y;
|
locRect.y = rect.y;
|
||||||
locRect.height = rect.height;
|
locRect.height = rect.height;
|
||||||
@ -7747,13 +7747,13 @@ void TrackPanel::OnVRulerMenu(Track *t, wxMouseEvent *pEvent)
|
|||||||
if (display == WaveTrack::Waveform) {
|
if (display == WaveTrack::Waveform) {
|
||||||
theMenu = mRulerWaveformMenu.get();
|
theMenu = mRulerWaveformMenu.get();
|
||||||
const int id =
|
const int id =
|
||||||
OnFirstWaveformScaleID + int(wt->GetWaveformSettings().scaleType);
|
OnFirstWaveformScaleID + (int)(wt->GetWaveformSettings().scaleType);
|
||||||
theMenu->Check(id, true);
|
theMenu->Check(id, true);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
theMenu = mRulerSpectrumMenu.get();
|
theMenu = mRulerSpectrumMenu.get();
|
||||||
const int id =
|
const int id =
|
||||||
OnFirstSpectrumScaleID + int(wt->GetSpectrogramSettings().scaleType);
|
OnFirstSpectrumScaleID + (int)(wt->GetSpectrogramSettings().scaleType);
|
||||||
theMenu->Check(id, true);
|
theMenu->Check(id, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -8525,7 +8525,7 @@ void TrackPanel::OnWaveformScaleType(wxCommandEvent &evt)
|
|||||||
const WaveformSettings::ScaleType newScaleType =
|
const WaveformSettings::ScaleType newScaleType =
|
||||||
WaveformSettings::ScaleType(
|
WaveformSettings::ScaleType(
|
||||||
std::max(0,
|
std::max(0,
|
||||||
std::min(int(WaveformSettings::stNumScaleTypes) - 1,
|
std::min((int)(WaveformSettings::stNumScaleTypes) - 1,
|
||||||
evt.GetId() - OnFirstWaveformScaleID
|
evt.GetId() - OnFirstWaveformScaleID
|
||||||
)));
|
)));
|
||||||
if (wt->GetWaveformSettings().scaleType != newScaleType) {
|
if (wt->GetWaveformSettings().scaleType != newScaleType) {
|
||||||
@ -8547,7 +8547,7 @@ void TrackPanel::OnSpectrumScaleType(wxCommandEvent &evt)
|
|||||||
const SpectrogramSettings::ScaleType newScaleType =
|
const SpectrogramSettings::ScaleType newScaleType =
|
||||||
SpectrogramSettings::ScaleType(
|
SpectrogramSettings::ScaleType(
|
||||||
std::max(0,
|
std::max(0,
|
||||||
std::min(int(SpectrogramSettings::stNumScaleTypes) - 1,
|
std::min((int)(SpectrogramSettings::stNumScaleTypes) - 1,
|
||||||
evt.GetId() - OnFirstSpectrumScaleID
|
evt.GetId() - OnFirstSpectrumScaleID
|
||||||
)));
|
)));
|
||||||
if (wt->GetSpectrogramSettings().scaleType != newScaleType) {
|
if (wt->GetSpectrogramSettings().scaleType != newScaleType) {
|
||||||
|
@ -288,7 +288,7 @@ const UndoState &UndoManager::SetStateTo
|
|||||||
|
|
||||||
current = n;
|
current = n;
|
||||||
|
|
||||||
if (current == int(stack.size()-1)) {
|
if (current == (int)(stack.size()-1)) {
|
||||||
*selectedRegion = stack[current]->state.selectedRegion;
|
*selectedRegion = stack[current]->state.selectedRegion;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -177,7 +177,7 @@ bool ViewInfo::ReadXMLAttribute(const wxChar *attr, const wxChar *value)
|
|||||||
if (!wxStrcmp(attr, wxT("vpos"))) {
|
if (!wxStrcmp(attr, wxT("vpos"))) {
|
||||||
long longVpos;
|
long longVpos;
|
||||||
wxString(value).ToLong(&longVpos);
|
wxString(value).ToLong(&longVpos);
|
||||||
vpos = int(longVpos);
|
vpos = (int)(longVpos);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -923,7 +923,7 @@ bool SpecCache::CalculateOneSpectrum
|
|||||||
freqCorrection = multiplier * quotIm;
|
freqCorrection = multiplier * quotIm;
|
||||||
}
|
}
|
||||||
|
|
||||||
const int bin = int(ii + freqCorrection + 0.5f);
|
const int bin = (int)(ii + freqCorrection + 0.5f);
|
||||||
if (bin >= 0 && bin < hFFT->Points) {
|
if (bin >= 0 && bin < hFFT->Points) {
|
||||||
double timeCorrection;
|
double timeCorrection;
|
||||||
{
|
{
|
||||||
@ -1058,7 +1058,7 @@ void SpecCache::Populate
|
|||||||
// I'm not sure what's a good stopping criterion?
|
// I'm not sure what's a good stopping criterion?
|
||||||
auto xx = lowerBoundX;
|
auto xx = lowerBoundX;
|
||||||
const double pixelsPerSample = pixelsPerSecond / rate;
|
const double pixelsPerSample = pixelsPerSecond / rate;
|
||||||
const int limit = std::min(int(0.5 + fftLen * pixelsPerSample), 100);
|
const int limit = std::min((int)(0.5 + fftLen * pixelsPerSample), 100);
|
||||||
for (int ii = 0; ii < limit; ++ii)
|
for (int ii = 0; ii < limit; ++ii)
|
||||||
{
|
{
|
||||||
const bool result =
|
const bool result =
|
||||||
|
@ -210,7 +210,7 @@ WaveTrack::WaveTrackDisplay WaveTrack::FindDefaultViewMode()
|
|||||||
if (viewMode < 0) {
|
if (viewMode < 0) {
|
||||||
int oldMode;
|
int oldMode;
|
||||||
gPrefs->Read(wxT("/GUI/DefaultViewMode"), &oldMode,
|
gPrefs->Read(wxT("/GUI/DefaultViewMode"), &oldMode,
|
||||||
int(WaveTrack::Waveform));
|
(int)(WaveTrack::Waveform));
|
||||||
viewMode = WaveTrack::ConvertLegacyDisplayValue(oldMode);
|
viewMode = WaveTrack::ConvertLegacyDisplayValue(oldMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -736,7 +736,7 @@ EffectNoiseReduction::Worker::Worker
|
|||||||
|
|
||||||
, mSpectrumSize(1 + mWindowSize / 2)
|
, mSpectrumSize(1 + mWindowSize / 2)
|
||||||
, mFreqSmoothingScratch(mSpectrumSize)
|
, mFreqSmoothingScratch(mSpectrumSize)
|
||||||
, mFreqSmoothingBins(int(settings.mFreqSmoothingBands))
|
, mFreqSmoothingBins((int)(settings.mFreqSmoothingBands))
|
||||||
, mBinLow(0)
|
, mBinLow(0)
|
||||||
, mBinHigh(mSpectrumSize)
|
, mBinHigh(mSpectrumSize)
|
||||||
|
|
||||||
@ -1415,7 +1415,7 @@ struct ControlInfo {
|
|||||||
wxString Text(double value) const
|
wxString Text(double value) const
|
||||||
{
|
{
|
||||||
if (formatAsInt)
|
if (formatAsInt)
|
||||||
return wxString::Format(format, int(value));
|
return wxString::Format(format, (int)(value));
|
||||||
else
|
else
|
||||||
return wxString::Format(format, value);
|
return wxString::Format(format, value);
|
||||||
}
|
}
|
||||||
|
@ -329,7 +329,7 @@ bool VampEffect::SetAutomationParameters(EffectAutomationParameters & parms)
|
|||||||
|
|
||||||
if (qs != 0.0)
|
if (qs != 0.0)
|
||||||
{
|
{
|
||||||
val = int((val - lower) / qs + 0.5) * qs + lower;
|
val = (int)((val - lower) / qs + 0.5) * qs + lower;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -844,7 +844,7 @@ void VampEffect::UpdateFromPlugin()
|
|||||||
|
|
||||||
if (qs != 0.0)
|
if (qs != 0.0)
|
||||||
{
|
{
|
||||||
value = int((value - lower) / qs + 0.5) * qs + lower;
|
value = (int)((value - lower) / qs + 0.5) * qs + lower;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -891,7 +891,7 @@ void VampEffect::OnSlider(wxCommandEvent & evt)
|
|||||||
|
|
||||||
if (qs != 0.0)
|
if (qs != 0.0)
|
||||||
{
|
{
|
||||||
val = int(val / qs + 0.5) * qs;
|
val = (int)(val / qs + 0.5) * qs;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -920,7 +920,7 @@ void VampEffect::OnTextCtrl(wxCommandEvent & evt)
|
|||||||
|
|
||||||
if (qs != 0.0)
|
if (qs != 0.0)
|
||||||
{
|
{
|
||||||
val = int((val - lower) / qs + 0.5) * qs + lower;
|
val = (int)((val - lower) / qs + 0.5) * qs + lower;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1087,9 +1087,9 @@ void ExportMixerPanel::OnPaint(wxPaintEvent & WXUNUSED(event))
|
|||||||
|
|
||||||
for( int i = 0; i < mMixerSpec->GetNumTracks(); i++ )
|
for( int i = 0; i < mMixerSpec->GetNumTracks(); i++ )
|
||||||
{
|
{
|
||||||
mTrackRects[ i ].x = ( int )( mBoxWidth * 2 + radius - radius *
|
mTrackRects[ i ].x = (int)( mBoxWidth * 2 + radius - radius *
|
||||||
cos( totAngle / 2.0 - angle * ( i + 1 ) ) - mBoxWidth + 0.5 );
|
cos( totAngle / 2.0 - angle * ( i + 1 ) ) - mBoxWidth + 0.5 );
|
||||||
mTrackRects[ i ].y = ( int )( mHeight * 0.5 - radius *
|
mTrackRects[ i ].y = (int)( mHeight * 0.5 - radius *
|
||||||
sin( totAngle * 0.5 - angle * ( i + 1.0 ) ) -
|
sin( totAngle * 0.5 - angle * ( i + 1.0 ) ) -
|
||||||
0.5 * mTrackHeight + 0.5 );
|
0.5 * mTrackHeight + 0.5 );
|
||||||
|
|
||||||
@ -1115,9 +1115,9 @@ void ExportMixerPanel::OnPaint(wxPaintEvent & WXUNUSED(event))
|
|||||||
|
|
||||||
for( int i = 0; i < mMixerSpec->GetNumChannels(); i++ )
|
for( int i = 0; i < mMixerSpec->GetNumChannels(); i++ )
|
||||||
{
|
{
|
||||||
mChannelRects[ i ].x = ( int )( mBoxWidth * 4 - radius + radius *
|
mChannelRects[ i ].x = (int)( mBoxWidth * 4 - radius + radius *
|
||||||
cos( totAngle * 0.5 - angle * ( i + 1 ) ) + 0.5 );
|
cos( totAngle * 0.5 - angle * ( i + 1 ) ) + 0.5 );
|
||||||
mChannelRects[ i ].y = ( int )( mHeight * 0.5 - radius *
|
mChannelRects[ i ].y = (int)( mHeight * 0.5 - radius *
|
||||||
sin( totAngle * 0.5 - angle * ( i + 1 ) ) -
|
sin( totAngle * 0.5 - angle * ( i + 1 ) ) -
|
||||||
0.5 * mChannelHeight + 0.5 );
|
0.5 * mChannelHeight + 0.5 );
|
||||||
|
|
||||||
|
@ -195,7 +195,7 @@ int ExportOGG::Export(AudacityProject *project,
|
|||||||
|
|
||||||
// Encoding setup
|
// Encoding setup
|
||||||
vorbis_info_init(&info);
|
vorbis_info_init(&info);
|
||||||
vorbis_encode_init_vbr(&info, numChannels, int(rate + 0.5), quality);
|
vorbis_encode_init_vbr(&info, numChannels, (int)(rate + 0.5), quality);
|
||||||
|
|
||||||
// Retrieve tags
|
// Retrieve tags
|
||||||
if (!FillComment(project, &comment, metadata)) {
|
if (!FillComment(project, &comment, metadata)) {
|
||||||
|
@ -237,10 +237,10 @@ bool SpectrogramSettings::Validate(bool quiet)
|
|||||||
std::max(0, std::min(NumWindowFuncs() - 1, windowType));
|
std::max(0, std::min(NumWindowFuncs() - 1, windowType));
|
||||||
scaleType =
|
scaleType =
|
||||||
ScaleType(std::max(0,
|
ScaleType(std::max(0,
|
||||||
std::min(int(SpectrogramSettings::stNumScaleTypes) - 1,
|
std::min((int)(SpectrogramSettings::stNumScaleTypes) - 1,
|
||||||
int(scaleType))));
|
(int)(scaleType))));
|
||||||
algorithm = Algorithm(
|
algorithm = Algorithm(
|
||||||
std::max(0, std::min(int(algNumAlgorithms) - 1, int(algorithm)))
|
std::max(0, std::min((int)(algNumAlgorithms) - 1, (int)(algorithm)))
|
||||||
);
|
);
|
||||||
ConvertToEnumeratedWindowSizes();
|
ConvertToEnumeratedWindowSizes();
|
||||||
ConvertToActualWindowSizes();
|
ConvertToActualWindowSizes();
|
||||||
|
@ -81,10 +81,10 @@ void TracksPrefs::Populate()
|
|||||||
// we don't display them by increasing integer values.
|
// we don't display them by increasing integer values.
|
||||||
|
|
||||||
mViewChoices.Add(_("Waveform"));
|
mViewChoices.Add(_("Waveform"));
|
||||||
mViewCodes.Add(int(WaveTrack::Waveform));
|
mViewCodes.Add((int)(WaveTrack::Waveform));
|
||||||
|
|
||||||
mViewChoices.Add(_("Waveform (dB)"));
|
mViewChoices.Add(_("Waveform (dB)"));
|
||||||
mViewCodes.Add(int(WaveTrack::obsoleteWaveformDBDisplay));
|
mViewCodes.Add((int)(WaveTrack::obsoleteWaveformDBDisplay));
|
||||||
|
|
||||||
mViewChoices.Add(_("Spectrogram"));
|
mViewChoices.Add(_("Spectrogram"));
|
||||||
mViewCodes.Add(WaveTrack::Spectrum);
|
mViewCodes.Add(WaveTrack::Spectrum);
|
||||||
|
@ -73,7 +73,7 @@ WaveformSettings& WaveformSettings::defaults()
|
|||||||
bool WaveformSettings::Validate(bool /* quiet */)
|
bool WaveformSettings::Validate(bool /* quiet */)
|
||||||
{
|
{
|
||||||
scaleType = ScaleType(
|
scaleType = ScaleType(
|
||||||
std::max(0, std::min(int(stNumScaleTypes) - 1, int(scaleType)))
|
std::max(0, std::min((int)(stNumScaleTypes) - 1, (int)(scaleType)))
|
||||||
);
|
);
|
||||||
|
|
||||||
ConvertToEnumeratedDBRange();
|
ConvertToEnumeratedDBRange();
|
||||||
@ -125,9 +125,9 @@ void WaveformSettings::ConvertToActualDBRange()
|
|||||||
wxArrayString codes;
|
wxArrayString codes;
|
||||||
GUIPrefs::GetRangeChoices(NULL, &codes);
|
GUIPrefs::GetRangeChoices(NULL, &codes);
|
||||||
long value = 0;
|
long value = 0;
|
||||||
codes[std::max(0, std::min(int(codes.size()) - 1, dBRange))]
|
codes[std::max(0, std::min((int)(codes.size()) - 1, dBRange))]
|
||||||
.ToLong(&value);
|
.ToLong(&value);
|
||||||
dBRange = int(value);
|
dBRange = (int)(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WaveformSettings::NextLowerDBRange()
|
void WaveformSettings::NextLowerDBRange()
|
||||||
|
@ -891,7 +891,7 @@ void NumericConverter::ControlsToValue()
|
|||||||
|
|
||||||
t /= mScalingFactor;
|
t /= mScalingFactor;
|
||||||
if(mNtscDrop) {
|
if(mNtscDrop) {
|
||||||
int t_int = int(t + .000000001);
|
int t_int = (int)(t + .000000001);
|
||||||
double t_frac = (t - t_int);
|
double t_frac = (t - t_int);
|
||||||
int tenMins = t_int/600;
|
int tenMins = t_int/600;
|
||||||
double frames = tenMins*17982;
|
double frames = tenMins*17982;
|
||||||
|
@ -1114,7 +1114,7 @@ void Ruler::Update(const TimeTrack* timetrack)// Envelope *speedEnv, long minSpe
|
|||||||
if (mMin * mMax < 0.0) {
|
if (mMin * mMax < 0.0) {
|
||||||
int mid;
|
int mid;
|
||||||
if (zoomInfo != NULL)
|
if (zoomInfo != NULL)
|
||||||
mid = int(zoomInfo->TimeToPosition(0.0, mLeftOffset));
|
mid = (int)(zoomInfo->TimeToPosition(0.0, mLeftOffset));
|
||||||
else
|
else
|
||||||
mid = (int)(mLength*(mMin / (mMin - mMax)) + 0.5);
|
mid = (int)(mLength*(mMin / (mMin - mMax)) + 0.5);
|
||||||
const int iMaxPos = (mOrientation == wxHORIZONTAL) ? mRight : mBottom - 5;
|
const int iMaxPos = (mOrientation == wxHORIZONTAL) ? mRight : mBottom - 5;
|
||||||
@ -1240,8 +1240,8 @@ void Ruler::Update(const TimeTrack* timetrack)// Envelope *speedEnv, long minSpe
|
|||||||
for (i = 0; i <= steps; i++) {
|
for (i = 0; i <= steps; i++) {
|
||||||
// PRL: Bug1038. Don't label 1.6, rounded, as a duplicate tick for "2"
|
// PRL: Bug1038. Don't label 1.6, rounded, as a duplicate tick for "2"
|
||||||
if (!(mFormat == IntFormat && decade < 10.0)) {
|
if (!(mFormat == IntFormat && decade < 10.0)) {
|
||||||
for (int f = start; f != int(end); f += mstep) {
|
for (int f = start; f != (int)(end); f += mstep) {
|
||||||
if (int(f / 10) != f / 10.0f) {
|
if ((int)(f / 10) != f / 10.0f) {
|
||||||
val = decade * f / 10;
|
val = decade * f / 10;
|
||||||
if (val >= rMin && val < rMax) {
|
if (val >= rMin && val < rMax) {
|
||||||
const int pos(0.5 + mLength * numberScale.ValueToPosition(val));
|
const int pos(0.5 + mLength * numberScale.ValueToPosition(val));
|
||||||
@ -1682,8 +1682,8 @@ inline int IndicatorWidthForHeight(int height)
|
|||||||
|
|
||||||
inline int IndicatorBigHeight()
|
inline int IndicatorBigHeight()
|
||||||
{
|
{
|
||||||
return std::max(int(ScrubHeight - TopMargin),
|
return std::max((int)(ScrubHeight - TopMargin),
|
||||||
int(IndicatorMediumWidth));
|
(int)(IndicatorMediumWidth));
|
||||||
}
|
}
|
||||||
|
|
||||||
inline int IndicatorBigWidth()
|
inline int IndicatorBigWidth()
|
||||||
@ -2277,7 +2277,7 @@ void AdornedRulerPanel::UpdateRects()
|
|||||||
|
|
||||||
if (mShowScrubbing) {
|
if (mShowScrubbing) {
|
||||||
mScrubZone = mInner;
|
mScrubZone = mInner;
|
||||||
auto scrubHeight = std::min(mScrubZone.height, int(ScrubHeight));
|
auto scrubHeight = std::min(mScrubZone.height, (int)(ScrubHeight));
|
||||||
|
|
||||||
int topHeight;
|
int topHeight;
|
||||||
#ifdef SCRUB_ABOVE
|
#ifdef SCRUB_ABOVE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user