Compare commits

34 Commits
Author SHA1 Message Date
Tichau ef566be2bf Add v0.2 screenshots. 2015-05-27 11:56:33 +02:00
Tichau c5b73b32b3 Add warning message for application installation. 2015-05-27 11:40:35 +02:00
Tichau 359a445126 Update readme. 2015-05-27 11:31:29 +02:00
Tichau a3cddcc75c Update the readme and the change log. 2015-05-27 11:29:14 +02:00
Tichau b8a46ac0ef Change the application version number to 0.2. 2015-05-27 11:28:51 +02:00
Tichau 3b2adcc941 Add ape format in default settings. 2015-05-27 11:25:09 +02:00
Tichau b4058b2ed6 Cancel auto exit when the user do an action. 2015-05-27 11:16:10 +02:00
Tichau 18d616050a Add support for APE format (decoding only) 2015-05-27 11:07:59 +02:00
Tichau 1b6984c378 Change installer banner color. 2015-05-27 10:48:47 +02:00
Tichau a589aa53a4 Rename resource file (for extension). 2015-05-27 10:48:38 +02:00
Tichau 0793a25ebc Add icon to application. 2015-05-27 10:39:21 +02:00
Tichau 4a02a02083 Add icon to context menu extension. 2015-05-27 10:05:22 +02:00
Tichau c929221c60 Rename icons. 2015-05-27 10:04:39 +02:00
Tichau ec98a107e4 Add 16x16 application icon. 2015-05-27 09:51:03 +02:00
Tichau 68327299c0 Add error check. 2015-05-26 21:55:52 +02:00
Tichau 4c7ff20193 Forbid to open a window twice. 2015-05-26 16:46:52 +02:00
Tichau 5b49da745a Display logs in a separate window. 2015-05-26 16:01:17 +02:00
Tichau 6944180acd Clean. 2015-05-26 15:40:07 +02:00
Tichau fbb1146931 Disable presets if all files are not compatible with it. 2015-05-26 15:18:14 +02:00
Tichau 81ea226e84 Add default conversion presets settings. 2015-05-26 13:30:50 +02:00
Tichau b0a1c57dd8 Clean 2015-05-26 12:49:38 +02:00
Tichau 45625d18e4 Load settings in context menu extension. 2015-05-26 12:37:44 +02:00
Tichau 6d1c8f3ff3 Execute preset from argument. 2015-05-26 11:36:31 +02:00
Tichau fbc080f935 Fixe add/remove preset button. 2015-05-26 11:11:45 +02:00
Tichau 9400f742d8 Add option to automaticaly open settings window. 2015-05-26 11:11:29 +02:00
Tichau 6dfd1f4bbf Add/Remove preset button 2015-05-23 16:17:47 +02:00
Tichau 96988cd131 Apply settings in XML and Registry. 2015-05-02 22:19:40 +02:00
Tichau df80137624 Change resharper settings. 2015-05-02 22:19:21 +02:00
Tichau 03e975b371 Serialize and deserialize settings. 2015-05-01 17:13:47 +02:00
Tichau 43f5cb91cd Add conversion presets and settings window. 2015-05-01 17:13:47 +02:00
Tichau be875bdf03 Add png icon. 2015-05-01 17:13:46 +02:00
adrien 7147d670c1 Readme spellchecking. 2015-04-30 14:40:40 +02:00
Tichau 390cfdc81b Add application icon and custom installer UI. 2015-04-14 00:46:24 +02:00
adrien 62636bd730 Add application screenshots. 2015-04-09 15:30:31 +02:00
48 changed files with 2125 additions and 325 deletions

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
<Application x:Class="FileConverter.Application"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml" ShutdownMode="OnMainWindowClose">
StartupUri="Windows/MainWindow.xaml" ShutdownMode="OnMainWindowClose">
<Application.Resources>
</Application.Resources>
+77 -50
View File
@@ -18,24 +18,27 @@ namespace FileConverter
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics.CodeAnalysis;
using System.Threading;
using System.Windows;
public partial class Application : System.Windows.Application
{
public static readonly Version Version = new Version()
private static readonly Version Version = new Version()
{
Major = 0,
Minor = 1,
Minor = 2,
};
private readonly List<ConversionJob> conversionJobs = new List<ConversionJob>();
private bool debugMode;
private bool initialized;
private bool cancelAutoExit;
public Application()
{
this.ConvertionJobs = this.conversionJobs.AsReadOnly();
this.Initialize();
if (this.initialized)
@@ -45,22 +48,51 @@ namespace FileConverter
}
}
public static Version ApplicationVersion
{
get
{
return Application.Version;
}
}
public ReadOnlyCollection<ConversionJob> ConvertionJobs
{
get;
private set;
}
public Settings Settings
{
get;
private set;
}
public bool ShowSettings
{
get;
set;
}
public bool Verbose
{
get;
set;
}
public void CancelAutoExit()
{
this.cancelAutoExit = true;
}
private void Initialize()
{
this.ConvertionJobs = this.conversionJobs.AsReadOnly();
// Load settigns.
Diagnostics.Log("Retrieve arguments...");
this.Settings = new Settings();
this.Settings.Load();
// Retrieve arguments.
Diagnostics.Log("Retrieve arguments...");
string[] args = Environment.GetCommandLineArgs();
@@ -69,8 +101,8 @@ namespace FileConverter
{
this.debugMode = true;
System.Array.Resize(ref args, 9);
args[1] = "--output-type";
args[2] = "Flac";
args[1] = "--conversion-preset";
args[2] = "To Mp3";
args[3] = @"D:\Projects\FileConverter\TestFiles\Herbie Hancock - Speak Like A Child [RVG Edition].flac";
args[3] = @"D:\Projects\FileConverter\TestFiles\01 - Le Bruit Du Bang.wma";
args[4] = @"D:\Projects\FileConverter\TestFiles\test\Toccata.wav";
@@ -79,6 +111,9 @@ namespace FileConverter
args[6] = @"D:\Projects\FileConverter\TestFiles\test\Toccata - Copie (3).wav";
args[7] = @"D:\Projects\FileConverter\TestFiles\test\Toccata - Copie (2).wav";
args[8] = @"D:\Projects\FileConverter\TestFiles\test\Toccata - Copie (5).wav";
System.Array.Resize(ref args, 2);
args[1] = "--settings";
}
#endif
@@ -90,8 +125,10 @@ namespace FileConverter
Diagnostics.Log(string.Empty);
OutputType outputType = OutputType.None;
ConversionPreset conversionPreset = null;
List<string> filePaths = new List<string>();
// Parse arguments.
for (int index = 1; index < args.Length; index++)
{
string argument = args[index];
@@ -102,42 +139,34 @@ namespace FileConverter
switch (parameterTitle)
{
case "output-type":
case "settings":
this.ShowSettings = true;
return;
case "apply-settings":
Settings.ApplyTemporarySettings();
Dispatcher.BeginInvoke((Action)(() => Application.Current.Shutdown()));
return;
case "conversion-preset":
if (index >= args.Length - 1)
{
if (index >= args.Length - 1)
{
Diagnostics.Log("ERROR ! Invalid format.");
return;
}
string outputTypeName = args[index + 1].ToLowerInvariant();
switch (outputTypeName)
{
case "mp3":
outputType = OutputType.Mp3;
break;
case "ogg":
outputType = OutputType.Ogg;
break;
case "wav":
outputType = OutputType.Wav;
break;
case "flac":
outputType = OutputType.Flac;
break;
default:
Diagnostics.Log("ERROR ! Unknown output type {0}.", outputType);
return;
}
index++;
continue;
MessageBox.Show(string.Format("ERROR ! Invalid format."), "Error", MessageBoxButton.OK, MessageBoxImage.Error);
Dispatcher.BeginInvoke((Action)(() => Application.Current.Shutdown()));
return;
}
conversionPreset = Settings.GetPresetFromName(args[index + 1]);
if (conversionPreset == null)
{
MessageBox.Show(string.Format("Invalid conversion preset '{0}'.", args[index + 1]), "Error", MessageBoxButton.OK, MessageBoxImage.Error);
Dispatcher.BeginInvoke((Action)(() => Application.Current.Shutdown()));
return;
}
index++;
continue;
case "verbose":
{
this.Verbose = true;
@@ -156,24 +185,17 @@ namespace FileConverter
}
}
if (outputType == OutputType.None)
if (conversionPreset == null)
{
Diagnostics.Log("ERROR ! Can't retrieve the output type from arguments.");
Diagnostics.Log("ERROR ! Can't retrieve the conversion preset from arguments.");
return;
}
// Create convertion jobs.
for (int index = 0; index < filePaths.Count; index++)
{
ConversionJob conversionJob = new ConversionJob();
string inputFilePath = filePaths[index];
string extension = System.IO.Path.GetExtension(inputFilePath);
string outputFilePath = inputFilePath.Substring(0, inputFilePath.Length - extension.Length) + "."
+ outputType.ToString().ToLowerInvariant();
conversionJob.Initialize(outputType, inputFilePath, outputFilePath);
ConversionJob conversionJob = new ConversionJob(conversionPreset, inputFilePath);
this.conversionJobs.Add(conversionJob);
}
@@ -222,6 +244,11 @@ namespace FileConverter
{
System.Threading.Thread.Sleep(3000);
if (this.cancelAutoExit)
{
return;
}
Dispatcher.BeginInvoke((Action)(() => Application.Current.Shutdown()));
}
#endif
+52 -48
View File
@@ -27,7 +27,7 @@ namespace FileConverter
public ConversionJob()
{
this.OutputType = OutputType.None;
this.ConversionPreset = null;
this.progress = 0f;
this.InputFilePath = string.Empty;
this.OutputFilePath = string.Empty;
@@ -35,6 +35,17 @@ namespace FileConverter
this.ExitingMessage = string.Empty;
}
public ConversionJob(ConversionPreset conversionPreset, string inputFilePath)
{
this.ConversionPreset = conversionPreset;
this.InputFilePath = inputFilePath;
string extension = System.IO.Path.GetExtension(inputFilePath);
this.OutputFilePath = inputFilePath.Substring(0, inputFilePath.Length - extension.Length) + "." + this.ConversionPreset.OutputType.ToString().ToLowerInvariant();
this.Initialize();
}
public event PropertyChangedEventHandler PropertyChanged;
public enum ConversionState
@@ -47,6 +58,12 @@ namespace FileConverter
Failed,
}
public ConversionPreset ConversionPreset
{
get;
private set;
}
public string InputFilePath
{
get;
@@ -58,13 +75,7 @@ namespace FileConverter
get;
private set;
}
public OutputType OutputType
{
get;
private set;
}
public ConversionState State
{
get
@@ -107,67 +118,33 @@ namespace FileConverter
}
}
public void Initialize(OutputType outputType, string inputFileName, string outputFileName)
{
if (outputType == OutputType.None)
{
throw new ArgumentException("The output type must be valid.", "outputType");
}
this.OutputType = outputType;
this.ffmpegProcessStartInfo = null;
string applicationDirectory = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
string ffmpegPath = string.Format("{0}\\ffmpeg.exe", applicationDirectory);
if (!System.IO.File.Exists(ffmpegPath))
{
Diagnostics.Log("Can't find ffmpeg executable ({0}). Try to reinstall the application.", ffmpegPath);
return;
}
this.ffmpegProcessStartInfo = new ProcessStartInfo(ffmpegPath);
this.ffmpegProcessStartInfo.CreateNoWindow = true;
this.ffmpegProcessStartInfo.UseShellExecute = false;
this.ffmpegProcessStartInfo.RedirectStandardOutput = true;
this.ffmpegProcessStartInfo.RedirectStandardError = true;
this.InputFilePath = inputFileName;
this.OutputFilePath = outputFileName;
this.State = ConversionState.Ready;
}
public void StartConvertion()
{
if (this.OutputType == OutputType.None)
if (this.ConversionPreset == null)
{
throw new Exception("The converter is not initialized.");
throw new Exception("The conversion preset must be valid.");
}
Diagnostics.Log("Convert file {0} to {1}.", this.InputFilePath, this.OutputFilePath);
string arguments = string.Empty;
switch (this.OutputType)
switch (this.ConversionPreset.OutputType)
{
case OutputType.Mp3:
arguments = string.Format("-n -stats -i \"{0}\" -qscale:a 5 \"{1}\"", this.InputFilePath, this.OutputFilePath);
arguments = string.Format("-n -stats -i \"{0}\" -qscale:a 2 \"{1}\"", this.InputFilePath, this.OutputFilePath);
break;
case OutputType.Ogg:
arguments = string.Format("-n -stats -i \"{0}\" -acodec libvorbis -qscale:a 5 \"{1}\"", this.InputFilePath, this.OutputFilePath);
arguments = string.Format("-n -stats -i \"{0}\" -acodec libvorbis -qscale:a 2 \"{1}\"", this.InputFilePath, this.OutputFilePath);
break;
case OutputType.Flac:
arguments = string.Format("-n -stats -i \"{0}\" \"{1}\"", this.InputFilePath, this.OutputFilePath);
break;
case OutputType.Wav:
arguments = string.Format("-n -stats -i \"{0}\" \"{1}\"", this.InputFilePath, this.OutputFilePath);
break;
default:
throw new NotImplementedException("Converter not implemented for output file type " + this.OutputType);
throw new NotImplementedException("Converter not implemented for output file type " + this.ConversionPreset.OutputType);
}
if (string.IsNullOrEmpty(arguments) || this.ffmpegProcessStartInfo == null)
@@ -217,6 +194,33 @@ namespace FileConverter
Diagnostics.Log("\nDone!");
}
private void Initialize()
{
if (this.ConversionPreset == null)
{
throw new Exception("The conversion preset must be valid.");
}
this.ffmpegProcessStartInfo = null;
string applicationDirectory = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
string ffmpegPath = string.Format("{0}\\ffmpeg.exe", applicationDirectory);
if (!System.IO.File.Exists(ffmpegPath))
{
Diagnostics.Log("Can't find ffmpeg executable ({0}). Try to reinstall the application.", ffmpegPath);
return;
}
this.ffmpegProcessStartInfo = new ProcessStartInfo(ffmpegPath);
this.ffmpegProcessStartInfo.CreateNoWindow = true;
this.ffmpegProcessStartInfo.UseShellExecute = false;
this.ffmpegProcessStartInfo.RedirectStandardOutput = true;
this.ffmpegProcessStartInfo.RedirectStandardError = true;
this.State = ConversionState.Ready;
}
private void ParseFFMPEGOutput(string input)
{
Match match = this.durationRegex.Match(input);
@@ -0,0 +1,151 @@
// <copyright file="FileConverter.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
using System.Collections.Generic;
namespace FileConverter
{
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Xml.Serialization;
using FileConverter.Annotations;
[XmlRoot]
[XmlType]
public class ConversionPreset : INotifyPropertyChanged, IDataErrorInfo
{
private string name;
private OutputType outputType;
private List<string> inputTypes;
public ConversionPreset()
{
this.Name = "New Preset";
}
public ConversionPreset(string name, OutputType outputType, string[] inputTypes)
{
this.Name = name;
this.OutputType = outputType;
this.InputTypes = new List<string>();
this.InputTypes.AddRange(inputTypes);
}
public event PropertyChangedEventHandler PropertyChanged;
[XmlAttribute]
public string Name
{
get
{
return this.name;
}
set
{
this.name = value;
this.OnPropertyChanged();
}
}
[XmlAttribute]
public OutputType OutputType
{
get
{
return outputType;
}
set
{
outputType = value;
this.OnPropertyChanged();
}
}
[XmlElement]
public List<string> InputTypes
{
get
{
return inputTypes;
}
set
{
inputTypes = value;
this.OnPropertyChanged();
}
}
[XmlIgnore]
public ConversionPreset.Setting[] Settings
{
get;
set;
}
[NotifyPropertyChangedInvocator]
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
public class Setting
{
}
public string this[string columnName]
{
get
{
return this.Validate(columnName);
}
}
public string Error
{
get
{
return this.Validate("Name");
}
}
private string Validate(string properyName)
{
// Return error message if there is an error, else return empty or null string.
switch (properyName)
{
case "Name":
{
if (string.IsNullOrEmpty(this.Name))
{
return "The preset name can't be empty.";
}
if (this.Name.Contains(";"))
{
return "The preset name can't contains the character ';'.";
}
Application application = Application.Current as Application;
if (application?.Settings != null)
{
int count = application.Settings.ConversionPresets.Count(match => match.name == this.Name);
if (count > 1)
{
return "The preset name is already used.";
}
}
}
break;
}
return string.Empty;
}
}
}
+32 -3
View File
@@ -41,6 +41,9 @@
<PlatformTarget>x64</PlatformTarget>
<OutputPath>bin\x64\Release\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>Resources\ApplicationIcon-256x256.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="Accessibility" />
<Reference Include="PresentationUI, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
@@ -68,8 +71,23 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Compile Include="ValueConverters\ApplicationVersionToApplicationName.cs" />
<Compile Include="ConversionPreset.cs" />
<Compile Include="ValueConverters\InputTypesToBool.cs" />
<Compile Include="Settings.cs" />
<Compile Include="Windows\DiagnosticsWindow.xaml.cs">
<DependentUpon>DiagnosticsWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Windows\SettingsWindow.xaml.cs">
<DependentUpon>SettingsWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Version.cs" />
<Page Include="MainWindow.xaml">
<Compile Include="XmlHelpers.cs" />
<Page Include="Windows\DiagnosticsWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Windows\MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
@@ -77,13 +95,17 @@
<DependentUpon>Application.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="ConversionStateToBrush.cs" />
<Compile Include="ValueConverters\ConversionStateToBrush.cs" />
<Compile Include="ConversionJob.cs" />
<Compile Include="Diagnostics.cs" />
<Compile Include="MainWindow.xaml.cs">
<Compile Include="Windows\MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Page Include="Windows\SettingsWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Compile Include="OutputType.cs" />
@@ -114,6 +136,13 @@
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ApplicationIcon.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ApplicationIcon-16x16.ico" />
<Resource Include="Resources\ApplicationIcon-256x256.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
@@ -5,4 +5,11 @@
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=StyleCop_002ESA1602/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=SuggestUseVarKeywordEvident/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_ABSTRACT_ACCESSORHOLDER_ON_SINGLE_LINE/@EntryValue">False</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_SIMPLE_ACCESSOR_ATTRIBUTE_ON_SAME_LINE/@EntryValue">False</s:Boolean></wpf:ResourceDictionary>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_SIMPLE_ACCESSOR_ATTRIBUTE_ON_SAME_LINE/@EntryValue">False</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_SIMPLE_ACCESSOR_ON_SINGLE_LINE/@EntryValue">False</s:Boolean>
<s:String x:Key="/Default/CodeStyle/CSharpVarKeywordUsage/ForBuiltInTypes/@EntryValue">UseExplicitType</s:String>
<s:String x:Key="/Default/CodeStyle/CSharpVarKeywordUsage/ForOtherTypes/@EntryValue">UseExplicitType</s:String>
<s:String x:Key="/Default/CodeStyle/CSharpVarKeywordUsage/ForSimpleTypes/@EntryValue">UseExplicitType</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=MethodPropertyEvent/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb_AaBb" /&gt;</s:String>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateThisQualifierSettings/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
-78
View File
@@ -1,78 +0,0 @@
<Window
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" x:Class="FileConverter.MainWindow"
xmlns:local="clr-namespace:FileConverter"
x:Name="FileConverterMainWindow" Title="{Binding ApplicationName, ElementName=FileConverterMainWindow, Mode=OneWay}" Height="500" Width="950" MinHeight="250" MinWidth="450" WindowStartupLocation="CenterScreen">
<Window.Resources>
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
<local:ConversionStateToBrush x:Key="ConversionStateToColor" />
</Window.Resources>
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="30" />
<RowDefinition Height="2*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="100" />
</Grid.ColumnDefinitions>
<Label Name="Title" Grid.Column="0" Content="Files to convert" VerticalAlignment="Top" Height="30" FontSize="16" FontWeight="Bold"/>
<Button Name="SettingsButton" Grid.Column="1" Content="Settings" Margin="0,3" Visibility="Hidden"></Button>
</Grid>
<ScrollViewer x:Name="ScrollViewer" Grid.Row="1" VerticalScrollBarVisibility="Auto" CanContentScroll="True">
<ItemsControl Name="ConverterJobsList">
<ItemsControl.DataContext>
<local:ConversionJob/>
</ItemsControl.DataContext>
<ItemsControl.ItemTemplate>
<DataTemplate>
<DockPanel Background="{Binding State, Converter={StaticResource ConversionStateToColor}, ConverterParameter='Background'}" Margin="0,4">
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="20" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2.5*" MinWidth="300" />
<ColumnDefinition Width="*" MinWidth="100" />
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" Grid.Column="0" Text="{Binding OutputFilePath}" FontWeight="Bold" />
<StackPanel Grid.Row="1" Grid.Column="0" Margin="10,0,0,0">
<WrapPanel>
<TextBlock Text="Converted from " FontSize="11" FontStyle="Italic" />
<TextBlock Text="{Binding InputFilePath}" FontSize="11" FontStyle="Italic" />
</WrapPanel>
<TextBlock Text="{Binding ExitingMessage}" Foreground="{Binding State, Converter={StaticResource ConversionStateToColor}, ConverterParameter='Foreground'}" />
</StackPanel>
<TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding State}" FontWeight="Bold" Foreground="{Binding State, Converter={StaticResource ConversionStateToColor}, ConverterParameter='Foreground'}" />
<ProgressBar Grid.Row="1" Grid.Column="1" Height="18" Width="Auto" Minimum="0" Maximum="1" SmallChange="0.001" Value="{Binding Progress, Mode=OneWay}" Foreground="{Binding State, Converter={StaticResource ConversionStateToColor}, ConverterParameter='Foreground'}" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" MinWidth="100" LargeChange="0.1" />
</Grid>
</DockPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
<Grid Grid.Row="2" Visibility="{Binding VerboseMode, Converter={StaticResource BooleanToVisibilityConverter}, ElementName=FileConverterMainWindow, Mode=OneWay}">
<Grid.RowDefinitions>
<RowDefinition Height="30" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Label Grid.Row="0" Content="Log" VerticalAlignment="Top" Height="30" FontSize="16" FontWeight="Bold" />
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" CanContentScroll="True">
<TextBlock Name="Diagnostics" TextWrapping="NoWrap" Text="{Binding Path=(local:Diagnostics.Content), Mode=OneWay}" FontFamily="Consolas" Foreground="#FF272727"/>
</ScrollViewer>
</Grid>
</Grid>
</Window>
@@ -1,69 +0,0 @@
// <copyright file="MainWindow.xaml.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
namespace FileConverter
{
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Windows;
using FileConverter.Annotations;
public partial class MainWindow : Window, INotifyPropertyChanged
{
private bool verboseMode;
private string applicationName;
public MainWindow()
{
this.InitializeComponent();
this.ApplicationName = string.Format("File Converter v{0}", Application.Version.ToString());
Application application = Application.Current as Application;
this.ConverterJobsList.ItemsSource = application.ConvertionJobs;
this.VerboseMode = application.Verbose;
}
public event PropertyChangedEventHandler PropertyChanged;
public string ApplicationName
{
get
{
return this.applicationName;
}
private set
{
this.applicationName = value;
this.OnPropertyChanged();
}
}
public bool VerboseMode
{
get
{
return this.verboseMode;
}
set
{
this.verboseMode = value;
this.OnPropertyChanged();
}
}
[NotifyPropertyChangedInvocator]
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
PropertyChangedEventHandler handler = this.PropertyChanged;
if (handler != null)
{
handler(this, new PropertyChangedEventArgs(propertyName));
}
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

+387
View File
@@ -0,0 +1,387 @@
// <copyright file="Settings.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
namespace FileConverter
{
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Security.Principal;
using System.Windows;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using Microsoft.Win32;
using FileConverter.Annotations;
public class Settings : INotifyPropertyChanged, IDataErrorInfo
{
private const char PresetSeparator = ';';
private ObservableCollection<ConversionPreset> conversionPresets = new ObservableCollection<ConversionPreset>();
public event PropertyChangedEventHandler PropertyChanged;
private static bool IsInAdmininstratorPrivileges
{
get
{
return new WindowsPrincipal(WindowsIdentity.GetCurrent()).IsInRole(WindowsBuiltInRole.Administrator);
}
}
public ObservableCollection<ConversionPreset> ConversionPresets
{
get { return this.conversionPresets; }
set { this.conversionPresets = value; }
}
[NotifyPropertyChangedInvocator]
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
public ConversionPreset GetPresetFromName(string presetName)
{
return this.conversionPresets.FirstOrDefault(match => match.Name == presetName);
}
public void Load()
{
ICollection<ConversionPreset> presets = this.ConversionPresets;
presets.Clear();
string userFilePath = Settings.GetUserSettingsFilePath();
if (File.Exists(userFilePath))
{
XmlHelpers.LoadFromFile<ConversionPreset>("Settings", userFilePath, ref presets);
}
else
{
// If user settings doesn't exist, load the default settings.
string defaultFilePath = Settings.GetDefaultSettingsFilePath();
if (File.Exists(defaultFilePath))
{
XmlHelpers.LoadFromFile<ConversionPreset>("Settings", defaultFilePath, ref presets);
}
else
{
Diagnostics.Log("Default settings not found. You should try to reinstall the application.");
}
}
}
public void Save()
{
// Save the settings in a temporary files (we'll write the settings file when we'll succeed to write the registry keys).
string temporaryFilePath = Settings.GetUserSettingsTemporaryFilePath();
XmlHelpers.SaveToFile("Settings", temporaryFilePath, this.ConversionPresets);
// Compute the registry entries data from settings.
Dictionary<string, List<string>> registryEntries = Settings.ComputeRegistryEntriesFromConvertionPresets(this.ConversionPresets);
// Detect if existing registry configuration need to be modified.
bool registryNeedModifications = Settings.IsRegistryNeedModifications(registryEntries);
if (registryNeedModifications)
{
// Write the settings in registry.
if (Settings.IsInAdmininstratorPrivileges)
{
// We are in admin mode, write reigstry ...
bool succeed = Settings.ApplyRegistryModifications(registryEntries);
if (succeed)
{
// ... and copy temporary settings file to the real settings file.
string userFilePath = Settings.GetUserSettingsFilePath();
File.Copy(temporaryFilePath, userFilePath, true);
File.Delete(temporaryFilePath);
}
}
else
{
// Run the application in admin mode in order to perform modifications.
Settings.RunSaveInAdminMode();
}
}
else
{
// Copy temporary settings file to the real settings file.
string userFilePath = Settings.GetUserSettingsFilePath();
File.Copy(temporaryFilePath, userFilePath, true);
File.Delete(temporaryFilePath);
}
}
public static void ApplyTemporarySettings()
{
// Load temporary settings.
string temporaryFilePath = Settings.GetUserSettingsTemporaryFilePath();
if (!File.Exists(temporaryFilePath))
{
return;
}
ICollection<ConversionPreset> conversionPresets = new ObservableCollection<ConversionPreset>();
XmlHelpers.LoadFromFile("Settings", temporaryFilePath, ref conversionPresets);
RegistryKey registryKey = Registry.CurrentUser.OpenSubKey(@"Software\FileConverter");
if (registryKey == null)
{
MessageBox.Show("Can't apply settings in registry.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
return;
}
// Compute the registry entries data from settings.
Dictionary<string, List<string>> registryEntries = ComputeRegistryEntriesFromConvertionPresets(conversionPresets);
bool succeed = Settings.ApplyRegistryModifications(registryEntries);
if (succeed)
{
// Copy temporary settings file to the real settings file.
string userFilePath = Settings.GetUserSettingsFilePath();
File.Copy(temporaryFilePath, userFilePath, true);
File.Delete(temporaryFilePath);
}
}
private static bool ApplyRegistryModifications(Dictionary<string, List<string>> registryEntries)
{
if (!Settings.IsInAdmininstratorPrivileges)
{
MessageBox.Show("Can't apply settings in registry because the application is not in administrator privileges.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
return false;
}
RegistryKey registryKey = Registry.CurrentUser.OpenSubKey(@"Software\FileConverter", RegistryKeyPermissionCheck.ReadWriteSubTree);
if (registryKey == null)
{
MessageBox.Show("Can't apply settings in registry (ErrorCode=1).", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
return false;
}
// Delete previous settings.
string[] subKeyNames = registryKey.GetSubKeyNames();
for (int index = 0; index < subKeyNames.Length; index++)
{
try
{
registryKey.DeleteSubKey(subKeyNames[index]);
}
catch (Exception exception)
{
MessageBox.Show("Can't apply settings in registry (ErrorCode=2).", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
return false;
}
}
// Apply settings in registry.
foreach (KeyValuePair<string, List<string>> registryEntry in registryEntries)
{
string presets = string.Empty;
for (int index = 0; index < registryEntry.Value.Count; index++)
{
if (index > 0)
{
presets += ";";
}
presets += registryEntry.Value[index];
}
RegistryKey subKey = null;
try
{
subKey = registryKey.CreateSubKey(registryEntry.Key);
}
catch (Exception exception)
{
Diagnostics.Log(exception.Message);
}
if (subKey == null)
{
MessageBox.Show("Can't apply settings in registry (ErrorCode=3).", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
return false;
}
subKey.SetValue("Presets", presets);
}
return true;
}
private static Dictionary<string, List<string>> ComputeRegistryEntriesFromConvertionPresets(ICollection<ConversionPreset> conversionPresets)
{
Dictionary<string, List<string>> registryEntries = new Dictionary<string, List<string>>();
foreach (ConversionPreset conversionPreset in conversionPresets)
{
List<string> inputTypes = conversionPreset.InputTypes;
for (int inputIndex = 0; inputIndex < inputTypes.Count; inputIndex++)
{
string inputType = inputTypes[inputIndex].ToLowerInvariant();
if (!registryEntries.ContainsKey(inputType))
{
registryEntries.Add(inputType, new List<string>());
}
registryEntries[inputType].Add(conversionPreset.Name);
}
}
return registryEntries;
}
private static string GetDefaultSettingsFilePath()
{
string path = Assembly.GetEntryAssembly().Location;
path = Path.GetDirectoryName(path);
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
path = Path.Combine(path, "Settings.xml");
return path;
}
private static string GetUserSettingsFilePath()
{
string path = Environment.GetEnvironmentVariable("LocalAppData");
path = Path.Combine(path, "FileConverter");
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
path = Path.Combine(path, "Settings.user.xml");
return path;
}
private static string GetUserSettingsTemporaryFilePath()
{
string path = Environment.GetEnvironmentVariable("LocalAppData");
path = Path.Combine(path, "FileConverter");
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
path = Path.Combine(path, "Settings.temp.xml");
return path;
}
private static bool IsRegistryNeedModifications(Dictionary<string, List<string>> registryEntries)
{
// Compare to registry entries.
RegistryKey registryKey = Registry.CurrentUser.OpenSubKey(@"Software\FileConverter");
if (registryKey == null)
{
return true;
}
string[] subKeyNames = registryKey.GetSubKeyNames();
if (subKeyNames.Length == registryEntries.Count)
{
for (int index = 0; index < subKeyNames.Length; index++)
{
string subKeyName = subKeyNames[index];
if (!registryEntries.ContainsKey(subKeyName))
{
return true;
}
List<string> presetsList = registryEntries[subKeyName];
RegistryKey subKey = registryKey.OpenSubKey(subKeyName);
if (subKey == null)
{
return true;
}
string presetsString = subKey.GetValue("Presets", string.Empty) as string;
string[] presets = presetsString != null ? presetsString.Split(Settings.PresetSeparator) : new string[0];
if (presets.Length != presetsList.Count)
{
return true;
}
for (int presetIndex = 0; presetIndex < presets.Length; presetIndex++)
{
if (!presetsList.Contains(presets[presetIndex]))
{
return true;
}
}
}
}
else
{
return true;
}
return false;
}
private static void RunSaveInAdminMode()
{
ProcessStartInfo processStartInfo = new ProcessStartInfo(Assembly.GetEntryAssembly().Location, "--apply-settings")
{
UseShellExecute = true,
Verb = "runas", // indicates to elevate privileges
};
Process process = new Process
{
EnableRaisingEvents = true, // enable WaitForExit()
StartInfo = processStartInfo
};
try
{
process.Start();
process.WaitForExit();
}
catch (Exception exception)
{
MessageBox.Show("Can't apply settings in registry because the application has no administrator privileges.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
return;
}
}
public string this[string columnName]
{
get
{
return this.Error;
}
}
public string Error
{
get
{
for (int index = 0; index < this.ConversionPresets.Count; index++)
{
string error = this.ConversionPresets[index].Error;
if (!string.IsNullOrEmpty(error))
{
return error;
}
}
return string.Empty;
}
}
}
}
+28
View File
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<Settings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ConversionPreset Name="To Ogg" OutputType="Ogg">
<InputTypes>Wav</InputTypes>
<InputTypes>Flac</InputTypes>
<InputTypes>Wma</InputTypes>
<InputTypes>Mp3</InputTypes>
<InputTypes>Ape</InputTypes>
</ConversionPreset>
<ConversionPreset Name="To Mp3" OutputType="Mp3">
<InputTypes>Flac</InputTypes>
<InputTypes>Ogg</InputTypes>
<InputTypes>Wav</InputTypes>
<InputTypes>Wma</InputTypes>
<InputTypes>Ape</InputTypes>
</ConversionPreset>
<ConversionPreset Name="To Flac" OutputType="Flac">
<InputTypes>Wav</InputTypes>
<InputTypes>Ape</InputTypes>
</ConversionPreset>
<ConversionPreset Name="To Wav" OutputType="Wav">
<InputTypes>Flac</InputTypes>
<InputTypes>Mp3</InputTypes>
<InputTypes>Ogg</InputTypes>
<InputTypes>Wma</InputTypes>
<InputTypes>Ape</InputTypes>
</ConversionPreset>
</Settings>
@@ -0,0 +1,28 @@
// <copyright file="ApplicationVersionToApplicationName.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
namespace FileConverter
{
using System;
using System.Globalization;
using System.Windows.Data;
public class ApplicationVersionToApplicationName : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (!(value is Version))
{
return "File Converter";
}
Version version = (Version)value;
return string.Format("File Converter v{0}", version.ToString());
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
@@ -0,0 +1,34 @@
// <copyright file="InputTypesToBool.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
namespace FileConverter
{
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Windows.Data;
public class InputTypesToBool : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
List<string> intputTypes = value as List<string>;
if (intputTypes == null)
{
throw new ArgumentException("The value must be an list of string.");
}
string referenceTypeName = parameter as string;
if (string.IsNullOrEmpty(referenceTypeName))
{
return false;
}
return intputTypes.Contains(referenceTypeName);
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
@@ -0,0 +1,20 @@
<Window x:Class="FileConverter.Windows.DiagnosticsWindow"
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:local="clr-namespace:FileConverter.Windows"
xmlns:fileConverter="clr-namespace:FileConverter"
mc:Ignorable="d"
Title="Diagnostics" Height="600" Width="800" Icon="/FileConverter;component/Resources/ApplicationIcon-16x16.ico">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="30" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Label Grid.Row="0" Content="Logs" VerticalAlignment="Top" Height="30" FontSize="16" FontWeight="Bold" />
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" CanContentScroll="True">
<TextBlock Name="Diagnostics" TextWrapping="NoWrap" Text="{Binding Path=(fileConverter:Diagnostics.Content), Mode=OneWay}" FontFamily="Consolas" Foreground="#FF272727"/>
</ScrollViewer>
</Grid>
</Window>
@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace FileConverter.Windows
{
/// <summary>
/// Interaction logic for DiagnosticsWindow.xaml
/// </summary>
public partial class DiagnosticsWindow : Window
{
public DiagnosticsWindow()
{
InitializeComponent();
}
}
}
@@ -0,0 +1,72 @@
<Window
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" x:Class="FileConverter.MainWindow"
xmlns:local="clr-namespace:FileConverter"
x:Name="FileConverterMainWindow" Height="500" Width="950" MinHeight="250" MinWidth="450" WindowStartupLocation="CenterScreen" Icon="/FileConverter;component/Resources/ApplicationIcon-16x16.ico">
<Window.Resources>
<local:ApplicationVersionToApplicationName x:Key="ApplicationVersionToApplicationName"/>
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
<local:ConversionStateToBrush x:Key="ConversionStateToColor" />
</Window.Resources>
<Window.Title>
<Binding Converter="{StaticResource ApplicationVersionToApplicationName}" Mode="OneWay" Path="(local:Application.ApplicationVersion)"/>
</Window.Title>
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="30" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="100" />
<ColumnDefinition Width="100" />
</Grid.ColumnDefinitions>
<Label Name="Title" Grid.Column="0" Content="Files to convert" VerticalAlignment="Top" Height="30" FontSize="16" FontWeight="Bold"/>
<Button Name="DiagnosticsButton" Grid.Column="1" Content="Logs" Margin="3,3" Click="DiagnosticsButton_OnClick"/>
<Button Name="SettingsButton" Grid.Column="2" Content="Settings" Margin="3,3" Click="SettingsButton_OnClick"/>
</Grid>
<ScrollViewer x:Name="ScrollViewer" Grid.Row="1" VerticalScrollBarVisibility="Auto" CanContentScroll="True">
<ItemsControl Name="ConverterJobsList">
<ItemsControl.DataContext>
<local:ConversionJob/>
</ItemsControl.DataContext>
<ItemsControl.ItemTemplate>
<DataTemplate>
<DockPanel Background="{Binding State, Converter={StaticResource ConversionStateToColor}, ConverterParameter='Background'}" Margin="0,4">
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="20" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2.5*" MinWidth="300" />
<ColumnDefinition Width="*" MinWidth="100" />
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" Grid.Column="0" Text="{Binding OutputFilePath}" FontWeight="Bold" />
<StackPanel Grid.Row="1" Grid.Column="0" Margin="10,0,0,0">
<WrapPanel>
<TextBlock Text="Converted from " FontSize="11" FontStyle="Italic" />
<TextBlock Text="{Binding InputFilePath}" FontSize="11" FontStyle="Italic" />
</WrapPanel>
<TextBlock Text="{Binding ExitingMessage}" Foreground="{Binding State, Converter={StaticResource ConversionStateToColor}, ConverterParameter='Foreground'}" />
</StackPanel>
<TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding State}" FontWeight="Bold" Foreground="{Binding State, Converter={StaticResource ConversionStateToColor}, ConverterParameter='Foreground'}" />
<ProgressBar Grid.Row="1" Grid.Column="1" Height="18" Width="Auto" Minimum="0" Maximum="1" SmallChange="0.001" Value="{Binding Progress, Mode=OneWay}" Foreground="{Binding State, Converter={StaticResource ConversionStateToColor}, ConverterParameter='Foreground'}" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" MinWidth="100" LargeChange="0.1" />
</Grid>
</DockPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</Grid>
</Window>
@@ -0,0 +1,100 @@
// <copyright file="MainWindow.xaml.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
namespace FileConverter
{
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Windows;
using FileConverter.Annotations;
using FileConverter.Windows;
public partial class MainWindow : Window, INotifyPropertyChanged
{
private bool verboseMode;
private DiagnosticsWindow diagnosticsWindow;
private SettingsWindow settingsWindow;
public MainWindow()
{
this.InitializeComponent();
Application application = Application.Current as Application;
this.ConverterJobsList.ItemsSource = application.ConvertionJobs;
if (application.Verbose)
{
this.ShowDiagnosticsWindow();
}
if (application.ShowSettings)
{
this.Hide();
this.ShowSettingsWindow();
this.settingsWindow.Deactivated += this.SettingsWindow_Closed;
}
}
public event PropertyChangedEventHandler PropertyChanged;
[NotifyPropertyChangedInvocator]
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
PropertyChangedEventHandler handler = this.PropertyChanged;
if (handler != null)
{
handler(this, new PropertyChangedEventArgs(propertyName));
}
}
private void SettingsButton_OnClick(object sender, RoutedEventArgs e)
{
this.ShowSettingsWindow();
}
private void SettingsWindow_Closed(object sender, System.EventArgs e)
{
settingsWindow.Deactivated -= this.SettingsWindow_Closed;
this.Close();
}
private void DiagnosticsButton_OnClick(object sender, RoutedEventArgs e)
{
this.ShowDiagnosticsWindow();
}
private void ShowDiagnosticsWindow()
{
if (this.diagnosticsWindow != null && this.diagnosticsWindow.IsVisible)
{
return;
}
else
{
this.diagnosticsWindow = new DiagnosticsWindow();
}
Application application = Application.Current as Application;
application?.CancelAutoExit();
this.diagnosticsWindow.Show();
}
private void ShowSettingsWindow()
{
if (this.settingsWindow != null && this.settingsWindow.IsVisible)
{
return;
}
else
{
this.settingsWindow = new SettingsWindow();
}
Application application = Application.Current as Application;
application?.CancelAutoExit();
this.settingsWindow.Show();
}
}
}
@@ -0,0 +1,119 @@
<Window x:Name="window" x:Class="FileConverter.SettingsWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:FileConverter"
Height="370" Width="520" MinHeight="370" MinWidth="440"
WindowStartupLocation="CenterScreen" Icon="/FileConverter;component/Resources/ApplicationIcon-16x16.ico">
<Window.Resources>
<local:InputTypesToBool x:Key="InputTypesToBool"/>
<local:ApplicationVersionToApplicationName x:Key="ApplicationVersionToApplicationName"/>
<Style TargetType="{x:Type TextBox}">
<Setter Property="Validation.ErrorTemplate">
<Setter.Value>
<ControlTemplate>
<DockPanel LastChildFill="true">
<Border Background="#F44336" DockPanel.Dock="right" Margin="5,0,0,0" Width="20" Height="20" CornerRadius="10"
ToolTip="{Binding ElementName=customAdorner, Path=AdornedElement.(Validation.Errors)[0].ErrorContent}">
<TextBlock Text="!" VerticalAlignment="center" HorizontalAlignment="center" FontWeight="Bold" Foreground="white"/>
</Border>
<AdornedElementPlaceholder Name="customAdorner" VerticalAlignment="Center" >
<Border BorderBrush="#F44336" BorderThickness="1" />
</AdornedElementPlaceholder>
</DockPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<Window.Title>
<Binding Converter="{StaticResource ApplicationVersionToApplicationName}" Mode="OneWay" Path="(local:Application.ApplicationVersion)"/>
</Window.Title>
<Grid Margin="10">
<Grid.CommandBindings>
<CommandBinding Command="New" CanExecute="CanSaveSettings" />
</Grid.CommandBindings>
<Grid.RowDefinitions>
<RowDefinition Height="48"/>
<RowDefinition Height="*"/>
<RowDefinition Height="28"/>
</Grid.RowDefinitions>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="48"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Image HorizontalAlignment="Left" Height="48" Width="48" VerticalAlignment="Top" Source="..\Resources\ApplicationIcon.png" />
<Label Content="Settings" FontSize="20" Margin="4" Grid.Column="1" VerticalAlignment="Center" />
<Label HorizontalAlignment="Right" FontStyle="Italic" FontSize="14" Grid.Column="2" VerticalAlignment="Center">
<Label.Content>
<Binding Converter="{StaticResource ApplicationVersionToApplicationName}" Mode="OneWay" Path="(local:Application.ApplicationVersion)"/>
</Label.Content>
</Label>
</Grid>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Label Content="Presets" Margin="0,5,0,0" VerticalAlignment="Top" HorizontalContentAlignment="Center" HorizontalAlignment="Left" Width="100" Grid.ColumnSpan="2"/>
<ListBox Name="PresetList" HorizontalAlignment="Left" Margin="0,36,0,0" Width="100" Grid.ColumnSpan="2"
Grid.Column="0" IsSynchronizedWithCurrentItem="True" SelectedItem="{Binding SelectedPreset, ElementName=window}">
<ItemsControl.DataContext>
<local:ConversionPreset/>
</ItemsControl.DataContext>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Label Content="{Binding Name}"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ListBox>
<!-- Preset settings -->
<GroupBox Header="Preset
" Margin="5,5,0,0" Grid.Column="1">
<Grid Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Label Content="Preset name" Grid.Row="0" HorizontalContentAlignment="Right" Margin="0,0,5,0"/>
<TextBox Name="PresetNameTextBox" Grid.Row="0" Grid.Column="1" Margin="5,2,25,2" Text="{Binding SelectedPreset.Name, Mode=TwoWay, ElementName=window, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}" TextWrapping="Wrap" Width="Auto" />
<GroupBox Grid.Row="1" Grid.Column="0" Header="Input formats" Margin="5">
<StackPanel>
<CheckBox Content="Ape" Height="20" VerticalAlignment="Top" Margin="2" Checked="ToggleButton_OnChecked" Unchecked="ToggleButton_OnUnchecked" IsChecked="{Binding SelectedPreset.InputTypes, Converter={StaticResource InputTypesToBool}, ConverterParameter='Ape', ElementName=window, Mode=OneWay}"/>
<CheckBox Content="Flac" Height="20" VerticalAlignment="Top" Margin="2" Checked="ToggleButton_OnChecked" Unchecked="ToggleButton_OnUnchecked" IsChecked="{Binding SelectedPreset.InputTypes, Converter={StaticResource InputTypesToBool}, ConverterParameter='Flac', ElementName=window, Mode=OneWay}"/>
<CheckBox Content="Mp3" Height="20" VerticalAlignment="Top" Margin="2" Checked="ToggleButton_OnChecked" Unchecked="ToggleButton_OnUnchecked" IsChecked="{Binding SelectedPreset.InputTypes, Converter={StaticResource InputTypesToBool}, ConverterParameter='Mp3', ElementName=window, Mode=OneWay}"/>
<CheckBox Content="Ogg" Height="20" VerticalAlignment="Top" Margin="2" Checked="ToggleButton_OnChecked" Unchecked="ToggleButton_OnUnchecked" IsChecked="{Binding SelectedPreset.InputTypes, Converter={StaticResource InputTypesToBool}, ConverterParameter='Ogg', ElementName=window, Mode=OneWay}"/>
<CheckBox Content="Wav" Height="20" VerticalAlignment="Top" Margin="2" Checked="ToggleButton_OnChecked" Unchecked="ToggleButton_OnUnchecked" IsChecked="{Binding SelectedPreset.InputTypes, Converter={StaticResource InputTypesToBool}, ConverterParameter='Wav', ElementName=window, Mode=OneWay}"/>
<CheckBox Content="Wma" Height="20" VerticalAlignment="Top" Margin="2" Checked="ToggleButton_OnChecked" Unchecked="ToggleButton_OnUnchecked" IsChecked="{Binding SelectedPreset.InputTypes, Converter={StaticResource InputTypesToBool}, ConverterParameter='Wma', ElementName=window, Mode=OneWay}"/>
</StackPanel>
</GroupBox>
<GroupBox Header="Output format" Grid.Row="1" Grid.Column="1" Margin="5">
<ComboBox Name="OutputFormats" Grid.Row="1" Grid.Column="1" Margin="5" Height="25" VerticalAlignment="Top" SelectedItem="{Binding SelectedPreset.OutputType, ElementName=window, Mode=TwoWay}">
</ComboBox>
</GroupBox>
</Grid>
</GroupBox>
</Grid>
<Button Name="AddPresetButton" Grid.Row="2" Content="+" HorizontalAlignment="Left" Width="28" Margin="18,4,0,0" Click="AddPresetButton_Click"/>
<Button Name="RemovePresetButton" Grid.Row="2" Content="-" HorizontalAlignment="Left" Width="28" Margin="54,4,0,0" Click="RemovePresetButton_Click"/>
<Button Name="CloseButton" Grid.Row="2" Content="Close" HorizontalAlignment="Right" Width="100" Margin="0,4,105,0" Click="CloseButton_Click" />
<Button Name="SaveButton" Grid.Row="2" Content="Save" HorizontalAlignment="Right" Width="100" Margin="0,4,0,0" Click="SaveButton_Click" Command="New"/>
</Grid>
</Window>
@@ -0,0 +1,131 @@
// <copyright file="SettingsWindow.xaml.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
namespace FileConverter
{
using System.Runtime.CompilerServices;
using System.Windows;
using System.ComponentModel;
using System.Windows.Controls;
using System.Windows.Input;
using FileConverter.Annotations;
/// <summary>
/// Interaction logic for Settings.xaml
/// </summary>
public partial class SettingsWindow : Window, INotifyPropertyChanged
{
private ConversionPreset selectedPreset;
private Settings settings;
public SettingsWindow()
{
this.InitializeComponent();
Application application = Application.Current as Application;
settings = application.Settings;
this.PresetList.ItemsSource = settings.ConversionPresets;
OutputType[] outputTypes = new[]
{
OutputType.Flac,
OutputType.Mp3,
OutputType.Ogg,
OutputType.Wav,
};
this.OutputFormats.ItemsSource = outputTypes;
}
public event PropertyChangedEventHandler PropertyChanged;
public ConversionPreset SelectedPreset
{
get
{
return this.selectedPreset;
}
set
{
this.selectedPreset = value;
this.OnPropertyChanged();
}
}
[NotifyPropertyChangedInvocator]
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
private void ToggleButton_OnChecked(object sender, RoutedEventArgs e)
{
if (this.selectedPreset == null)
{
return;
}
CheckBox checkBox = sender as System.Windows.Controls.CheckBox;
string inputFormat = checkBox.Content as string;
if (!this.selectedPreset.InputTypes.Contains(inputFormat))
{
this.selectedPreset.InputTypes.Add(inputFormat);
}
}
private void ToggleButton_OnUnchecked(object sender, RoutedEventArgs e)
{
if (this.selectedPreset == null)
{
return;
}
CheckBox checkBox = sender as System.Windows.Controls.CheckBox;
string inputFormat = checkBox.Content as string;
this.selectedPreset.InputTypes.Remove(inputFormat);
}
private void CloseButton_Click(object sender, RoutedEventArgs e)
{
// Load previous preset in order to cancel changes.
Application application = Application.Current as Application;
application.Settings.Load();
this.Hide();
}
private void SaveButton_Click(object sender, RoutedEventArgs e)
{
// Save changes.
Application application = Application.Current as Application;
application.Settings.Save();
this.Hide();
}
private void AddPresetButton_Click(object sender, RoutedEventArgs e)
{
Application application = Application.Current as Application;
ConversionPreset newPreset = new ConversionPreset("New preset", OutputType.None, new string[0]);
application.Settings.ConversionPresets.Add(newPreset);
this.SelectedPreset = newPreset;
this.PresetNameTextBox.Focus();
this.PresetNameTextBox.SelectAll();
}
private void RemovePresetButton_Click(object sender, RoutedEventArgs e)
{
Application application = Application.Current as Application;
application.Settings.ConversionPresets.Remove(this.selectedPreset);
}
private void CanSaveSettings(object sender, CanExecuteRoutedEventArgs e)
{
e.CanExecute = this.settings != null && string.IsNullOrEmpty(this.settings.Error);
}
}
}
+75
View File
@@ -0,0 +1,75 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Windows.Documents;
using System.Xml;
using System.Xml.Serialization;
using FileConverter;
public class XmlHelpers
{
public static void LoadFromFile<T>(string root, string path, ref ICollection<T> collection)
{
if (string.IsNullOrEmpty(path))
{
throw new ArgumentNullException("path");
}
XmlRootAttribute xmlRoot = new XmlRootAttribute
{
ElementName = root
};
XmlSerializer serializer = new XmlSerializer(typeof(List<T>), xmlRoot);
try
{
using (StreamReader reader = new StreamReader(path))
using (XmlReader xmlReader = XmlReader.Create(reader, new XmlReaderSettings { IgnoreWhitespace = true, IgnoreComments = true }))
{
List<T> elements = (List<T>)serializer.Deserialize(xmlReader);
foreach (T element in elements)
{
collection.Add(element);
}
}
}
catch (System.Exception exception)
{
Diagnostics.Log("The database of type '" + typeof(T) + "' failed to load the asset. The following exception was raised:\n " + exception.Message);
}
}
public static void SaveToFile<T>(string root, string path, ICollection<T> objectsToSerialize)
{
if (string.IsNullOrEmpty(path))
{
return;
}
List<T> list = new List<T>();
list.AddRange(objectsToSerialize);
XmlRootAttribute xmlRoot = new XmlRootAttribute
{
ElementName = root
};
XmlSerializer serializer = new XmlSerializer(typeof(List<T>), xmlRoot);
try
{
using (StreamWriter writer = new StreamWriter(path))
using (XmlWriter xmlWriter = XmlWriter.Create(writer, new XmlWriterSettings { Indent = true, IndentChars = " " }))
{
serializer.Serialize(xmlWriter, list);
}
}
catch (System.Exception exception)
{
Diagnostics.Log("The database of type '" + typeof(T) + "' failed to load the asset. The following exception was raised:\n " + exception.Message);
}
}
}
@@ -2,8 +2,11 @@
namespace FileConverterExtension
{
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Windows.Forms;
@@ -18,6 +21,38 @@ namespace FileConverterExtension
public class FileConverterExtension : SharpContextMenu
{
private string fileConverterPath;
private RegistryKey fileConverterRegistryKey;
private List<PresetDefinition> presetList = new List<PresetDefinition>();
private RegistryKey FileConverterRegistryKey
{
get
{
if (this.fileConverterRegistryKey == null)
{
this.fileConverterRegistryKey = Registry.CurrentUser.OpenSubKey(@"Software\FileConverter");
if (this.fileConverterRegistryKey == null)
{
throw new Exception("Can't retrieve file converter registry entry.");
}
}
return this.fileConverterRegistryKey;
}
}
private string FileConverterPath
{
get
{
if (string.IsNullOrEmpty(this.fileConverterPath))
{
this.fileConverterPath = this.FileConverterRegistryKey.GetValue("Path") as string;
}
return this.fileConverterPath;
}
}
protected override bool CanShowMenu()
{
@@ -32,18 +67,11 @@ namespace FileConverterExtension
extension = extension.Substring(1).ToLowerInvariant();
switch (extension)
{
case "ape":
case "mp3":
return true;
case "wav":
return true;
case "ogg":
return true;
case "flac":
return true;
case "wma":
return true;
}
@@ -54,80 +82,127 @@ namespace FileConverterExtension
protected override ContextMenuStrip CreateMenu()
{
this.RefreshPresetList();
ContextMenuStrip menu = new ContextMenuStrip();
ToolStripMenuItem fileConverterItem = new ToolStripMenuItem
{
Text = "File Converter"
Text = "File Converter",
Image = Properties.Resources.ApplicationIcon_16x16.ToBitmap(),
};
for (int index = 0; index < this.presetList.Count; index++)
{
PresetDefinition preset = this.presetList[index];
ToolStripMenuItem subItem = new ToolStripMenuItem
{
Text = "To Ogg",
Text = preset.Name,
Enabled = preset.Enabled
};
fileConverterItem.DropDownItems.Add(subItem);
subItem.Click += (sender, args) => this.ConvertFiles(FileType.Ogg);
subItem.Click += (sender, args) => this.ConvertFiles(preset.Name);
}
if (this.presetList.Count > 0)
{
fileConverterItem.DropDownItems.Add(new ToolStripSeparator());
}
{
ToolStripMenuItem subItem = new ToolStripMenuItem
{
Text = "To Mp3",
Text = "Settings",
};
fileConverterItem.DropDownItems.Add(subItem);
subItem.Click += (sender, args) => this.ConvertFiles(FileType.Mp3);
}
{
ToolStripMenuItem subItem = new ToolStripMenuItem
{
Text = "To Flac",
};
fileConverterItem.DropDownItems.Add(subItem);
subItem.Click += (sender, args) => this.ConvertFiles(FileType.Flac);
}
{
ToolStripMenuItem subItem = new ToolStripMenuItem
{
Text = "To Wav",
};
fileConverterItem.DropDownItems.Add(subItem);
subItem.Click += (sender, args) => this.ConvertFiles(FileType.Wav);
subItem.Click += (sender, args) => this.OpenSettings();
}
menu.Items.Add(fileConverterItem);
RegistryKey registryKey = Registry.CurrentUser.OpenSubKey(@"Software\FileConverter");
this.fileConverterPath = null;
if (registryKey != null)
{
this.fileConverterPath = registryKey.GetValue("Path") as string;
}
return menu;
}
private void ConvertFiles(FileType ouputType)
private void RefreshPresetList()
{
if (string.IsNullOrEmpty(this.fileConverterPath))
// Retrieve selected files extensions.
List<string> extensions = new List<string>();
foreach (string filePath in this.SelectedItemPaths)
{
string extension = Path.GetExtension(filePath);
if (string.IsNullOrEmpty(extension))
{
continue;
}
extension = extension.Substring(1).ToLowerInvariant();
if (extensions.Contains(extension))
{
continue;
}
extensions.Add(extension);
}
// Compute preset list.
this.presetList.Clear();
RegistryKey fileConverterKey = this.FileConverterRegistryKey;
for (int extensionIndex = 0; extensionIndex < extensions.Count; extensionIndex++)
{
string extension = extensions[extensionIndex];
RegistryKey extensionKey = fileConverterKey.OpenSubKey(extension);
if (extensionKey == null)
{
continue;
}
string presetsString = extensionKey.GetValue("Presets") as string;
if (presetsString == null)
{
continue;
}
string[] presets = presetsString.Split(';');
for (int presetIndex = 0; presetIndex < presets.Length; presetIndex++)
{
string presetName = presets[presetIndex];
PresetDefinition presetDefinition = this.presetList.FirstOrDefault(match => match.Name == presetName);
if (presetDefinition == null)
{
presetDefinition = new PresetDefinition(presetName);
this.presetList.Add(presetDefinition);
}
presetDefinition.ExtensionRefCount++;
}
}
// Update enable states.
for (int index = 0; index < this.presetList.Count; index++)
{
this.presetList[index].Enabled = this.presetList[index].ExtensionRefCount == extensions.Count;
}
}
private void OpenSettings()
{
if (string.IsNullOrEmpty(this.FileConverterPath))
{
MessageBox.Show(string.Format("Can't retrieve the file converter executable path. You should try to reinstall the application."));
return;
}
if (!File.Exists(this.fileConverterPath))
if (!File.Exists(this.FileConverterPath))
{
MessageBox.Show(string.Format("Can't find the file converter executable ({0}). You should try to reinstall the application.", this.fileConverterPath));
MessageBox.Show(string.Format("Can't find the file converter executable ({0}). You should try to reinstall the application.", this.FileConverterPath));
return;
}
ProcessStartInfo processStartInfo = new ProcessStartInfo(this.fileConverterPath);
ProcessStartInfo processStartInfo = new ProcessStartInfo(this.FileConverterPath);
processStartInfo.CreateNoWindow = false;
processStartInfo.UseShellExecute = false;
@@ -135,8 +210,38 @@ namespace FileConverterExtension
// Build arguments string.
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.Append("--output-type ");
stringBuilder.Append(ouputType.ToString());
stringBuilder.Append("--settings");
processStartInfo.Arguments = stringBuilder.ToString();
Process exeProcess = Process.Start(processStartInfo);
}
private void ConvertFiles(string presetName)
{
if (string.IsNullOrEmpty(this.FileConverterPath))
{
MessageBox.Show(string.Format("Can't retrieve the file converter executable path. You should try to reinstall the application."));
return;
}
if (!File.Exists(this.FileConverterPath))
{
MessageBox.Show(string.Format("Can't find the file converter executable ({0}). You should try to reinstall the application.", this.FileConverterPath));
return;
}
ProcessStartInfo processStartInfo = new ProcessStartInfo(this.FileConverterPath);
processStartInfo.CreateNoWindow = false;
processStartInfo.UseShellExecute = false;
processStartInfo.RedirectStandardOutput = false;
// Build arguments string.
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.Append("--conversion-preset ");
stringBuilder.Append(" \"");
stringBuilder.Append(presetName);
stringBuilder.Append("\"");
foreach (var filePath in this.SelectedItemPaths)
{
@@ -61,12 +61,27 @@
</ItemGroup>
<ItemGroup>
<Compile Include="FileConverterExtension.cs" />
<Compile Include="FileType.cs" />
<Compile Include="PresetDefinition.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="FileConverterExtensionKey.snk" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<SubType>Designer</SubType>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="Resources\ApplicationIcon-16x16.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
@@ -1,14 +0,0 @@
// <copyright file="FileType.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
namespace FileConverterExtension
{
public enum FileType
{
Undefined,
Mp3,
Ogg,
Flac,
Wav,
}
}
@@ -0,0 +1,21 @@
// <copyright file="PresetDefinition.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
namespace FileConverterExtension
{
public class PresetDefinition
{
public bool Enabled;
public int ExtensionRefCount;
public PresetDefinition(string name)
{
this.Name = name;
}
public string Name
{
get;
private set;
}
}
}
@@ -0,0 +1,73 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace FileConverterExtension.Properties {
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 Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <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("FileConverterExtension.Properties.Resources", typeof(Resources).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 resource of type System.Drawing.Icon similar to (Icon).
/// </summary>
internal static System.Drawing.Icon ApplicationIcon_16x16 {
get {
object obj = ResourceManager.GetObject("ApplicationIcon_16x16", resourceCulture);
return ((System.Drawing.Icon)(obj));
}
}
}
}
@@ -0,0 +1,124 @@
<?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>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="ApplicationIcon_16x16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\ApplicationIcon-16x16.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

+35 -10
View File
@@ -11,14 +11,17 @@
<?endif ?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="$(var.ProductName)" Language="1033" Version="0.1.0" Manufacturer="AAllard" UpgradeCode="e3ca717b-a897-418a-bbef-5c7e35c76e4b">
<Product Id="*" Name="$(var.ProductName)" Language="1033" Version="0.2.0" Manufacturer="AAllard" UpgradeCode="e3ca717b-a897-418a-bbef-5c7e35c76e4b">
<Package Id="*" InstallerVersion="200" Compressed="yes" InstallScope="perMachine" Platform="x64" />
<Icon Id="icon.ico" SourceFile="..\Resources\ApplicationIcon-256x256.ico"/>
<Property Id="ARPPRODUCTICON" Value="icon.ico" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<Media Id="1" Cabinet="CabFile.cab" EmbedCab="yes" />
<Feature Id="ProductFeature" Title="Installer" Level="1">
<ComponentGroupRef Id="ProductComponents" />
<ComponentGroupRef Id="ProductComponents" />
</Feature>
<Feature Id="ShellExtensionFeature" Title="ShellExtension" Level="1" AllowAdvertise="no">
@@ -27,14 +30,14 @@
<UIRef Id="WixUI_InstallDir" />
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
<WixVariable Id="WixUILicenseRtf" Value="License.rtf" />
<!--<WixVariable Id="WixUIBannerBmp" Value="path\banner.bmp" />
<WixVariable Id="WixUIDialogBmp" Value="path\dialog.bmp" />
<WixVariable Id="WixUIExclamationIco" Value="path\exclamation.ico" />
<WixVariable Id="WixUIInfoIco" Value="path\information.ico" />
<WixVariable Id="WixUINewIco" Value="path\new.ico" />
<WixVariable Id="WixUIUpIco" Value="path\up.ico" />-->
<WixVariable Id="WixUILicenseRtf" Value="License.rtf" />
<WixVariable Id="WixUIBannerBmp" Value="..\Resources\Installer\Banner.bmp" />
<WixVariable Id="WixUIDialogBmp" Value="..\Resources\Installer\UI.bmp" />
<WixVariable Id="WixUIExclamationIco" Value="..\Resources\Installer\ErrorIcon.ico" />
<WixVariable Id="WixUIInfoIco" Value="..\Resources\Installer\WarningIcon.ico" />
<!--<WixVariable Id="WixUINewIco" Value="Icon16x16.ico" />
<WixVariable Id="WixUIUpIco" Value="Icon16x16.ico" />-->
</Product>
<Fragment>
@@ -57,6 +60,9 @@
<Component Guid="{1790B82E-86BC-4B95-AA1D-9859FF3B6CA4}" Win64="$(var.Win64)">
<File Source="..\Middleware\ffmpeg.exe" KeyPath="yes" />
</Component>
<Component Guid="{86AEF5B3-C25B-4662-BAEF-20969D1821A5}" Win64="$(var.Win64)">
<File Source="..\Application\FileConverter\Settings.xml" KeyPath="yes" />
</Component>
<Component Guid="{A5158756-A107-4010-9E2F-3C0333F5A5F6}" Win64="$(var.Win64)">
<File Source="..\README.md" KeyPath="yes" />
</Component>
@@ -66,6 +72,25 @@
<RegistryKey Root="HKCU" Key="Software\FileConverter" Action="createAndRemoveOnUninstall">
<RegistryValue Name="Path" Type="string" Value="[INSTALLFOLDER]FileConverter.exe"/>
</RegistryKey>
<RegistryKey Root="HKCU" Key="Software\FileConverter\ape" Action="createAndRemoveOnUninstall">
<RegistryValue Name="Presets" Type="string" Value="To Ogg;To Mp3;To Flac;To Wav"/>
</RegistryKey>
<RegistryKey Root="HKCU" Key="Software\FileConverter\flac" Action="createAndRemoveOnUninstall">
<RegistryValue Name="Presets" Type="string" Value="To Ogg;To Mp3;To Wav"/>
</RegistryKey>
<RegistryKey Root="HKCU" Key="Software\FileConverter\mp3" Action="createAndRemoveOnUninstall">
<RegistryValue Name="Presets" Type="string" Value="To Ogg;To Wav"/>
</RegistryKey>
<RegistryKey Root="HKCU" Key="Software\FileConverter\ogg" Action="createAndRemoveOnUninstall">
<RegistryValue Name="Presets" Type="string" Value="To Mp3;To Wav"/>
</RegistryKey>
<RegistryKey Root="HKCU" Key="Software\FileConverter\wav" Action="createAndRemoveOnUninstall">
<RegistryValue Name="Presets" Type="string" Value="To Ogg;To Mp3;To Flac"/>
</RegistryKey>
<RegistryKey Root="HKCU" Key="Software\FileConverter\wma" Action="createAndRemoveOnUninstall">
<RegistryValue Name="Presets" Type="string" Value="To Ogg;To Mp3;To Wav"/>
</RegistryKey>
</Component>
</ComponentGroup>
</Fragment>
+18 -3
View File
@@ -1,8 +1,23 @@
# File Converter
## Description
File Converter is a very simple tool who allows you to convert one or several file(s) from one format to another using the context menu in windows explorer.
This program use [ffmpeg](https://www.ffmpeg.org/) as file conversion tool.
File Converter is a very simple tool which allows you to convert one or several file(s) from one format to another using the context menu in windows explorer.
This program uses [ffmpeg](https://www.ffmpeg.org/) as file conversion tool.
You can convert files from formats **Ape, Mp3, Ogg, Wav, Flac, Wma** to formats **Mp3, Ogg, Wav, Flac**
**Remove any previous installation of the application before installing the newer version.**
## Change Log
v0.2
- New: Add decode support for file format Ape
- New: Add notion of conversion preset (in order to customize the conversion possibilities).
- New: Add settings window to edit conversion presets.
- New: Add application icon.
- New: Customize application installer.
- New: Add diagnostic window to read the application logs.
v0.1
You can convert files from formats **Mp3, Ogg, Wav, Flac, Wma** to formats **Mp3, Ogg, Wav, Flac**
- New: Add decode support for file formats Mp3, Ogg, Wav, Flac, Wma
- New: Add encode support for file formats Mp3, Ogg, Wav, Flac
- New: UI to visualize the conversion progress
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

+159
View File
@@ -0,0 +1,159 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="Capa_1"
x="0px"
y="0px"
width="792px"
height="792px"
viewBox="0 0 792 792"
style="enable-background:new 0 0 792 792;"
xml:space="preserve"
inkscape:version="0.91 r13725"
sodipodi:docname="ApplicationIcon.svg"
inkscape:export-filename="D:\Users\Adrien.Adrien-PC\Documents\GitHub\FileConverter\Resources\ApplicationIcon.png"
inkscape:export-xdpi="8.6400003"
inkscape:export-ydpi="8.6400003"><metadata
id="metadata3385"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title /></cc:Work></rdf:RDF></metadata><defs
id="defs3383" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1018"
id="namedview3381"
showgrid="false"
showguides="true"
inkscape:guide-bbox="true"
inkscape:zoom="0.3535534"
inkscape:cx="-538.5249"
inkscape:cy="-40.831874"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="layer4"><sodipodi:guide
position="21.058654,403.40483"
orientation="0,1"
id="guide4315" /></sodipodi:namedview><g
inkscape:groupmode="layer"
id="layer3"
inkscape:label="Background"><circle
style="opacity:1;fill:#0171bb;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path4286"
cx="389.60046"
cy="396.81552"
r="250" /></g><g
inkscape:groupmode="layer"
id="layer4"
inkscape:label="Pattern"
style="display:inline"><circle
style="opacity:1;fill:#004b82;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path4393"
cx="388.34808"
cy="393.1311"
r="185.13635" /><path
style="fill:#004b82;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 220.61731,309.04607 333.0473,168.99852 -96.87364,160.51324 C 224.69865,684.45629 144.72119,490.77251 144.24978,434.20397 Z"
id="path4397"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccc" /></g><g
inkscape:groupmode="layer"
id="layer2"
inkscape:label="Arrow"
style="display:inline"><path
style="opacity:1;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:45;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path4307"
sodipodi:type="arc"
sodipodi:cx="388.49072"
sodipodi:cy="391.00571"
sodipodi:rx="164.15593"
sodipodi:ry="164.15593"
sodipodi:start="0.5814947"
sodipodi:end="6.2723665"
d="M 525.66641,481.17222 A 164.15593,164.15593 0 0 1 319.54955,539.98317 164.15593,164.15593 0 0 1 230.97218,344.79881 164.15593,164.15593 0 0 1 410.95201,228.39372 164.15593,164.15593 0 0 1 552.63705,389.22977"
sodipodi:open="true" /><path
style="fill:#ffffff;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 502.05274,388.6363 52.26457,89.16055 48.0834,-89.16055 z"
id="path4317"
inkscape:connector-curvature="0" /><path
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 544.46303,493.53621 -28.0754,-44.18448 -9.52444,19.46287 z"
id="path4348"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccc" /></g><g
id="g3337"
transform="matrix(0.55346595,0,0,0.55346595,167.0343,189.85664)" /><g
id="g3351" /><g
id="g3353" /><g
id="g3355" /><g
id="g3357" /><g
id="g3359" /><g
id="g3361" /><g
id="g3363" /><g
id="g3365" /><g
id="g3367" /><g
id="g3369" /><g
id="g3371" /><g
id="g3373" /><g
id="g3375" /><g
id="g3377" /><g
id="g3379" /><g
inkscape:groupmode="layer"
id="layer1"
inkscape:label="Files"
style="display:inline"><g
transform="translate(491.76135,105.01435)"
id="g3"
style="stroke:#ffffff;stroke-opacity:1;fill:#ffffff;fill-opacity:0.94117647;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none"><g
id="g5"
style="stroke:#ffffff;stroke-opacity:1;fill:#ffffff;fill-opacity:0.94117647;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none"><path
inkscape:connector-curvature="0"
d="m -174.15384,386.14314 149.574394,0 c 4.183017,0 7.605485,-3.42247 7.605485,-7.60549 l 0,-129.16619 c 0,-2.15503 -0.887157,-4.18301 -2.408254,-5.57751 l -58.815902,-54.63288 c -1.39404,-1.26743 -3.295411,-2.02798 -5.196783,-2.02798 l -90.75894,0 c -4.18302,0 -7.60548,3.42247 -7.60548,7.60549 l 0,183.79907 c 0,4.18302 3.42246,7.60549 7.60548,7.60549 z m 141.968909,-133.47627 0,0.38028 -51.970517,0 0,-48.67511 51.970517,48.29483 z m -134.363419,-50.32281 67.181935,0 0,58.30857 c 0,4.18302 3.422465,7.60549 7.605481,7.60549 l 59.57645,0 0,102.67405 -134.363866,0 0,-168.58811 z"
id="path7"
style="stroke:#ffffff;stroke-opacity:1;fill:#ffffff;fill-opacity:0.94117647;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none" /></g></g><g
transform="translate(491.76135,105.01435)"
id="g9" /><g
transform="translate(491.76135,105.01435)"
id="g11" /><g
transform="translate(491.76135,105.01435)"
id="g13" /><g
transform="translate(491.76135,105.01435)"
id="g15" /><g
transform="translate(491.76135,105.01435)"
id="g17" /><g
transform="translate(491.76135,105.01435)"
id="g19" /><g
transform="translate(491.76135,105.01435)"
id="g21" /><g
transform="translate(491.76135,105.01435)"
id="g23" /><g
transform="translate(491.76135,105.01435)"
id="g25" /><g
transform="translate(491.76135,105.01435)"
id="g27" /><g
transform="translate(491.76135,105.01435)"
id="g29" /><g
transform="translate(491.76135,105.01435)"
id="g31" /><g
transform="translate(491.76135,105.01435)"
id="g33" /><g
transform="translate(491.76135,105.01435)"
id="g35" /><g
transform="translate(491.76135,105.01435)"
id="g37" /></g></svg>

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

+101
View File
@@ -0,0 +1,101 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="Capa_1"
x="0px"
y="0px"
viewBox="0 0 27.964 27.964"
style="enable-background:new 0 0 27.964 27.964;"
xml:space="preserve"
inkscape:version="0.91 r13725"
sodipodi:docname="ErrorIcon.svg"><metadata
id="metadata44"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
id="defs42" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1018"
id="namedview40"
showgrid="false"
inkscape:zoom="33.757688"
inkscape:cx="12.891981"
inkscape:cy="17.64304"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="Capa_1" /><g
id="g3"
style="fill:#d32f2f;fill-opacity:1;stroke:#d32f2f;stroke-opacity:1"
transform="matrix(0.96727092,0,0,0.96727092,0.4279787,0.48722445)"><g
id="c127_X"
style="fill:#d32f2f;fill-opacity:1;stroke:#d32f2f;stroke-opacity:1"><path
style="fill:#d32f2f;fill-opacity:1;stroke:#d32f2f;stroke-opacity:1"
d="M 13.981,0 C 6.261,0 0,6.259 0,13.979 c 0,7.724 6.261,13.984 13.981,13.984 7.725,0 13.983,-6.261 13.983,-13.984 C 27.965,6.259 21.706,0 13.981,0 Z m 0,26.531 c -6.93,0 -12.55,-5.62 -12.55,-12.553 0,-6.93 5.62,-12.548 12.55,-12.548 6.931,0 12.553,5.618 12.553,12.548 0,6.933 -5.622,12.553 -12.553,12.553 z"
id="path6"
inkscape:connector-curvature="0" /><path
style="fill:#d32f2f;fill-opacity:1;stroke:#d32f2f;stroke-opacity:1"
d="M 19.994,10.197 17.767,7.97 c 0,0 -3.553,3.783 -3.785,3.783 -0.231,0 -3.785,-3.783 -3.785,-3.783 l -2.228,2.228 c 0,0 3.785,3.472 3.785,3.787 0,0.312 -3.785,3.782 -3.785,3.782 l 2.228,2.226 c 0,0 3.525,-3.784 3.785,-3.784 0.262,0 3.785,3.784 3.785,3.784 l 2.228,-2.226 c 0,0 -3.786,-3.528 -3.786,-3.782 -0.001,-0.263 3.785,-3.788 3.785,-3.788 z"
id="path8"
inkscape:connector-curvature="0" /></g></g><g
id="g10"
style="fill:#d32f2f;fill-opacity:1;stroke:#d32f2f;stroke-opacity:1"
transform="matrix(0.96727092,0,0,0.96727092,0.4279787,0.48722445)" /><g
id="g12"
style="fill:#d32f2f;fill-opacity:1;stroke:#d32f2f;stroke-opacity:1"
transform="matrix(0.96727092,0,0,0.96727092,0.4279787,0.48722445)" /><g
id="g14"
style="fill:#d32f2f;fill-opacity:1;stroke:#d32f2f;stroke-opacity:1"
transform="matrix(0.96727092,0,0,0.96727092,0.4279787,0.48722445)" /><g
id="g16"
style="fill:#d32f2f;fill-opacity:1;stroke:#d32f2f;stroke-opacity:1"
transform="matrix(0.96727092,0,0,0.96727092,0.4279787,0.48722445)" /><g
id="g18"
style="fill:#d32f2f;fill-opacity:1;stroke:#d32f2f;stroke-opacity:1"
transform="matrix(0.96727092,0,0,0.96727092,0.4279787,0.48722445)" /><g
id="g20"
style="fill:#d32f2f;fill-opacity:1;stroke:#d32f2f;stroke-opacity:1"
transform="matrix(0.96727092,0,0,0.96727092,0.4279787,0.48722445)" /><g
id="g22"
style="fill:#d32f2f;fill-opacity:1;stroke:#d32f2f;stroke-opacity:1"
transform="matrix(0.96727092,0,0,0.96727092,0.4279787,0.48722445)" /><g
id="g24"
style="fill:#d32f2f;fill-opacity:1;stroke:#d32f2f;stroke-opacity:1"
transform="matrix(0.96727092,0,0,0.96727092,0.4279787,0.48722445)" /><g
id="g26"
style="fill:#d32f2f;fill-opacity:1;stroke:#d32f2f;stroke-opacity:1"
transform="matrix(0.96727092,0,0,0.96727092,0.4279787,0.48722445)" /><g
id="g28"
style="fill:#d32f2f;fill-opacity:1;stroke:#d32f2f;stroke-opacity:1"
transform="matrix(0.96727092,0,0,0.96727092,0.4279787,0.48722445)" /><g
id="g30"
style="fill:#d32f2f;fill-opacity:1;stroke:#d32f2f;stroke-opacity:1"
transform="matrix(0.96727092,0,0,0.96727092,0.4279787,0.48722445)" /><g
id="g32"
style="fill:#d32f2f;fill-opacity:1;stroke:#d32f2f;stroke-opacity:1"
transform="matrix(0.96727092,0,0,0.96727092,0.4279787,0.48722445)" /><g
id="g34"
style="fill:#d32f2f;fill-opacity:1;stroke:#d32f2f;stroke-opacity:1"
transform="matrix(0.96727092,0,0,0.96727092,0.4279787,0.48722445)" /><g
id="g36"
style="fill:#d32f2f;fill-opacity:1;stroke:#d32f2f;stroke-opacity:1"
transform="matrix(0.96727092,0,0,0.96727092,0.4279787,0.48722445)" /><g
id="g38"
style="fill:#d32f2f;fill-opacity:1;stroke:#d32f2f;stroke-opacity:1"
transform="matrix(0.96727092,0,0,0.96727092,0.4279787,0.48722445)" /></svg>

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 451 KiB

Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

+84
View File
@@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="Capa_1"
x="0px"
y="0px"
viewBox="0 0 29.535 29.535"
style="enable-background:new 0 0 29.535 29.535;"
xml:space="preserve"
inkscape:version="0.91 r13725"
sodipodi:docname="WarningIcon.svg"><metadata
id="metadata45"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
id="defs43" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1018"
id="namedview41"
showgrid="false"
inkscape:zoom="7.9905198"
inkscape:cx="-4.6304873"
inkscape:cy="14.7675"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="Capa_1" /><g
id="g3"
style="fill:#ffa000;fill-opacity:1"><path
style="fill:#ffa000;fill-opacity:1"
d="M14.768,0C6.609,0,0,6.609,0,14.768c0,8.155,6.609,14.767,14.768,14.767s14.766-6.612,14.766-14.767 C29.534,6.609,22.927,0,14.768,0z M14.768,27.126c-6.826,0-12.359-5.532-12.359-12.359c0-6.828,5.533-12.362,12.359-12.362 S27.128,7.94,27.128,14.768C27.128,21.594,21.594,27.126,14.768,27.126z"
id="path5" /><polygon
style="fill:#ffa000;fill-opacity:1"
points="16.338,17.962 16.938,5.601 12.625,5.601 13.227,17.962 "
id="polygon7" /><path
style="fill:#ffa000;fill-opacity:1"
d="M14.781,19.323c-1.445,0-2.455,1.011-2.455,2.485c0,1.418,0.982,2.482,2.398,2.482h0.057 c1.473,0,2.428-1.064,2.428-2.482C17.182,20.334,16.227,19.323,14.781,19.323z"
id="path9" /></g><g
id="g11"
style="fill:#ffa000;fill-opacity:1" /><g
id="g13"
style="fill:#ffa000;fill-opacity:1" /><g
id="g15"
style="fill:#ffa000;fill-opacity:1" /><g
id="g17"
style="fill:#ffa000;fill-opacity:1" /><g
id="g19"
style="fill:#ffa000;fill-opacity:1" /><g
id="g21"
style="fill:#ffa000;fill-opacity:1" /><g
id="g23"
style="fill:#ffa000;fill-opacity:1" /><g
id="g25"
style="fill:#ffa000;fill-opacity:1" /><g
id="g27"
style="fill:#ffa000;fill-opacity:1" /><g
id="g29"
style="fill:#ffa000;fill-opacity:1" /><g
id="g31"
style="fill:#ffa000;fill-opacity:1" /><g
id="g33"
style="fill:#ffa000;fill-opacity:1" /><g
id="g35"
style="fill:#ffa000;fill-opacity:1" /><g
id="g37"
style="fill:#ffa000;fill-opacity:1" /><g
id="g39"
style="fill:#ffa000;fill-opacity:1" /></svg>

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB