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