1
0
mirror of https://github.com/strawberrymusicplayer/strawberry synced 2025-02-02 18:46:46 +01:00

Silence some conversion warnings

This commit is contained in:
Jonas Kvinge 2022-02-06 04:19:45 +01:00
parent 8bf473dc3a
commit eee3445d2f
7 changed files with 17 additions and 17 deletions

View File

@ -1040,13 +1040,13 @@ TagLib::ID3v2::PopularimeterFrame *TagReaderTagLib::GetPOPMFrameFromTag(TagLib::
float TagReaderTagLib::ConvertPOPMRating(const int POPM_rating) {
if (POPM_rating < 0x01) return 0.0;
else if (POPM_rating < 0x40) return 0.20;
else if (POPM_rating < 0x80) return 0.40;
else if (POPM_rating < 0xC0) return 0.60;
else if (POPM_rating < 0xFC) return 0.80;
if (POPM_rating < 0x01) return 0.0F;
else if (POPM_rating < 0x40) return 0.20F;
else if (POPM_rating < 0x80) return 0.40F;
else if (POPM_rating < 0xC0) return 0.60F;
else if (POPM_rating < 0xFC) return 0.80F;
return 1.0;
return 1.0F;
}

View File

@ -73,7 +73,7 @@ void Analyzer::Base::transform(Scope &scope) {
}
fht_->logSpectrum(scope.data(), aux.data());
fht_->scale(scope.data(), 1.0 / 20);
fht_->scale(scope.data(), 1.0F / 20);
scope.resize(fht_->size() / 2); // second half of values are rubbish

View File

@ -130,7 +130,7 @@ void BlockAnalyzer::transform(Analyzer::Scope &s) {
for (uint x = 0; x < s.size(); ++x) s[x] *= 2;
fht_->spectrum(s.data());
fht_->scale(s.data(), 1.0 / 20);
fht_->scale(s.data(), 1.0F / 20);
// the second half is pretty dull, so only show it if the user has a large analyzer by setting to scope_.size() if large we prevent interpolation of large analyzers, this is good!
s.resize(scope_.size() <= kMaxColumns / 2 ? kMaxColumns / 2 : scope_.size());

View File

@ -102,7 +102,7 @@ void BoomAnalyzer::resizeEvent(QResizeEvent *e) {
void BoomAnalyzer::transform(Scope &s) {
fht_->spectrum(s.data());
fht_->scale(s.data(), 1.0 / 50);
fht_->scale(s.data(), 1.0F / 50);
s.resize(scope_.size() <= static_cast<quint64>(kMaxBandCount) / 2 ? kMaxBandCount / 2 : scope_.size());

View File

@ -1383,10 +1383,10 @@ void GstEnginePipeline::UpdateEqualizer() {
for (int i = 0; i < kEqBandCount; ++i) {
float gain = eq_enabled_ ? static_cast<float>(eq_band_gains_[i]) : static_cast<float>(0.0);
if (gain < 0) {
gain *= 0.24;
gain *= 0.24F;
}
else {
gain *= 0.12;
gain *= 0.12F;
}
const int index_in_eq = i + 1;
@ -1397,8 +1397,8 @@ void GstEnginePipeline::UpdateEqualizer() {
}
// Update preamp
float preamp = 1.0;
if (eq_enabled_) preamp = static_cast<float>(eq_preamp_ + 100) * static_cast<float>(0.01); // To scale from 0.0 to 2.0
float preamp = 1.0F;
if (eq_enabled_) preamp = static_cast<float>(eq_preamp_ + 100) * 0.01F; // To scale from 0.0 to 2.0
g_object_set(G_OBJECT(equalizer_preamp_), "volume", preamp, nullptr);

View File

@ -82,7 +82,7 @@ const int QueuedItemDelegate::kQueueBoxLength = 30;
const QRgb QueuedItemDelegate::kQueueBoxGradientColor1 = qRgb(102, 150, 227);
const QRgb QueuedItemDelegate::kQueueBoxGradientColor2 = qRgb(77, 121, 200);
const int QueuedItemDelegate::kQueueOpacitySteps = 10;
const float QueuedItemDelegate::kQueueOpacityLowerBound = 0.4;
const float QueuedItemDelegate::kQueueOpacityLowerBound = 0.4F;
const int PlaylistDelegateBase::kMinHeight = 19;
@ -100,7 +100,7 @@ void QueuedItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &op
if (ok && queue_pos != -1) {
float opacity = static_cast<float>(kQueueOpacitySteps - qMin(kQueueOpacitySteps, queue_pos));
opacity /= kQueueOpacitySteps;
opacity *= static_cast<float>(1.0) - static_cast<float>(kQueueOpacityLowerBound);
opacity *= 1.0F - kQueueOpacityLowerBound;
opacity += kQueueOpacityLowerBound;
DrawBox(painter, option.rect, option.font, QString::number(queue_pos + 1), kQueueBoxLength, opacity);
}

View File

@ -424,8 +424,8 @@ void VolumeSlider::drawVolumeSliderHandle() {
painter.drawImage(0, 0, pixmapHandle);
// BEGIN Calculate handle animation pixmaps for mouse-over effect
float opacity = 0.0;
const float step = 1.0 / ANIM_MAX;
float opacity = 0.0F;
const float step = 1.0F / ANIM_MAX;
QImage dst;
handle_pixmaps_.clear();
for (int i = 0; i < ANIM_MAX; ++i) {