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