mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-16 18:35:35 +08:00
[AFV] style, const, formatting
This commit is contained in:
@@ -53,8 +53,8 @@ namespace BlackCore
|
||||
{
|
||||
OutputVolumeStreamArgs outputVolumeStreamArgs;
|
||||
outputVolumeStreamArgs.PeakRaw = m_maxSampleOutput / 1.0;
|
||||
outputVolumeStreamArgs.PeakDB = static_cast<float>(20 * std::log10(outputVolumeStreamArgs.PeakRaw));
|
||||
const double db = qBound(m_minDb, outputVolumeStreamArgs.PeakDB, m_maxDb);
|
||||
outputVolumeStreamArgs.PeakDb = static_cast<float>(20 * std::log10(outputVolumeStreamArgs.PeakRaw));
|
||||
const double db = qBound(m_minDb, outputVolumeStreamArgs.PeakDb, m_maxDb);
|
||||
double ratio = (db - m_minDb) / (m_maxDb - m_minDb);
|
||||
if (ratio < 0.30) { ratio = 0.0; }
|
||||
if (ratio > 1.0) { ratio = 1.0; }
|
||||
|
||||
@@ -26,9 +26,9 @@ namespace BlackCore
|
||||
//! Stream args
|
||||
struct OutputVolumeStreamArgs
|
||||
{
|
||||
double PeakRaw = 0.0;
|
||||
double PeakDB = -1 * std::numeric_limits<double>::infinity();
|
||||
double PeakVU = 0.0;
|
||||
double PeakRaw = 0.0; //!< raw peak
|
||||
double PeakDb = -1 * std::numeric_limits<double>::infinity(); //!< dB peak
|
||||
double PeakVU = 0.0; //!< VU peak
|
||||
};
|
||||
|
||||
//! Output buffer
|
||||
@@ -60,9 +60,9 @@ namespace BlackCore
|
||||
static constexpr int SampleCountPerEvent = 4800;
|
||||
QAudioFormat m_outputFormat;
|
||||
float m_maxSampleOutput = 0.0;
|
||||
int m_sampleCount = 0;
|
||||
const double m_maxDb = 0;
|
||||
const double m_minDb = -40;
|
||||
int m_sampleCount = 0;
|
||||
const double m_maxDb = 0;
|
||||
const double m_minDb = -40;
|
||||
};
|
||||
|
||||
//! Output
|
||||
@@ -95,10 +95,9 @@ namespace BlackCore
|
||||
|
||||
private:
|
||||
bool m_started = false;
|
||||
|
||||
BlackMisc::Audio::CAudioDeviceInfo m_device;
|
||||
QScopedPointer<QAudioOutput> m_audioOutputCom;
|
||||
CAudioOutputBuffer *m_audioOutputBuffer = nullptr;
|
||||
QScopedPointer<QAudioOutput> m_audioOutputCom;
|
||||
CAudioOutputBuffer *m_audioOutputBuffer = nullptr;
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
Reference in New Issue
Block a user