mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 17:35:34 +08:00
Allow to reset volume to 100% in GUI
This commit is contained in:
@@ -29,6 +29,8 @@ namespace BlackGui
|
||||
Q_ASSERT(c);
|
||||
c = connect(this->ui->sb_Volume, static_cast<void (QSpinBox::*)(int)> (&QSpinBox::valueChanged), this, &CAudioVolumeComponent::ps_changeOutputVolumeFromSpinBox);
|
||||
Q_ASSERT(c);
|
||||
c = connect(this->ui->pb_Volume100, &QPushButton::clicked, this, &CAudioVolumeComponent::ps_setVolume100);
|
||||
Q_ASSERT(c);
|
||||
Q_UNUSED(c);
|
||||
}
|
||||
|
||||
@@ -38,6 +40,7 @@ namespace BlackGui
|
||||
void CAudioVolumeComponent::runtimeHasBeenSet()
|
||||
{
|
||||
// from audio context
|
||||
Q_ASSERT(this->getIContextAudio());
|
||||
bool c = connect(this->getIContextAudio(), &IContextAudio::changedMute, this, &CAudioVolumeComponent::ps_onMuteChanged);
|
||||
Q_ASSERT(c);
|
||||
connect(this->getIContextAudio(), &IContextAudio::changedAudioVolume, this, &CAudioVolumeComponent::ps_onOutputVolumeChanged);
|
||||
@@ -56,6 +59,9 @@ namespace BlackGui
|
||||
{
|
||||
this->ui->lbl_ContextLocation->setText("remote");
|
||||
}
|
||||
|
||||
// init volume
|
||||
this->ps_changeOutputVolumeFromSlider(this->getIContextAudio()->getVoiceOutputVolume()); // init volume
|
||||
}
|
||||
|
||||
void CAudioVolumeComponent::ps_onMuteChanged(bool muted)
|
||||
@@ -76,7 +82,6 @@ namespace BlackGui
|
||||
this->ui->sb_Volume->setToolTip(v);
|
||||
}
|
||||
|
||||
|
||||
if (volume > 100)
|
||||
{
|
||||
int v = volume - 100;
|
||||
@@ -90,6 +95,11 @@ namespace BlackGui
|
||||
}
|
||||
}
|
||||
|
||||
void CAudioVolumeComponent::ps_setVolume100()
|
||||
{
|
||||
this->ps_onOutputVolumeChanged(100);
|
||||
}
|
||||
|
||||
void CAudioVolumeComponent::ps_changeOutputVolumeFromSlider(int volume)
|
||||
{
|
||||
if (volume > 100)
|
||||
|
||||
@@ -47,6 +47,9 @@ namespace BlackGui
|
||||
//! Volumes changed (elsewhere)
|
||||
void ps_onOutputVolumeChanged(int volume);
|
||||
|
||||
//! Set volume to 100
|
||||
void ps_setVolume100();
|
||||
|
||||
//! Change values because of volume GUI controls
|
||||
void ps_changeOutputVolumeFromSlider(int volume);
|
||||
|
||||
|
||||
@@ -68,6 +68,9 @@
|
||||
<property name="singleStep">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="pageStep">
|
||||
<number>20</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>90</number>
|
||||
</property>
|
||||
@@ -156,6 +159,25 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pb_Volume100">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>100%</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="hs_AudioSoundButtons">
|
||||
<property name="orientation">
|
||||
|
||||
Reference in New Issue
Block a user