Commit 8e9d663a authored by Dan Pascu's avatar Dan Pascu

Added control to adjust tail_length in preferences, but keep it hidden

parent 4e3b750f
...@@ -234,6 +234,7 @@ class PreferencesWindow(base_class, ui_class): ...@@ -234,6 +234,7 @@ class PreferencesWindow(base_class, ui_class):
self.audio_output_device_button.activated[int].connect(self._SH_AudioOutputDeviceButtonActivated) self.audio_output_device_button.activated[int].connect(self._SH_AudioOutputDeviceButtonActivated)
self.audio_sample_rate_button.activated[str].connect(self._SH_AudioSampleRateButtonActivated) self.audio_sample_rate_button.activated[str].connect(self._SH_AudioSampleRateButtonActivated)
self.enable_echo_cancelling_button.clicked.connect(self._SH_EnableEchoCancellingButtonClicked) self.enable_echo_cancelling_button.clicked.connect(self._SH_EnableEchoCancellingButtonClicked)
self.tail_length_slider.valueChanged.connect(self._SH_TailLengthSliderValueChanged)
# Audio codecs # Audio codecs
self.audio_codecs_list.itemChanged.connect(self._SH_AudioCodecsListItemChanged) self.audio_codecs_list.itemChanged.connect(self._SH_AudioCodecsListItemChanged)
...@@ -294,6 +295,11 @@ class PreferencesWindow(base_class, ui_class): ...@@ -294,6 +295,11 @@ class PreferencesWindow(base_class, ui_class):
def setupUi(self): def setupUi(self):
super(PreferencesWindow, self).setupUi(self) super(PreferencesWindow, self).setupUi(self)
# Hide the tail_length slider as it is only useful for debugging -Dan
self.tail_length_label.hide()
self.tail_length_slider.hide()
self.tail_length_value_label.hide()
#self.rename_account_button.hide() # do not use this for the time being -Dan #self.rename_account_button.hide() # do not use this for the time being -Dan
self.section_group = QActionGroup(self) self.section_group = QActionGroup(self)
...@@ -489,6 +495,7 @@ class PreferencesWindow(base_class, ui_class): ...@@ -489,6 +495,7 @@ class PreferencesWindow(base_class, ui_class):
# Audio devices # Audio devices
self.load_audio_devices() self.load_audio_devices()
self.enable_echo_cancelling_button.setChecked(settings.audio.echo_canceller.enabled) self.enable_echo_cancelling_button.setChecked(settings.audio.echo_canceller.enabled)
self.tail_length_slider.setValue(settings.audio.echo_canceller.tail_length)
self.audio_sample_rate_button.clear() self.audio_sample_rate_button.clear()
for rate in SIPSimpleSettings.audio.sample_rate.type.valid_values: for rate in SIPSimpleSettings.audio.sample_rate.type.valid_values:
self.audio_sample_rate_button.addItem(str(rate), rate) self.audio_sample_rate_button.addItem(str(rate), rate)
...@@ -1052,6 +1059,11 @@ class PreferencesWindow(base_class, ui_class): ...@@ -1052,6 +1059,11 @@ class PreferencesWindow(base_class, ui_class):
settings.audio.echo_canceller.enabled = checked settings.audio.echo_canceller.enabled = checked
settings.save() settings.save()
def _SH_TailLengthSliderValueChanged(self, value):
settings = SIPSimpleSettings()
settings.audio.echo_canceller.tail_length = value
settings.save()
# Audio codecs signal handlers # Audio codecs signal handlers
def _SH_AudioCodecsListItemChanged(self, item): def _SH_AudioCodecsListItemChanged(self, item):
if not self.load_in_progress: if not self.load_in_progress:
......
...@@ -1458,6 +1458,22 @@ ...@@ -1458,6 +1458,22 @@
<item row="0" column="1"> <item row="0" column="1">
<widget class="QComboBox" name="audio_input_device_button"/> <widget class="QComboBox" name="audio_input_device_button"/>
</item> </item>
<item row="6" column="0" colspan="4">
<spacer name="audio_spacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="audio_output_device_label"> <widget class="QLabel" name="audio_output_device_label">
<property name="text"> <property name="text">
...@@ -1518,29 +1534,6 @@ ...@@ -1518,29 +1534,6 @@
</item> </item>
</widget> </widget>
</item> </item>
<item row="4" column="1" colspan="2">
<widget class="QCheckBox" name="enable_echo_cancelling_button">
<property name="text">
<string>Enable Echo Cancelling</string>
</property>
</widget>
</item>
<item row="5" column="0" colspan="4">
<spacer name="audio_spacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="2"> <item row="0" column="2">
<spacer name="audio_spacer_1"> <spacer name="audio_spacer_1">
<property name="orientation"> <property name="orientation">
...@@ -1554,6 +1547,46 @@ ...@@ -1554,6 +1547,46 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="5" column="0">
<widget class="QLabel" name="tail_length_label">
<property name="text">
<string>Tail Length:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QSlider" name="tail_length_slider">
<property name="maximum">
<number>30</number>
</property>
<property name="pageStep">
<number>5</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="QLabel" name="tail_length_value_label">
<property name="text">
<string>1</string>
</property>
</widget>
</item>
<item row="4" column="1" colspan="2">
<widget class="QCheckBox" name="enable_echo_cancelling_button">
<property name="text">
<string>Enable Echo Cancelling</string>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
...@@ -2720,5 +2753,22 @@ ...@@ -2720,5 +2753,22 @@
</customwidget> </customwidget>
</customwidgets> </customwidgets>
<resources/> <resources/>
<connections/> <connections>
<connection>
<sender>tail_length_slider</sender>
<signal>valueChanged(int)</signal>
<receiver>tail_length_value_label</receiver>
<slot>setNum(int)</slot>
<hints>
<hint type="sourcelabel">
<x>228</x>
<y>229</y>
</hint>
<hint type="destinationlabel">
<x>364</x>
<y>238</y>
</hint>
</hints>
</connection>
</connections>
</ui> </ui>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment