Commit 764679eb authored by Margaux Clerc's avatar Margaux Clerc

Updated interface for windows 10

parent 79e04c68
...@@ -5,4 +5,15 @@ ...@@ -5,4 +5,15 @@
xmlns:local="using:Linphone" xmlns:local="using:Linphone"
RequestedTheme="Light"> 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> </Application>
...@@ -30,14 +30,21 @@ using Windows.UI.Xaml.Data; ...@@ -30,14 +30,21 @@ using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input; using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media; using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation; using Windows.UI.Xaml.Navigation;
using BelledonneCommunications.Linphone.Native;
using Linphone.Model;
using System.Diagnostics;
using Windows.UI.Core;
using Windows.Networking.PushNotifications;
namespace Linphone namespace Linphone
{ {
/// <summary> /// <summary>
/// Provides application-specific behavior to supplement the default Application class. /// Provides application-specific behavior to supplement the default Application class.
/// </summary> /// </summary>
sealed partial class App : Application sealed partial class App : Application, CallControllerListener
{ {
Frame rootFrame;
/// <summary> /// <summary>
/// Initializes the singleton application object. This is the first line of authored code /// 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(). /// executed, and as such is the logical equivalent of main() or WinMain().
...@@ -48,6 +55,56 @@ namespace Linphone ...@@ -48,6 +55,56 @@ namespace Linphone
this.Suspending += OnSuspending; this.Suspending += OnSuspending;
} }
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);
//this.Page.NavigationService.RemoveBackEntry();
}
}
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> /// <summary>
/// Invoked when the application is launched normally by the end user. Other entry points /// Invoked when the application is launched normally by the end user. Other entry points
/// will be used such as when the application is launched to open a specific file. /// will be used such as when the application is launched to open a specific file.
...@@ -59,11 +116,17 @@ namespace Linphone ...@@ -59,11 +116,17 @@ namespace Linphone
#if DEBUG #if DEBUG
if (System.Diagnostics.Debugger.IsAttached) if (System.Diagnostics.Debugger.IsAttached)
{ {
this.DebugSettings.EnableFrameRateCounter = true; this.DebugSettings.EnableFrameRateCounter = false;
} }
#endif #endif
Frame rootFrame = Window.Current.Content as Frame; //Start linphone
LinphoneManager.Instance.InitLinphoneCore();
LinphoneManager.Instance.CoreDispatcher = Windows.ApplicationModel.Core.CoreApplication.GetCurrentView().CoreWindow.Dispatcher;
LinphoneManager.Instance.CallListener = this;
rootFrame = Window.Current.Content as Frame;
// Do not repeat app initialization when the Window already has content, // Do not repeat app initialization when the Window already has content,
// just ensure that the window is active // just ensure that the window is active
...@@ -83,12 +146,14 @@ namespace Linphone ...@@ -83,12 +146,14 @@ namespace Linphone
Window.Current.Content = rootFrame; Window.Current.Content = rootFrame;
} }
SystemNavigationManager.GetForCurrentView().BackRequested += Back_requested;
if (rootFrame.Content == null) if (rootFrame.Content == null)
{ {
// When the navigation stack isn't restored navigate to the first page, // When the navigation stack isn't restored navigate to the first page,
// configuring the new page by passing required information as a navigation // configuring the new page by passing required information as a navigation
// parameter // parameter
rootFrame.Navigate(typeof(MainPage), e.Arguments); rootFrame.Navigate(typeof(Views.Dialer), e.Arguments);
} }
// Ensure the current window is active // Ensure the current window is active
Window.Current.Activate(); Window.Current.Activate();
...@@ -117,5 +182,10 @@ namespace Linphone ...@@ -117,5 +182,10 @@ namespace Linphone
//TODO: Save application state and stop any background activity //TODO: Save application state and stop any background activity
deferral.Complete(); deferral.Complete();
} }
public void CallIncoming(Call call)
{
rootFrame.Navigate(typeof(Views.IncomingCall), call.RemoteAddress.AsString());
}
} }
} }
This diff is collapsed.
[net]
firewall_policy=0
download_bw=380
upload_bw=380
[sip]
default_proxy=0
[rtp]
audio_rtp_port=7076
video_rtp_port=9078
[sound]
hold_music=Assets/Sounds/toy-mono.wav
[video]
capture=1
display=1
size=qvga
[proxy_default_values]
reg_expires=28800
[net]
mtu=1300
[sip]
guess_hostname=1
inc_timeout=45
use_ipv6=0
register_only_when_network_is_up=1
auto_net_state_mon=0
keepalive_period=30000
ping_with_options=0
store_ha1_passwd=0
sip_port=-1
sip_tcp_port=-1
sip_tls_port=-1
inactive_video_on_pause=1
defer_update_default=1
[rtp]
audio_jitt_comp=60
video_jitt_comp=60
nortp_timeout=30
[sound]
dtmf_player_amp=0.1
[video]
displaytype=MSWP8Dis
[misc]
history_max_size=30
max_calls=1
file_transfer_server_url=https://www.linphone.org:444/lft.php
log_collection_upload_server_url=https://www.linphone.org:444/lft.php
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"
TextChanged="address_TextChanged"
InputScope="EmailSmtpAddress"
GotFocus="address_GotFocus"
LostFocus="address_LostFocus"
CompositeMode="MinBlend">
</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 System.Diagnostics;
using Windows.UI.Xaml.Controls;
namespace Linphone.Controls
{
public interface AddressBoxFocused
{
void Focused();
void UnFocused();
}
public partial class AddressBox : UserControl
{
public AddressBoxFocused FocusListener;
public String Text
{
get { return address.Text; }
set { address.Text = value; Debug.WriteLine("Set"); }
}
public AddressBox()
{
InitializeComponent();
this.DataContext = this;
}
private void backspace_Hold_1(object sender, Windows.UI.Xaml.RoutedEventArgs e)
{
address.Text = "";
}
private void backspace_Click_1(object sender, Windows.UI.Xaml.RoutedEventArgs e)
{
if (address.Text.Length > 0)
address.Text = address.Text.Substring(0, address.Text.Length - 1);
}
private void address_GotFocus(object sender, Windows.UI.Xaml.RoutedEventArgs e)
{
if (FocusListener != null)
FocusListener.Focused();
}
private void address_LostFocus(object sender, Windows.UI.Xaml.RoutedEventArgs e)
{
if (FocusListener != null)
FocusListener.UnFocused();
}
private void address_TextChanged(object sender, TextChangedEventArgs e)
{
if(address.Text.Length > 0)
{
Backspace.IsEnabled = true;
} else
{
Backspace.IsEnabled = false;
}
}
}
}
<UserControl x:Class="Linphone.Controls.CallControlsL"
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="using:Linphone.Controls"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="860">
<Grid x:Name="LayoutRoot">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<ToggleButton
x:Name="speaker"
Grid.Row="1"
Grid.Column="0"
BorderThickness="0"
Margin="-10"
Click="speaker_Click_1">
<StackPanel Orientation="Vertical">
<Image x:Name="speakerImg" Source="/Assets/Incall_Icons/speaker_off.png" Stretch="None"/>
</StackPanel>
</ToggleButton>
<ToggleButton
x:Name="microphone"
Grid.Row="1"
Grid.Column="1"
BorderThickness="0"
Margin="-10"
Click="microphone_Click_1"
IsEnabled="False">
<StackPanel Orientation="Vertical">
<Image x:Name="microImg" Source="/Assets/Incall_Icons/micro_on.png" Stretch="None" Opacity="0.4"/>
</StackPanel>
</ToggleButton>
<ToggleButton
x:Name="bluetooth"
Grid.Row="1"
Grid.Column="2"
BorderThickness="0"
Margin="-10"
Click="bluetooth_Click_1"
IsEnabled="False">
<StackPanel Orientation="Vertical">
<Image x:Name="bluetoothImg" Source="/Assets/Incall_Icons/bluetooth_off.png" Stretch="None" Opacity="0.4"/>
</StackPanel>
</ToggleButton>
<ToggleButton
x:Name="pause"
Grid.Row="2"
Grid.Column="0"
BorderThickness="0"
Margin="-10"
Click="pause_Click_1"
IsEnabled="False">
<StackPanel Orientation="Vertical">
<Image x:Name="pauseImg" Source="/Assets/Incall_Icons/play.png" Stretch="None" Opacity="0.4"/>
</StackPanel>
</ToggleButton>
<ToggleButton
x:Name="video"
Grid.Row="2"
Grid.Column="1"
BorderThickness="0"
Margin="-10"
Click="video_Click_1"
IsEnabled="False"
Visibility="{Binding VideoButtonVisibility}">
<StackPanel Orientation="Vertical">
<Image x:Name="videoImg" Source="/Assets/Incall_Icons/video_off.png" Stretch="None" Opacity="0.4"/>
</StackPanel>
</ToggleButton>
<ToggleButton
x:Name="stats"
Grid.Row="2"
Grid.Column="2"
BorderThickness="0"
Margin="-10"
Click="stats_Click_1">
<StackPanel Orientation="Vertical">
<Image x:Name="statsImg" Source="/Assets/Incall_Icons/stats.png" Stretch="None"/>
</StackPanel>
</ToggleButton>
<Button
x:Name="camera"
Grid.Row="3"
Grid.Column="3"
BorderThickness="0"
Margin="-10"
Click="camera_Click_1"
IsEnabled="False"
Visibility="{Binding CameraButtonVisibility}">
<StackPanel Orientation="Vertical">
<Image x:Name="cameraImg" Source="/Assets/Incall_Icons/camera.png" Stretch="None" Opacity="0.4"/>
</StackPanel>
</Button>
<Button
x:Name="hangUp"
Grid.Row="3"
Grid.Column="0"
Grid.ColumnSpan="3"
BorderThickness="0"
Margin="-10"
Content="HangUp"
Click="hangUp_Click"
ClickMode="Release"/>
<ToggleButton
x:Name="dialpad"
Grid.Row="3"
Grid.Column="4"
Grid.ColumnSpan="2"
BorderThickness="0"
Margin="-10"
Click="dialpad_Click_1">
<Image Source="/Assets/Incall_Icons/dialpad.png" Stretch="None"/>
</ToggleButton>
<!-- Statistics panel -->
<Grid x:Name="statsPanel" Grid.Row="1" Grid.RowSpan="2" Grid.Column="3" Grid.ColumnSpan="3" Visibility="Collapsed">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="StatPayloadType" Margin="5" Grid.Column="0" Grid.Row="1"/>
<TextBlock Text="{Binding PayloadType}" Grid.Column="1" Grid.Row="1"/>
<TextBlock Text="StatDownloadBandwidth" Margin="5" Grid.Column="0" Grid.Row="2"/>
<TextBlock Text="{Binding DownBandwidth}" Grid.Column="1" Grid.Row="2"/>
<TextBlock Text="StatUploadBandwidth" Margin="5" Grid.Column="0" Grid.Row="3"/>
<TextBlock Text="{Binding UpBandwidth}" Grid.Column="1" Grid.Row="3"/>
<TextBlock Text="StatMediaEncryption" Margin="5" Grid.Column="0" Grid.Row="4"/>
<TextBlock Text="{Binding MediaEncryption}" Grid.Column="1" Grid.Row="4"/>
<TextBlock Text="StatICE" Margin="5" Grid.Column="0" Grid.Row="5"/>
<TextBlock Text="{Binding ICE}" Grid.Column="1" Grid.Row="5"/>
<TextBlock Text="StatReceivedVideoSize" Visibility="{Binding VideoStatsVisibility}" Margin="5" Grid.Column="0" Grid.Row="6"/>
<TextBlock Text="{Binding ReceivedVideoSize}" Visibility="{Binding VideoStatsVisibility}" Grid.Column="1" Grid.Row="6"/>
<TextBlock Text="StatSentVideoSize" Visibility="{Binding VideoStatsVisibility}" Margin="5" Grid.Column="0" Grid.Row="7"/>
<TextBlock Text="{Binding SentVideoSize}" Visibility="{Binding VideoStatsVisibility}" Grid.Column="1" Grid.Row="7"/>
</Grid>
<!-- Numeric pad buttons -->
<controls:Numpad
x:Name="numpad"
Grid.Row="0"
Grid.RowSpan="3"
Grid.Column="3"
Grid.ColumnSpan="3"
Visibility="Collapsed"/>
</Grid>
</UserControl>
\ No newline at end of file
/*
CallControlsL.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 System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using Linphone.Model;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Media.Imaging;
namespace Linphone.Controls
{
/// <summary>
///
/// </summary>
public partial class CallControlsL : UserControl
{
private const string speakerOn = "/Assets/Incall_Icons/speaker_on.png";
private const string speakerOff = "/Assets/Incall_Icons/speaker_off.png";
private const string bluetoothOn = "/Assets/Incall_Icons/bluetooth_on.png";
private const string bluetoothOff = "/Assets/Incall_Icons/bluetooth_off.png";
private const string videoOn = "/Assets/Incall_Icons/video_on.png";
private const string videoOff = "/Assets/Incall_Icons/video_off.png";
private const string pauseOn = "/Assets/Incall_Icons/pause.png";
private const string pauseOff = "/Assets/Incall_Icons/play.png";
private const string micOn = "/Assets/Incall_Icons/micro_on.png";
private const string micOff = "/Assets/Incall_Icons/micro_off.png";
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;
/// <summary>
/// Public constructor
/// </summary>
public CallControlsL()
{
this.InitializeComponent();
}
private void hangUp_Click(object sender, RoutedEventArgs e)
{
HangUpClick(this);
}
private void bluetooth_Click_1(object sender, RoutedEventArgs e)
{
/*bool isBluetoothToggled = (bool)bluetooth.IsChecked;
bluetoothImg.Source = new BitmapImage(new Uri(isBluetoothToggled ? bluetoothOn : bluetoothOff, UriKind.RelativeOrAbsolute));
BluetoothClick(this, isBluetoothToggled);*/
}
private void speaker_Click_1(object sender, RoutedEventArgs e)
{
/* bool isSpeakerToggled = (bool)speaker.IsChecked;
if (SpeakerClick(this, isSpeakerToggled))
{
speakerImg.Source = new BitmapImage(new Uri(isSpeakerToggled ? speakerOn : speakerOff, UriKind.RelativeOrAbsolute));
}*/
}
private void microphone_Click_1(object sender, RoutedEventArgs e)
{
/* bool isMicToggled = (bool)microphone.IsChecked;
microImg.Source = new BitmapImage(new Uri(isMicToggled ? micOff : micOn, UriKind.RelativeOrAbsolute));
MuteClick(this, isMicToggled);*/
}
private void stats_Click_1(object sender, RoutedEventArgs e)
{
/*bool areStatsVisible = (bool)stats.IsChecked;
StatsClick(this, areStatsVisible);*/
}
private void video_Click_1(object sender, RoutedEventArgs e)
{
/* bool isVideoToggled = (bool)video.IsChecked;
videoImg.Source = new BitmapImage(new Uri(isVideoToggled ? videoOn : videoOff, UriKind.RelativeOrAbsolute));