kopia lustrzana https://gitlab.com/eliggett/wfview
add volume control to audiohandler
rodzic
7cb9ae9195
commit
54daaccdfa
|
@ -827,6 +827,15 @@ bool audioHandler::init(const quint8 bits, const quint8 channels, const quint16
|
|||
return isInitialized;
|
||||
}
|
||||
|
||||
void audioHandler::setVolume(quint8 volume)
|
||||
{
|
||||
if (audioOutput != Q_NULLPTR) {
|
||||
audioOutput->setVolume((qreal)(volume / 255.0));
|
||||
}
|
||||
else if (audioInput != Q_NULLPTR) {
|
||||
audioInput->setVolume((qreal)(volume / 255.0));
|
||||
}
|
||||
}
|
||||
|
||||
bool audioHandler::setDevice(QAudioDeviceInfo deviceInfo)
|
||||
{
|
||||
|
|
|
@ -46,7 +46,7 @@ public:
|
|||
bool setDevice(QAudioDeviceInfo deviceInfo);
|
||||
|
||||
void start();
|
||||
void setVolume(float volume);
|
||||
void setVolume(quint8 volume);
|
||||
void flush();
|
||||
void stop();
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue