Commit 74be929f authored by Margaux Clerc's avatar Margaux Clerc

Restore echo callibration in audio settings

parent 6f692a22
......@@ -740,7 +740,23 @@ void CoreListener.CallStateChanged(Call call, CallState state, string message)
});
}
public EchoCalibratorListener ECListener { get; set; }
public void EcCalibrationStatus(EcCalibratorStatus status, int delayMs)
{
Debug.WriteLine("[LinphoneManager] Echo canceller calibration status: " + status.ToString() + "\r\n");
if (status == EcCalibratorStatus.Done)
{
Debug.WriteLine("[LinphoneManager] Echo canceller delay: {0} ms\r\n", delayMs);
}
CoreDispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
if (ECListener != null)
{
ECListener.ECStatusNotified(status, delayMs);
}
});
}
#endregion
......@@ -837,12 +853,12 @@ void CoreListener.CallStateChanged(Call call, CallState state, string message)
}
ContactManager.ContactFound -= OnContactFound;
}
#endregion
}
public void EcCalibrationStatus(EcCalibratorStatus status, int delayMs)
public interface EchoCalibratorListener
{
throw new NotImplementedException();
}
#endregion
void ECStatusNotified(EcCalibratorStatus status, int delayMs);
}
}
......
......@@ -369,7 +369,7 @@ and cc-by-nd from https://github.com/Templarian/WindowsIcons</value>
<data name="ECCalibrationInProgress" xml:space="preserve">
<value>Calibration in progress</value>
</data>
<data name="ECCalibrationNotRun.Content" xml:space="preserve">
<data name="ECCalibrationNotRun.Text" xml:space="preserve">
<value>Click button to calibrate</value>
</data>
<data name="H264Codec.Header" xml:space="preserve">
......
......@@ -105,15 +105,16 @@
Click="ECCalibratorButton_Click_1"
Margin="0,30,0,0"
x:Uid="EchoCancellerCalibration"
HorizontalAlignment="Center"
Content="EchoCancellerCalibration" />
<Button
<TextBlock
Grid.Row="3"
x:Name="ECCalibratorStatusButton"
IsEnabled="False"
BorderThickness="0"
Margin="0,30,0,0"
Style="{StaticResource ListItemStyle}"
HorizontalAlignment="Center"
x:Uid="ECCalibrationNotRun"
Content="ECCalibrationNotRun" />
Text="ECCalibrationNotRun" />
</StackPanel>
</PivotItem>
</Pivot>
......
......@@ -26,7 +26,7 @@ namespace Linphone.Views
/// <summary>
/// Page displaying the audio settings and the audio codecs to let the user enable/disable them.
/// </summary>
public partial class AudioSettings : Page
public partial class AudioSettings : Page, EchoCalibratorListener
{
private CodecsSettingsManager _settings = new CodecsSettingsManager();
private bool saveSettingsOnLeave = true;
......@@ -59,7 +59,7 @@ namespace Linphone.Views
protected override void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
//LinphoneManager.Instance.ECListener = this;
LinphoneManager.Instance.ECListener = this;
}
/// <summary>
......@@ -117,8 +117,8 @@ namespace Linphone.Views
{
var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
ECCalibratorButton.IsEnabled = false;
ECCalibratorStatusButton.Content = loader.GetString("ECCalibrationInProgress");
//LinphoneManager.Instance.Core.StartEchoCalibration();
ECCalibratorStatusButton.Text = loader.GetString("ECCalibrationInProgress");
LinphoneManager.Instance.Core.StartEchoCalibration();
}
/// <summary>
......@@ -126,7 +126,7 @@ namespace Linphone.Views
/// </summary>
protected override void OnNavigatedFrom(NavigationEventArgs nea)
{
//LinphoneManager.Instance.ECListener = null;
LinphoneManager.Instance.ECListener = null;
}
/// <summary>
......@@ -136,26 +136,25 @@ namespace Linphone.Views
/// <param name="delayMs">The echo delay in milliseconds if the status is EcCalibratorStatus.Done</param>
public void ECStatusNotified(EcCalibratorStatus status, int delayMs)
{
/*BaseModel.UIDispatcher.BeginInvoke(() =>
{
var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
if (status == EcCalibratorStatus.Done)
{
ECCalibratorStatusButton.Content = String.Format(AppResources.ECCalibrationDone, delayMs);
ECCalibratorStatusButton.Text = String.Format(loader.GetString("ECCalibrationDone"), delayMs);
}
else if (status == EcCalibratorStatus.DoneNoEcho)
{
ECCalibratorStatusButton.Content = AppResources.ECCalibrationDoneNoEcho;
ECCalibratorStatusButton.Text = loader.GetString("ECCalibrationDoneNoEcho");
}
else if (status == EcCalibratorStatus.Failed)
{
ECCalibratorStatusButton.Content = AppResources.ECCalibrationFailed;
ECCalibratorStatusButton.Text = loader.GetString("ECCalibrationFailed");
}
else if (status == EcCalibratorStatus.InProgress)
{
ECCalibratorStatusButton.Content = AppResources.ECCalibrationInProgress;
ECCalibratorStatusButton.Text = loader.GetString("ECCalibrationInProgress");
}
ECCalibratorButton.IsEnabled = true;
});*/
}
}
}
\ No newline at end of file
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