Commit a780efe9 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Added more settings (transport list picker and codecs page)

parent 6a866f52
No preview for this file type
......@@ -113,9 +113,17 @@
<Compile Include="Model\ContactPictureConverter.cs" />
<Compile Include="Model\LinphoneManager.cs" />
<Compile Include="Model\SettingsManager.cs" />
<Compile Include="Resources\DefaultValues.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>DefaultValues.resx</DependentUpon>
</Compile>
<Compile Include="Views\About.xaml.cs">
<DependentUpon>About.xaml</DependentUpon>
</Compile>
<Compile Include="Views\CodecsSettings.xaml.cs">
<DependentUpon>CodecsSettings.xaml</DependentUpon>
</Compile>
<Compile Include="Views\Contacts.xaml.cs">
<DependentUpon>Contacts.xaml</DependentUpon>
</Compile>
......@@ -160,6 +168,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\CodecsSettings.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\Contacts.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
......@@ -189,6 +201,10 @@
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>AppResources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="Resources\DefaultValues.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>DefaultValues.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Content Include="Assets\AppBar\add.png" />
......
using System;
using Linphone.Resources;
using System;
using System.Collections.Generic;
using System.IO.IsolatedStorage;
using System.Linq;
using System.Resources;
using System.Text;
using System.Threading.Tasks;
......@@ -10,13 +12,28 @@ namespace Linphone.Model
public class SettingsManager
{
private IsolatedStorageSettings settings;
private ResourceManager resourceManager;
const string DebugSettingKeyName = "Debug";
const string TransportSettingKeyName = "Transport";
const string AMRNBSettingKeyName = "AMRNB";
const string AMRWBSettingKeyName = "AMRWB";
const string Speex16SettingKeyName = "Speex16";
const string Speex8SettingKeyName = "Speex8";
const string PCMUSettingKeyName = "PCMU";
const string PCMASettingKeyName = "PCMA";
const string G722SettingKeyName = "G722";
const string ILBCSettingKeyName = "ILBC";
const string SILK16SettingKeyName = "SILK16";
const string GSMSettingKeyName = "GSM";
public SettingsManager()
{
// Get the settings for this application.
settings = IsolatedStorageSettings.ApplicationSettings;
// Default values for the settings
resourceManager = new ResourceManager("Linphone.Resources.DefaultValues", typeof(DefaultValues).Assembly);
}
public static bool isDebugEnabled
......@@ -99,5 +116,162 @@ namespace Linphone.Model
}
}
}
public string Transport
{
get
{
return GetValueOrDefault<string>(TransportSettingKeyName, resourceManager.GetString("TransportDefault"));
}
set
{
if (AddOrUpdateValue(TransportSettingKeyName, value))
{
Save();
}
}
}
//Codecs Settings
public bool? AMRNB
{
get
{
return GetValueOrDefault<bool?>(AMRNBSettingKeyName, false);
}
set
{
if (AddOrUpdateValue(AMRNBSettingKeyName, value))
{
Save();
}
}
}
public bool? AMRWB
{
get
{
return GetValueOrDefault<bool?>(AMRWBSettingKeyName, false);
}
set
{
if (AddOrUpdateValue(AMRWBSettingKeyName, value))
{
Save();
}
}
}
public bool? Speex16
{
get
{
return GetValueOrDefault<bool?>(Speex16SettingKeyName, false);
}
set
{
if (AddOrUpdateValue(Speex16SettingKeyName, value))
{
Save();
}
}
}
public bool? Speex8
{
get
{
return GetValueOrDefault<bool?>(Speex8SettingKeyName, false);
}
set
{
if (AddOrUpdateValue(Speex8SettingKeyName, value))
{
Save();
}
}
}
public bool? PCMU
{
get
{
return GetValueOrDefault<bool?>(PCMUSettingKeyName, false);
}
set
{
if (AddOrUpdateValue(PCMUSettingKeyName, value))
{
Save();
}
}
}
public bool? PCMA
{
get
{
return GetValueOrDefault<bool?>(PCMASettingKeyName, false);
}
set
{
if (AddOrUpdateValue(PCMASettingKeyName, value))
{
Save();
}
}
}
public bool? G722
{
get
{
return GetValueOrDefault<bool?>(G722SettingKeyName, false);
}
set
{
if (AddOrUpdateValue(G722SettingKeyName, value))
{
Save();
}
}
}
public bool? ILBC
{
get
{
return GetValueOrDefault<bool?>(ILBCSettingKeyName, false);
}
set
{
if (AddOrUpdateValue(ILBCSettingKeyName, value))
{
Save();
}
}
}
public bool? SILK16
{
get
{
return GetValueOrDefault<bool?>(SILK16SettingKeyName, false);
}
set
{
if (AddOrUpdateValue(SILK16SettingKeyName, value))
{
Save();
}
}
}
public bool? GSM
{
get
{
return GetValueOrDefault<bool?>(GSMSettingKeyName, false);
}
set
{
if (AddOrUpdateValue(GSMSettingKeyName, value))
{
Save();
}
}
}
}
}
......@@ -9,7 +9,7 @@ using System.Resources;
[assembly: AssemblyTitle("Linphone")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyCompany("Belledonne Communications")]
[assembly: AssemblyProduct("Linphone")]
[assembly: AssemblyCopyright("Copyright © 2013")]
[assembly: AssemblyTrademark("")]
......@@ -18,7 +18,7 @@ using System.Resources;
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
[assembly: ComVisible(true)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("72f2215f-dfaa-41b2-938b-eb34d5f87815")]
......
<?xml version="1.0" encoding="utf-8"?>
<Deployment xmlns="http://schemas.microsoft.com/windowsphone/2012/deployment" AppPlatformVersion="8.0">
<DefaultLanguage xmlns="" code="en-US" />
<App xmlns="" ProductID="{bb0b8f3f-8638-49cf-b968-e097a2e6cbbe}" Title="Linphone" RuntimeType="Silverlight" Version="1.0.0.0" Genre="apps.normal" Author="Linphone author" Description="VoIP SIP client" Publisher="Linphone" PublisherID="{c333a626-bb9d-4f5c-bbe9-09b7448be4e0}">
<App xmlns="" ProductID="{bb0b8f3f-8638-49cf-b968-e097a2e6cbbe}" Title="Linphone" RuntimeType="Silverlight" Version="1.0.0.0" Genre="apps.normal" Author="Belledonne Communications" Description="VoIP SIP client" Publisher="Linphone" PublisherID="{c333a626-bb9d-4f5c-bbe9-09b7448be4e0}">
<IconPath IsRelative="true" IsResource="false">Assets\AppIcon.png</IconPath>
<Capabilities>
<Capability Name="ID_CAP_NETWORKING" />
......
......@@ -93,6 +93,24 @@ namespace Linphone.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to AMR-NB.
/// </summary>
public static string AMRNBCodec {
get {
return ResourceManager.GetString("AMRNBCodec", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to AMR-WB.
/// </summary>
public static string AMRWBCodec {
get {
return ResourceManager.GetString("AMRWBCodec", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Linphone.
/// </summary>
......@@ -111,6 +129,15 @@ namespace Linphone.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Codecs.
/// </summary>
public static string CodecsMenu {
get {
return ResourceManager.GetString("CodecsMenu", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Contacts.
/// </summary>
......@@ -121,7 +148,7 @@ namespace Linphone.Resources {
}
/// <summary>
/// Looks up a localized string similar to Enable debug.
/// Looks up a localized string similar to Debug.
/// </summary>
public static string DebugSetting {
get {
......@@ -156,6 +183,24 @@ namespace Linphone.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to G722.
/// </summary>
public static string G722Codec {
get {
return ResourceManager.GetString("G722Codec", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to GSM.
/// </summary>
public static string GSMCodec {
get {
return ResourceManager.GetString("GSMCodec", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to History.
/// </summary>
......@@ -165,6 +210,33 @@ namespace Linphone.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to ILBC.
/// </summary>
public static string ILBCCodec {
get {
return ResourceManager.GetString("ILBCCodec", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to PCMA.
/// </summary>
public static string PCMACodec {
get {
return ResourceManager.GetString("PCMACodec", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to PCMU.
/// </summary>
public static string PCMUCodec {
get {
return ResourceManager.GetString("PCMUCodec", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to LeftToRight.
/// </summary>
......@@ -200,5 +272,59 @@ namespace Linphone.Resources {
return ResourceManager.GetString("SettingsMenu", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to SILK 16.
/// </summary>
public static string SILK16Codec {
get {
return ResourceManager.GetString("SILK16Codec", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Speex 16.
/// </summary>
public static string Speex16Codec {
get {
return ResourceManager.GetString("Speex16Codec", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Speex 8.
/// </summary>
public static string Speex8Codec {
get {
return ResourceManager.GetString("Speex8Codec", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Transport.
/// </summary>
public static string TransportSetting {
get {
return ResourceManager.GetString("TransportSetting", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to TCP.
/// </summary>
public static string TransportTCP {
get {
return ResourceManager.GetString("TransportTCP", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to UDP.
/// </summary>
public static string TransportUDP {
get {
return ResourceManager.GetString("TransportUDP", resourceCulture);
}
}
}
}
......@@ -135,7 +135,7 @@
<value>Cancel</value>
</data>
<data name="DebugSetting" xml:space="preserve">
<value>Enable debug</value>
<value>Debug</value>
</data>
<data name="DeleteAllMenu" xml:space="preserve">
<value>Delete All</value>
......@@ -170,4 +170,46 @@ http://www.linphone.org/m/help
©2013 Belledonne Communications</value>
</data>
<data name="AMRNBCodec" xml:space="preserve">
<value>AMR-NB</value>
</data>
<data name="AMRWBCodec" xml:space="preserve">
<value>AMR-WB</value>
</data>
<data name="CodecsMenu" xml:space="preserve">
<value>Codecs</value>
</data>
<data name="G722Codec" xml:space="preserve">
<value>G722</value>
</data>
<data name="GSMCodec" xml:space="preserve">
<value>GSM</value>
</data>
<data name="ILBCCodec" xml:space="preserve">
<value>ILBC</value>
</data>
<data name="PCMACodec" xml:space="preserve">
<value>PCMA</value>
</data>
<data name="PCMUCodec" xml:space="preserve">
<value>PCMU</value>
</data>
<data name="SILK16Codec" xml:space="preserve">
<value>SILK 16</value>
</data>
<data name="Speex16Codec" xml:space="preserve">
<value>Speex 16</value>
</data>
<data name="Speex8Codec" xml:space="preserve">
<value>Speex 8</value>
</data>
<data name="TransportSetting" xml:space="preserve">
<value>Transport</value>
</data>
<data name="TransportTCP" xml:space="preserve">
<value>TCP</value>
</data>
<data name="TransportUDP" xml:space="preserve">
<value>UDP</value>
</data>
</root>
\ No newline at end of file
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18010
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Linphone.Resources {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class DefaultValues {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal DefaultValues() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Linphone.Resources.DefaultValues", typeof(DefaultValues).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to UDP.
/// </summary>
internal static string TransportDefault {
get {
return ResourceManager.GetString("TransportDefault", resourceCulture);
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="TransportDefault" xml:space="preserve">
<value>UDP</value>
</data>
</root>
\ No newline at end of file
<phone:PhoneApplicationPage
x:Class="Linphone.Views.CodecsSettings"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
mc:Ignorable="d"
shell:SystemTray.IsVisible="True">
<!--LayoutRoot is the root grid where all page content is placed-->
<Grid x:Name="LayoutRoot" Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!--TitlePanel contains the name of the application and page title-->
<StackPanel Grid.Row="0" Margin="12,5,0,0">
<TextBlock Text="{Binding Path=LocalizedResources.SettingsMenu, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextNormalStyle}"/>
<TextBlock Text="{Binding Path=LocalizedResources.CodecsMenu, Source={StaticResource LocalizedStrings}}" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
</StackPanel>
<!--ContentPanel - place additional content here-->
<ScrollViewer Grid.Row="1" Margin="12,0,12,0">
<ScrollViewer.Content>
<Grid x:Name="ContentPanel">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>