mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 09:15:34 +08:00
Ref T730, style
This commit is contained in:
committed by
Mat Sutcliffe
parent
bed49ff072
commit
e33e06b21e
@@ -28,24 +28,30 @@ namespace BlackSound
|
||||
VHFEmulation = 1
|
||||
};
|
||||
|
||||
//! Equalizer
|
||||
class BLACKSOUND_EXPORT CEqualizerSampleProvider : public ISampleProvider
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
//! Ctor
|
||||
CEqualizerSampleProvider(ISampleProvider *sourceProvider, EqualizerPresets preset, QObject *parent = nullptr);
|
||||
|
||||
//! \copydoc ISampleProvider::readSamples
|
||||
virtual int readSamples(QVector<qint16> &samples, qint64 count) override;
|
||||
|
||||
//! Bypassing?
|
||||
void setBypassEffects(bool value) { m_bypass = value; }
|
||||
|
||||
//! Gain @{
|
||||
double outputGain() const;
|
||||
void setOutputGain(double outputGain);
|
||||
//! @}
|
||||
|
||||
private:
|
||||
void setupPreset(EqualizerPresets preset);
|
||||
|
||||
ISampleProvider *m_sourceProvider;
|
||||
ISampleProvider *m_sourceProvider = nullptr;
|
||||
|
||||
int m_channels = 1;
|
||||
bool m_bypass = false;
|
||||
|
||||
@@ -24,14 +24,14 @@ namespace BlackSound
|
||||
{
|
||||
int samplesRead = m_sourceProvider->readSamples(samples, count);
|
||||
|
||||
if (! qFuzzyCompare(m_volume, 1.0))
|
||||
if (!qFuzzyCompare(m_volume, 1.0))
|
||||
{
|
||||
for (int n = 0; n < samplesRead; n++)
|
||||
{
|
||||
samples[n] *= m_volume;
|
||||
samples[n] = static_cast<qint16>(qRound(samples[n] * m_volume));
|
||||
}
|
||||
}
|
||||
return samplesRead;
|
||||
}
|
||||
}
|
||||
}
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
@@ -27,16 +27,19 @@ namespace BlackSound
|
||||
//! Noise generator
|
||||
CVolumeSampleProvider(ISampleProvider *sourceProvider, QObject *parent = nullptr);
|
||||
|
||||
//! \copydoc ISampleProvider::readSamples
|
||||
virtual int readSamples(QVector<qint16> &samples, qint64 count) override;
|
||||
|
||||
//! Volume @{
|
||||
double volume() const { return m_volume; }
|
||||
void setVolume(double volume) { m_volume = volume; }
|
||||
//! @}
|
||||
|
||||
private:
|
||||
ISampleProvider *m_sourceProvider = nullptr;
|
||||
double m_volume = 1.0;
|
||||
};
|
||||
}
|
||||
}
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
#endif // guard
|
||||
|
||||
Reference in New Issue
Block a user