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

Use properties for LinphoneCore objects.

parent 436bc777
......@@ -62,7 +62,7 @@ namespace Linphone.Agents
{
// Initiate incoming call processing by creating the Linphone Core
InitManager.CreateLinphoneCore(OopServer, null, OutputTraceLevel.Message);
OopServer.LinphoneCore.SetNetworkReachable(true);
OopServer.LinphoneCore.NetworkReachable = true;
OopServer.LinphoneCore.IterateEnabled = true;
}
}
......
......@@ -69,8 +69,8 @@ namespace Linphone.Agents
LpConfig config = server.LinphoneCoreFactory.CreateLpConfig(GetConfigPath(), GetFactoryConfigPath());
ConfigureLogger(server, level);
server.LinphoneCoreFactory.CreateLinphoneCore(listener, config);
server.LinphoneCore.SetRootCA("Assets/rootca.pem");
server.LinphoneCore.SetChatDatabasePath(GetChatDatabasePath());
server.LinphoneCore.RootCA = "Assets/rootca.pem";
server.LinphoneCore.ChatDatabasePath = GetChatDatabasePath();
server.LinphoneCore.SetUserAgent(Customs.UserAgent, Linphone.Version.Number);
}
}
......
......@@ -44,7 +44,7 @@ namespace Linphone.Agents
{
var server = BackgroundManager.Instance.OopServer;
InitManager.CreateLinphoneCore(server, this, OutputTraceLevel.Message);
server.LinphoneCore.SetNetworkReachable(true);
server.LinphoneCore.NetworkReachable = true;
server.LinphoneCore.IterateEnabled = true;
Debug.WriteLine("[KeepAliveAgent] Linphone Core created");
}
......@@ -67,11 +67,11 @@ namespace Linphone.Agents
Debug.WriteLine("[IncomingCallAgent] Incoming call processing is now complete.");
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();
}
base.NotifyComplete();
......
......@@ -118,8 +118,8 @@ VoipPhoneCall^ CallController::NewOutgoingCall(Platform::String^ number)
this->call = call;
VoipCallMedia media = VoipCallMedia::Audio;
if (Globals::Instance->LinphoneCore->IsVideoSupported() && Globals::Instance->LinphoneCore->IsVideoEnabled()) {
VideoPolicy^ policy = Globals::Instance->LinphoneCore->GetVideoPolicy();
if (Globals::Instance->LinphoneCore->VideoSupported && Globals::Instance->LinphoneCore->VideoEnabled) {
VideoPolicy^ policy = Globals::Instance->LinphoneCore->VideoPolicy;
if ((policy != nullptr) && policy->AutomaticallyInitiate) {
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
void LinphoneCoreFactory::SetLogLevel(OutputTraceLevel logLevel)
{
API_LOCK;
Linphone::Core::LinphoneCore::SetLogLevel(logLevel);
Linphone::Core::LinphoneCore::LogLevel = logLevel;
}
void LinphoneCoreFactory::ResetLogCollection()
......
......@@ -27,10 +27,10 @@ namespace Linphone.Controls
public void RefreshStatus()
{
RegistrationState state;
if (LinphoneManager.Instance.LinphoneCore.GetDefaultProxyConfig() == null)
if (LinphoneManager.Instance.LinphoneCore.DefaultProxyConfig == null)
state = RegistrationState.RegistrationNone;
else
state = LinphoneManager.Instance.LinphoneCore.GetDefaultProxyConfig().State;
state = LinphoneManager.Instance.LinphoneCore.DefaultProxyConfig.State;
RefreshStatus(state);
}
......
......@@ -57,12 +57,12 @@ namespace Linphone.Views
public LinphoneCall GetCurrentCall()
{
LinphoneCall call = LinphoneManager.Instance.LinphoneCore.GetCurrentCall();
LinphoneCall call = LinphoneManager.Instance.LinphoneCore.CurrentCall;
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;
......@@ -90,7 +90,7 @@ namespace Linphone.Views
public void ToggleCameras()
{
LinphoneManager.Instance.ToggleCameras();
if (LinphoneManager.Instance.LinphoneCore.IsSelfViewEnabled())
if (LinphoneManager.Instance.LinphoneCore.SelfViewEnabled)
{
ShowLocalVideo();
}
......@@ -115,7 +115,7 @@ namespace Linphone.Views
break;
}
RemoteVideoRotation = rotation;
Int32 id = LinphoneManager.Instance.LinphoneCore.GetNativeVideoWindowId();
Int32 id = LinphoneManager.Instance.LinphoneCore.NativeVideoWindowId;
RemoteVideoUri = Mediastreamer2.WP8Video.VideoRenderer.StreamUri(id);
RemoteVideoProgressBarVisibility = Visibility.Visible;
}
......@@ -134,13 +134,13 @@ namespace Linphone.Views
private void ShowLocalVideo()
{
String device = LinphoneManager.Instance.LinphoneCore.GetVideoDevice();
String device = LinphoneManager.Instance.LinphoneCore.VideoDevice;
LocalVideoUri = Mediastreamer2.WP8Video.VideoRenderer.CameraUri(device);
}
public void LocalVideoOpened()
{
Int32 rotation = LinphoneManager.Instance.LinphoneCore.GetCameraSensorRotation();
Int32 rotation = LinphoneManager.Instance.LinphoneCore.CameraSensorRotation;
switch (pageOrientation)
{
case Microsoft.Phone.Controls.PageOrientation.LandscapeLeft:
......@@ -151,7 +151,7 @@ namespace Linphone.Views
break;
}
LocalVideoRotation = rotation % 360;
String device = LinphoneManager.Instance.LinphoneCore.GetVideoDevice();
String device = LinphoneManager.Instance.LinphoneCore.VideoDevice;
Boolean mirrored = Mediastreamer2.WP8Video.VideoRenderer.IsCameraMirrored(device);
if (mirrored)
{
......@@ -174,7 +174,7 @@ namespace Linphone.Views
{
Logger.Msg("[InCall] ShowVideo");
ShowRemoteVideo();
if (LinphoneManager.Instance.LinphoneCore.IsSelfViewEnabled())
if (LinphoneManager.Instance.LinphoneCore.SelfViewEnabled)
{
ShowLocalVideo();
}
......@@ -474,7 +474,7 @@ namespace Linphone.Views
if (this.remoteVideoRotation != value)
{
this.remoteVideoRotation = value;
LinphoneManager.Instance.LinphoneCore.SetDeviceRotation(this.remoteVideoRotation);
LinphoneManager.Instance.LinphoneCore.DeviceRotation = this.remoteVideoRotation;
LinphoneCall call = GetCurrentCall();
if (call != null) LinphoneManager.Instance.LinphoneCore.UpdateCall(call, null);
this.OnPropertyChanged();
......
This diff is collapsed.
This diff is collapsed.
......@@ -70,7 +70,7 @@ namespace Linphone.Views
tunnelPort.Text = _networkSettings.TunnelPort;
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;
SendLogs.IsEnabled = _settings.DebugEnabled;
......
......@@ -112,7 +112,7 @@ namespace Linphone.Views
{
_conversations = 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)
{
......
......@@ -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
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();
NavigationService.Navigate(new Uri("/Views/InCall.xaml?sip=" + uri, UriKind.RelativeOrAbsolute));
}
......@@ -264,7 +264,7 @@ namespace Linphone
private bool IsRegisterEnabled()
{
LinphoneCore lc = LinphoneManager.Instance.LinphoneCore;
LinphoneProxyConfig cfg = lc.GetDefaultProxyConfig();
LinphoneProxyConfig cfg = lc.DefaultProxyConfig;
if (cfg != null)
{
return cfg.RegisterEnabled;
......@@ -275,14 +275,14 @@ namespace Linphone
private bool IsAccountConfigured()
{
LinphoneCore lc = LinphoneManager.Instance.LinphoneCore;
LinphoneProxyConfig cfg = lc.GetDefaultProxyConfig();
LinphoneProxyConfig cfg = lc.DefaultProxyConfig;
return cfg != null;
}
private void EnableRegister(bool enable)
{
LinphoneCore lc = LinphoneManager.Instance.LinphoneCore;
LinphoneProxyConfig cfg = lc.GetDefaultProxyConfig();
LinphoneProxyConfig cfg = lc.DefaultProxyConfig;
if (cfg != null)
{
cfg.Edit();
......
......@@ -34,7 +34,7 @@ namespace Linphone.Views
{
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.RemoveBackEntry(); // Prevent a back to this screen from the dialer
......
......@@ -41,7 +41,7 @@ namespace Linphone.Views
{
InitializeComponent();
var call = LinphoneManager.Instance.LinphoneCore.GetCurrentCall();
var call = LinphoneManager.Instance.LinphoneCore.CurrentCall;
if (call != null && call.State == Core.LinphoneCallState.StreamsRunning)
{
PauseStateChanged(call, false, false);
......@@ -50,7 +50,7 @@ namespace Linphone.Views
buttons.speaker.IsChecked = true;
buttons_landscape.speaker.IsChecked = true;
}
if (LinphoneManager.Instance.LinphoneCore.IsMicMuted())
if (LinphoneManager.Instance.LinphoneCore.MicMuted)
{
buttons.microphone.IsChecked = true;
buttons_landscape.microphone.IsChecked = true;
......@@ -199,9 +199,9 @@ namespace Linphone.Views
}
// 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)
{
CallStateChanged(call, LinphoneCallState.StreamsRunning);
......
......@@ -26,7 +26,7 @@ namespace Linphone.Views
{
InitializeComponent();
if (!LinphoneManager.Instance.LinphoneCore.IsVideoSupported() || !LinphoneManager.Instance.LinphoneCore.IsVideoEnabled())
if (!LinphoneManager.Instance.LinphoneCore.VideoSupported || !LinphoneManager.Instance.LinphoneCore.VideoEnabled)
{
AnswerVideo.Visibility = Visibility.Collapsed;
}
......@@ -104,7 +104,7 @@ namespace Linphone.Views
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));
}
......
......@@ -28,7 +28,7 @@ namespace Linphone.Views
{
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;
}
......
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