Silence some conversion warnings
This commit is contained in:
@@ -1040,13 +1040,13 @@ TagLib::ID3v2::PopularimeterFrame *TagReaderTagLib::GetPOPMFrameFromTag(TagLib::
|
|||||||
|
|
||||||
float TagReaderTagLib::ConvertPOPMRating(const int POPM_rating) {
|
float TagReaderTagLib::ConvertPOPMRating(const int POPM_rating) {
|
||||||
|
|
||||||
if (POPM_rating < 0x01) return 0.0;
|
if (POPM_rating < 0x01) return 0.0F;
|
||||||
else if (POPM_rating < 0x40) return 0.20;
|
else if (POPM_rating < 0x40) return 0.20F;
|
||||||
else if (POPM_rating < 0x80) return 0.40;
|
else if (POPM_rating < 0x80) return 0.40F;
|
||||||
else if (POPM_rating < 0xC0) return 0.60;
|
else if (POPM_rating < 0xC0) return 0.60F;
|
||||||
else if (POPM_rating < 0xFC) return 0.80;
|
else if (POPM_rating < 0xFC) return 0.80F;
|
||||||
|
|
||||||
return 1.0;
|
return 1.0F;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ void Analyzer::Base::transform(Scope &scope) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fht_->logSpectrum(scope.data(), aux.data());
|
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
|
scope.resize(fht_->size() / 2); // second half of values are rubbish
|
||||||
|
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ void BlockAnalyzer::transform(Analyzer::Scope &s) {
|
|||||||
for (uint x = 0; x < s.size(); ++x) s[x] *= 2;
|
for (uint x = 0; x < s.size(); ++x) s[x] *= 2;
|
||||||
|
|
||||||
fht_->spectrum(s.data());
|
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!
|
// 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());
|
s.resize(scope_.size() <= kMaxColumns / 2 ? kMaxColumns / 2 : scope_.size());
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ void BoomAnalyzer::resizeEvent(QResizeEvent *e) {
|
|||||||
void BoomAnalyzer::transform(Scope &s) {
|
void BoomAnalyzer::transform(Scope &s) {
|
||||||
|
|
||||||
fht_->spectrum(s.data());
|
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());
|
s.resize(scope_.size() <= static_cast<quint64>(kMaxBandCount) / 2 ? kMaxBandCount / 2 : scope_.size());
|
||||||
|
|
||||||
|
|||||||
@@ -1383,10 +1383,10 @@ void GstEnginePipeline::UpdateEqualizer() {
|
|||||||
for (int i = 0; i < kEqBandCount; ++i) {
|
for (int i = 0; i < kEqBandCount; ++i) {
|
||||||
float gain = eq_enabled_ ? static_cast<float>(eq_band_gains_[i]) : static_cast<float>(0.0);
|
float gain = eq_enabled_ ? static_cast<float>(eq_band_gains_[i]) : static_cast<float>(0.0);
|
||||||
if (gain < 0) {
|
if (gain < 0) {
|
||||||
gain *= 0.24;
|
gain *= 0.24F;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
gain *= 0.12;
|
gain *= 0.12F;
|
||||||
}
|
}
|
||||||
|
|
||||||
const int index_in_eq = i + 1;
|
const int index_in_eq = i + 1;
|
||||||
@@ -1397,8 +1397,8 @@ void GstEnginePipeline::UpdateEqualizer() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Update preamp
|
// Update preamp
|
||||||
float preamp = 1.0;
|
float preamp = 1.0F;
|
||||||
if (eq_enabled_) preamp = static_cast<float>(eq_preamp_ + 100) * static_cast<float>(0.01); // To scale from 0.0 to 2.0
|
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);
|
g_object_set(G_OBJECT(equalizer_preamp_), "volume", preamp, nullptr);
|
||||||
|
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ const int QueuedItemDelegate::kQueueBoxLength = 30;
|
|||||||
const QRgb QueuedItemDelegate::kQueueBoxGradientColor1 = qRgb(102, 150, 227);
|
const QRgb QueuedItemDelegate::kQueueBoxGradientColor1 = qRgb(102, 150, 227);
|
||||||
const QRgb QueuedItemDelegate::kQueueBoxGradientColor2 = qRgb(77, 121, 200);
|
const QRgb QueuedItemDelegate::kQueueBoxGradientColor2 = qRgb(77, 121, 200);
|
||||||
const int QueuedItemDelegate::kQueueOpacitySteps = 10;
|
const int QueuedItemDelegate::kQueueOpacitySteps = 10;
|
||||||
const float QueuedItemDelegate::kQueueOpacityLowerBound = 0.4;
|
const float QueuedItemDelegate::kQueueOpacityLowerBound = 0.4F;
|
||||||
|
|
||||||
const int PlaylistDelegateBase::kMinHeight = 19;
|
const int PlaylistDelegateBase::kMinHeight = 19;
|
||||||
|
|
||||||
@@ -100,7 +100,7 @@ void QueuedItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &op
|
|||||||
if (ok && queue_pos != -1) {
|
if (ok && queue_pos != -1) {
|
||||||
float opacity = static_cast<float>(kQueueOpacitySteps - qMin(kQueueOpacitySteps, queue_pos));
|
float opacity = static_cast<float>(kQueueOpacitySteps - qMin(kQueueOpacitySteps, queue_pos));
|
||||||
opacity /= kQueueOpacitySteps;
|
opacity /= kQueueOpacitySteps;
|
||||||
opacity *= static_cast<float>(1.0) - static_cast<float>(kQueueOpacityLowerBound);
|
opacity *= 1.0F - kQueueOpacityLowerBound;
|
||||||
opacity += kQueueOpacityLowerBound;
|
opacity += kQueueOpacityLowerBound;
|
||||||
DrawBox(painter, option.rect, option.font, QString::number(queue_pos + 1), kQueueBoxLength, opacity);
|
DrawBox(painter, option.rect, option.font, QString::number(queue_pos + 1), kQueueBoxLength, opacity);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -424,8 +424,8 @@ void VolumeSlider::drawVolumeSliderHandle() {
|
|||||||
painter.drawImage(0, 0, pixmapHandle);
|
painter.drawImage(0, 0, pixmapHandle);
|
||||||
|
|
||||||
// BEGIN Calculate handle animation pixmaps for mouse-over effect
|
// BEGIN Calculate handle animation pixmaps for mouse-over effect
|
||||||
float opacity = 0.0;
|
float opacity = 0.0F;
|
||||||
const float step = 1.0 / ANIM_MAX;
|
const float step = 1.0F / ANIM_MAX;
|
||||||
QImage dst;
|
QImage dst;
|
||||||
handle_pixmaps_.clear();
|
handle_pixmaps_.clear();
|
||||||
for (int i = 0; i < ANIM_MAX; ++i) {
|
for (int i = 0; i < ANIM_MAX; ++i) {
|
||||||
|
|||||||
Reference in New Issue
Block a user