Commit 1b66b431 authored by Dan Pascu's avatar Dan Pascu

Use the new echo canceller settings from middleware

parent 0e1bc84a
......@@ -32,7 +32,6 @@ from zope.interface import implements
from sipsimple.account import Account, AccountManager, BonjourAccount
from sipsimple.addressbook import Contact, Group
from sipsimple.application import SIPApplication
from sipsimple.configuration import DefaultValue
from sipsimple.configuration.settings import SIPSimpleSettings
from sipsimple.storage import FileStorage
from sipsimple.threading import run_in_twisted_thread
......@@ -242,10 +241,6 @@ class Blink(QApplication):
if settings.google_contacts.authorization_token is InvalidToken:
self.main_window.google_contacts_dialog.open_for_incorrect_password()
self.update_manager.initialize()
if settings.audio.tail_length not in (0, SIPSimpleSettings.audio.tail_length.default):
# Fix old hardcoded setting value
settings.audio.tail_length = DefaultValue
settings.save()
def _NH_SIPApplicationWillEnd(self, notification):
self.ip_address_monitor.stop()
......
......@@ -10,7 +10,7 @@ import sys
from sipsimple.configuration import Setting, SettingsGroup, SettingsObject, SettingsObjectExtension
from sipsimple.configuration.datatypes import AudioCodecList, NonNegativeInteger, PositiveInteger, Path, SampleRate
from sipsimple.configuration.settings import AudioSettings, ChatSettings, FileTransferSettings, LogsSettings, RTPSettings, TLSSettings
from sipsimple.configuration.settings import AudioSettings, ChatSettings, EchoCancellerSettings, FileTransferSettings, LogsSettings, RTPSettings, TLSSettings
from blink import __version__
from blink.configuration.datatypes import ApplicationDataPath, AuthorizationToken, HTTPURL, IconDescriptor, SoundFile, PresenceState, PresenceStateList
......@@ -24,10 +24,15 @@ class AnsweringMachineSettings(SettingsGroup):
unavailable_message = Setting(type=SoundFile, default=SoundFile(Resources.get('sounds/unavailable_message.wav')), nillable=True)
class EchoCancellerSettingsExtension(EchoCancellerSettings):
enabled = Setting(type=bool, default=True)
tail_length = Setting(type=NonNegativeInteger, default=15)
class AudioSettingsExtension(AudioSettings):
recordings_directory = Setting(type=ApplicationDataPath, default=ApplicationDataPath('recordings'))
sample_rate = Setting(type=SampleRate, default=44100)
tail_length = Setting(type=NonNegativeInteger, default=15)
echo_canceller = EchoCancellerSettingsExtension
class ChatSettingsExtension(ChatSettings):
......
......@@ -487,7 +487,7 @@ class PreferencesWindow(base_class, ui_class):
# Audio devices
self.load_audio_devices()
self.enable_echo_cancelling_button.setChecked(settings.audio.tail_length != 0)
self.enable_echo_cancelling_button.setChecked(settings.audio.echo_canceller.enabled)
self.audio_sample_rate_button.clear()
for rate in SIPSimpleSettings.audio.sample_rate.type.valid_values:
self.audio_sample_rate_button.addItem(str(rate), rate)
......@@ -1024,7 +1024,7 @@ class PreferencesWindow(base_class, ui_class):
def _SH_EnableEchoCancellingButtonClicked(self, checked):
settings = SIPSimpleSettings()
settings.audio.tail_length = DefaultValue if checked else 0
settings.audio.echo_canceller.enabled = checked
settings.save()
# Audio codecs signal handlers
......
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