mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 11:28:07 +00:00
Fix volumes :
- In settings : apply volume to general setting. - In call : use general volume if it cannot be set/get directly from call. - ALSA : allow get/set
This commit is contained in:
parent
6e82b0347f
commit
f0b0c845c0
3 changed files with 25 additions and 4 deletions
|
|
@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
## 4.4.0 - [Undefined]
|
||||
|
||||
## Added
|
||||
|
||||
## Fixed
|
||||
|
||||
- Changing volume in settings has a overall effect.
|
||||
- ALSA volumes can be view/changed while being in call.
|
||||
|
||||
## 4.3.1 - 2021-11-04
|
||||
|
||||
### Added
|
||||
|
|
|
|||
|
|
@ -199,22 +199,34 @@ void CallModel::updateStats (const shared_ptr<const linphone::CallStats> &callSt
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
float CallModel::getSpeakerVolumeGain () const {
|
||||
return mCall->getSpeakerVolumeGain();
|
||||
float gain = mCall->getSpeakerVolumeGain();
|
||||
if( gain < 0)
|
||||
gain = CoreManager::getInstance()->getSettingsModel()->getPlaybackGain();
|
||||
return gain;
|
||||
}
|
||||
|
||||
void CallModel::setSpeakerVolumeGain (float volume) {
|
||||
Q_ASSERT(volume >= 0.0f && volume <= 1.0f);
|
||||
mCall->setSpeakerVolumeGain(volume);
|
||||
if( mCall->getSpeakerVolumeGain() >= 0)
|
||||
mCall->setSpeakerVolumeGain(volume);
|
||||
else
|
||||
CoreManager::getInstance()->getSettingsModel()->setPlaybackGain(volume);
|
||||
emit speakerVolumeGainChanged(getSpeakerVolumeGain());
|
||||
}
|
||||
|
||||
float CallModel::getMicroVolumeGain () const {
|
||||
return mCall->getMicrophoneVolumeGain();
|
||||
float gain = mCall->getMicrophoneVolumeGain();
|
||||
if( gain < 0)
|
||||
gain = CoreManager::getInstance()->getSettingsModel()->getCaptureGain();
|
||||
return gain;
|
||||
}
|
||||
|
||||
void CallModel::setMicroVolumeGain (float volume) {
|
||||
Q_ASSERT(volume >= 0.0f && volume <= 1.0f);
|
||||
mCall->setMicrophoneVolumeGain(volume);
|
||||
if(mCall->getMicrophoneVolumeGain() >= 0)
|
||||
mCall->setMicrophoneVolumeGain(volume);
|
||||
else
|
||||
CoreManager::getInstance()->getSettingsModel()->setCaptureGain(volume);
|
||||
emit microVolumeGainChanged(getMicroVolumeGain());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -224,6 +224,7 @@ float SettingsModel::getPlaybackGain() const {
|
|||
}
|
||||
|
||||
void SettingsModel::setPlaybackGain(float gain) {
|
||||
CoreManager::getInstance()->getCore()->setPlaybackGainDb(MediastreamerUtils::linearToDb(gain));
|
||||
if (mSimpleCaptureGraph && mSimpleCaptureGraph->isRunning()) {
|
||||
mSimpleCaptureGraph->setPlaybackGain(gain);
|
||||
}
|
||||
|
|
@ -235,6 +236,7 @@ float SettingsModel::getCaptureGain() const {
|
|||
}
|
||||
|
||||
void SettingsModel::setCaptureGain(float gain) {
|
||||
CoreManager::getInstance()->getCore()->setMicGainDb(MediastreamerUtils::linearToDb(gain));
|
||||
if (mSimpleCaptureGraph && mSimpleCaptureGraph->isRunning()) {
|
||||
mSimpleCaptureGraph->setCaptureGain(gain);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue