Commit 6aa0e4b8 authored by Ghislain MARY's avatar Ghislain MARY

Use properties for LinphoneCore objects.

parent 436bc777
...@@ -62,7 +62,7 @@ namespace Linphone.Agents ...@@ -62,7 +62,7 @@ namespace Linphone.Agents
{ {
// Initiate incoming call processing by creating the Linphone Core // Initiate incoming call processing by creating the Linphone Core
InitManager.CreateLinphoneCore(OopServer, null, OutputTraceLevel.Message); InitManager.CreateLinphoneCore(OopServer, null, OutputTraceLevel.Message);
OopServer.LinphoneCore.SetNetworkReachable(true); OopServer.LinphoneCore.NetworkReachable = true;
OopServer.LinphoneCore.IterateEnabled = true; OopServer.LinphoneCore.IterateEnabled = true;
} }
} }
......
...@@ -69,8 +69,8 @@ namespace Linphone.Agents ...@@ -69,8 +69,8 @@ namespace Linphone.Agents
LpConfig config = server.LinphoneCoreFactory.CreateLpConfig(GetConfigPath(), GetFactoryConfigPath()); LpConfig config = server.LinphoneCoreFactory.CreateLpConfig(GetConfigPath(), GetFactoryConfigPath());
ConfigureLogger(server, level); ConfigureLogger(server, level);
server.LinphoneCoreFactory.CreateLinphoneCore(listener, config); server.LinphoneCoreFactory.CreateLinphoneCore(listener, config);
server.LinphoneCore.SetRootCA("Assets/rootca.pem"); server.LinphoneCore.RootCA = "Assets/rootca.pem";
server.LinphoneCore.SetChatDatabasePath(GetChatDatabasePath()); server.LinphoneCore.ChatDatabasePath = GetChatDatabasePath();
server.LinphoneCore.SetUserAgent(Customs.UserAgent, Linphone.Version.Number); server.LinphoneCore.SetUserAgent(Customs.UserAgent, Linphone.Version.Number);
} }
} }
......
...@@ -44,7 +44,7 @@ namespace Linphone.Agents ...@@ -44,7 +44,7 @@ namespace Linphone.Agents
{ {
var server = BackgroundManager.Instance.OopServer; var server = BackgroundManager.Instance.OopServer;
InitManager.CreateLinphoneCore(server, this, OutputTraceLevel.Message); InitManager.CreateLinphoneCore(server, this, OutputTraceLevel.Message);
server.LinphoneCore.SetNetworkReachable(true); server.LinphoneCore.NetworkReachable = true;
server.LinphoneCore.IterateEnabled = true; server.LinphoneCore.IterateEnabled = true;
Debug.WriteLine("[KeepAliveAgent] Linphone Core created"); Debug.WriteLine("[KeepAliveAgent] Linphone Core created");
} }
...@@ -67,11 +67,11 @@ namespace Linphone.Agents ...@@ -67,11 +67,11 @@ namespace Linphone.Agents
Debug.WriteLine("[IncomingCallAgent] Incoming call processing is now complete."); Debug.WriteLine("[IncomingCallAgent] Incoming call processing is now complete.");
BackgroundManager.Instance.OopServer.CallController.IncomingCallViewDismissed = null; BackgroundManager.Instance.OopServer.CallController.IncomingCallViewDismissed = null;
TileManager.Instance.UpdateCount(BackgroundManager.Instance.OopServer.LinphoneCore.GetMissedCallsCount()); TileManager.Instance.UpdateCount(BackgroundManager.Instance.OopServer.LinphoneCore.MissedCallsCount);
if (BackgroundManager.Instance.OopServer.LinphoneCore.GetCallsNb() == 0) if (BackgroundManager.Instance.OopServer.LinphoneCore.CallsNb == 0)
{ {
BackgroundManager.Instance.OopServer.LinphoneCore.SetNetworkReachable(false); // To prevent the core from unregister BackgroundManager.Instance.OopServer.LinphoneCore.NetworkReachable = false; // To prevent the core from unregister
BackgroundManager.Instance.OopServer.LinphoneCoreFactory.Destroy(); BackgroundManager.Instance.OopServer.LinphoneCoreFactory.Destroy();
} }
base.NotifyComplete(); base.NotifyComplete();
......
...@@ -118,8 +118,8 @@ VoipPhoneCall^ CallController::NewOutgoingCall(Platform::String^ number) ...@@ -118,8 +118,8 @@ VoipPhoneCall^ CallController::NewOutgoingCall(Platform::String^ number)
this->call = call; this->call = call;
VoipCallMedia media = VoipCallMedia::Audio; VoipCallMedia media = VoipCallMedia::Audio;
if (Globals::Instance->LinphoneCore->IsVideoSupported() && Globals::Instance->LinphoneCore->IsVideoEnabled()) { if (Globals::Instance->LinphoneCore->VideoSupported && Globals::Instance->LinphoneCore->VideoEnabled) {
VideoPolicy^ policy = Globals::Instance->LinphoneCore->GetVideoPolicy(); VideoPolicy^ policy = Globals::Instance->LinphoneCore->VideoPolicy;
if ((policy != nullptr) && policy->AutomaticallyInitiate) { if ((policy != nullptr) && policy->AutomaticallyInitiate) {
media = VoipCallMedia::Audio | VoipCallMedia::Video; media = VoipCallMedia::Audio | VoipCallMedia::Video;
} }
......
This diff is collapsed.
This diff is collapsed.
...@@ -101,7 +101,7 @@ Linphone::Core::VideoSize^ LinphoneCoreFactory::CreateVideoSize(int width, int h ...@@ -101,7 +101,7 @@ Linphone::Core::VideoSize^ LinphoneCoreFactory::CreateVideoSize(int width, int h
void LinphoneCoreFactory::SetLogLevel(OutputTraceLevel logLevel) void LinphoneCoreFactory::SetLogLevel(OutputTraceLevel logLevel)
{ {
API_LOCK; API_LOCK;
Linphone::Core::LinphoneCore::SetLogLevel(logLevel); Linphone::Core::LinphoneCore::LogLevel = logLevel;
} }
void LinphoneCoreFactory::ResetLogCollection() void LinphoneCoreFactory::ResetLogCollection()
......
...@@ -27,10 +27,10 @@ namespace Linphone.Controls ...@@ -27,10 +27,10 @@ namespace Linphone.Controls
public void RefreshStatus() public void RefreshStatus()
{ {
RegistrationState state; RegistrationState state;
if (LinphoneManager.Instance.LinphoneCore.GetDefaultProxyConfig() == null) if (LinphoneManager.Instance.LinphoneCore.DefaultProxyConfig == null)
state = RegistrationState.RegistrationNone; state = RegistrationState.RegistrationNone;
else else
state = LinphoneManager.Instance.LinphoneCore.GetDefaultProxyConfig().State; state = LinphoneManager.Instance.LinphoneCore.DefaultProxyConfig.State;
RefreshStatus(state); RefreshStatus(state);
} }
......
...@@ -57,12 +57,12 @@ namespace Linphone.Views ...@@ -57,12 +57,12 @@ namespace Linphone.Views
public LinphoneCall GetCurrentCall() public LinphoneCall GetCurrentCall()
{ {
LinphoneCall call = LinphoneManager.Instance.LinphoneCore.GetCurrentCall(); LinphoneCall call = LinphoneManager.Instance.LinphoneCore.CurrentCall;
if (call == null) if (call == null)
{ {
if (LinphoneManager.Instance.LinphoneCore.GetCallsNb() > 0) if (LinphoneManager.Instance.LinphoneCore.CallsNb > 0)
{ {
call = (LinphoneCall)LinphoneManager.Instance.LinphoneCore.GetCalls()[0]; call = (LinphoneCall)LinphoneManager.Instance.LinphoneCore.Calls[0];
} }
} }
return call; return call;
...@@ -90,7 +90,7 @@ namespace Linphone.Views ...@@ -90,7 +90,7 @@ namespace Linphone.Views
public void ToggleCameras() public void ToggleCameras()
{ {
LinphoneManager.Instance.ToggleCameras(); LinphoneManager.Instance.ToggleCameras();
if (LinphoneManager.Instance.LinphoneCore.IsSelfViewEnabled()) if (LinphoneManager.Instance.LinphoneCore.SelfViewEnabled)
{ {
ShowLocalVideo(); ShowLocalVideo();
} }
...@@ -115,7 +115,7 @@ namespace Linphone.Views ...@@ -115,7 +115,7 @@ namespace Linphone.Views
break; break;
} }
RemoteVideoRotation = rotation; RemoteVideoRotation = rotation;
Int32 id = LinphoneManager.Instance.LinphoneCore.GetNativeVideoWindowId(); Int32 id = LinphoneManager.Instance.LinphoneCore.NativeVideoWindowId;
RemoteVideoUri = Mediastreamer2.WP8Video.VideoRenderer.StreamUri(id); RemoteVideoUri = Mediastreamer2.WP8Video.VideoRenderer.StreamUri(id);
RemoteVideoProgressBarVisibility = Visibility.Visible; RemoteVideoProgressBarVisibility = Visibility.Visible;
} }
...@@ -134,13 +134,13 @@ namespace Linphone.Views ...@@ -134,13 +134,13 @@ namespace Linphone.Views
private void ShowLocalVideo() private void ShowLocalVideo()
{ {
String device = LinphoneManager.Instance.LinphoneCore.GetVideoDevice(); String device = LinphoneManager.Instance.LinphoneCore.VideoDevice;
LocalVideoUri = Mediastreamer2.WP8Video.VideoRenderer.CameraUri(device); LocalVideoUri = Mediastreamer2.WP8Video.VideoRenderer.CameraUri(device);
} }
public void LocalVideoOpened() public void LocalVideoOpened()
{ {
Int32 rotation = LinphoneManager.Instance.LinphoneCore.GetCameraSensorRotation(); Int32 rotation = LinphoneManager.Instance.LinphoneCore.CameraSensorRotation;
switch (pageOrientation) switch (pageOrientation)
{ {
case Microsoft.Phone.Controls.PageOrientation.LandscapeLeft: case Microsoft.Phone.Controls.PageOrientation.LandscapeLeft:
...@@ -151,7 +151,7 @@ namespace Linphone.Views ...@@ -151,7 +151,7 @@ namespace Linphone.Views
break; break;
} }
LocalVideoRotation = rotation % 360; LocalVideoRotation = rotation % 360;
String device = LinphoneManager.Instance.LinphoneCore.GetVideoDevice(); String device = LinphoneManager.Instance.LinphoneCore.VideoDevice;
Boolean mirrored = Mediastreamer2.WP8Video.VideoRenderer.IsCameraMirrored(device); Boolean mirrored = Mediastreamer2.WP8Video.VideoRenderer.IsCameraMirrored(device);
if (mirrored) if (mirrored)
{ {
...@@ -174,7 +174,7 @@ namespace Linphone.Views ...@@ -174,7 +174,7 @@ namespace Linphone.Views
{ {
Logger.Msg("[InCall] ShowVideo"); Logger.Msg("[InCall] ShowVideo");
ShowRemoteVideo(); ShowRemoteVideo();
if (LinphoneManager.Instance.LinphoneCore.IsSelfViewEnabled()) if (LinphoneManager.Instance.LinphoneCore.SelfViewEnabled)
{ {
ShowLocalVideo(); ShowLocalVideo();
} }
...@@ -474,7 +474,7 @@ namespace Linphone.Views ...@@ -474,7 +474,7 @@ namespace Linphone.Views
if (this.remoteVideoRotation != value) if (this.remoteVideoRotation != value)
{ {
this.remoteVideoRotation = value; this.remoteVideoRotation = value;
LinphoneManager.Instance.LinphoneCore.SetDeviceRotation(this.remoteVideoRotation); LinphoneManager.Instance.LinphoneCore.DeviceRotation = this.remoteVideoRotation;
LinphoneCall call = GetCurrentCall(); LinphoneCall call = GetCurrentCall();
if (call != null) LinphoneManager.Instance.LinphoneCore.UpdateCall(call, null); if (call != null) LinphoneManager.Instance.LinphoneCore.UpdateCall(call, null);
this.OnPropertyChanged(); this.OnPropertyChanged();
......
This diff is collapsed.
This diff is collapsed.
...@@ -70,7 +70,7 @@ namespace Linphone.Views ...@@ -70,7 +70,7 @@ namespace Linphone.Views
tunnelPort.Text = _networkSettings.TunnelPort; tunnelPort.Text = _networkSettings.TunnelPort;
tunnelServer.Text = _networkSettings.TunnelServer; tunnelServer.Text = _networkSettings.TunnelServer;
TunnelPanel.Visibility = LinphoneManager.Instance.LinphoneCore.IsTunnelAvailable() && Customs.IsTunnelEnabled ? Visibility.Visible : Visibility.Collapsed; //Hidden properties for now TunnelPanel.Visibility = LinphoneManager.Instance.LinphoneCore.TunnelAvailable && Customs.IsTunnelEnabled ? Visibility.Visible : Visibility.Collapsed; //Hidden properties for now
Debug.IsChecked = _settings.DebugEnabled; Debug.IsChecked = _settings.DebugEnabled;
SendLogs.IsEnabled = _settings.DebugEnabled; SendLogs.IsEnabled = _settings.DebugEnabled;
......
...@@ -112,7 +112,7 @@ namespace Linphone.Views ...@@ -112,7 +112,7 @@ namespace Linphone.Views
{ {
_conversations = new ObservableCollection<Conversation>(); _conversations = new ObservableCollection<Conversation>();
_sortedConversations = new ObservableCollection<Conversation>(); _sortedConversations = new ObservableCollection<Conversation>();
foreach (LinphoneChatRoom conversation in LinphoneManager.Instance.LinphoneCore.GetChatRooms()) foreach (LinphoneChatRoom conversation in LinphoneManager.Instance.LinphoneCore.ChatRooms)
{ {
if (conversation.HistorySize > 0) if (conversation.HistorySize > 0)
{ {
......
...@@ -108,9 +108,9 @@ namespace Linphone ...@@ -108,9 +108,9 @@ namespace Linphone
} }
// Navigate to the current call (if existing) when using the app launcher to restart the app while call is in background // Navigate to the current call (if existing) when using the app launcher to restart the app while call is in background
if (LinphoneManager.Instance.LinphoneCore.GetCallsNb() > 0) if (LinphoneManager.Instance.LinphoneCore.CallsNb > 0)
{ {
LinphoneCall call = LinphoneManager.Instance.LinphoneCore.GetCurrentCall(); LinphoneCall call = LinphoneManager.Instance.LinphoneCore.CurrentCall;
String uri = call.RemoteAddress.AsStringUriOnly(); String uri = call.RemoteAddress.AsStringUriOnly();
NavigationService.Navigate(new Uri("/Views/InCall.xaml?sip=" + uri, UriKind.RelativeOrAbsolute)); NavigationService.Navigate(new Uri("/Views/InCall.xaml?sip=" + uri, UriKind.RelativeOrAbsolute));
} }
...@@ -264,7 +264,7 @@ namespace Linphone ...@@ -264,7 +264,7 @@ namespace Linphone
private bool IsRegisterEnabled() private bool IsRegisterEnabled()
{ {
LinphoneCore lc = LinphoneManager.Instance.LinphoneCore; LinphoneCore lc = LinphoneManager.Instance.LinphoneCore;
LinphoneProxyConfig cfg = lc.GetDefaultProxyConfig(); LinphoneProxyConfig cfg = lc.DefaultProxyConfig;
if (cfg != null) if (cfg != null)
{ {
return cfg.RegisterEnabled; return cfg.RegisterEnabled;
...@@ -275,14 +275,14 @@ namespace Linphone ...@@ -275,14 +275,14 @@ namespace Linphone
private bool IsAccountConfigured() private bool IsAccountConfigured()
{ {
LinphoneCore lc = LinphoneManager.Instance.LinphoneCore; LinphoneCore lc = LinphoneManager.Instance.LinphoneCore;
LinphoneProxyConfig cfg = lc.GetDefaultProxyConfig(); LinphoneProxyConfig cfg = lc.DefaultProxyConfig;
return cfg != null; return cfg != null;
} }
private void EnableRegister(bool enable) private void EnableRegister(bool enable)
{ {
LinphoneCore lc = LinphoneManager.Instance.LinphoneCore; LinphoneCore lc = LinphoneManager.Instance.LinphoneCore;
LinphoneProxyConfig cfg = lc.GetDefaultProxyConfig(); LinphoneProxyConfig cfg = lc.DefaultProxyConfig;
if (cfg != null) if (cfg != null)
{ {
cfg.Edit(); cfg.Edit();
......
...@@ -34,7 +34,7 @@ namespace Linphone.Views ...@@ -34,7 +34,7 @@ namespace Linphone.Views
{ {
base.OnNavigatedTo(e); base.OnNavigatedTo(e);
if (LinphoneManager.Instance.LinphoneCore.GetProxyConfigList().Count > 0) if (LinphoneManager.Instance.LinphoneCore.ProxyConfigList.Count > 0)
{ {
NavigationService.Navigate(new Uri("/Views/Dialer.xaml", UriKind.RelativeOrAbsolute)); NavigationService.Navigate(new Uri("/Views/Dialer.xaml", UriKind.RelativeOrAbsolute));
NavigationService.RemoveBackEntry(); // Prevent a back to this screen from the dialer NavigationService.RemoveBackEntry(); // Prevent a back to this screen from the dialer
......
...@@ -41,7 +41,7 @@ namespace Linphone.Views ...@@ -41,7 +41,7 @@ namespace Linphone.Views
{ {
InitializeComponent(); InitializeComponent();
var call = LinphoneManager.Instance.LinphoneCore.GetCurrentCall(); var call = LinphoneManager.Instance.LinphoneCore.CurrentCall;
if (call != null && call.State == Core.LinphoneCallState.StreamsRunning) if (call != null && call.State == Core.LinphoneCallState.StreamsRunning)
{ {
PauseStateChanged(call, false, false); PauseStateChanged(call, false, false);
...@@ -50,7 +50,7 @@ namespace Linphone.Views ...@@ -50,7 +50,7 @@ namespace Linphone.Views
buttons.speaker.IsChecked = true; buttons.speaker.IsChecked = true;
buttons_landscape.speaker.IsChecked = true; buttons_landscape.speaker.IsChecked = true;
} }
if (LinphoneManager.Instance.LinphoneCore.IsMicMuted()) if (LinphoneManager.Instance.LinphoneCore.MicMuted)
{ {
buttons.microphone.IsChecked = true; buttons.microphone.IsChecked = true;
buttons_landscape.microphone.IsChecked = true; buttons_landscape.microphone.IsChecked = true;
...@@ -199,9 +199,9 @@ namespace Linphone.Views ...@@ -199,9 +199,9 @@ namespace Linphone.Views
} }
// Callback CallStateChanged set too late when call is incoming, so trigger it manually // Callback CallStateChanged set too late when call is incoming, so trigger it manually
if (LinphoneManager.Instance.LinphoneCore.GetCallsNb() > 0) if (LinphoneManager.Instance.LinphoneCore.CallsNb > 0)
{ {
LinphoneCall call = (LinphoneCall)LinphoneManager.Instance.LinphoneCore.GetCalls()[0]; LinphoneCall call = (LinphoneCall)LinphoneManager.Instance.LinphoneCore.Calls[0];
if (call.State == LinphoneCallState.StreamsRunning) if (call.State == LinphoneCallState.StreamsRunning)
{ {
CallStateChanged(call, LinphoneCallState.StreamsRunning); CallStateChanged(call, LinphoneCallState.StreamsRunning);
......
...@@ -26,7 +26,7 @@ namespace Linphone.Views ...@@ -26,7 +26,7 @@ namespace Linphone.Views
{ {
InitializeComponent(); InitializeComponent();
if (!LinphoneManager.Instance.LinphoneCore.IsVideoSupported() || !LinphoneManager.Instance.LinphoneCore.IsVideoEnabled()) if (!LinphoneManager.Instance.LinphoneCore.VideoSupported || !LinphoneManager.Instance.LinphoneCore.VideoEnabled)
{ {
AnswerVideo.Visibility = Visibility.Collapsed; AnswerVideo.Visibility = Visibility.Collapsed;
} }
...@@ -104,7 +104,7 @@ namespace Linphone.Views ...@@ -104,7 +104,7 @@ namespace Linphone.Views
private void Answer_Click(object sender, RoutedEventArgs e) private void Answer_Click(object sender, RoutedEventArgs e)
{ {
LinphoneManager.Instance.LinphoneCore.AcceptCall(LinphoneManager.Instance.LinphoneCore.GetCurrentCall()); LinphoneManager.Instance.LinphoneCore.AcceptCall(LinphoneManager.Instance.LinphoneCore.CurrentCall);
NavigationService.Navigate(new Uri("/Views/InCall.xaml?sip=" + _callingNumber, UriKind.RelativeOrAbsolute)); NavigationService.Navigate(new Uri("/Views/InCall.xaml?sip=" + _callingNumber, UriKind.RelativeOrAbsolute));
} }
......
...@@ -28,7 +28,7 @@ namespace Linphone.Views ...@@ -28,7 +28,7 @@ namespace Linphone.Views
{ {
base.OnNavigatedTo(e); base.OnNavigatedTo(e);
bool isVideoEnabled = LinphoneManager.Instance.LinphoneCore.IsVideoSupported() && (LinphoneManager.Instance.LinphoneCore.IsVideoDisplayEnabled() || LinphoneManager.Instance.LinphoneCore.IsVideoCaptureEnabled()); bool isVideoEnabled = LinphoneManager.Instance.LinphoneCore.VideoSupported && (LinphoneManager.Instance.LinphoneCore.VideoDisplayEnabled || LinphoneManager.Instance.LinphoneCore.VideoCaptureEnabled);
Video.Visibility = isVideoEnabled ? Visibility.Visible : Visibility.Collapsed; Video.Visibility = isVideoEnabled ? Visibility.Visible : Visibility.Collapsed;
} }
......
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