Commit 81c63531 authored by Margaux Clerc's avatar Margaux Clerc

Merge remote-tracking branch 'origin/dev_newUI'

parents 07c8e8f9 37223199
......@@ -4,6 +4,14 @@ Microsoft Visual Studio Solution File, Format Version 12.00
VisualStudioVersion = 14.0.24720.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Linphone", "Linphone\Linphone.csproj", "{6122CCBD-FB37-48CE-9C50-0C8A35003AE6}"
ProjectSection(ProjectDependencies) = postProject
{088A6C0F-16FA-4360-93C7-D781244E77FD} = {088A6C0F-16FA-4360-93C7-D781244E77FD}
{2D0E44C4-E51D-4911-B876-345D1E5E5209} = {2D0E44C4-E51D-4911-B876-345D1E5E5209}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MSWinRTVideo", "submodules\mswinrtvid\MSWinRTVideo.vcxproj", "{2D0E44C4-E51D-4911-B876-345D1E5E5209}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LinphoneTasks", "Linphone\Tasks\LinphoneTasks.csproj", "{088A6C0F-16FA-4360-93C7-D781244E77FD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
......@@ -37,6 +45,36 @@ Global
{6122CCBD-FB37-48CE-9C50-0C8A35003AE6}.Release|x86.ActiveCfg = Release|x86
{6122CCBD-FB37-48CE-9C50-0C8A35003AE6}.Release|x86.Build.0 = Release|x86
{6122CCBD-FB37-48CE-9C50-0C8A35003AE6}.Release|x86.Deploy.0 = Release|x86
{2D0E44C4-E51D-4911-B876-345D1E5E5209}.Debug|Any CPU.ActiveCfg = Debug|Win32
{2D0E44C4-E51D-4911-B876-345D1E5E5209}.Debug|ARM.ActiveCfg = Debug|ARM
{2D0E44C4-E51D-4911-B876-345D1E5E5209}.Debug|ARM.Build.0 = Debug|ARM
{2D0E44C4-E51D-4911-B876-345D1E5E5209}.Debug|x64.ActiveCfg = Debug|x64
{2D0E44C4-E51D-4911-B876-345D1E5E5209}.Debug|x64.Build.0 = Debug|x64
{2D0E44C4-E51D-4911-B876-345D1E5E5209}.Debug|x86.ActiveCfg = Debug|Win32
{2D0E44C4-E51D-4911-B876-345D1E5E5209}.Debug|x86.Build.0 = Debug|Win32
{2D0E44C4-E51D-4911-B876-345D1E5E5209}.Release|Any CPU.ActiveCfg = Release|Win32
{2D0E44C4-E51D-4911-B876-345D1E5E5209}.Release|ARM.ActiveCfg = Release|ARM
{2D0E44C4-E51D-4911-B876-345D1E5E5209}.Release|ARM.Build.0 = Release|ARM
{2D0E44C4-E51D-4911-B876-345D1E5E5209}.Release|x64.ActiveCfg = Release|x64
{2D0E44C4-E51D-4911-B876-345D1E5E5209}.Release|x64.Build.0 = Release|x64
{2D0E44C4-E51D-4911-B876-345D1E5E5209}.Release|x86.ActiveCfg = Release|Win32
{2D0E44C4-E51D-4911-B876-345D1E5E5209}.Release|x86.Build.0 = Release|Win32
{088A6C0F-16FA-4360-93C7-D781244E77FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{088A6C0F-16FA-4360-93C7-D781244E77FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{088A6C0F-16FA-4360-93C7-D781244E77FD}.Debug|ARM.ActiveCfg = Debug|ARM
{088A6C0F-16FA-4360-93C7-D781244E77FD}.Debug|ARM.Build.0 = Debug|ARM
{088A6C0F-16FA-4360-93C7-D781244E77FD}.Debug|x64.ActiveCfg = Debug|x64
{088A6C0F-16FA-4360-93C7-D781244E77FD}.Debug|x64.Build.0 = Debug|x64
{088A6C0F-16FA-4360-93C7-D781244E77FD}.Debug|x86.ActiveCfg = Debug|x86
{088A6C0F-16FA-4360-93C7-D781244E77FD}.Debug|x86.Build.0 = Debug|x86
{088A6C0F-16FA-4360-93C7-D781244E77FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{088A6C0F-16FA-4360-93C7-D781244E77FD}.Release|Any CPU.Build.0 = Release|Any CPU
{088A6C0F-16FA-4360-93C7-D781244E77FD}.Release|ARM.ActiveCfg = Release|ARM
{088A6C0F-16FA-4360-93C7-D781244E77FD}.Release|ARM.Build.0 = Release|ARM
{088A6C0F-16FA-4360-93C7-D781244E77FD}.Release|x64.ActiveCfg = Release|x64
{088A6C0F-16FA-4360-93C7-D781244E77FD}.Release|x64.Build.0 = Release|x64
{088A6C0F-16FA-4360-93C7-D781244E77FD}.Release|x86.ActiveCfg = Release|x86
{088A6C0F-16FA-4360-93C7-D781244E77FD}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......
......@@ -5,4 +5,15 @@
xmlns:local="using:Linphone"
RequestedTheme="Light">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Styles/Styles.xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Light" Source="Styles/Light.xaml"></ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
......@@ -15,29 +15,28 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
using BelledonneCommunications.Linphone.Native;
using Linphone.Model;
using System.Diagnostics;
using Windows.UI.Core;
using Windows.UI.Popups;
namespace Linphone
{
/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
/// </summary>
sealed partial class App : Application
sealed partial class App : Application, CallControllerListener
{
Frame rootFrame;
bool acceptCall;
String sipAddress;
/// <summary>
/// Initializes the singleton application object. This is the first line of authored code
/// executed, and as such is the logical equivalent of main() or WinMain().
......@@ -45,7 +44,68 @@ namespace Linphone
public App()
{
this.InitializeComponent();
this.UnhandledException += App_UnhandledException; ;
this.Suspending += OnSuspending;
SettingsManager.InstallConfigFile();
acceptCall = false;
}
private void App_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
e.Handled = true;
Debug.WriteLine(e.Message);
}
private void Back_requested(object sender, BackRequestedEventArgs e)
{
if (rootFrame.CanGoBack)
{
rootFrame.GoBack();
e.Handled = true;
}
}
public void CallEnded(Call call)
{
Debug.WriteLine("[CallListener] Call ended, can go back ? " + rootFrame.CanGoBack);
if (rootFrame.CanGoBack)
{
rootFrame.GoBack();
}
else
{
// Launch the Dialer and remove the incall view from the backstack
rootFrame.Navigate(typeof(Views.Dialer), null);
if (rootFrame.BackStack.Count > 0)
{
rootFrame.BackStack.Clear();
}
}
}
public void CallUpdatedByRemote(Call call, bool isVideoAdded)
{
//throw new NotImplementedException();
}
public void MuteStateChanged(bool isMicMuted)
{
//throw new NotImplementedException();
}
public void NewCallStarted(string callerNumber)
{
Debug.WriteLine("[CallListener] NewCallStarted " + callerNumber);
rootFrame.Navigate(typeof(Views.InCall), callerNumber);
}
public void PauseStateChanged(Call call, bool isCallPaused, bool isCallPausedByRemote)
{
Debug.WriteLine("Pausestatechanged");
// if (this.PauseListener != null)
// this.PauseListener.PauseStateChanged(call, isCallPaused, isCallPausedByRemote);
}
/// <summary>
......@@ -55,15 +115,28 @@ namespace Linphone
/// <param name="e">Details about the launch request and process.</param>
protected override void OnLaunched(LaunchActivatedEventArgs e)
{
Initialize(e, null);
}
private void Initialize(IActivatedEventArgs e, String args)
{
#if DEBUG
if (System.Diagnostics.Debugger.IsAttached)
{
this.DebugSettings.EnableFrameRateCounter = true;
this.DebugSettings.EnableFrameRateCounter = false;
}
#endif
//Start linphone
var currentView = SystemNavigationManager.GetForCurrentView();
currentView.AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible;
LinphoneManager.Instance.InitLinphoneCore();
LinphoneManager.Instance.CallListener = this;
LinphoneManager.Instance.CoreDispatcher = Windows.ApplicationModel.Core.CoreApplication.GetCurrentView().CoreWindow.Dispatcher;
Frame rootFrame = Window.Current.Content as Frame;
rootFrame = Window.Current.Content as Frame;
// Do not repeat app initialization when the Window already has content,
// just ensure that the window is active
......@@ -83,17 +156,50 @@ namespace Linphone
Window.Current.Content = rootFrame;
}
SystemNavigationManager.GetForCurrentView().BackRequested += Back_requested;
if (rootFrame.Content == null)
{
// When the navigation stack isn't restored navigate to the first page,
// configuring the new page by passing required information as a navigation
// parameter
rootFrame.Navigate(typeof(MainPage), e.Arguments);
if (args != null)
{
if (args.StartsWith("chat"))
{
var sipAddrr = args.Split('=')[1];
rootFrame.Navigate(typeof(Views.Chat), args);
}
else
{
if (args.StartsWith("answer"))
{
acceptCall = true;
sipAddress = args.Split('=')[1];
}
rootFrame.Navigate(typeof(Views.Dialer), null);
}
}
else
{
// When the navigation stack isn't restored navigate to the first page,
// configuring the new page by passing required information as a navigation
// parameter
rootFrame.Navigate(typeof(Views.Dialer), args);
}
}
// Ensure the current window is active
Window.Current.Activate();
}
protected override void OnActivated(IActivatedEventArgs args)
{
if (args.Kind == ActivationKind.ToastNotification)
{
var toastArgs = args as ToastNotificationActivatedEventArgs;
var arguments = toastArgs.Argument;
Initialize(args, arguments);
}
}
/// <summary>
/// Invoked when Navigation to a certain page fails
/// </summary>
......@@ -117,5 +223,25 @@ namespace Linphone
//TODO: Save application state and stop any background activity
deferral.Complete();
}
public void CallIncoming(Call call)
{
if(acceptCall)
{
if (sipAddress != "")
{
Address addr = LinphoneManager.Instance.Core.InterpretURL(sipAddress);
if (addr != null && addr.AsStringUriOnly().Equals(call.RemoteAddress.AsStringUriOnly()))
{
LinphoneManager.Instance.Core.AcceptCall(call);
rootFrame.Navigate(typeof(Views.InCall), call.RemoteAddress.AsString());
acceptCall = false;
}
}
} else
{
rootFrame.Navigate(typeof(Views.IncomingCall), call.RemoteAddress.AsString());
}
}
}
}
This diff is collapsed.
[net]
download_bw=380
upload_bw=380
[sip]
default_proxy=0
media_encryption=none
[misc]
log_collection_upload_server_url=https://www.linphone.org:444/lft.php
file_transfer_server_url=https://www.linphone.org:444/lft.php
[sound]
hold_music=Assets/Sounds/toy-mono.wav
[video]
automatically_accept=0
automatically_initiate=0
capture=1
display=1
size=qvga
[proxy_default_values]
reg_expires=28800
\ No newline at end of file
[net]
mtu=1300
[sip]
guess_hostname=1
inc_timeout=45
use_ipv6=0
register_only_when_network_is_up=1
ping_with_options=0
store_ha1_passwd=0
inactive_video_on_pause=1
[rtp]
audio_rtp_port=7076
video_rtp_port=9078
audio_jitt_comp=60
video_jitt_comp=60
nortp_timeout=30
[sound]
dtmf_player_amp=0.1
[misc]
history_max_size=30
max_calls=1
This source diff could not be displayed because it is too large. You can view the blob instead.
<UserControl x:Class="Linphone.Controls.AddressBox"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="Linphone.Controls"
mc:Ignorable="d"
d:DesignHeight="100" d:DesignWidth="480">
<Grid x:Name="LayoutRoot">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="Auto"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBox
Grid.Column="0"
x:Name="address"
Text="{Binding Text}"
PlaceholderText="Number or address"
x:Uid="AddressHint"
VerticalAlignment="Center"
AcceptsReturn="False"
InputScope="EmailSmtpAddress"
TextChanged="address_TextChanged">
</TextBox>
<Button
x:Name="Backspace"
Grid.Column="1"
Background="Transparent"
ClickMode="Press"
IsEnabled="False"
Style="{StaticResource ButtonStyle}"
Click="backspace_Click_1"
Holding="backspace_Hold_1">
<FontIcon
FontFamily="Segoe MDL2 Assets"
Glyph="&#xE750;"
FontSize="30"/>
</Button>
</Grid>
</UserControl>
\ No newline at end of file
/*
AddressBox.xaml.cs
Copyright (C) 2016 Belledonne Communications, Grenoble, France
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
using System;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
namespace Linphone.Controls
{
public partial class AddressBox : UserControl
{
public String Text
{
get { return address.Text; }
set {
address.Text = value;
if(value.Length > 0)
{
Backspace.IsEnabled = true;
} else
{
Backspace.IsEnabled = false;
}
}
}
public AddressBox()
{
InitializeComponent();
this.DataContext = this;
}
private void backspace_Hold_1(object sender, RoutedEventArgs e)
{
address.Text = "";
}
private void backspace_Click_1(object sender, RoutedEventArgs e)
{
if (address.Text.Length > 0)
address.Text = address.Text.Substring(0, address.Text.Length - 1);
}
private void address_TextChanged(object sender, TextChangedEventArgs e)
{
if(address.Text.Length > 0)
{
Backspace.IsEnabled = true;
} else
{
Backspace.IsEnabled = false;
}
}
}
}
This diff is collapsed.
/*
CallControlsP.xaml.cs
Copyright (C) 2015 Belledonne Communications, Grenoble, France
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
using Linphone.Model;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml;
namespace Linphone.Controls
{
public partial class CallControlsP : UserControl
{
public delegate void HangUpClickEventHandler(object sender);
public event HangUpClickEventHandler HangUpClick;
public delegate void StatsClickEventHandler(object sender, bool areStatsVisible);
public event StatsClickEventHandler StatsClick;
public delegate void CameraClickEventHandler(object sender);
public event CameraClickEventHandler CameraClick;
public delegate void PauseClickEventHandler(object sender, bool isPaused);
public event PauseClickEventHandler PauseClick;
public delegate bool SpeakerClickEventHandler(object sender, bool isSpeakerOn);
public event SpeakerClickEventHandler SpeakerClick;
public delegate void MuteClickEventHandler(object sender, bool isMuteOn);
public event MuteClickEventHandler MuteClick;
public delegate void VideoClickEventHandler(object sender, bool isVideoOn);
public event VideoClickEventHandler VideoClick;
public delegate void DialpadClickEventHandler(object sender, bool isDialpadShown);
public event DialpadClickEventHandler DialpadClick;
public delegate void BluetoothClickEventHandler(object sender, bool isBluetoothOn);
public event DialpadClickEventHandler BluetoothClick;
public CallControlsP()
{
InitializeComponent();
microphone.IsChecked = LinphoneManager.Instance.Core.IsMicEnabled;
video.IsEnabled = LinphoneManager.Instance.IsVideoAvailable;
camera.IsEnabled = LinphoneManager.Instance.IsVideoAvailable && LinphoneManager.Instance.NumberOfCameras > 1;
}
#region Button enabled/disabled
public void enabledDialpad(bool isDialpadShown)
{
dialpad.Visibility = isDialpadShown ? Visibility.Visible : Visibility.Collapsed;
}
public void enabledVideo(bool isVideoEnabled)
{
video.IsEnabled = isVideoEnabled;
}
public void checkedVideo(bool isVideoChecked)
{
video.IsChecked = isVideoChecked;
}
public void enabledPause(bool isPauseEnabled)
{
pause.IsEnabled = isPauseEnabled;
}
#endregion
#region Click Event
private void hangUp_Click(object sender, RoutedEventArgs e)
{
HangUpClick(this);
}
private void bluetooth_Click_1(object sender, RoutedEventArgs e)
{
bool isBluetoothToggled = (bool)bluetooth.IsChecked;
BluetoothClick(this, isBluetoothToggled);
}
private void speaker_Click_1(object sender, RoutedEventArgs e)
{
bool isSpeakerToggled = (bool)speaker.IsChecked;
SpeakerClick(this, isSpeakerToggled);
}
private void microphone_Click_1(object sender, RoutedEventArgs e)
{
bool isMicToggled = (bool)microphone.IsChecked;
MuteClick(this, isMicToggled);
}
private void stats_Click_1(object sender, RoutedEventArgs e)
{
bool areStatsVisible = (bool)stats.IsChecked;
stats.IsChecked = areStatsVisible;
statsPanel.Visibility = areStatsVisible ? Visibility.Visible : Visibility.Collapsed;
StatsClick(this, areStatsVisible);
}
private void video_Click_1(object sender, RoutedEventArgs e)
{
bool isVideoToggled = (bool)video.IsChecked;
video.IsChecked = isVideoToggled;
VideoClick(this, isVideoToggled);
}
private void camera_Click_1(object sender, RoutedEventArgs e)
{
CameraClick(this);
}
private void dialpad_Click_1(object sender, RoutedEventArgs e)
{
bool isDialpadChecked = (bool)dialpad.IsChecked;
dialpad.IsChecked = isDialpadChecked;
numpad.Visibility = isDialpadChecked ? Visibility.Visible : Visibility.Collapsed;
DialpadClick(this, isDialpadChecked);
}
private void pause_Click_1(object sender, RoutedEventArgs e)
{
bool isPauseToggled = (bool)pause.IsChecked;
PauseClick(this, isPauseToggled);
}
#endregion
}
}
<UserControl x:Class="Linphone.Controls.ChatBubble"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
xmlns:controls="using:Linphone.Controls"
d:DesignHeight="480" d:DesignWidth="480">
<Grid x:Name="LayoutRoot">
</Grid>
</UserControl>
\ No newline at end of file
/*
ChatBubble.xaml.cs
Copyright (C) 2015 Belledonne Communications, Grenoble, France
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
using BelledonneCommunications.Linphone.Native;
using Linphone.Model;
using System;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Documents;
namespace Linphone.Controls
{
/// <summary>