Remove use of C-style casts

This commit is contained in:
staticssleever668
2021-10-11 23:28:28 +03:00
committed by Jonas Kvinge
parent 637772f8f0
commit b38ad81928
41 changed files with 84 additions and 84 deletions

View File

@@ -384,7 +384,7 @@ bool GstEnginePipeline::InitAudioBin() {
g_object_set(G_OBJECT(rgvolume), "album-mode", rg_mode_, nullptr);
g_object_set(G_OBJECT(rgvolume), "pre-amp", rg_preamp_, nullptr);
g_object_set(G_OBJECT(rgvolume), "fallback-gain", rg_fallbackgain_, nullptr);
g_object_set(G_OBJECT(rglimiter), "enabled", int(rg_compression_), nullptr);
g_object_set(G_OBJECT(rglimiter), "enabled", static_cast<int>(rg_compression_), nullptr);
}
}
@@ -671,7 +671,7 @@ GstPadProbeReturn GstEnginePipeline::HandoffCallback(GstPad *pad, GstPadProbeInf
int16_t *d = static_cast<int16_t*>(g_malloc(buf16_size));
memset(d, 0, buf16_size);
for (int i = 0; i < (samples * channels); ++i) {
float sample_float = (s[i] * float(32768.0));
float sample_float = (s[i] * static_cast<float>(32768.0));
d[i] = static_cast<int16_t>(sample_float);
}
gst_buffer_unmap(buf, &map_info);
@@ -1173,7 +1173,7 @@ void GstEnginePipeline::SetVolumeModifier(const qreal mod) {
void GstEnginePipeline::UpdateVolume() {
if (!volume_) return;
double vol = double(volume_percent_) * double(0.01) * volume_modifier_;
double vol = static_cast<double>(volume_percent_) * static_cast<double>(0.01) * volume_modifier_;
g_object_set(G_OBJECT(volume_), "volume", vol, nullptr);
}
@@ -1207,7 +1207,7 @@ void GstEnginePipeline::UpdateEqualizer() {
// Update band gains
for (int i = 0; i < kEqBandCount; ++i) {
float gain = eq_enabled_ ? eq_band_gains_[i] : float(0.0);
float gain = eq_enabled_ ? eq_band_gains_[i] : static_cast<float>(0.0);
if (gain < 0) {
gain *= 0.24;
}
@@ -1224,7 +1224,7 @@ void GstEnginePipeline::UpdateEqualizer() {
// Update preamp
float preamp = 1.0;
if (eq_enabled_) preamp = float(eq_preamp_ + 100) * float(0.01); // To scale from 0.0 to 2.0
if (eq_enabled_) preamp = static_cast<float>(eq_preamp_ + 100) * static_cast<float>(0.01); // To scale from 0.0 to 2.0
g_object_set(G_OBJECT(equalizer_preamp_), "volume", preamp, nullptr);

View File

@@ -54,7 +54,7 @@ QList<DeviceFinder::Device> MMDeviceFinder::ListDevices() {
devices.append(default_device);
IMMDeviceEnumerator *enumerator = nullptr;
HRESULT hr = CoCreateInstance(CLSID_MMDeviceEnumerator, nullptr, CLSCTX_ALL, IID_IMMDeviceEnumerator, (void**)&enumerator);
HRESULT hr = CoCreateInstance(CLSID_MMDeviceEnumerator, nullptr, CLSCTX_ALL, IID_IMMDeviceEnumerator, reinterpret_cast<void**>(&enumerator));
if (hr == S_OK) {
IMMDeviceCollection *collection = nullptr;
hr = enumerator->EnumAudioEndpoints(eRender, DEVICE_STATE_ACTIVE, &collection);

View File

@@ -182,7 +182,7 @@ void VLCEngine::Seek(const quint64 offset_nanosec) {
uint len = length();
if (len == 0) return;
float pos = float(offset) / len;
float pos = static_cast<float>(offset) / len;
libvlc_media_player_set_position(player_, pos);