Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7e13e9a100 | ||
|
|
03f23a0cfe | ||
|
|
e6670702a5 | ||
|
|
0c6c073cea | ||
|
|
b73b62e104 | ||
|
|
271fd489cc | ||
|
|
ab34ef9c48 | ||
|
|
6f55bd85f6 | ||
|
|
064aad972e | ||
|
|
44ec6d0cf9 | ||
|
|
c13249fdc7 | ||
|
|
680a45427c | ||
|
|
fc78c264a9 | ||
|
|
5323055e9c | ||
|
|
823cec2671 | ||
|
|
a28fdef080 | ||
|
|
1586917a2c | ||
|
|
ae009e0749 | ||
|
|
8397e40e52 | ||
|
|
a6baaba462 | ||
|
|
22655e58a5 | ||
|
|
d19a8f19d0 | ||
|
|
7c2e97d6c1 | ||
|
|
1b5484f5d7 | ||
|
|
9467da8dd0 | ||
|
|
020ee655dd | ||
|
|
279c075790 | ||
|
|
1c91123ccb | ||
|
|
a38c1bb338 | ||
|
|
647f04b1ee | ||
|
|
e9035fc43f | ||
|
|
538eea34f3 | ||
|
|
17cc4c8dcf | ||
|
|
357a3b6d6c | ||
|
|
bbd893e46f | ||
|
|
04b1bbdd06 | ||
|
|
ce1ad3181e | ||
|
|
15235a6382 | ||
|
|
b3e26812f3 | ||
|
|
2bc4cbddaa | ||
|
|
e447410a1e | ||
|
|
c0d7c404b2 | ||
|
|
23dcc2067d | ||
|
|
093c5a1c6d | ||
|
|
acaba53b3f | ||
|
|
946b6fc3f4 | ||
|
|
e0beb08a09 | ||
|
|
a8741693f5 | ||
|
|
03fa599a9b | ||
|
|
4a87c62992 | ||
|
|
fe7c3d37a7 | ||
|
|
0ac9af89ec | ||
|
|
a48917614e | ||
|
|
c5aa5efca4 | ||
|
|
49520eb2f6 | ||
|
|
3ae020866d | ||
|
|
df7834dec8 | ||
|
|
666af8a37b | ||
|
|
8e1f73f745 | ||
|
|
569d4198ed | ||
|
|
73ae27644d | ||
|
|
780ca19ae3 | ||
|
|
35fa417695 | ||
|
|
6f06f2943b | ||
|
|
9d648d7975 | ||
|
|
95d141dd69 | ||
|
|
bf724d0dd3 | ||
|
|
a51d07a893 | ||
|
|
a583053379 | ||
|
|
37f976f65b | ||
|
|
ff20b26a03 | ||
|
|
af4c708652 | ||
|
|
7539a7e448 | ||
|
|
beb64eb1de | ||
|
|
585ea47702 | ||
|
|
9dee8067a0 | ||
|
|
6728cdd509 | ||
|
|
2cf4c690be | ||
|
|
560364d320 | ||
|
|
c59ff01a73 | ||
|
|
245411bd8b | ||
|
|
73fface5cb | ||
|
|
c53a886353 | ||
|
|
0abd3da8d6 | ||
|
|
04adacee45 | ||
|
|
f4f4a4c357 | ||
|
|
5c9a931558 | ||
|
|
2161f170fc | ||
|
|
7674071fce | ||
|
|
6a1dc7a847 | ||
|
|
347d34ff28 | ||
|
|
ffc81bc378 | ||
|
|
0fd9e3d801 | ||
|
|
7a4666aa15 | ||
|
|
6594d95120 | ||
|
|
ad051308e1 | ||
|
|
dda464c64e | ||
|
|
7fc4646c19 | ||
|
|
424abe9aa4 | ||
|
|
21b6187812 | ||
|
|
b2501a1a04 | ||
|
|
e8a01c91f2 | ||
|
|
efed37b4dc | ||
|
|
1289db0bfa | ||
|
|
6fdb5f2e7a | ||
|
|
6f4b3f85ba | ||
|
|
0f8bcfab57 | ||
|
|
4718c0a9dc | ||
|
|
63633eb3a5 | ||
|
|
571ee4bec5 | ||
|
|
a735eab698 | ||
|
|
dd4389eb24 | ||
|
|
64f9f66724 | ||
|
|
dac4f092ae | ||
|
|
32514af57c | ||
|
|
d3ea351731 | ||
|
|
b13e2621c9 | ||
|
|
42ccbdb8fa | ||
|
|
939d6db778 | ||
|
|
375e8dbb26 | ||
|
|
f5172223b8 | ||
|
|
250ec2f7d3 | ||
|
|
34138ef00c | ||
|
|
3f9b0a0f32 | ||
|
|
b4061a7bdf | ||
|
|
801e1a415f | ||
|
|
8e6db881ea | ||
|
|
5b975fb463 |
No files matched your search
@@ -194,3 +194,6 @@ FakesAssemblies/
|
||||
|
||||
# Visual Studio 6 workspace options file
|
||||
*.opt
|
||||
|
||||
# Ignore the installer signing commands file
|
||||
Installer/Installer.sign
|
||||
@@ -1,8 +1,50 @@
|
||||
<Application x:Class="FileConverter.Application"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:xaml="clr-namespace:Markdown.Xaml;assembly=Markdown.Xaml"
|
||||
xmlns:valueConverters="clr-namespace:FileConverter.ValueConverters"
|
||||
StartupUri="Windows/MainWindow.xaml" ShutdownMode="OnMainWindowClose">
|
||||
<Application.Resources>
|
||||
|
||||
<!-- Converters -->
|
||||
<valueConverters:ApplicationVersionToApplicationName x:Key="ApplicationVersionToApplicationName"/>
|
||||
|
||||
<!-- Markdown style -->
|
||||
<Style TargetType="FlowDocument" x:Key="DocumentStyle">
|
||||
<Setter Property="FontFamily" Value="Segoe UI" />
|
||||
<Setter Property="TextAlignment" Value="Left" />
|
||||
<Setter Property="Foreground" Value="#786C71" />
|
||||
<Setter Property="Background" Value="White" />
|
||||
<Setter Property="LineHeight" Value="9"/>
|
||||
<Setter Property="FontSize" Value="13" />
|
||||
</Style>
|
||||
|
||||
<Style x:Key="PageHeader" TargetType="Paragraph">
|
||||
<Setter Property="FontSize" Value="24" />
|
||||
<Setter Property="Foreground" Value="#1E6BB8" />
|
||||
</Style>
|
||||
|
||||
<Style x:Key="SubHeader"
|
||||
TargetType="Paragraph">
|
||||
<Setter Property="FontSize"
|
||||
Value="20" />
|
||||
<Setter Property="Foreground"
|
||||
Value="#DF3900" />
|
||||
</Style>
|
||||
|
||||
<Style x:Key="SubHeaderSecondary"
|
||||
TargetType="Paragraph">
|
||||
<Setter Property="FontSize"
|
||||
Value="20" />
|
||||
<Setter Property="Foreground"
|
||||
Value="#DF3900" />
|
||||
</Style>
|
||||
|
||||
<xaml:Markdown x:Key="Markdown"
|
||||
DocumentStyle="{StaticResource DocumentStyle}"
|
||||
Heading1Style="{StaticResource PageHeader}"
|
||||
Heading2Style="{StaticResource SubHeader}"
|
||||
Heading3Style="{StaticResource SubHeaderSecondary}"/>
|
||||
|
||||
<xaml:TextToFlowDocumentConverter x:Key="TextToFlowDocumentConverter" Markdown="{StaticResource Markdown}"/>
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
@@ -1,7 +1,7 @@
|
||||
// <copyright file="Application.xaml.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
/* File Converter - This program allow you to convert file format to another.
|
||||
Copyright (C) 2015 Adrien Allard
|
||||
Copyright (C) 2016 Adrien Allard
|
||||
email: adrien.allard.pro@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
|
||||
@@ -19,44 +19,37 @@ namespace FileConverter
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
using FileConverter.ConversionJobs;
|
||||
using FileConverter.Diagnostics;
|
||||
using FileConverter.Windows;
|
||||
|
||||
public partial class Application : System.Windows.Application
|
||||
{
|
||||
private int numberOfConversionThread = 1;
|
||||
|
||||
private static readonly Version Version = new Version()
|
||||
{
|
||||
Major = 0,
|
||||
Minor = 4,
|
||||
Major = 1,
|
||||
Minor = 0,
|
||||
Patch = 0,
|
||||
};
|
||||
|
||||
private readonly List<ConversionJob> conversionJobs = new List<ConversionJob>();
|
||||
|
||||
private bool debugMode;
|
||||
private bool initialized;
|
||||
private int numberOfConversionThread = 1;
|
||||
|
||||
private bool needToRunConversionThread;
|
||||
private bool cancelAutoExit;
|
||||
private bool isSessionEnding;
|
||||
private UpgradeVersionDescription upgradeVersionDescription = null;
|
||||
|
||||
public Application()
|
||||
{
|
||||
this.ConvertionJobs = this.conversionJobs.AsReadOnly();
|
||||
}
|
||||
|
||||
protected override void OnStartup(StartupEventArgs e)
|
||||
{
|
||||
base.OnStartup(e);
|
||||
|
||||
this.Initialize();
|
||||
|
||||
if (this.initialized)
|
||||
{
|
||||
Thread fileConvertionThread = new Thread(this.ConvertFiles);
|
||||
fileConvertionThread.Start();
|
||||
}
|
||||
}
|
||||
public event EventHandler<ApplicationTerminateArgs> OnApplicationTerminate;
|
||||
|
||||
public static Version ApplicationVersion
|
||||
{
|
||||
@@ -84,6 +77,12 @@ namespace FileConverter
|
||||
set;
|
||||
}
|
||||
|
||||
public bool HideMainWindow
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public bool Verbose
|
||||
{
|
||||
get;
|
||||
@@ -93,55 +92,105 @@ namespace FileConverter
|
||||
public void CancelAutoExit()
|
||||
{
|
||||
this.cancelAutoExit = true;
|
||||
}
|
||||
|
||||
private void Initialize()
|
||||
{
|
||||
Diagnostics.Debug.Log("The number of processors on this computer is {0}. Set the default number of conversion threads to {0}", Environment.ProcessorCount);
|
||||
this.numberOfConversionThread = Environment.ProcessorCount;
|
||||
|
||||
// Load settigns.
|
||||
Debug.Log("Load settings...");
|
||||
this.Settings = Settings.Load();
|
||||
if (this.Settings == null)
|
||||
if (this.OnApplicationTerminate != null)
|
||||
{
|
||||
Diagnostics.Debug.LogError("The application will now shutdown. If you want to fix the problem yourself please edit or delete the file: C:\\Users\\UserName\\AppData\\Local\\FileConverter\\Settings.user.xml.");
|
||||
Dispatcher.BeginInvoke((Action)(() => Application.Current.Shutdown()));
|
||||
return;
|
||||
this.OnApplicationTerminate.Invoke(this, new ApplicationTerminateArgs(float.NaN));
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnStartup(StartupEventArgs e)
|
||||
{
|
||||
base.OnStartup(e);
|
||||
|
||||
this.Initialize();
|
||||
|
||||
if (this.needToRunConversionThread)
|
||||
{
|
||||
Thread fileConvertionThread = new Thread(this.ConvertFiles);
|
||||
fileConvertionThread.Start();
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnExit(ExitEventArgs e)
|
||||
{
|
||||
base.OnExit(e);
|
||||
|
||||
Debug.Log("Exit application.");
|
||||
|
||||
if (!this.isSessionEnding && this.upgradeVersionDescription != null && this.upgradeVersionDescription.NeedToUpgrade)
|
||||
{
|
||||
Debug.Log("A new version of file converter has been found: {0}.", this.upgradeVersionDescription.LatestVersion);
|
||||
|
||||
if (string.IsNullOrEmpty(this.upgradeVersionDescription.InstallerPath))
|
||||
{
|
||||
Debug.LogError("Invalid installer path.");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("Wait for the end of the installer download.");
|
||||
while (this.upgradeVersionDescription.InstallerDownloadInProgress)
|
||||
{
|
||||
Thread.Sleep(1000);
|
||||
}
|
||||
|
||||
string installerPath = this.upgradeVersionDescription.InstallerPath;
|
||||
if (!System.IO.File.Exists(installerPath))
|
||||
{
|
||||
Debug.LogError("Can't find upgrade installer ({0}). Try to restart the application.", installerPath);
|
||||
return;
|
||||
}
|
||||
|
||||
// Start process.
|
||||
Debug.Log("Start file converter upgrade from version {0} to {1}.", ApplicationVersion, this.upgradeVersionDescription.LatestVersion);
|
||||
|
||||
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo(installerPath)
|
||||
{
|
||||
UseShellExecute = true,
|
||||
};
|
||||
|
||||
Debug.Log("Start upgrade process: {0}{1}.", System.IO.Path.GetFileName(startInfo.FileName), startInfo.Arguments);
|
||||
System.Diagnostics.Process process = new System.Diagnostics.Process
|
||||
{
|
||||
StartInfo = startInfo
|
||||
};
|
||||
|
||||
process.Start();
|
||||
}
|
||||
}
|
||||
|
||||
Debug.Release();
|
||||
}
|
||||
|
||||
protected override void OnSessionEnding(SessionEndingCancelEventArgs e)
|
||||
{
|
||||
base.OnSessionEnding(e);
|
||||
|
||||
this.isSessionEnding = true;
|
||||
this.Shutdown();
|
||||
}
|
||||
|
||||
private void Initialize()
|
||||
{
|
||||
Diagnostics.Debug.Log("File Converter v" + ApplicationVersion.ToString());
|
||||
this.numberOfConversionThread = System.Math.Max(1, Environment.ProcessorCount / 2);
|
||||
Diagnostics.Debug.Log("The number of processors on this computer is {0}. Set the default number of conversion threads to {0}", this.numberOfConversionThread);
|
||||
|
||||
// Retrieve arguments.
|
||||
Debug.Log("Retrieve arguments...");
|
||||
string[] args = Environment.GetCommandLineArgs();
|
||||
|
||||
#if (DEBUG)
|
||||
if (args.Length <= 1)
|
||||
{
|
||||
this.debugMode = true;
|
||||
System.Array.Resize(ref args, 8);
|
||||
args[1] = "--conversion-preset";
|
||||
args[2] = "To Ogg";
|
||||
args[3] = "--verbose";
|
||||
|
||||
args[4] = @"D:\Test\TrailerV2 compressed.mkv";
|
||||
args[4] = @"D:\Test\image.png";
|
||||
args[4] = @"E:\Track01.cda";
|
||||
args[4] = @"D:\Test\Track01.mp3";
|
||||
args[5] = @"D:\Test\Track02.mp3";
|
||||
args[6] = @"D:\Test\Track03.mp3";
|
||||
args[7] = @"D:\Test\Track04.mp3";
|
||||
|
||||
//System.Array.Resize(ref args, 2);
|
||||
//args[1] = "--settings";
|
||||
|
||||
System.Array.Resize(ref args, 5);
|
||||
args[1] = "--conversion-preset";
|
||||
args[2] = "To Aac";
|
||||
args[3] = "--verbose";
|
||||
args[4] = @"D:\Test\02 - Corn on the Cob.flac";
|
||||
////System.Array.Resize(ref args, 5);
|
||||
////args[1] = "--conversion-preset";
|
||||
////args[2] = "To Png";
|
||||
////args[3] = "--verbose";
|
||||
////args[4] = @"D:\Test\images\Mario Big.png";
|
||||
}
|
||||
#endif
|
||||
|
||||
// Log arguments.
|
||||
for (int index = 0; index < args.Length; index++)
|
||||
{
|
||||
string argument = args[index];
|
||||
@@ -150,13 +199,26 @@ namespace FileConverter
|
||||
|
||||
Debug.Log(string.Empty);
|
||||
|
||||
ConversionPreset conversionPreset = null;
|
||||
List<string> filePaths = new List<string>();
|
||||
if (args.Length == 1)
|
||||
{
|
||||
// Diplay help windows to explain that this application is a context menu extension.
|
||||
ApplicationStartHelp applicationStartHelp = new ApplicationStartHelp();
|
||||
applicationStartHelp.Show();
|
||||
this.HideMainWindow = true;
|
||||
return;
|
||||
}
|
||||
|
||||
// Parse arguments.
|
||||
List<string> filePaths = new List<string>();
|
||||
string conversionPresetName = null;
|
||||
for (int index = 1; index < args.Length; index++)
|
||||
{
|
||||
string argument = args[index];
|
||||
if (string.IsNullOrEmpty(argument))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (argument.StartsWith("--"))
|
||||
{
|
||||
// This is an optional parameter.
|
||||
@@ -164,9 +226,20 @@ namespace FileConverter
|
||||
|
||||
switch (parameterTitle)
|
||||
{
|
||||
case "post-install-init":
|
||||
Settings.PostInstallationInitialization();
|
||||
Dispatcher.BeginInvoke((Action)(() => Application.Current.Shutdown()));
|
||||
return;
|
||||
|
||||
case "version":
|
||||
Console.Write(ApplicationVersion.ToString());
|
||||
Dispatcher.BeginInvoke((Action)(() => Application.Current.Shutdown()));
|
||||
return;
|
||||
|
||||
case "settings":
|
||||
this.ShowSettings = true;
|
||||
return;
|
||||
this.HideMainWindow = true;
|
||||
break;
|
||||
|
||||
case "apply-settings":
|
||||
Settings.ApplyTemporarySettings();
|
||||
@@ -181,17 +254,10 @@ namespace FileConverter
|
||||
return;
|
||||
}
|
||||
|
||||
conversionPreset = this.Settings.GetPresetFromName(args[index + 1]);
|
||||
if (conversionPreset == null)
|
||||
{
|
||||
Debug.LogError("Invalid conversion preset '{0}'. (code 0x02)", args[index + 1]);
|
||||
Dispatcher.BeginInvoke((Action)(() => Application.Current.Shutdown()));
|
||||
return;
|
||||
}
|
||||
|
||||
conversionPresetName = args[index + 1];
|
||||
index++;
|
||||
continue;
|
||||
|
||||
|
||||
case "verbose":
|
||||
{
|
||||
this.Verbose = true;
|
||||
@@ -200,7 +266,7 @@ namespace FileConverter
|
||||
break;
|
||||
|
||||
default:
|
||||
Debug.LogError("Unknown option {0}.", parameterTitle);
|
||||
Debug.LogError("Unknown application argument: '--{0}'.", parameterTitle);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -210,41 +276,64 @@ namespace FileConverter
|
||||
}
|
||||
}
|
||||
|
||||
if (conversionPreset == null)
|
||||
// Load settigns.
|
||||
Debug.Log("Load settings...");
|
||||
this.Settings = Settings.Load();
|
||||
if (this.Settings == null)
|
||||
{
|
||||
Debug.LogError("Can't retrieve the conversion preset from arguments.");
|
||||
Diagnostics.Debug.LogError("The application will now shutdown. If you want to fix the problem yourself please edit or delete the file: C:\\Users\\UserName\\AppData\\Local\\FileConverter\\Settings.user.xml.");
|
||||
Dispatcher.BeginInvoke((Action)(() => Application.Current.Shutdown()));
|
||||
return;
|
||||
}
|
||||
|
||||
// Create convertion jobs.
|
||||
Debug.Log("Create jobs for conversion preset: '{0}'", conversionPreset.Name);
|
||||
try
|
||||
// Check upgrade.
|
||||
if (this.Settings.CheckUpgradeAtStartup)
|
||||
{
|
||||
for (int index = 0; index < filePaths.Count; index++)
|
||||
{
|
||||
string inputFilePath = filePaths[index];
|
||||
ConversionJob conversionJob = ConversionJobFactory.Create(conversionPreset, inputFilePath);
|
||||
conversionJob.PrepareConversion(inputFilePath);
|
||||
long fileTime = Registry.GetValue<long>(Registry.Keys.LastUpdateCheckDate);
|
||||
DateTime lastUpdateDateTime = DateTime.FromFileTime(fileTime);
|
||||
|
||||
this.conversionJobs.Add(conversionJob);
|
||||
TimeSpan durationSinceLastUpdate = DateTime.Now.Subtract(lastUpdateDateTime);
|
||||
if (durationSinceLastUpdate > new TimeSpan(1, 0, 0, 0))
|
||||
{
|
||||
Task<UpgradeVersionDescription> task = Upgrade.Helpers.GetLatestVersionDescriptionAsync(this.OnGetLatestVersionDescription);
|
||||
}
|
||||
}
|
||||
catch (Exception exception)
|
||||
|
||||
ConversionPreset conversionPreset = null;
|
||||
if (!string.IsNullOrEmpty(conversionPresetName))
|
||||
{
|
||||
Debug.LogError(exception.Message);
|
||||
throw;
|
||||
conversionPreset = this.Settings.GetPresetFromName(conversionPresetName);
|
||||
if (conversionPreset == null)
|
||||
{
|
||||
Debug.LogError("Invalid conversion preset '{0}'. (code 0x02)", conversionPresetName);
|
||||
Dispatcher.BeginInvoke((Action)(() => Application.Current.Shutdown()));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
this.initialized = true;
|
||||
}
|
||||
if (conversionPreset != null)
|
||||
{
|
||||
// Create convertion jobs.
|
||||
Debug.Log("Create jobs for conversion preset: '{0}'", conversionPreset.Name);
|
||||
try
|
||||
{
|
||||
for (int index = 0; index < filePaths.Count; index++)
|
||||
{
|
||||
string inputFilePath = filePaths[index];
|
||||
ConversionJob conversionJob = ConversionJobFactory.Create(conversionPreset, inputFilePath);
|
||||
conversionJob.PrepareConversion(inputFilePath);
|
||||
|
||||
protected override void OnExit(ExitEventArgs e)
|
||||
{
|
||||
base.OnExit(e);
|
||||
this.conversionJobs.Add(conversionJob);
|
||||
}
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
Debug.LogError(exception.Message);
|
||||
throw;
|
||||
}
|
||||
|
||||
Debug.Log("Exit application.");
|
||||
|
||||
Debug.Release();
|
||||
this.needToRunConversionThread = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void ConvertFiles()
|
||||
@@ -313,13 +402,33 @@ namespace FileConverter
|
||||
allConversionsSucceed &= this.conversionJobs[index].State == ConversionJob.ConversionState.Done;
|
||||
}
|
||||
|
||||
if (this.cancelAutoExit)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (allConversionsSucceed)
|
||||
{
|
||||
System.Threading.Thread.Sleep((int)this.Settings.DurationBetweenEndOfConversionsAndApplicationExit * 1000);
|
||||
|
||||
if (this.cancelAutoExit)
|
||||
float remainingTime = this.Settings.DurationBetweenEndOfConversionsAndApplicationExit;
|
||||
while (remainingTime > 0f)
|
||||
{
|
||||
return;
|
||||
if (this.OnApplicationTerminate != null)
|
||||
{
|
||||
this.OnApplicationTerminate.Invoke(this, new ApplicationTerminateArgs(remainingTime));
|
||||
}
|
||||
|
||||
System.Threading.Thread.Sleep(1000);
|
||||
remainingTime--;
|
||||
|
||||
if (this.cancelAutoExit)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.OnApplicationTerminate != null)
|
||||
{
|
||||
this.OnApplicationTerminate.Invoke(this, new ApplicationTerminateArgs(remainingTime));
|
||||
}
|
||||
|
||||
Dispatcher.BeginInvoke((Action)(() => Application.Current.Shutdown()));
|
||||
@@ -341,7 +450,14 @@ namespace FileConverter
|
||||
return;
|
||||
}
|
||||
|
||||
conversionJob.StartConvertion();
|
||||
try
|
||||
{
|
||||
conversionJob.StartConvertion();
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
Debug.LogError("Failure during conversion: {0}", exception.ToString());
|
||||
}
|
||||
|
||||
if (conversionJob.State == ConversionJob.ConversionState.Done && !System.IO.File.Exists(conversionJob.OutputFilePath))
|
||||
{
|
||||
@@ -352,5 +468,23 @@ namespace FileConverter
|
||||
Debug.Log("The conversion job failed but there is an output file that does exists.");
|
||||
}
|
||||
}
|
||||
|
||||
private void OnGetLatestVersionDescription(UpgradeVersionDescription upgradeVersionDescription)
|
||||
{
|
||||
if (upgradeVersionDescription == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Registry.SetValue(Registry.Keys.LastUpdateCheckDate, DateTime.Now.ToFileTime());
|
||||
|
||||
if (upgradeVersionDescription.LatestVersion <= ApplicationVersion)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this.upgradeVersionDescription = upgradeVersionDescription;
|
||||
(this.MainWindow as MainWindow).OnNewVersionReleased(upgradeVersionDescription);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
// <copyright file="ApplicationTerminateArgs.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverter
|
||||
{
|
||||
public class ApplicationTerminateArgs : System.EventArgs
|
||||
{
|
||||
public ApplicationTerminateArgs(float remainingTimeBeforeTermination)
|
||||
{
|
||||
this.RemainingTimeBeforeTermination = remainingTimeBeforeTermination;
|
||||
}
|
||||
|
||||
public float RemainingTimeBeforeTermination
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
// <copyright file="CancelConversionJobCommand.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverter.Commands
|
||||
{
|
||||
using System;
|
||||
using System.Windows.Input;
|
||||
using FileConverter.ConversionJobs;
|
||||
|
||||
public class CancelConversionJobCommand : ICommand
|
||||
{
|
||||
private readonly ConversionJob conversionJob;
|
||||
|
||||
public CancelConversionJobCommand(ConversionJob conversionJob)
|
||||
{
|
||||
this.conversionJob = conversionJob;
|
||||
}
|
||||
|
||||
public event EventHandler CanExecuteChanged;
|
||||
|
||||
public bool CanExecute(object parameter)
|
||||
{
|
||||
if (this.conversionJob == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return this.conversionJob.IsCancelable && this.conversionJob.State == ConversionJob.ConversionState.InProgress;
|
||||
}
|
||||
|
||||
public void Execute(object parameter)
|
||||
{
|
||||
this.conversionJob?.Cancel();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
// <copyright file="DelegateCommand.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverter.Commands
|
||||
{
|
||||
using System;
|
||||
using System.Windows.Input;
|
||||
|
||||
public class DelegateCommand : ICommand
|
||||
{
|
||||
private Action executeMethod;
|
||||
private Func<bool> canExecuteMethod;
|
||||
|
||||
public DelegateCommand(Action executeMethod)
|
||||
{
|
||||
if (executeMethod == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(executeMethod));
|
||||
}
|
||||
|
||||
this.executeMethod = executeMethod;
|
||||
}
|
||||
|
||||
public DelegateCommand(Action executeMethod, Func<bool> canExecuteMethod)
|
||||
{
|
||||
this.executeMethod = executeMethod;
|
||||
this.canExecuteMethod = canExecuteMethod;
|
||||
}
|
||||
|
||||
public event EventHandler CanExecuteChanged;
|
||||
|
||||
public bool CanExecute(object parameter)
|
||||
{
|
||||
if (this.canExecuteMethod != null)
|
||||
{
|
||||
return this.canExecuteMethod.Invoke();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void Execute(object parameter)
|
||||
{
|
||||
this.executeMethod.Invoke();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// <copyright file="OpenUrlCommand.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverter.Commands
|
||||
{
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Windows.Input;
|
||||
|
||||
public class OpenUrlCommand : ICommand
|
||||
{
|
||||
public OpenUrlCommand()
|
||||
{
|
||||
}
|
||||
|
||||
public event EventHandler CanExecuteChanged;
|
||||
|
||||
public bool CanExecute(object parameter)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public void Execute(object parameter)
|
||||
{
|
||||
string url = parameter as string;
|
||||
if (string.IsNullOrEmpty(url))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Process.Start(url);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,6 @@ namespace FileConverter.ConversionJobs
|
||||
{
|
||||
None = 0x00,
|
||||
|
||||
CdaExtraction = 0x01,
|
||||
CdDriveExtraction = 0x01,
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ namespace FileConverter.ConversionJobs
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
|
||||
using FileConverter.Commands;
|
||||
using FileConverter.Diagnostics;
|
||||
|
||||
public class ConversionJob : INotifyPropertyChanged
|
||||
@@ -16,6 +17,7 @@ namespace FileConverter.ConversionJobs
|
||||
private string errorMessage = string.Empty;
|
||||
private string initialInputPath = string.Empty;
|
||||
private string userState = string.Empty;
|
||||
private CancelConversionJobCommand cancelCommand;
|
||||
|
||||
public ConversionJob()
|
||||
{
|
||||
@@ -126,6 +128,31 @@ namespace FileConverter.ConversionJobs
|
||||
protected set;
|
||||
}
|
||||
|
||||
public CancelConversionJobCommand CancelCommand
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.cancelCommand == null)
|
||||
{
|
||||
this.cancelCommand = new CancelConversionJobCommand(this);
|
||||
}
|
||||
|
||||
return this.cancelCommand;
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsCancelable
|
||||
{
|
||||
get;
|
||||
protected set;
|
||||
}
|
||||
|
||||
protected bool CancelIsRequested
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
protected virtual InputPostConversionAction InputPostConversionAction
|
||||
{
|
||||
get
|
||||
@@ -141,7 +168,7 @@ namespace FileConverter.ConversionJobs
|
||||
|
||||
public virtual bool CanStartConversion(ConversionFlags conversionFlags)
|
||||
{
|
||||
return true;
|
||||
return (conversionFlags & ConversionFlags.CdDriveExtraction) == 0;
|
||||
}
|
||||
|
||||
public void PrepareConversion(string inputFilePath, string outputFilePath = null)
|
||||
@@ -192,6 +219,9 @@ namespace FileConverter.ConversionJobs
|
||||
// Create output folder that doesn't exist.
|
||||
{
|
||||
StringBuilder path = new StringBuilder(this.OutputFilePath.Length);
|
||||
string drive = PathHelpers.GetDrive(this.OutputFilePath);
|
||||
path.Append(drive);
|
||||
|
||||
foreach (string directory in PathHelpers.GetDirectories(this.OutputFilePath))
|
||||
{
|
||||
path.Append(directory);
|
||||
@@ -225,6 +255,12 @@ namespace FileConverter.ConversionJobs
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if the input file is located on a cd drive.
|
||||
if (PathHelpers.IsOnCDDrive(this.InputFilePath))
|
||||
{
|
||||
this.StateFlags = ConversionFlags.CdDriveExtraction;
|
||||
}
|
||||
|
||||
this.Initialize();
|
||||
|
||||
if (this.State == ConversionState.Unknown)
|
||||
@@ -253,7 +289,16 @@ namespace FileConverter.ConversionJobs
|
||||
|
||||
this.State = ConversionState.InProgress;
|
||||
|
||||
this.Convert();
|
||||
try
|
||||
{
|
||||
this.Convert();
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
this.ConversionFailed(exception.Message);
|
||||
}
|
||||
|
||||
this.StateFlags = ConversionFlags.None;
|
||||
|
||||
if (this.State == ConversionState.Failed)
|
||||
{
|
||||
@@ -265,6 +310,17 @@ namespace FileConverter.ConversionJobs
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void Cancel()
|
||||
{
|
||||
if (!this.IsCancelable || this.State != ConversionState.InProgress)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this.CancelIsRequested = true;
|
||||
this.ConversionFailed("Canceled.");
|
||||
}
|
||||
|
||||
protected virtual void Convert()
|
||||
{
|
||||
}
|
||||
@@ -277,9 +333,17 @@ namespace FileConverter.ConversionJobs
|
||||
{
|
||||
Debug.Log("Conversion Failed.");
|
||||
|
||||
if (System.IO.File.Exists(this.OutputFilePath))
|
||||
try
|
||||
{
|
||||
System.IO.File.Delete(this.OutputFilePath);
|
||||
if (System.IO.File.Exists(this.OutputFilePath))
|
||||
{
|
||||
System.IO.File.Delete(this.OutputFilePath);
|
||||
}
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
Debug.Log("Can't delete file '{0}' after conversion job failure.", this.OutputFilePath);
|
||||
Debug.Log("An exception as been thrown: {0}.", exception.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -323,6 +387,8 @@ namespace FileConverter.ConversionJobs
|
||||
|
||||
protected void ConversionFailed(string exitingMessage)
|
||||
{
|
||||
Debug.Log("Fail: {0}", exitingMessage);
|
||||
|
||||
if (this.State == ConversionState.Failed)
|
||||
{
|
||||
// Already failed, don't override informations.
|
||||
|
||||
@@ -6,20 +6,29 @@ namespace FileConverter.ConversionJobs
|
||||
{
|
||||
public static ConversionJob Create(ConversionPreset conversionPreset, string inputFilePath)
|
||||
{
|
||||
ConversionJob conversionJob = null;
|
||||
|
||||
string extension = System.IO.Path.GetExtension(inputFilePath);
|
||||
extension = extension.ToLowerInvariant().Substring(1, extension.Length - 1);
|
||||
if (extension == "cda")
|
||||
{
|
||||
conversionJob = new ConversionJob_ExtractCDA(conversionPreset);
|
||||
}
|
||||
else
|
||||
{
|
||||
conversionJob = new ConversionJob_FFMPEG(conversionPreset);
|
||||
return new ConversionJob_ExtractCDA(conversionPreset);
|
||||
}
|
||||
|
||||
return conversionJob;
|
||||
if (conversionPreset.OutputType == OutputType.Ico)
|
||||
{
|
||||
return new ConversionJob_Ico(conversionPreset);
|
||||
}
|
||||
|
||||
if (conversionPreset.OutputType == OutputType.Gif)
|
||||
{
|
||||
return new ConversionJob_Gif(conversionPreset);
|
||||
}
|
||||
|
||||
if (PathHelpers.GetExtensionCategory(extension) == PathHelpers.InputCategoryNames.Image)
|
||||
{
|
||||
return new ConversionJob_ImageMagick(conversionPreset);
|
||||
}
|
||||
|
||||
return new ConversionJob_FFMPEG(conversionPreset);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,13 +6,11 @@ namespace FileConverter.ConversionJobs
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
|
||||
using Diagnostics;
|
||||
using Ripper;
|
||||
|
||||
using WaveLib;
|
||||
using Yeti.MMedia;
|
||||
|
||||
using FileConverter.Diagnostics;
|
||||
|
||||
public class ConversionJob_ExtractCDA : ConversionJob
|
||||
{
|
||||
private Ripper.CDDrive cdDrive;
|
||||
@@ -37,12 +35,7 @@ namespace FileConverter.ConversionJobs
|
||||
return InputPostConversionAction.None;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CanStartConversion(ConversionFlags conversionFlags)
|
||||
{
|
||||
return (conversionFlags & ConversionFlags.CdaExtraction) == 0;
|
||||
}
|
||||
|
||||
|
||||
protected override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
@@ -110,8 +103,6 @@ namespace FileConverter.ConversionJobs
|
||||
this.compressionConversionJob = ConversionJobFactory.Create(this.ConversionPreset, this.intermediateFilePath);
|
||||
this.compressionConversionJob.PrepareConversion(this.intermediateFilePath, this.OutputFilePath);
|
||||
this.compressionThread = new Thread(this.CompressAsync);
|
||||
|
||||
this.StateFlags = ConversionFlags.CdaExtraction;
|
||||
}
|
||||
|
||||
protected override void Convert()
|
||||
|
||||
@@ -3,11 +3,84 @@
|
||||
namespace FileConverter.ConversionJobs
|
||||
{
|
||||
using System;
|
||||
using System.Globalization;
|
||||
|
||||
using FileConverter.Controls;
|
||||
|
||||
public partial class ConversionJob_FFMPEG
|
||||
{
|
||||
private static string Encapsulate(string optionName, string args)
|
||||
{
|
||||
if (string.IsNullOrEmpty(args))
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
return string.Format("{0} \"{1}\"", optionName, args);
|
||||
}
|
||||
|
||||
private static string ComputeTransformArgs(ConversionPreset conversionPreset)
|
||||
{
|
||||
float scaleFactor = conversionPreset.GetSettingsValue<float>(ConversionPreset.ConversionSettingKeys.VideoScale);
|
||||
string scaleArgs = string.Empty;
|
||||
|
||||
if (conversionPreset.OutputType == OutputType.Mkv || conversionPreset.OutputType == OutputType.Mp4)
|
||||
{
|
||||
// This presets use h264 codec, the size of the video need to be divisible by 2.
|
||||
scaleArgs = string.Format("scale=trunc(iw*{0}/2)*2:trunc(ih*{0}/2)*2", scaleFactor.ToString("#.##", CultureInfo.InvariantCulture));
|
||||
}
|
||||
else if (Math.Abs(scaleFactor - 1f) >= 0.005f)
|
||||
{
|
||||
scaleArgs = string.Format("scale=iw*{0}:ih*{0}", scaleFactor.ToString("#.##", CultureInfo.InvariantCulture));
|
||||
}
|
||||
|
||||
float rotationAngleInDegrees = conversionPreset.GetSettingsValue<float>(ConversionPreset.ConversionSettingKeys.VideoRotation);
|
||||
string rotationArgs = string.Empty;
|
||||
if (Math.Abs(rotationAngleInDegrees - 0f) >= 0.05f)
|
||||
{
|
||||
// Transpose:
|
||||
// 0: 90 CounterClockwise and vertical flip
|
||||
// 1: 90 Clockwise
|
||||
// 2: 90 CounterClockwise
|
||||
// 3: 90 Clockwise and vertical flip
|
||||
if (Math.Abs(rotationAngleInDegrees - 90f) <= 0.05f)
|
||||
{
|
||||
rotationArgs = "transpose=2";
|
||||
}
|
||||
else if (Math.Abs(rotationAngleInDegrees - 180f) <= 0.05f)
|
||||
{
|
||||
rotationArgs = "vflip,hflip";
|
||||
}
|
||||
else if (Math.Abs(rotationAngleInDegrees - 270f) <= 0.05f)
|
||||
{
|
||||
rotationArgs = "transpose=1";
|
||||
}
|
||||
else
|
||||
{
|
||||
Diagnostics.Debug.LogError("Unsupported rotation: {0}°", rotationAngleInDegrees);
|
||||
}
|
||||
}
|
||||
|
||||
// Build vf args content (scale=..., transpose=...)
|
||||
string transformArgs = string.Empty;
|
||||
if (!string.IsNullOrEmpty(scaleArgs))
|
||||
{
|
||||
transformArgs += scaleArgs;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(rotationArgs))
|
||||
{
|
||||
if (!string.IsNullOrEmpty(transformArgs))
|
||||
{
|
||||
transformArgs += ",";
|
||||
}
|
||||
|
||||
transformArgs += rotationArgs;
|
||||
}
|
||||
|
||||
return transformArgs;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Convert bitrate in <c>mp3</c> encoder quality index.
|
||||
/// </summary>
|
||||
@@ -131,6 +204,18 @@ namespace FileConverter.ConversionJobs
|
||||
throw new Exception("Unknown Wav encoding.");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Convert video quality index to MPEG4 video quality level.
|
||||
/// </summary>
|
||||
/// <param name="quality">The quality index.</param>
|
||||
/// <returns>Returns the H264 constant rate factor.</returns>
|
||||
/// The range of the video quality level is 1-31: where 1 is the highest quality/largest filesize, 31 being the lowest quality/smallest filesize.
|
||||
/// https://trac.ffmpeg.org/wiki/Encode/MPEG-4
|
||||
private int MPEG4QualityToQualityIndex(int quality)
|
||||
{
|
||||
return 31 - quality;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Convert video quality index to H264 constant rate factor.
|
||||
/// </summary>
|
||||
@@ -251,5 +336,17 @@ namespace FileConverter.ConversionJobs
|
||||
|
||||
throw new Exception("Unknown VBR bitrate.");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Convert video quality index to H264 constant rate factor.
|
||||
/// </summary>
|
||||
/// <param name="quality">The quality index.</param>
|
||||
/// <returns>Returns the H264 constant rate factor.</returns>
|
||||
/// The range of the quantizer scale is 0-63: lower values mean better quality.
|
||||
/// https://trac.ffmpeg.org/wiki/Encode/VP9
|
||||
private int WebmQualityToCRF(int quality)
|
||||
{
|
||||
return 63 - quality;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,9 @@
|
||||
namespace FileConverter.ConversionJobs
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
@@ -19,12 +21,25 @@ namespace FileConverter.ConversionJobs
|
||||
|
||||
private ProcessStartInfo ffmpegProcessStartInfo;
|
||||
|
||||
private List<FFMpegPass> ffmpegArgumentStringByPass = new List<FFMpegPass>();
|
||||
|
||||
public ConversionJob_FFMPEG() : base()
|
||||
{
|
||||
this.IsCancelable = true;
|
||||
}
|
||||
|
||||
public ConversionJob_FFMPEG(ConversionPreset conversionPreset) : base(conversionPreset)
|
||||
{
|
||||
this.IsCancelable = true;
|
||||
}
|
||||
|
||||
protected virtual string FfmpegPath
|
||||
{
|
||||
get
|
||||
{
|
||||
string applicationDirectory = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
|
||||
return System.IO.Path.Combine(applicationDirectory, "ffmpeg.exe");
|
||||
}
|
||||
}
|
||||
|
||||
protected override void Initialize()
|
||||
@@ -38,8 +53,7 @@ namespace FileConverter.ConversionJobs
|
||||
|
||||
this.ffmpegProcessStartInfo = null;
|
||||
|
||||
string applicationDirectory = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
|
||||
string ffmpegPath = string.Format("{0}\\ffmpeg.exe", applicationDirectory);
|
||||
string ffmpegPath = this.FfmpegPath;
|
||||
if (!System.IO.File.Exists(ffmpegPath))
|
||||
{
|
||||
this.ConversionFailed("Can't find ffmpeg executable. You should try to reinstall the application.");
|
||||
@@ -54,15 +68,45 @@ namespace FileConverter.ConversionJobs
|
||||
this.ffmpegProcessStartInfo.RedirectStandardOutput = true;
|
||||
this.ffmpegProcessStartInfo.RedirectStandardError = true;
|
||||
|
||||
string arguments = string.Empty;
|
||||
this.FillFFMpegArgumentsList();
|
||||
}
|
||||
|
||||
protected virtual void FillFFMpegArgumentsList()
|
||||
{
|
||||
switch (this.ConversionPreset.OutputType)
|
||||
{
|
||||
case OutputType.Aac:
|
||||
{
|
||||
// https://trac.ffmpeg.org/wiki/Encode/AAC
|
||||
int audioEncodingBitrate = this.ConversionPreset.GetSettingsValue<int>(ConversionPreset.ConversionSettingKeys.AudioBitrate);
|
||||
string encoderArgs = string.Format("-c:a aac -q:a {0} -strict experimental", this.AACBitrateToQualityIndex(audioEncodingBitrate));
|
||||
arguments = string.Format("-n -stats -i \"{0}\" {2} \"{1}\"", this.InputFilePath, this.OutputFilePath, encoderArgs);
|
||||
string encoderArgs = string.Format("-c:a aac -q:a {0}", this.AACBitrateToQualityIndex(audioEncodingBitrate));
|
||||
string arguments = string.Format("-n -stats -i \"{0}\" {2} \"{1}\"", this.InputFilePath, this.OutputFilePath, encoderArgs);
|
||||
|
||||
this.ffmpegArgumentStringByPass.Add(new FFMpegPass(arguments));
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case OutputType.Avi:
|
||||
{
|
||||
// https://trac.ffmpeg.org/wiki/Encode/MPEG-4
|
||||
int videoEncodingQuality = this.ConversionPreset.GetSettingsValue<int>(ConversionPreset.ConversionSettingKeys.VideoQuality);
|
||||
int audioEncodingBitrate = this.ConversionPreset.GetSettingsValue<int>(ConversionPreset.ConversionSettingKeys.AudioBitrate);
|
||||
|
||||
string transformArgs = ConversionJob_FFMPEG.ComputeTransformArgs(this.ConversionPreset);
|
||||
|
||||
string audioArgs = "-an";
|
||||
if (this.ConversionPreset.GetSettingsValue<bool>(ConversionPreset.ConversionSettingKeys.EnableAudio))
|
||||
{
|
||||
audioArgs = string.Format("-c:a libmp3lame -qscale:a {0}", this.MP3VBRBitrateToQualityIndex(audioEncodingBitrate));
|
||||
}
|
||||
|
||||
// Compute final arguments.
|
||||
string videoFilteringArgs = ConversionJob_FFMPEG.Encapsulate("-vf", transformArgs);
|
||||
string encoderArgs = string.Format("-c:v mpeg4 -vtag xvid -qscale:v {0} {1} {2}", this.MPEG4QualityToQualityIndex(videoEncodingQuality), audioArgs, videoFilteringArgs);
|
||||
string arguments = string.Format("-n -stats -i \"{0}\" {2} \"{1}\"", this.InputFilePath, this.OutputFilePath, encoderArgs);
|
||||
|
||||
this.ffmpegArgumentStringByPass.Add(new FFMpegPass(arguments));
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -71,7 +115,40 @@ namespace FileConverter.ConversionJobs
|
||||
{
|
||||
// http://taer-naguur.blogspot.fr/2013/11/flac-audio-encoding-with-ffmpeg.html
|
||||
string encoderArgs = string.Format("-compression_level 12");
|
||||
string arguments = string.Format("-n -stats -i \"{0}\" {2} \"{1}\"", this.InputFilePath, this.OutputFilePath, encoderArgs);
|
||||
|
||||
this.ffmpegArgumentStringByPass.Add(new FFMpegPass(arguments));
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case OutputType.Gif:
|
||||
{
|
||||
// http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html
|
||||
string fileName = Path.GetFileName(this.InputFilePath);
|
||||
string tempPath = Path.GetTempPath();
|
||||
string paletteFilePath = PathHelpers.GenerateUniquePath(tempPath + fileName + " - palette.png");
|
||||
|
||||
string transformArgs = ConversionJob_FFMPEG.ComputeTransformArgs(this.ConversionPreset);
|
||||
|
||||
// fps.
|
||||
int framesPerSecond = this.ConversionPreset.GetSettingsValue<int>(ConversionPreset.ConversionSettingKeys.VideoFramesPerSecond);
|
||||
if (!string.IsNullOrEmpty(transformArgs))
|
||||
{
|
||||
transformArgs += ",";
|
||||
}
|
||||
|
||||
transformArgs += string.Format("fps={0}", framesPerSecond);
|
||||
|
||||
// Generate palette.
|
||||
string encoderArgs = string.Format("-vf \"{0},palettegen\"", transformArgs);
|
||||
string arguments = string.Format("-n -stats -i \"{0}\" {2} \"{1}\"", this.InputFilePath, paletteFilePath, encoderArgs);
|
||||
this.ffmpegArgumentStringByPass.Add(new FFMpegPass("Indexing colors", arguments, paletteFilePath));
|
||||
|
||||
// Create gif.
|
||||
encoderArgs = string.Format("-i \"{0}\" -lavfi \"{1},paletteuse\"", paletteFilePath, transformArgs);
|
||||
arguments = string.Format("-n -stats -i \"{0}\" {2} \"{1}\"", this.InputFilePath, this.OutputFilePath, encoderArgs);
|
||||
this.ffmpegArgumentStringByPass.Add(new FFMpegPass(arguments));
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -79,7 +156,29 @@ namespace FileConverter.ConversionJobs
|
||||
case OutputType.Ico:
|
||||
{
|
||||
string encoderArgs = string.Empty;
|
||||
arguments = string.Format("-n -stats -i \"{0}\" {2} \"{1}\"", this.InputFilePath, this.OutputFilePath, encoderArgs);
|
||||
string arguments = string.Format("-n -stats -i \"{0}\" {2} \"{1}\"", this.InputFilePath, this.OutputFilePath, encoderArgs);
|
||||
|
||||
this.ffmpegArgumentStringByPass.Add(new FFMpegPass(arguments));
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case OutputType.Jpg:
|
||||
{
|
||||
int encodingQuality = this.ConversionPreset.GetSettingsValue<int>(ConversionPreset.ConversionSettingKeys.ImageQuality);
|
||||
|
||||
float scaleFactor = this.ConversionPreset.GetSettingsValue<float>(ConversionPreset.ConversionSettingKeys.ImageScale);
|
||||
string scaleArgs = string.Empty;
|
||||
if (Math.Abs(scaleFactor - 1f) >= 0.005f)
|
||||
{
|
||||
scaleArgs = string.Format("-vf scale=iw*{0}:ih*{0}", scaleFactor.ToString("#.##", CultureInfo.InvariantCulture));
|
||||
}
|
||||
|
||||
string encoderArgs = string.Format("-q:v {0} {1}", this.JPGQualityToQualityIndex(encodingQuality), scaleArgs);
|
||||
|
||||
string arguments = string.Format("-n -stats -i \"{0}\" {2} \"{1}\"", this.InputFilePath, this.OutputFilePath, encoderArgs);
|
||||
|
||||
this.ffmpegArgumentStringByPass.Add(new FFMpegPass(arguments));
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -103,20 +202,41 @@ namespace FileConverter.ConversionJobs
|
||||
break;
|
||||
}
|
||||
|
||||
arguments = string.Format("-n -stats -i \"{0}\" {2} \"{1}\"", this.InputFilePath, this.OutputFilePath, encoderArgs);
|
||||
string arguments = string.Format("-n -stats -i \"{0}\" {2} \"{1}\"", this.InputFilePath, this.OutputFilePath, encoderArgs);
|
||||
|
||||
this.ffmpegArgumentStringByPass.Add(new FFMpegPass(arguments));
|
||||
}
|
||||
|
||||
break;
|
||||
break;
|
||||
|
||||
case OutputType.Mkv:
|
||||
case OutputType.Mp4:
|
||||
{
|
||||
// https://trac.ffmpeg.org/wiki/Encode/H.264
|
||||
// https://trac.ffmpeg.org/wiki/Encode/AAC
|
||||
int videoEncodingQuality = this.ConversionPreset.GetSettingsValue<int>(ConversionPreset.ConversionSettingKeys.VideoQuality);
|
||||
string videoEncodingSpeed = this.ConversionPreset.GetSettingsValue<string>(ConversionPreset.ConversionSettingKeys.VideoEncodingSpeed);
|
||||
int audioEncodingBitrate = this.ConversionPreset.GetSettingsValue<int>(ConversionPreset.ConversionSettingKeys.AudioBitrate);
|
||||
string encoderArgs = string.Format("-c:v libx264 -preset {0} -crf {1} -c:a aac -q:a {2} -strict experimental", this.H264EncodingSpeedToPreset(videoEncodingSpeed), this.H264QualityToCRF(videoEncodingQuality), this.AACBitrateToQualityIndex(audioEncodingBitrate));
|
||||
arguments = string.Format("-n -stats -i \"{0}\" {2} \"{1}\"", this.InputFilePath, this.OutputFilePath, encoderArgs);
|
||||
|
||||
string transformArgs = ConversionJob_FFMPEG.ComputeTransformArgs(this.ConversionPreset);
|
||||
string videoFilteringArgs = ConversionJob_FFMPEG.Encapsulate("-vf", transformArgs);
|
||||
|
||||
string audioArgs = "-an";
|
||||
if (this.ConversionPreset.GetSettingsValue<bool>(ConversionPreset.ConversionSettingKeys.EnableAudio))
|
||||
{
|
||||
audioArgs = string.Format("-c:a aac -qscale:a {0}", this.AACBitrateToQualityIndex(audioEncodingBitrate));
|
||||
}
|
||||
|
||||
string encoderArgs = string.Format(
|
||||
"-c:v libx264 -preset {0} -crf {1} {2} {3}",
|
||||
this.H264EncodingSpeedToPreset(videoEncodingSpeed),
|
||||
this.H264QualityToCRF(videoEncodingQuality),
|
||||
audioArgs,
|
||||
videoFilteringArgs);
|
||||
|
||||
string arguments = string.Format("-n -stats -i \"{0}\" {2} \"{1}\"", this.InputFilePath, this.OutputFilePath, encoderArgs);
|
||||
|
||||
this.ffmpegArgumentStringByPass.Add(new FFMpegPass(arguments));
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -124,26 +244,29 @@ namespace FileConverter.ConversionJobs
|
||||
case OutputType.Ogg:
|
||||
{
|
||||
int encodingQuality = this.ConversionPreset.GetSettingsValue<int>(ConversionPreset.ConversionSettingKeys.AudioBitrate);
|
||||
string encoderArgs = string.Format("-codec:a libvorbis -qscale:a {0}", this.OGGVBRBitrateToQualityIndex(encodingQuality));
|
||||
arguments = string.Format("-n -stats -i \"{0}\" {2} \"{1}\"", this.InputFilePath, this.OutputFilePath, encoderArgs);
|
||||
string encoderArgs = string.Format("-vn -codec:a libvorbis -qscale:a {0}", this.OGGVBRBitrateToQualityIndex(encodingQuality));
|
||||
string arguments = string.Format("-n -stats -i \"{0}\" {2} \"{1}\"", this.InputFilePath, this.OutputFilePath, encoderArgs);
|
||||
|
||||
this.ffmpegArgumentStringByPass.Add(new FFMpegPass(arguments));
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case OutputType.Png:
|
||||
{
|
||||
float scaleFactor = this.ConversionPreset.GetSettingsValue<float>(ConversionPreset.ConversionSettingKeys.ImageScale);
|
||||
string scaleArgs = string.Empty;
|
||||
if (Math.Abs(scaleFactor - 1f) >= 0.005f)
|
||||
{
|
||||
scaleArgs = string.Format("-vf scale=iw*{0}:ih*{0}", scaleFactor.ToString("#.##", CultureInfo.InvariantCulture));
|
||||
}
|
||||
|
||||
// http://www.howtogeek.com/203979/is-the-png-format-lossless-since-it-has-a-compression-parameter/
|
||||
string encoderArgs = string.Format("-compression_level 100");
|
||||
arguments = string.Format("-n -stats -i \"{0}\" {2} \"{1}\"", this.InputFilePath, this.OutputFilePath, encoderArgs);
|
||||
}
|
||||
string encoderArgs = string.Format("-compression_level 100 {0}", scaleArgs);
|
||||
|
||||
break;
|
||||
string arguments = string.Format("-n -stats -i \"{0}\" {2} \"{1}\"", this.InputFilePath, this.OutputFilePath, encoderArgs);
|
||||
|
||||
case OutputType.Jpg:
|
||||
{
|
||||
int encodingQuality = this.ConversionPreset.GetSettingsValue<int>(ConversionPreset.ConversionSettingKeys.ImageQuality);
|
||||
string encoderArgs = string.Format("-q:v {0}", this.JPGQualityToQualityIndex(encodingQuality));
|
||||
arguments = string.Format("-n -stats -i \"{0}\" {2} \"{1}\"", this.InputFilePath, this.OutputFilePath, encoderArgs);
|
||||
this.ffmpegArgumentStringByPass.Add(new FFMpegPass(arguments));
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -152,21 +275,69 @@ namespace FileConverter.ConversionJobs
|
||||
{
|
||||
EncodingMode encodingMode = this.ConversionPreset.GetSettingsValue<EncodingMode>(ConversionPreset.ConversionSettingKeys.AudioEncodingMode);
|
||||
string encoderArgs = string.Format("-acodec {0}", this.WAVEncodingToCodecArgument(encodingMode));
|
||||
arguments = string.Format("-n -stats -i \"{0}\" {2} \"{1}\"", this.InputFilePath, this.OutputFilePath, encoderArgs);
|
||||
string arguments = string.Format("-n -stats -i \"{0}\" {2} \"{1}\"", this.InputFilePath, this.OutputFilePath, encoderArgs);
|
||||
|
||||
this.ffmpegArgumentStringByPass.Add(new FFMpegPass(arguments));
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case OutputType.Webm:
|
||||
{
|
||||
// https://trac.ffmpeg.org/wiki/Encode/VP9
|
||||
int videoEncodingQuality = this.ConversionPreset.GetSettingsValue<int>(ConversionPreset.ConversionSettingKeys.VideoQuality);
|
||||
int audioEncodingQuality = this.ConversionPreset.GetSettingsValue<int>(ConversionPreset.ConversionSettingKeys.AudioBitrate);
|
||||
|
||||
string encodingArgs = string.Empty;
|
||||
if (videoEncodingQuality == 63)
|
||||
{
|
||||
// Replace maximum quality settings by lossless compression.
|
||||
encodingArgs = "-lossless 1";
|
||||
}
|
||||
else
|
||||
{
|
||||
encodingArgs = string.Format("-crf {0} -b:v 0", this.WebmQualityToCRF(videoEncodingQuality));
|
||||
}
|
||||
|
||||
string transformArgs = ConversionJob_FFMPEG.ComputeTransformArgs(this.ConversionPreset);
|
||||
string videoFilteringArgs = ConversionJob_FFMPEG.Encapsulate("-vf", transformArgs);
|
||||
|
||||
string audioArgs = "-an";
|
||||
if (this.ConversionPreset.GetSettingsValue<bool>(ConversionPreset.ConversionSettingKeys.EnableAudio))
|
||||
{
|
||||
audioArgs = string.Format("-c:a libvorbis -qscale:a {0}", this.OGGVBRBitrateToQualityIndex(audioEncodingQuality));
|
||||
}
|
||||
|
||||
string encoderArgs = string.Format(
|
||||
"-c:v libvpx-vp9 {0} {1} {2}",
|
||||
encodingArgs,
|
||||
audioArgs,
|
||||
videoFilteringArgs);
|
||||
|
||||
string arguments = string.Format("-n -stats -i \"{0}\" {2} \"{1}\"", this.InputFilePath, this.OutputFilePath, encoderArgs);
|
||||
|
||||
this.ffmpegArgumentStringByPass.Add(new FFMpegPass(arguments));
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new NotImplementedException("Converter not implemented for output file type " + this.ConversionPreset.OutputType);
|
||||
throw new NotImplementedException("Converter not implemented for output file type " +
|
||||
this.ConversionPreset.OutputType);
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(arguments))
|
||||
if (this.ffmpegArgumentStringByPass.Count == 0)
|
||||
{
|
||||
throw new Exception("Invalid ffmpeg process arguments.");
|
||||
throw new Exception("No ffmpeg arguments generated.");
|
||||
}
|
||||
|
||||
this.ffmpegProcessStartInfo.Arguments = arguments;
|
||||
for (int index = 0; index < this.ffmpegArgumentStringByPass.Count; index++)
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.ffmpegArgumentStringByPass[index].Arguments))
|
||||
{
|
||||
throw new Exception("Invalid ffmpeg process arguments.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override void Convert()
|
||||
@@ -176,37 +347,63 @@ namespace FileConverter.ConversionJobs
|
||||
throw new Exception("The conversion preset must be valid.");
|
||||
}
|
||||
|
||||
this.UserState = "Conversion";
|
||||
|
||||
Diagnostics.Debug.Log("Execute command: {0} {1}.", this.ffmpegProcessStartInfo.FileName, this.ffmpegProcessStartInfo.Arguments);
|
||||
Diagnostics.Debug.Log(string.Empty);
|
||||
|
||||
try
|
||||
for (int index = 0; index < this.ffmpegArgumentStringByPass.Count; index++)
|
||||
{
|
||||
using (Process exeProcess = Process.Start(this.ffmpegProcessStartInfo))
|
||||
FFMpegPass currentPass = this.ffmpegArgumentStringByPass[index];
|
||||
|
||||
this.UserState = currentPass.Name;
|
||||
this.ffmpegProcessStartInfo.Arguments = currentPass.Arguments;
|
||||
|
||||
Diagnostics.Debug.Log("Execute command: {0} {1}.", this.ffmpegProcessStartInfo.FileName, this.ffmpegProcessStartInfo.Arguments);
|
||||
Diagnostics.Debug.Log(string.Empty);
|
||||
|
||||
try
|
||||
{
|
||||
using (StreamReader reader = exeProcess.StandardError)
|
||||
using (Process exeProcess = Process.Start(this.ffmpegProcessStartInfo))
|
||||
{
|
||||
while (!reader.EndOfStream)
|
||||
using (StreamReader reader = exeProcess.StandardError)
|
||||
{
|
||||
string result = reader.ReadLine();
|
||||
while (!reader.EndOfStream)
|
||||
{
|
||||
if (this.CancelIsRequested && !exeProcess.HasExited)
|
||||
{
|
||||
exeProcess.Kill();
|
||||
}
|
||||
|
||||
this.ParseFFMPEGOutput(result);
|
||||
string result = reader.ReadLine();
|
||||
|
||||
Diagnostics.Debug.Log("ffmpeg output: {0}", result);
|
||||
this.ParseFFMPEGOutput(result);
|
||||
|
||||
Diagnostics.Debug.Log("ffmpeg output: {0}", result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
exeProcess.WaitForExit();
|
||||
exeProcess.WaitForExit();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
this.ConversionFailed("Failed to launch FFMPEG process.");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
this.ConversionFailed("Failed to launch FFMPEG process.");
|
||||
throw;
|
||||
}
|
||||
|
||||
Diagnostics.Debug.Log("");
|
||||
Diagnostics.Debug.Log(string.Empty);
|
||||
|
||||
// Clean intermediate files.
|
||||
for (int index = 0; index < this.ffmpegArgumentStringByPass.Count; index++)
|
||||
{
|
||||
FFMpegPass currentPass = this.ffmpegArgumentStringByPass[index];
|
||||
|
||||
if (string.IsNullOrEmpty(currentPass.FileToDelete))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Diagnostics.Debug.Log("Delete intermediate file {0}.", currentPass.FileToDelete);
|
||||
|
||||
File.Delete(currentPass.FileToDelete);
|
||||
}
|
||||
}
|
||||
|
||||
private void ParseFFMPEGOutput(string input)
|
||||
@@ -223,26 +420,58 @@ namespace FileConverter.ConversionJobs
|
||||
return;
|
||||
}
|
||||
|
||||
match = this.progressRegex.Match(input);
|
||||
if (match.Success && match.Groups.Count >= 7)
|
||||
if (this.fileDuration.Ticks > 0)
|
||||
{
|
||||
int size = int.Parse(match.Groups[1].Value);
|
||||
int hours = int.Parse(match.Groups[2].Value);
|
||||
int minutes = int.Parse(match.Groups[3].Value);
|
||||
int seconds = int.Parse(match.Groups[4].Value);
|
||||
int milliseconds = int.Parse(match.Groups[5].Value);
|
||||
float bitrate = 0f;
|
||||
float.TryParse(match.Groups[6].Value, out bitrate);
|
||||
match = this.progressRegex.Match(input);
|
||||
if (match.Success && match.Groups.Count >= 7)
|
||||
{
|
||||
int size = int.Parse(match.Groups[1].Value);
|
||||
int hours = int.Parse(match.Groups[2].Value);
|
||||
int minutes = int.Parse(match.Groups[3].Value);
|
||||
int seconds = int.Parse(match.Groups[4].Value);
|
||||
int milliseconds = int.Parse(match.Groups[5].Value) * 10;
|
||||
float bitrate = 0f;
|
||||
float.TryParse(match.Groups[6].Value, out bitrate);
|
||||
|
||||
this.actualConvertedDuration = new TimeSpan(0, hours, minutes, seconds, milliseconds);
|
||||
this.actualConvertedDuration = new TimeSpan(0, hours, minutes, seconds, milliseconds);
|
||||
|
||||
this.Progress = this.actualConvertedDuration.Ticks / (float)this.fileDuration.Ticks;
|
||||
return;
|
||||
this.Progress = this.actualConvertedDuration.Ticks / (float)this.fileDuration.Ticks;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (input.Contains("Exiting.") || input.Contains("Error") || input.Contains("Unsupported dimensions") || input.Contains("No such file or directory"))
|
||||
{
|
||||
this.ConversionFailed(input);
|
||||
if (input.StartsWith("Error while decoding stream") && input.EndsWith("Invalid data found when processing input"))
|
||||
{
|
||||
// It is normal for a transport stream to start with a broken frame.
|
||||
// https://trac.ffmpeg.org/ticket/1622
|
||||
}
|
||||
else
|
||||
{
|
||||
this.ConversionFailed(input);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private struct FFMpegPass
|
||||
{
|
||||
public string Name;
|
||||
public string Arguments;
|
||||
public string FileToDelete;
|
||||
|
||||
public FFMpegPass(string name, string arguments, string fileToDelete)
|
||||
{
|
||||
this.Name = name;
|
||||
this.Arguments = arguments;
|
||||
this.FileToDelete = fileToDelete;
|
||||
}
|
||||
|
||||
public FFMpegPass(string arguments)
|
||||
{
|
||||
this.Name = "Conversion";
|
||||
this.Arguments = arguments;
|
||||
this.FileToDelete = string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
// <copyright file="ConversionJob_Gif.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverter.ConversionJobs
|
||||
{
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
public class ConversionJob_Gif : ConversionJob
|
||||
{
|
||||
private string intermediateFilePath = string.Empty;
|
||||
private ConversionJob pngConversionJob = null;
|
||||
private ConversionJob gifConversionJob = null;
|
||||
|
||||
public ConversionJob_Gif(ConversionPreset conversionPreset) : base(conversionPreset)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
if (this.ConversionPreset == null)
|
||||
{
|
||||
throw new Exception("The conversion preset must be valid.");
|
||||
}
|
||||
|
||||
string extension = System.IO.Path.GetExtension(this.InputFilePath);
|
||||
extension = extension.ToLowerInvariant().Substring(1, extension.Length - 1);
|
||||
|
||||
string inputFilePath = string.Empty;
|
||||
|
||||
// If the output is an image start to convert it into png before send it to ffmpeg.
|
||||
if (PathHelpers.GetExtensionCategory(extension) == PathHelpers.InputCategoryNames.Image && extension != "png")
|
||||
{
|
||||
// Generate intermediate file path.
|
||||
string fileName = Path.GetFileName(this.OutputFilePath);
|
||||
string tempPath = Path.GetTempPath();
|
||||
this.intermediateFilePath = PathHelpers.GenerateUniquePath(tempPath + fileName + ".png");
|
||||
|
||||
// Convert input in png file to send it to ffmpeg for the gif conversion.
|
||||
ConversionPreset intermediatePreset = new ConversionPreset("To compatible image", OutputType.Png, this.ConversionPreset.InputTypes.ToArray());
|
||||
this.pngConversionJob = ConversionJobFactory.Create(intermediatePreset, this.InputFilePath);
|
||||
this.pngConversionJob.PrepareConversion(this.InputFilePath, this.intermediateFilePath);
|
||||
|
||||
inputFilePath = this.intermediateFilePath;
|
||||
}
|
||||
else
|
||||
{
|
||||
inputFilePath = this.InputFilePath;
|
||||
}
|
||||
|
||||
// Convert png file into ico.
|
||||
this.gifConversionJob = new ConversionJob_FFMPEG(this.ConversionPreset);
|
||||
this.gifConversionJob.PrepareConversion(inputFilePath, this.OutputFilePath);
|
||||
}
|
||||
|
||||
protected override void Convert()
|
||||
{
|
||||
if (this.ConversionPreset == null)
|
||||
{
|
||||
throw new Exception("The conversion preset must be valid.");
|
||||
}
|
||||
|
||||
Task updateProgress = this.UpdateProgress();
|
||||
|
||||
if (this.pngConversionJob != null)
|
||||
{
|
||||
this.UserState = "Read input image";
|
||||
|
||||
Diagnostics.Debug.Log(string.Empty);
|
||||
Diagnostics.Debug.Log("Convert image to PNG (intermediate format).");
|
||||
this.pngConversionJob.StartConvertion();
|
||||
|
||||
if (this.pngConversionJob.State != ConversionState.Done)
|
||||
{
|
||||
this.ConversionFailed(this.pngConversionJob.ErrorMessage);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Diagnostics.Debug.Log(string.Empty);
|
||||
Diagnostics.Debug.Log("Convert png intermediate image to gif.");
|
||||
this.gifConversionJob.StartConvertion();
|
||||
|
||||
if (this.gifConversionJob.State != ConversionState.Done)
|
||||
{
|
||||
this.ConversionFailed(this.gifConversionJob.ErrorMessage);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(this.intermediateFilePath))
|
||||
{
|
||||
Diagnostics.Debug.Log("Delete intermediate file {0}.", this.intermediateFilePath);
|
||||
|
||||
File.Delete(this.intermediateFilePath);
|
||||
}
|
||||
|
||||
updateProgress.Wait();
|
||||
}
|
||||
|
||||
private async Task UpdateProgress()
|
||||
{
|
||||
while (this.gifConversionJob.State != ConversionState.Done &&
|
||||
this.gifConversionJob.State != ConversionState.Failed)
|
||||
{
|
||||
if (this.pngConversionJob != null && this.pngConversionJob.State == ConversionState.InProgress)
|
||||
{
|
||||
this.Progress = this.pngConversionJob.Progress;
|
||||
}
|
||||
|
||||
if (this.gifConversionJob != null && this.gifConversionJob.State == ConversionState.InProgress)
|
||||
{
|
||||
this.Progress = this.gifConversionJob.Progress;
|
||||
this.UserState = this.gifConversionJob.UserState;
|
||||
}
|
||||
|
||||
await Task.Delay(40);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
// <copyright file="ConversionJob_Ico.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverter.ConversionJobs
|
||||
{
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
public class ConversionJob_Ico : ConversionJob
|
||||
{
|
||||
private string intermediateFilePath;
|
||||
private ConversionJob pngConversionJob;
|
||||
private ConversionJob icoConversionJob;
|
||||
|
||||
public ConversionJob_Ico(ConversionPreset conversionPreset) : base(conversionPreset)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
if (this.ConversionPreset == null)
|
||||
{
|
||||
throw new Exception("The conversion preset must be valid.");
|
||||
}
|
||||
|
||||
// Generate intermediate file path.
|
||||
string fileName = Path.GetFileName(this.OutputFilePath);
|
||||
string tempPath = Path.GetTempPath();
|
||||
this.intermediateFilePath = PathHelpers.GenerateUniquePath(tempPath + fileName + ".png");
|
||||
|
||||
// Convert input in png file to send it to ffmpeg for the ico conversion.
|
||||
ConversionPreset intermediatePreset = new ConversionPreset("To compatible image", OutputType.Png, this.ConversionPreset.InputTypes.ToArray());
|
||||
intermediatePreset.SetSettingsValue(ConversionPreset.ConversionSettingKeys.ImageClampSizePowerOf2, "True");
|
||||
intermediatePreset.SetSettingsValue(ConversionPreset.ConversionSettingKeys.ImageMaximumSize, "256");
|
||||
this.pngConversionJob = ConversionJobFactory.Create(intermediatePreset, this.InputFilePath);
|
||||
this.pngConversionJob.PrepareConversion(this.InputFilePath, this.intermediateFilePath);
|
||||
|
||||
// Convert png file into ico.
|
||||
this.icoConversionJob = new ConversionJob_FFMPEG(this.ConversionPreset);
|
||||
this.icoConversionJob.PrepareConversion(this.intermediateFilePath, this.OutputFilePath);
|
||||
}
|
||||
|
||||
protected override void Convert()
|
||||
{
|
||||
if (this.ConversionPreset == null)
|
||||
{
|
||||
throw new Exception("The conversion preset must be valid.");
|
||||
}
|
||||
|
||||
Diagnostics.Debug.Log(string.Empty);
|
||||
Diagnostics.Debug.Log("Convert image to PNG (intermediate format).");
|
||||
this.pngConversionJob.StartConvertion();
|
||||
|
||||
if (this.pngConversionJob.State != ConversionState.Done)
|
||||
{
|
||||
this.ConversionFailed(this.pngConversionJob.ErrorMessage);
|
||||
return;
|
||||
}
|
||||
|
||||
Diagnostics.Debug.Log(string.Empty);
|
||||
Diagnostics.Debug.Log("Convert png intermediate image to ICO.");
|
||||
this.icoConversionJob.StartConvertion();
|
||||
|
||||
if (this.icoConversionJob.State != ConversionState.Done)
|
||||
{
|
||||
this.ConversionFailed(this.icoConversionJob.ErrorMessage);
|
||||
return;
|
||||
}
|
||||
|
||||
Diagnostics.Debug.Log("Delete intermediate file {0}.", this.intermediateFilePath);
|
||||
|
||||
File.Delete(this.intermediateFilePath);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
// <copyright file="ConversionJob_ImageMagick.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverter.ConversionJobs
|
||||
{
|
||||
using System;
|
||||
|
||||
using FileConverter.Diagnostics;
|
||||
using ImageMagick;
|
||||
|
||||
public class ConversionJob_ImageMagick : ConversionJob
|
||||
{
|
||||
public ConversionJob_ImageMagick() : base()
|
||||
{
|
||||
}
|
||||
|
||||
public ConversionJob_ImageMagick(ConversionPreset conversionPreset) : base(conversionPreset)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
if (this.ConversionPreset == null)
|
||||
{
|
||||
throw new Exception("The conversion preset must be valid.");
|
||||
}
|
||||
}
|
||||
|
||||
protected override void Convert()
|
||||
{
|
||||
if (this.ConversionPreset == null)
|
||||
{
|
||||
throw new Exception("The conversion preset must be valid.");
|
||||
}
|
||||
|
||||
using (MagickImage image = new MagickImage(this.InputFilePath))
|
||||
{
|
||||
image.Progress += this.Image_Progress;
|
||||
Debug.Log("Load image {0} succeed.", this.InputFilePath);
|
||||
|
||||
float scaleFactor = this.ConversionPreset.GetSettingsValue<float>(ConversionPreset.ConversionSettingKeys.ImageScale);
|
||||
if (Math.Abs(scaleFactor - 1f) >= 0.005f)
|
||||
{
|
||||
Debug.Log("Apply scale factor: {0}%.", scaleFactor * 100);
|
||||
|
||||
image.Scale(new Percentage(scaleFactor * 100f));
|
||||
}
|
||||
|
||||
float rotateAngleInDegrees = this.ConversionPreset.GetSettingsValue<float>(ConversionPreset.ConversionSettingKeys.ImageRotation);
|
||||
if (Math.Abs(rotateAngleInDegrees - 0f) >= 0.05f)
|
||||
{
|
||||
Debug.Log("Apply rotation: {0}°.", rotateAngleInDegrees);
|
||||
|
||||
image.Rotate(rotateAngleInDegrees);
|
||||
}
|
||||
|
||||
bool clampSizeToPowerOf2 = this.ConversionPreset.GetSettingsValue<bool>(ConversionPreset.ConversionSettingKeys.ImageClampSizePowerOf2);
|
||||
if (clampSizeToPowerOf2)
|
||||
{
|
||||
int referenceSize = System.Math.Min(image.Width, image.Height);
|
||||
int size = 2;
|
||||
while (size * 2 <= referenceSize)
|
||||
{
|
||||
size *= 2;
|
||||
}
|
||||
|
||||
Debug.Log("Clamp size to the nearest power of 2 size (from {0}x{1} to {2}x{2}).", image.Width, image.Height, size);
|
||||
|
||||
image.Scale(size, size);
|
||||
}
|
||||
|
||||
int maximumSize = this.ConversionPreset.GetSettingsValue<int>(ConversionPreset.ConversionSettingKeys.ImageMaximumSize);
|
||||
if (maximumSize > 0)
|
||||
{
|
||||
int width = System.Math.Min(image.Width, maximumSize);
|
||||
int height = System.Math.Min(image.Height, maximumSize);
|
||||
|
||||
Debug.Log("Clamp size to maximum size of {2}x{2} (from {0}x{1} to {2}x{3}).", image.Width, image.Height, width, height);
|
||||
|
||||
image.Scale(width, height);
|
||||
}
|
||||
|
||||
Debug.Log("Convert image (output: {0}).", this.OutputFilePath);
|
||||
switch (this.ConversionPreset.OutputType)
|
||||
{
|
||||
case OutputType.Png:
|
||||
image.Quality = 100;
|
||||
break;
|
||||
|
||||
case OutputType.Jpg:
|
||||
image.Quality = this.ConversionPreset.GetSettingsValue<int>(ConversionPreset.ConversionSettingKeys.ImageQuality);
|
||||
break;
|
||||
|
||||
default:
|
||||
this.ConversionFailed(string.Format("Unsupported output format {0}.", this.ConversionPreset.OutputType));
|
||||
image.Progress -= this.Image_Progress;
|
||||
return;
|
||||
}
|
||||
|
||||
image.Write(this.OutputFilePath);
|
||||
image.Progress -= this.Image_Progress;
|
||||
}
|
||||
}
|
||||
|
||||
private void Image_Progress(object sender, ProgressEventArgs eventArgs)
|
||||
{
|
||||
this.Progress = (float)eventArgs.Progress.ToDouble() / 100f;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,7 @@ namespace FileConverter
|
||||
|
||||
using FileConverter.Annotations;
|
||||
using FileConverter.Controls;
|
||||
using FileConverter.Diagnostics;
|
||||
using FileConverter.ValueConverters;
|
||||
|
||||
[XmlRoot]
|
||||
@@ -95,6 +96,13 @@ namespace FileConverter
|
||||
}
|
||||
}
|
||||
|
||||
[XmlAttribute]
|
||||
public bool IsDefaultSettings
|
||||
{
|
||||
get;
|
||||
set;
|
||||
} = false;
|
||||
|
||||
[XmlElement]
|
||||
public List<string> InputTypes
|
||||
{
|
||||
@@ -355,6 +363,11 @@ namespace FileConverter
|
||||
{
|
||||
string settingsValue = this.GetSettingsValue(settingsKey);
|
||||
|
||||
if (settingsValue == null)
|
||||
{
|
||||
return default(T);
|
||||
}
|
||||
|
||||
Type type = typeof(T);
|
||||
if (type.IsEnum)
|
||||
{
|
||||
@@ -391,80 +404,58 @@ namespace FileConverter
|
||||
|
||||
private bool IsRelevantSetting(string settingsKey)
|
||||
{
|
||||
switch (this.OutputType)
|
||||
{
|
||||
case OutputType.Wav:
|
||||
switch (settingsKey)
|
||||
{
|
||||
case ConversionPreset.ConversionSettingKeys.AudioEncodingMode:
|
||||
return true;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case OutputType.Mp3:
|
||||
switch (settingsKey)
|
||||
{
|
||||
case ConversionPreset.ConversionSettingKeys.AudioEncodingMode:
|
||||
case ConversionPreset.ConversionSettingKeys.AudioBitrate:
|
||||
return true;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case OutputType.Ogg:
|
||||
switch (settingsKey)
|
||||
{
|
||||
case ConversionPreset.ConversionSettingKeys.AudioBitrate:
|
||||
return true;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case OutputType.Mkv:
|
||||
switch (settingsKey)
|
||||
{
|
||||
case ConversionPreset.ConversionSettingKeys.AudioBitrate:
|
||||
case ConversionPreset.ConversionSettingKeys.VideoQuality:
|
||||
case ConversionPreset.ConversionSettingKeys.VideoEncodingSpeed:
|
||||
return true;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case OutputType.Jpg:
|
||||
switch (settingsKey)
|
||||
{
|
||||
case ConversionPreset.ConversionSettingKeys.ImageQuality:
|
||||
return true;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
return this.Settings.ContainsKey(settingsKey);
|
||||
}
|
||||
|
||||
private void InitializeDefaultSettings(OutputType outputType)
|
||||
{
|
||||
this.settings.Clear();
|
||||
|
||||
switch (outputType)
|
||||
{
|
||||
case OutputType.Aac:
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.AudioBitrate, "128");
|
||||
break;
|
||||
|
||||
case OutputType.Flac:
|
||||
case OutputType.Ico:
|
||||
case OutputType.Flac:
|
||||
break;
|
||||
|
||||
case OutputType.Gif:
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.VideoScale, "1");
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.VideoRotation, "0");
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.VideoFramesPerSecond, "15");
|
||||
break;
|
||||
|
||||
case OutputType.Png:
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.ImageScale, "1");
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.ImageRotation, "0");
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.ImageClampSizePowerOf2, "False");
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.ImageMaximumSize, "0");
|
||||
break;
|
||||
|
||||
case OutputType.Jpg:
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.ImageQuality, "25");
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.ImageQuality, "90");
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.ImageScale, "1");
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.ImageRotation, "0");
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.ImageClampSizePowerOf2, "False");
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.ImageMaximumSize, "0");
|
||||
break;
|
||||
|
||||
case OutputType.Avi:
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.EnableAudio, "True");
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.VideoQuality, "20");
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.VideoScale, "1");
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.VideoRotation, "0");
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.AudioBitrate, "190");
|
||||
break;
|
||||
|
||||
case OutputType.Mkv:
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.EnableAudio, "True");
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.VideoQuality, "28");
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.VideoEncodingSpeed, "Very Slow");
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.VideoEncodingSpeed, "Medium");
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.VideoScale, "1");
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.VideoRotation, "0");
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.AudioBitrate, "128");
|
||||
break;
|
||||
|
||||
@@ -473,6 +464,15 @@ namespace FileConverter
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.AudioBitrate, "190");
|
||||
break;
|
||||
|
||||
case OutputType.Mp4:
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.EnableAudio, "True");
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.VideoQuality, "28");
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.VideoEncodingSpeed, "Medium");
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.VideoScale, "1");
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.VideoRotation, "0");
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.AudioBitrate, "128");
|
||||
break;
|
||||
|
||||
case OutputType.Ogg:
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.AudioBitrate, "160");
|
||||
break;
|
||||
@@ -481,6 +481,14 @@ namespace FileConverter
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.AudioEncodingMode, EncodingMode.Wav16.ToString(), true);
|
||||
break;
|
||||
|
||||
case OutputType.Webm:
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.EnableAudio, "True");
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.AudioBitrate, "160");
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.VideoQuality, "40");
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.VideoScale, "1");
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.VideoRotation, "0");
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new System.Exception("Missing default settings for type " + outputType);
|
||||
}
|
||||
@@ -634,8 +642,18 @@ namespace FileConverter
|
||||
public const string AudioEncodingMode = "AudioEncodingMode";
|
||||
public const string AudioBitrate = "AudioBitrate";
|
||||
public const string ImageQuality = "ImageQuality";
|
||||
public const string ImageScale = "ImageScale";
|
||||
public const string ImageRotation = "ImageRotation";
|
||||
public const string ImageClampSizePowerOf2 = "ImageClampSizePowerOf2";
|
||||
public const string ImageMaximumSize = "ImageMaximumSize";
|
||||
public const string VideoQuality = "VideoQuality";
|
||||
public const string VideoEncodingSpeed = "VideoEncodingSpeed";
|
||||
public const string VideoScale = "VideoScale";
|
||||
public const string VideoRotation = "VideoRotation";
|
||||
public const string VideoFramesPerSecond = "VideoFramesPerSecond";
|
||||
|
||||
public const string EnableAudio = "EnableAudio";
|
||||
public const string EnableVideo = "EnableVideo";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,4 @@
|
||||
// <copyright file="Diagnostics.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
using System.Linq;
|
||||
// <copyright file="Debug.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverter.Diagnostics
|
||||
{
|
||||
@@ -9,7 +7,7 @@ namespace FileConverter.Diagnostics
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
|
||||
public static class Debug
|
||||
@@ -18,15 +16,13 @@ namespace FileConverter.Diagnostics
|
||||
private static Dictionary<int, DiagnosticsData> diagnosticsDataById = new Dictionary<int, DiagnosticsData>();
|
||||
private static int threadCount = 0;
|
||||
|
||||
public static event EventHandler<PropertyChangedEventArgs> StaticPropertyChanged;
|
||||
|
||||
static Debug()
|
||||
{
|
||||
string path = PathHelpers.GetUserDataFolderPath();
|
||||
|
||||
// Delete old diagnostics folder (1 day).
|
||||
DateTime expirationDate = DateTime.Now.Subtract(new TimeSpan(1, 0, 0, 0));
|
||||
string[] diagnosticsDirectories = Directory.GetDirectories(path, "Diagnostics.*");
|
||||
string[] diagnosticsDirectories = Directory.GetDirectories(path, "Diagnostics-*");
|
||||
for (int index = 0; index < diagnosticsDirectories.Length; index++)
|
||||
{
|
||||
string directory = diagnosticsDirectories[index];
|
||||
@@ -37,11 +33,15 @@ namespace FileConverter.Diagnostics
|
||||
}
|
||||
}
|
||||
|
||||
Debug.diagnosticsFolderPath = Path.Combine(path, "Diagnostics." + Process.GetCurrentProcess().Id);
|
||||
string diagnosticsFolderName = $"Diagnostics-{DateTime.Now.Hour}h{DateTime.Now.Minute}m{DateTime.Now.Second}s";
|
||||
|
||||
Debug.diagnosticsFolderPath = Path.Combine(path, diagnosticsFolderName);
|
||||
Debug.diagnosticsFolderPath = PathHelpers.GenerateUniquePath(Debug.diagnosticsFolderPath);
|
||||
Directory.CreateDirectory(Debug.diagnosticsFolderPath);
|
||||
}
|
||||
|
||||
public static event EventHandler<PropertyChangedEventArgs> StaticPropertyChanged;
|
||||
|
||||
public static DiagnosticsData[] Data
|
||||
{
|
||||
get
|
||||
@@ -91,6 +91,5 @@ namespace FileConverter.Diagnostics
|
||||
|
||||
Debug.diagnosticsDataById.Clear();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,13 @@
|
||||
// <copyright file="DiagnosticsData.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
namespace FileConverter.Diagnostics
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
|
||||
using FileConverter.Annotations;
|
||||
|
||||
@@ -19,14 +18,14 @@ namespace FileConverter.Diagnostics
|
||||
private System.IO.TextWriter logFileWriter;
|
||||
private string name;
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
public DiagnosticsData(string name)
|
||||
{
|
||||
this.Name = name;
|
||||
this.LogMessages = new ReadOnlyCollection<string>(this.logMessages);
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
|
||||
@@ -46,6 +46,13 @@
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Accessibility" />
|
||||
<Reference Include="Magick.NET-Q16-AnyCPU, Version=7.0.0.0, Culture=neutral, PublicKeyToken=2004825badfa91ec, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Magick.NET-Q16-AnyCPU.7.0.0.0101\lib\net40-client\Magick.NET-Q16-AnyCPU.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Markdown.Xaml">
|
||||
<HintPath>..\..\Middleware\Markdown.Xaml.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="PresentationUI, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
|
||||
<Reference Include="ReachFramework" />
|
||||
<Reference Include="Ripper, Version=1.0.5806.33932, Culture=neutral, processorArchitecture=MSIL">
|
||||
@@ -80,14 +87,21 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Compile Include="ApplicationTerminateArgs.cs" />
|
||||
<Compile Include="Commands\DelegateCommand.cs" />
|
||||
<Compile Include="Commands\OpenUrlCommand.cs" />
|
||||
<Compile Include="Controls\EncodingQualitySliderControl.xaml.cs">
|
||||
<DependentUpon>EncodingQualitySliderControl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Commands\CancelConversionJobCommand.cs" />
|
||||
<Compile Include="ConversionJobs\ConversionFlags.cs" />
|
||||
<Compile Include="ConversionJobs\ConversionJob_ExtractCDA.cs" />
|
||||
<Compile Include="ConversionJobs\ConversionJobFactory.cs" />
|
||||
<Compile Include="ConversionJobs\ConversionJob_FFMPEG.Converters.cs" />
|
||||
<Compile Include="ConversionJobs\ConversionJob_FFMPEG.cs" />
|
||||
<Compile Include="ConversionJobs\ConversionJob_Gif.cs" />
|
||||
<Compile Include="ConversionJobs\ConversionJob_Ico.cs" />
|
||||
<Compile Include="ConversionJobs\ConversionJob_ImageMagick.cs" />
|
||||
<Compile Include="ConversionPreset\ConversionSettingsOverride.cs" />
|
||||
<Compile Include="ConversionPreset\ConversionSettings.cs" />
|
||||
<Compile Include="Diagnostics\DiagnosticsData.cs" />
|
||||
@@ -100,8 +114,12 @@
|
||||
<DependentUpon>Resources.en.resx</DependentUpon>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<ExcludeFromStyleCop>True</ExcludeFromStyleCop>
|
||||
</Compile>
|
||||
<Compile Include="Registry.cs" />
|
||||
<Compile Include="Settings.Settings.cs" />
|
||||
<Compile Include="Upgrade\Helpers.cs" />
|
||||
<Compile Include="Upgrade\UpgradeVersionDescription.cs" />
|
||||
<Compile Include="ValueConverters\ApplicationVersionToApplicationName.cs" />
|
||||
<Compile Include="ConversionPreset\ConversionPreset.cs" />
|
||||
<Compile Include="ValueConverters\BitrateToString.cs" />
|
||||
@@ -112,12 +130,17 @@
|
||||
<Compile Include="ValueConverters\Generic\DoubleToTimeString.cs" />
|
||||
<Compile Include="ValueConverters\Generic\EqualsConverter.cs" />
|
||||
<Compile Include="ValueConverters\Generic\CollectionContainsElementToBool.cs" />
|
||||
<Compile Include="ValueConverters\Generic\FormatStringConverter.cs" />
|
||||
<Compile Include="ValueConverters\Generic\ValueToString.cs" />
|
||||
<Compile Include="ValueConverters\Generic\StringToValueType.cs" />
|
||||
<Compile Include="ValueConverters\InputTypesToBool.cs" />
|
||||
<Compile Include="Settings.cs" />
|
||||
<Compile Include="ValueConverters\OutputTypeToVisibility.cs" />
|
||||
<Compile Include="ValueConverters\Generic\StringToEnum.cs" />
|
||||
<Compile Include="ValueConverters\Generic\ValueConverterGroup.cs" />
|
||||
<Compile Include="Windows\ApplicationStartHelp.xaml.cs">
|
||||
<DependentUpon>ApplicationStartHelp.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Windows\DiagnosticsWindow.xaml.cs">
|
||||
<DependentUpon>DiagnosticsWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -128,11 +151,18 @@
|
||||
<DependentUpon>SettingsWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Version.cs" />
|
||||
<Compile Include="Windows\UpgradeWindow.xaml.cs">
|
||||
<DependentUpon>UpgradeWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="XmlHelpers.cs" />
|
||||
<Page Include="Controls\EncodingQualitySliderControl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Windows\ApplicationStartHelp.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Windows\DiagnosticsWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
@@ -156,6 +186,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Windows\UpgradeWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="OutputType.cs" />
|
||||
@@ -184,6 +218,7 @@
|
||||
<Generator>PublicResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<None Include="packages.config" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
@@ -199,7 +234,38 @@
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\ApplicationIcon.ico" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\DownloadIcon.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\ContextMenuScreenshot.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\CancelIcon.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\SuccessIcon.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\FailIcon.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\GitHub-Icon.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\GitHub-Issue-Icon.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\GitHub-Documentation-Icon.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\Pledge-icon.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>copy /Y "$(SolutionDir)Middleware\ffmpeg.exe" "$(TargetDir)ffmpeg.exe"
|
||||
copy /Y "$(ProjectDir)Settings.default.xml" "$(TargetDir)Settings.default.xml"</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<!-- 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.
|
||||
<Target Name="BeforeBuild">
|
||||
|
||||
@@ -7,13 +7,17 @@ namespace FileConverter
|
||||
None,
|
||||
|
||||
Aac,
|
||||
Avi,
|
||||
Flac,
|
||||
Gif,
|
||||
Ico,
|
||||
Jpg,
|
||||
Mkv,
|
||||
Mp3,
|
||||
Mp4,
|
||||
Ogg,
|
||||
Png,
|
||||
Wav,
|
||||
Webm,
|
||||
}
|
||||
}
|
||||
@@ -9,9 +9,9 @@ namespace FileConverter
|
||||
{
|
||||
private static Regex driveLetterRegex = new Regex(@"[a-zA-Z]:\\");
|
||||
private static Regex cdaTrackNumberRegex = new Regex(@"[a-zA-Z]:\\Track([0-9]+)\.cda");
|
||||
private static Regex pathRegex = new Regex(@"^[a-zA-Z]:\\(?:[^\\/:*?""<>|\r\n]+\\)*[^\.\\/:*?""<>|\r\n][^\\/:*?""<>|\r\n]*$");
|
||||
private static Regex pathRegex = new Regex(@"^(?:\\\\[^\\/:*?""<>|\r\n]+\\|[a-zA-Z]:\\)(?:[^\\/:*?""<>|\r\n]+\\)*[^\.\\/:*?""<>|\r\n][^\\/:*?""<>|\r\n]*$");
|
||||
private static Regex filenameRegex = new Regex(@"[^\\]*", RegexOptions.RightToLeft);
|
||||
private static Regex directoryRegex = new Regex(@"(?:([^\\]*)\\)*");
|
||||
private static Regex directoryRegex = new Regex(@"^(?<drive>\\\\[^\\/:*?""""<>|\r\n]+\\|[A-Za-z]:\\)(?:(?<folders>[^\\]*)\\)*");
|
||||
|
||||
public static bool IsPathDriveLetterValid(string path)
|
||||
{
|
||||
@@ -23,6 +23,28 @@ namespace FileConverter
|
||||
return PathHelpers.driveLetterRegex.Match(path).Groups[0].Value;
|
||||
}
|
||||
|
||||
public static bool IsOnCDDrive(string path)
|
||||
{
|
||||
string pathDriveLetter = GetPathDriveLetter(path);
|
||||
if (string.IsNullOrEmpty(pathDriveLetter))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
char driveLetter = pathDriveLetter[0];
|
||||
|
||||
char[] driveLetters = Ripper.CDDrive.GetCDDriveLetters();
|
||||
for (int index = 0; index < driveLetters.Length; index++)
|
||||
{
|
||||
if (driveLetters[index] == driveLetter)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static int GetCDATrackNumber(string path)
|
||||
{
|
||||
Match match = PathHelpers.cdaTrackNumberRegex.Match(path);
|
||||
@@ -41,17 +63,27 @@ namespace FileConverter
|
||||
Match filenameMatch = matchCollection.Count > 0 ? matchCollection[0] : null;
|
||||
return filenameMatch?.Groups[0].Value;
|
||||
}
|
||||
|
||||
|
||||
public static string GetDrive(string path)
|
||||
{
|
||||
MatchCollection matchCollection = PathHelpers.directoryRegex.Matches(path);
|
||||
Match match = matchCollection.Count > 0 ? matchCollection[0] : null;
|
||||
|
||||
Group matchGroup = match?.Groups["drive"];
|
||||
return matchGroup?.Captures[0].Value;
|
||||
}
|
||||
|
||||
public static IEnumerable<string> GetDirectories(string path)
|
||||
{
|
||||
MatchCollection matchCollection = PathHelpers.directoryRegex.Matches(path);
|
||||
Match match = matchCollection.Count > 0 ? matchCollection[0] : null;
|
||||
if (match == null || match.Groups.Count < 2)
|
||||
|
||||
Group matchGroup = match?.Groups["folders"];
|
||||
if (matchGroup == null)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
|
||||
Group matchGroup = match.Groups[1];
|
||||
for (int index = 0; index < matchGroup.Captures.Count; index++)
|
||||
{
|
||||
yield return matchGroup.Captures[index].Value;
|
||||
@@ -83,26 +115,42 @@ namespace FileConverter
|
||||
case "flac":
|
||||
case "mp3":
|
||||
case "m4a":
|
||||
case "oga":
|
||||
case "ogg":
|
||||
case "wav":
|
||||
case "wma":
|
||||
return InputCategoryNames.Audio;
|
||||
|
||||
case "3gp":
|
||||
case "avi":
|
||||
case "bik":
|
||||
case "flv":
|
||||
case "m4v":
|
||||
case "mp4":
|
||||
case "mpeg":
|
||||
case "mov":
|
||||
case "mkv":
|
||||
case "ogv":
|
||||
case "vob":
|
||||
case "webm":
|
||||
case "wmv":
|
||||
return InputCategoryNames.Video;
|
||||
|
||||
case "bmp":
|
||||
case "exr":
|
||||
case "ico":
|
||||
case "jpg":
|
||||
case "jpeg":
|
||||
case "png":
|
||||
case "psd":
|
||||
case "tga":
|
||||
case "tiff":
|
||||
case "svg":
|
||||
case "xcf":
|
||||
return InputCategoryNames.Image;
|
||||
|
||||
case "gif":
|
||||
return InputCategoryNames.AnimatedImage;
|
||||
}
|
||||
|
||||
return InputCategoryNames.Misc;
|
||||
@@ -125,14 +173,20 @@ namespace FileConverter
|
||||
case OutputType.Wav:
|
||||
return category == InputCategoryNames.Audio || category == InputCategoryNames.Video;
|
||||
|
||||
case OutputType.Avi:
|
||||
case OutputType.Mkv:
|
||||
return category == InputCategoryNames.Video;
|
||||
|
||||
case OutputType.Mp4:
|
||||
case OutputType.Webm:
|
||||
return category == InputCategoryNames.Video || category == InputCategoryNames.AnimatedImage;
|
||||
|
||||
case OutputType.Ico:
|
||||
case OutputType.Png:
|
||||
case OutputType.Jpg:
|
||||
case OutputType.Png:
|
||||
return category == InputCategoryNames.Image;
|
||||
|
||||
case OutputType.Gif:
|
||||
return category == InputCategoryNames.Image || category == InputCategoryNames.Video || category == InputCategoryNames.AnimatedImage;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@@ -140,7 +194,7 @@ namespace FileConverter
|
||||
|
||||
public static string GetUserDataFolderPath()
|
||||
{
|
||||
string path = System.Environment.GetFolderPath((System.Environment.SpecialFolder.LocalApplicationData));
|
||||
string path = System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData);
|
||||
path = System.IO.Path.Combine(path, "FileConverter");
|
||||
|
||||
if (!System.IO.Directory.Exists(path))
|
||||
@@ -156,6 +210,8 @@ namespace FileConverter
|
||||
public const string Audio = "Audio";
|
||||
public const string Video = "Video";
|
||||
public const string Image = "Image";
|
||||
public const string AnimatedImage = "Animated Image";
|
||||
|
||||
public const string Misc = "Misc";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ using System.Windows;
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("FileConverter")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2014")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2016")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
|
||||
@@ -60,6 +60,24 @@ namespace FileConverter.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to 90° counter clockwise rotation.
|
||||
/// </summary>
|
||||
public static string NinetyDegreesRotationTooltip {
|
||||
get {
|
||||
return ResourceManager.GetString("NinetyDegreesRotationTooltip", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to 180° rotation.
|
||||
/// </summary>
|
||||
public static string OneEightyDegreesRotationTooltip {
|
||||
get {
|
||||
return ResourceManager.GetString("OneEightyDegreesRotationTooltip", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to C:\Music\Artist\Album\Song.wav.
|
||||
/// </summary>
|
||||
@@ -91,6 +109,15 @@ namespace FileConverter.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to 90° clockwise rotation.
|
||||
/// </summary>
|
||||
public static string TwoSeventyDegreesRotationTooltip {
|
||||
get {
|
||||
return ResourceManager.GetString("TwoSeventyDegreesRotationTooltip", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Define the ratio 'file size' versus 'video quality'. A lower value will give you a smaller file, a greater value give you a better video quality..
|
||||
/// </summary>
|
||||
@@ -108,5 +135,14 @@ namespace FileConverter.Properties {
|
||||
return ResourceManager.GetString("VideoEncodingSpeedTooltip", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to No rotation.
|
||||
/// </summary>
|
||||
public static string ZeroDegreesRotationTooltip {
|
||||
get {
|
||||
return ResourceManager.GetString("ZeroDegreesRotationTooltip", resourceCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -117,6 +117,12 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="NinetyDegreesRotationTooltip" xml:space="preserve">
|
||||
<value>90° counter clockwise rotation</value>
|
||||
</data>
|
||||
<data name="OneEightyDegreesRotationTooltip" xml:space="preserve">
|
||||
<value>180° rotation</value>
|
||||
</data>
|
||||
<data name="OuputFileNameTemplateSample" xml:space="preserve">
|
||||
<value>C:\Music\Artist\Album\Song.wav</value>
|
||||
</data>
|
||||
@@ -136,10 +142,16 @@ Special paths:
|
||||
(p:v): my videos path
|
||||
(p:p): my pictures path</value>
|
||||
</data>
|
||||
<data name="TwoSeventyDegreesRotationTooltip" xml:space="preserve">
|
||||
<value>90° clockwise rotation</value>
|
||||
</data>
|
||||
<data name="VideoEncodingQualityTooltip" xml:space="preserve">
|
||||
<value>Define the ratio 'file size' versus 'video quality'. A lower value will give you a smaller file, a greater value give you a better video quality.</value>
|
||||
</data>
|
||||
<data name="VideoEncodingSpeedTooltip" xml:space="preserve">
|
||||
<value>Define the ratio 'file size' versus 'compression duration'. A slow compression will give you a smaller file (for the same video quality) than a faster compression.</value>
|
||||
</data>
|
||||
<data name="ZeroDegreesRotationTooltip" xml:space="preserve">
|
||||
<value>No rotation</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -117,6 +117,12 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="NinetyDegreesRotationTooltip" xml:space="preserve">
|
||||
<value>90° counter clockwise rotation</value>
|
||||
</data>
|
||||
<data name="OneEightyDegreesRotationTooltip" xml:space="preserve">
|
||||
<value>180° rotation</value>
|
||||
</data>
|
||||
<data name="OuputFileNameTemplateSample" xml:space="preserve">
|
||||
<value>C:\Music\Artist\Album\Song.wav</value>
|
||||
</data>
|
||||
@@ -136,10 +142,16 @@ Special paths:
|
||||
(p:v): my videos path
|
||||
(p:p): my pictures path</value>
|
||||
</data>
|
||||
<data name="TwoSeventyDegreesRotationTooltip" xml:space="preserve">
|
||||
<value>90° clockwise rotation</value>
|
||||
</data>
|
||||
<data name="VideoEncodingQualityTooltip" xml:space="preserve">
|
||||
<value>Define the ratio 'file size' versus 'video quality'. A lower value will give you a smaller file, a greater value give you a better video quality.</value>
|
||||
</data>
|
||||
<data name="VideoEncodingSpeedTooltip" xml:space="preserve">
|
||||
<value>Define the ratio 'file size' versus 'compression duration'. A slow compression will give you a smaller file (for the same video quality) than a faster compression.</value>
|
||||
</data>
|
||||
<data name="ZeroDegreesRotationTooltip" xml:space="preserve">
|
||||
<value>No rotation</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -0,0 +1,203 @@
|
||||
// <copyright file="Registry.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.IO;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
public class Registry : IDisposable
|
||||
{
|
||||
private static Registry instance;
|
||||
|
||||
private Dictionary<string, string> registryEntries = new Dictionary<string, string>();
|
||||
|
||||
~Registry()
|
||||
{
|
||||
this.Dispose();
|
||||
Registry.instance = null;
|
||||
}
|
||||
|
||||
[XmlElement("Entry")]
|
||||
public Entry[] SerializableEntries
|
||||
{
|
||||
get
|
||||
{
|
||||
Entry[] entries = new Entry[this.registryEntries.Count];
|
||||
int index = 0;
|
||||
foreach (KeyValuePair<string, string> kvp in this.registryEntries)
|
||||
{
|
||||
if (kvp.Value == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
entries[index] = new Entry(kvp.Key, kvp.Value);
|
||||
index++;
|
||||
}
|
||||
|
||||
return entries;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this.registryEntries.Clear();
|
||||
for (int index = 0; index < value.Length; index++)
|
||||
{
|
||||
Entry entry = value[index];
|
||||
if (entry.Key == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (this.registryEntries.ContainsKey(entry.Key))
|
||||
{
|
||||
Diagnostics.Debug.Log("Ignore registry entry {0}.", entry.Key);
|
||||
continue;
|
||||
}
|
||||
|
||||
this.registryEntries.Add(entry.Key, entry.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static Registry Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Registry.instance == null)
|
||||
{
|
||||
Registry.Load();
|
||||
}
|
||||
|
||||
return Registry.instance;
|
||||
}
|
||||
}
|
||||
|
||||
public static T GetValue<T>(string key)
|
||||
{
|
||||
Registry registry = Registry.Instance;
|
||||
|
||||
string stringValue;
|
||||
if (!registry.registryEntries.TryGetValue(key, out stringValue))
|
||||
{
|
||||
return default(T);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
object value = System.Convert.ChangeType(stringValue, typeof(T));
|
||||
return (T)value;
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
Diagnostics.Debug.LogError("Can't convert registry value: {0}.", exception.Message);
|
||||
}
|
||||
|
||||
return default(T);
|
||||
}
|
||||
|
||||
public static void SetValue<T>(string key, T value)
|
||||
{
|
||||
Registry registry = Registry.Instance;
|
||||
|
||||
if (!registry.registryEntries.ContainsKey(key))
|
||||
{
|
||||
registry.registryEntries.Add(key, null);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
string stringValue = (string)System.Convert.ChangeType(value, typeof(string));
|
||||
registry.registryEntries[key] = stringValue;
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
Diagnostics.Debug.LogError("Can't convert registry value: {0}.", exception.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// SAVE
|
||||
string registryFilePath = Registry.GetUserRegistryFilePath();
|
||||
|
||||
try
|
||||
{
|
||||
XmlHelpers.SaveToFile("Registry", registryFilePath, this);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
Diagnostics.Debug.LogError("Fail to save registry. {0}", exception.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private static void Load()
|
||||
{
|
||||
string registryFilePath = Registry.GetUserRegistryFilePath();
|
||||
if (!File.Exists(registryFilePath))
|
||||
{
|
||||
Registry.instance = new Registry();
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
Registry.instance = null;
|
||||
XmlHelpers.LoadFromFile<Registry>("Registry", registryFilePath, out Registry.instance);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
Registry.instance = new Registry();
|
||||
Diagnostics.Debug.LogError("Fail to load registry. {0}", exception.Message);
|
||||
while (exception.InnerException != null)
|
||||
{
|
||||
exception = exception.InnerException;
|
||||
Diagnostics.Debug.LogError("Inner exception: {0}", exception.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static string GetUserRegistryFilePath()
|
||||
{
|
||||
string path = PathHelpers.GetUserDataFolderPath();
|
||||
path = Path.Combine(path, "Registry.xml");
|
||||
return path;
|
||||
}
|
||||
|
||||
[XmlRoot("Entry")]
|
||||
public struct Entry
|
||||
{
|
||||
public Entry(string key, string value)
|
||||
{
|
||||
this.Key = key;
|
||||
this.Value = value;
|
||||
}
|
||||
|
||||
[XmlAttribute]
|
||||
public string Key
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
[XmlText]
|
||||
public string Value
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Keys
|
||||
{
|
||||
public static readonly string LastUpdateCheckDate = "LastUpdateCheckDate";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 551 B |
|
After Width: | Height: | Size: 976 B |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
@@ -2,19 +2,18 @@
|
||||
|
||||
namespace FileConverter
|
||||
{
|
||||
using System.Linq;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
public partial class Settings : IXmlSerializable
|
||||
{
|
||||
public const int Version = 1;
|
||||
|
||||
private double settingsWindowHeight = 640;
|
||||
private double settingsWindowWidth = 800;
|
||||
|
||||
private bool exitApplicationWhenConversionsFinished = true;
|
||||
private float durationBetweenEndOfConversionsAndApplicationExit = 3f;
|
||||
private ObservableCollection<ConversionPreset> conversionPresets = new ObservableCollection<ConversionPreset>();
|
||||
private bool checkUpgradeAtStartup = true;
|
||||
|
||||
[XmlAttribute]
|
||||
public int SerializationVersion
|
||||
@@ -85,6 +84,21 @@ namespace FileConverter
|
||||
}
|
||||
}
|
||||
|
||||
[XmlElement]
|
||||
public bool CheckUpgradeAtStartup
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.checkUpgradeAtStartup;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.checkUpgradeAtStartup = value;
|
||||
this.OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public void OnDeserializationComplete()
|
||||
{
|
||||
this.DurationBetweenEndOfConversionsAndApplicationExit = System.Math.Max(0, System.Math.Min(10, this.DurationBetweenEndOfConversionsAndApplicationExit));
|
||||
|
||||
@@ -11,12 +11,11 @@ namespace FileConverter
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Security.Principal;
|
||||
using System.Xml.Serialization;
|
||||
using System.Windows;
|
||||
|
||||
using Microsoft.Win32;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
using FileConverter.Annotations;
|
||||
using Microsoft.Win32;
|
||||
|
||||
[XmlRoot]
|
||||
[XmlType]
|
||||
@@ -73,7 +72,7 @@ namespace FileConverter
|
||||
Settings settings = null;
|
||||
XmlHelpers.LoadFromFile("Settings", temporaryFilePath, out settings);
|
||||
|
||||
RegistryKey registryKey = Registry.CurrentUser.OpenSubKey(@"Software\FileConverter");
|
||||
RegistryKey registryKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(@"Software\FileConverter");
|
||||
if (registryKey == null)
|
||||
{
|
||||
Diagnostics.Debug.LogError("Can't apply settings in registry. (code 0x03)");
|
||||
@@ -94,7 +93,7 @@ namespace FileConverter
|
||||
}
|
||||
}
|
||||
|
||||
public static Settings Load()
|
||||
public static void PostInstallationInitialization()
|
||||
{
|
||||
Settings defaultSettings = null;
|
||||
|
||||
@@ -116,6 +115,7 @@ namespace FileConverter
|
||||
Diagnostics.Debug.LogError("Default settings not found at path {0}. You should try to reinstall the application.", defaultFilePath);
|
||||
}
|
||||
|
||||
// Load user settings if exists.
|
||||
Settings userSettings = null;
|
||||
string userFilePath = Settings.GetUserSettingsFilePath();
|
||||
if (File.Exists(userFilePath))
|
||||
@@ -124,9 +124,58 @@ namespace FileConverter
|
||||
{
|
||||
XmlHelpers.LoadFromFile<Settings>("Settings", userFilePath, out userSettings);
|
||||
}
|
||||
catch (Exception exception)
|
||||
catch (Exception)
|
||||
{
|
||||
MessageBoxResult messageBoxResult = MessageBox.Show("Can't load file converter user settings. Do you want to fall back to default settings ?", "Error", MessageBoxButton.YesNo, MessageBoxImage.Exclamation);
|
||||
System.IO.File.Delete(userFilePath);
|
||||
}
|
||||
|
||||
if (userSettings != null)
|
||||
{
|
||||
if (userSettings.SerializationVersion != Version)
|
||||
{
|
||||
Diagnostics.Debug.Log("File converter settings has been imported from version {0} to version {1}.", userSettings.SerializationVersion, Version);
|
||||
userSettings.SerializationVersion = Version;
|
||||
}
|
||||
|
||||
// Remove default settings.
|
||||
if (userSettings.ConversionPresets != null)
|
||||
{
|
||||
for (int index = userSettings.ConversionPresets.Count - 1; index >= 0; index--)
|
||||
{
|
||||
if (userSettings.ConversionPresets[index].IsDefaultSettings)
|
||||
{
|
||||
userSettings.ConversionPresets.RemoveAt(index);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Settings settings = userSettings != null ? userSettings.Merge(defaultSettings) : defaultSettings;
|
||||
settings.Save();
|
||||
}
|
||||
|
||||
public static Settings Load()
|
||||
{
|
||||
Settings settings = null;
|
||||
string userFilePath = Settings.GetUserSettingsFilePath();
|
||||
if (File.Exists(userFilePath))
|
||||
{
|
||||
Settings userSettings = null;
|
||||
try
|
||||
{
|
||||
XmlHelpers.LoadFromFile<Settings>("Settings", userFilePath, out userSettings);
|
||||
settings = userSettings;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
MessageBoxResult messageBoxResult =
|
||||
MessageBox.Show(
|
||||
"Can't load file converter user settings. Do you want to fall back to default settings ?",
|
||||
"Error",
|
||||
MessageBoxButton.YesNo,
|
||||
MessageBoxImage.Exclamation);
|
||||
|
||||
if (messageBoxResult == MessageBoxResult.Yes)
|
||||
{
|
||||
System.IO.File.Delete(userFilePath);
|
||||
@@ -141,10 +190,34 @@ namespace FileConverter
|
||||
if (userSettings != null && userSettings.SerializationVersion != Version)
|
||||
{
|
||||
Diagnostics.Debug.Log("File converter settings has been imported from version {0} to version {1}.", userSettings.SerializationVersion, Version);
|
||||
userSettings.SerializationVersion = Version;
|
||||
userSettings.Save();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Load the default settings.
|
||||
string defaultFilePath = Settings.GetDefaultSettingsFilePath();
|
||||
if (File.Exists(defaultFilePath))
|
||||
{
|
||||
Settings defaultSettings = null;
|
||||
try
|
||||
{
|
||||
XmlHelpers.LoadFromFile<Settings>("Settings", defaultFilePath, out defaultSettings);
|
||||
settings = defaultSettings;
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
Diagnostics.Debug.LogError("Fail to load file converter default settings. {0}", exception.Message);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Diagnostics.Debug.LogError("Default settings not found at path {0}. You should try to reinstall the application.", defaultFilePath);
|
||||
}
|
||||
}
|
||||
|
||||
return userSettings != null ? userSettings.Merge(defaultSettings) : defaultSettings;
|
||||
return settings;
|
||||
}
|
||||
|
||||
public ConversionPreset GetPresetFromName(string presetName)
|
||||
@@ -171,7 +244,7 @@ namespace FileConverter
|
||||
// Write the settings in registry.
|
||||
if (Settings.IsInAdmininstratorPrivileges)
|
||||
{
|
||||
// We are in admin mode, write reigstry ...
|
||||
// We are in admin mode, write registry ...
|
||||
bool succeed = Settings.ApplyRegistryModifications(registryEntries);
|
||||
if (succeed)
|
||||
{
|
||||
@@ -212,7 +285,7 @@ namespace FileConverter
|
||||
return false;
|
||||
}
|
||||
|
||||
RegistryKey registryKey = Registry.CurrentUser.OpenSubKey(@"Software\FileConverter", RegistryKeyPermissionCheck.ReadWriteSubTree);
|
||||
RegistryKey registryKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(@"Software\FileConverter", RegistryKeyPermissionCheck.ReadWriteSubTree);
|
||||
if (registryKey == null)
|
||||
{
|
||||
MessageBox.Show("Can't apply settings in registry. (code 0x05)", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
@@ -302,7 +375,7 @@ namespace FileConverter
|
||||
Directory.CreateDirectory(path);
|
||||
}
|
||||
|
||||
path = Path.Combine(path, "Settings.xml");
|
||||
path = Path.Combine(path, "Settings.default.xml");
|
||||
return path;
|
||||
}
|
||||
|
||||
@@ -323,7 +396,7 @@ namespace FileConverter
|
||||
private static bool IsRegistryNeedModifications(Dictionary<string, List<string>> registryEntries)
|
||||
{
|
||||
// Compare to registry entries.
|
||||
RegistryKey registryKey = Registry.CurrentUser.OpenSubKey(@"Software\FileConverter");
|
||||
RegistryKey registryKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(@"Software\FileConverter");
|
||||
if (registryKey == null)
|
||||
{
|
||||
return true;
|
||||
@@ -410,7 +483,7 @@ namespace FileConverter
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
for (int index = 0; index < settings.conversionPresets.Count; index++)
|
||||
{
|
||||
ConversionPreset conversionPreset = settings.conversionPresets[index];
|
||||
|
||||
@@ -0,0 +1,506 @@
|
||||
<?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" SerializationVersion="1">
|
||||
<ExitApplicationWhenConversionsFinished>true</ExitApplicationWhenConversionsFinished>
|
||||
<DurationBetweenEndOfConversionsAndApplicationExit>3</DurationBetweenEndOfConversionsAndApplicationExit>
|
||||
<ConversionPreset Name="To Mkv" OutputType="Mkv" IsDefaultSettings="true">
|
||||
<InputTypes>3gp</InputTypes>
|
||||
<InputTypes>avi</InputTypes>
|
||||
<InputTypes>bik</InputTypes>
|
||||
<InputTypes>flv</InputTypes>
|
||||
<InputTypes>m4v</InputTypes>
|
||||
<InputTypes>mkv</InputTypes>
|
||||
<InputTypes>mov</InputTypes>
|
||||
<InputTypes>mp4</InputTypes>
|
||||
<InputTypes>mpeg</InputTypes>
|
||||
<InputTypes>ogv</InputTypes>
|
||||
<InputTypes>webm</InputTypes>
|
||||
<InputTypes>wmv</InputTypes>
|
||||
<InputTypes>gif</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="EnableAudio" Value="True" />
|
||||
<Settings Key="VideoQuality" Value="30" />
|
||||
<Settings Key="VideoEncodingSpeed" Value="Medium" />
|
||||
<Settings Key="VideoScale" Value="1" />
|
||||
<Settings Key="VideoRotation" Value="0" />
|
||||
<Settings Key="AudioBitrate" Value="155" />
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="To Mp4" OutputType="Mp4" IsDefaultSettings="true">
|
||||
<InputTypes>avi</InputTypes>
|
||||
<InputTypes>bik</InputTypes>
|
||||
<InputTypes>flv</InputTypes>
|
||||
<InputTypes>mkv</InputTypes>
|
||||
<InputTypes>mov</InputTypes>
|
||||
<InputTypes>mp4</InputTypes>
|
||||
<InputTypes>3gp</InputTypes>
|
||||
<InputTypes>webm</InputTypes>
|
||||
<InputTypes>wmv</InputTypes>
|
||||
<InputTypes>m4v</InputTypes>
|
||||
<InputTypes>mpeg</InputTypes>
|
||||
<InputTypes>ogv</InputTypes>
|
||||
<InputTypes>gif</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="EnableAudio" Value="True" />
|
||||
<Settings Key="VideoQuality" Value="30" />
|
||||
<Settings Key="VideoEncodingSpeed" Value="Medium" />
|
||||
<Settings Key="VideoScale" Value="1" />
|
||||
<Settings Key="VideoRotation" Value="0" />
|
||||
<Settings Key="AudioBitrate" Value="155" />
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="To Mp4 (low quality)" OutputType="Mp4" IsDefaultSettings="true">
|
||||
<InputTypes>3gp</InputTypes>
|
||||
<InputTypes>avi</InputTypes>
|
||||
<InputTypes>bik</InputTypes>
|
||||
<InputTypes>flv</InputTypes>
|
||||
<InputTypes>m4v</InputTypes>
|
||||
<InputTypes>mkv</InputTypes>
|
||||
<InputTypes>mov</InputTypes>
|
||||
<InputTypes>mp4</InputTypes>
|
||||
<InputTypes>mpeg</InputTypes>
|
||||
<InputTypes>ogv</InputTypes>
|
||||
<InputTypes>webm</InputTypes>
|
||||
<InputTypes>wmv</InputTypes>
|
||||
<InputTypes>gif</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="EnableAudio" Value="True" />
|
||||
<Settings Key="VideoQuality" Value="20" />
|
||||
<Settings Key="VideoEncodingSpeed" Value="Medium" />
|
||||
<Settings Key="VideoScale" Value="1" />
|
||||
<Settings Key="VideoRotation" Value="0" />
|
||||
<Settings Key="AudioBitrate" Value="96" />
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="To Mp4 (rotate left)" OutputType="Mp4" IsDefaultSettings="true">
|
||||
<InputTypes>gif</InputTypes>
|
||||
<InputTypes>3gp</InputTypes>
|
||||
<InputTypes>avi</InputTypes>
|
||||
<InputTypes>bik</InputTypes>
|
||||
<InputTypes>flv</InputTypes>
|
||||
<InputTypes>m4v</InputTypes>
|
||||
<InputTypes>mkv</InputTypes>
|
||||
<InputTypes>mov</InputTypes>
|
||||
<InputTypes>mp4</InputTypes>
|
||||
<InputTypes>mpeg</InputTypes>
|
||||
<InputTypes>ogv</InputTypes>
|
||||
<InputTypes>webm</InputTypes>
|
||||
<InputTypes>wmv</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="EnableAudio" Value="True" />
|
||||
<Settings Key="VideoQuality" Value="30" />
|
||||
<Settings Key="VideoEncodingSpeed" Value="Medium" />
|
||||
<Settings Key="VideoScale" Value="1" />
|
||||
<Settings Key="VideoRotation" Value="90" />
|
||||
<Settings Key="AudioBitrate" Value="155" />
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="To Mp4 (rotate right)" OutputType="Mp4" IsDefaultSettings="true">
|
||||
<InputTypes>avi</InputTypes>
|
||||
<InputTypes>bik</InputTypes>
|
||||
<InputTypes>flv</InputTypes>
|
||||
<InputTypes>mkv</InputTypes>
|
||||
<InputTypes>mov</InputTypes>
|
||||
<InputTypes>mp4</InputTypes>
|
||||
<InputTypes>3gp</InputTypes>
|
||||
<InputTypes>webm</InputTypes>
|
||||
<InputTypes>wmv</InputTypes>
|
||||
<InputTypes>m4v</InputTypes>
|
||||
<InputTypes>mpeg</InputTypes>
|
||||
<InputTypes>ogv</InputTypes>
|
||||
<InputTypes>gif</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="EnableAudio" Value="True" />
|
||||
<Settings Key="VideoQuality" Value="30" />
|
||||
<Settings Key="VideoEncodingSpeed" Value="Medium" />
|
||||
<Settings Key="VideoScale" Value="1" />
|
||||
<Settings Key="VideoRotation" Value="270" />
|
||||
<Settings Key="AudioBitrate" Value="155" />
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="To Webm" OutputType="Webm" IsDefaultSettings="true">
|
||||
<InputTypes>avi</InputTypes>
|
||||
<InputTypes>bik</InputTypes>
|
||||
<InputTypes>flv</InputTypes>
|
||||
<InputTypes>mkv</InputTypes>
|
||||
<InputTypes>mov</InputTypes>
|
||||
<InputTypes>mp4</InputTypes>
|
||||
<InputTypes>3gp</InputTypes>
|
||||
<InputTypes>webm</InputTypes>
|
||||
<InputTypes>wmv</InputTypes>
|
||||
<InputTypes>m4v</InputTypes>
|
||||
<InputTypes>mpeg</InputTypes>
|
||||
<InputTypes>ogv</InputTypes>
|
||||
<InputTypes>gif</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="EnableAudio" Value="True" />
|
||||
<Settings Key="AudioBitrate" Value="160" />
|
||||
<Settings Key="VideoQuality" Value="40" />
|
||||
<Settings Key="VideoScale" Value="1" />
|
||||
<Settings Key="VideoRotation" Value="0" />
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="To Avi" OutputType="Avi" IsDefaultSettings="true">
|
||||
<InputTypes>3gp</InputTypes>
|
||||
<InputTypes>avi</InputTypes>
|
||||
<InputTypes>bik</InputTypes>
|
||||
<InputTypes>flv</InputTypes>
|
||||
<InputTypes>m4v</InputTypes>
|
||||
<InputTypes>mkv</InputTypes>
|
||||
<InputTypes>mov</InputTypes>
|
||||
<InputTypes>mp4</InputTypes>
|
||||
<InputTypes>mpeg</InputTypes>
|
||||
<InputTypes>ogv</InputTypes>
|
||||
<InputTypes>webm</InputTypes>
|
||||
<InputTypes>wmv</InputTypes>
|
||||
<InputTypes>gif</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="EnableAudio" Value="True" />
|
||||
<Settings Key="VideoQuality" Value="27" />
|
||||
<Settings Key="VideoScale" Value="1" />
|
||||
<Settings Key="VideoRotation" Value="0" />
|
||||
<Settings Key="AudioBitrate" Value="190" />
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="To Gif" OutputType="Gif" IsDefaultSettings="true">
|
||||
<InputTypes>bmp</InputTypes>
|
||||
<InputTypes>exr</InputTypes>
|
||||
<InputTypes>ico</InputTypes>
|
||||
<InputTypes>jpg</InputTypes>
|
||||
<InputTypes>jpeg</InputTypes>
|
||||
<InputTypes>png</InputTypes>
|
||||
<InputTypes>psd</InputTypes>
|
||||
<InputTypes>svg</InputTypes>
|
||||
<InputTypes>tga</InputTypes>
|
||||
<InputTypes>tiff</InputTypes>
|
||||
<InputTypes>xcf</InputTypes>
|
||||
<InputTypes>3gp</InputTypes>
|
||||
<InputTypes>avi</InputTypes>
|
||||
<InputTypes>bik</InputTypes>
|
||||
<InputTypes>flv</InputTypes>
|
||||
<InputTypes>m4v</InputTypes>
|
||||
<InputTypes>mkv</InputTypes>
|
||||
<InputTypes>mov</InputTypes>
|
||||
<InputTypes>mp4</InputTypes>
|
||||
<InputTypes>mpeg</InputTypes>
|
||||
<InputTypes>ogv</InputTypes>
|
||||
<InputTypes>webm</InputTypes>
|
||||
<InputTypes>wmv</InputTypes>
|
||||
<InputTypes>gif</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="VideoScale" Value="1" />
|
||||
<Settings Key="VideoRotation" Value="0" />
|
||||
<Settings Key="VideoFramesPerSecond" Value="15" />
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="To Gif (low quality)" OutputType="Gif" IsDefaultSettings="true">
|
||||
<InputTypes>bmp</InputTypes>
|
||||
<InputTypes>exr</InputTypes>
|
||||
<InputTypes>ico</InputTypes>
|
||||
<InputTypes>jpg</InputTypes>
|
||||
<InputTypes>jpeg</InputTypes>
|
||||
<InputTypes>png</InputTypes>
|
||||
<InputTypes>psd</InputTypes>
|
||||
<InputTypes>svg</InputTypes>
|
||||
<InputTypes>tga</InputTypes>
|
||||
<InputTypes>tiff</InputTypes>
|
||||
<InputTypes>xcf</InputTypes>
|
||||
<InputTypes>3gp</InputTypes>
|
||||
<InputTypes>avi</InputTypes>
|
||||
<InputTypes>bik</InputTypes>
|
||||
<InputTypes>flv</InputTypes>
|
||||
<InputTypes>m4v</InputTypes>
|
||||
<InputTypes>mkv</InputTypes>
|
||||
<InputTypes>mov</InputTypes>
|
||||
<InputTypes>mp4</InputTypes>
|
||||
<InputTypes>mpeg</InputTypes>
|
||||
<InputTypes>ogv</InputTypes>
|
||||
<InputTypes>webm</InputTypes>
|
||||
<InputTypes>wmv</InputTypes>
|
||||
<InputTypes>gif</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="VideoScale" Value="0,75" />
|
||||
<Settings Key="VideoRotation" Value="0" />
|
||||
<Settings Key="VideoFramesPerSecond" Value="10" />
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="To Ogg" OutputType="Ogg" IsDefaultSettings="true">
|
||||
<InputTypes>aac</InputTypes>
|
||||
<InputTypes>aiff</InputTypes>
|
||||
<InputTypes>ape</InputTypes>
|
||||
<InputTypes>flac</InputTypes>
|
||||
<InputTypes>m4a</InputTypes>
|
||||
<InputTypes>mp3</InputTypes>
|
||||
<InputTypes>wma</InputTypes>
|
||||
<InputTypes>wav</InputTypes>
|
||||
<InputTypes>3gp</InputTypes>
|
||||
<InputTypes>avi</InputTypes>
|
||||
<InputTypes>bik</InputTypes>
|
||||
<InputTypes>flv</InputTypes>
|
||||
<InputTypes>m4v</InputTypes>
|
||||
<InputTypes>mkv</InputTypes>
|
||||
<InputTypes>mov</InputTypes>
|
||||
<InputTypes>mp4</InputTypes>
|
||||
<InputTypes>mpeg</InputTypes>
|
||||
<InputTypes>ogv</InputTypes>
|
||||
<InputTypes>webm</InputTypes>
|
||||
<InputTypes>wmv</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="AudioBitrate" Value="160" />
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="To Flac" OutputType="Flac" IsDefaultSettings="true">
|
||||
<InputTypes>wav</InputTypes>
|
||||
<InputTypes>ape</InputTypes>
|
||||
<InputTypes>wma</InputTypes>
|
||||
<InputTypes>aiff</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="To Wav" OutputType="Wav" IsDefaultSettings="true">
|
||||
<InputTypes>aac</InputTypes>
|
||||
<InputTypes>aiff</InputTypes>
|
||||
<InputTypes>ape</InputTypes>
|
||||
<InputTypes>flac</InputTypes>
|
||||
<InputTypes>m4a</InputTypes>
|
||||
<InputTypes>mp3</InputTypes>
|
||||
<InputTypes>ogg</InputTypes>
|
||||
<InputTypes>wma</InputTypes>
|
||||
<InputTypes>avi</InputTypes>
|
||||
<InputTypes>bik</InputTypes>
|
||||
<InputTypes>flv</InputTypes>
|
||||
<InputTypes>mkv</InputTypes>
|
||||
<InputTypes>mov</InputTypes>
|
||||
<InputTypes>mp4</InputTypes>
|
||||
<InputTypes>3gp</InputTypes>
|
||||
<InputTypes>webm</InputTypes>
|
||||
<InputTypes>wmv</InputTypes>
|
||||
<InputTypes>m4v</InputTypes>
|
||||
<InputTypes>oga</InputTypes>
|
||||
<InputTypes>ogv</InputTypes>
|
||||
<InputTypes>mpeg</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="AudioEncodingMode" Value="Wav16" />
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="To Mp3" OutputType="Mp3" IsDefaultSettings="true">
|
||||
<InputTypes>aac</InputTypes>
|
||||
<InputTypes>aiff</InputTypes>
|
||||
<InputTypes>ape</InputTypes>
|
||||
<InputTypes>flac</InputTypes>
|
||||
<InputTypes>m4a</InputTypes>
|
||||
<InputTypes>ogg</InputTypes>
|
||||
<InputTypes>wma</InputTypes>
|
||||
<InputTypes>avi</InputTypes>
|
||||
<InputTypes>bik</InputTypes>
|
||||
<InputTypes>flv</InputTypes>
|
||||
<InputTypes>mkv</InputTypes>
|
||||
<InputTypes>mov</InputTypes>
|
||||
<InputTypes>mp4</InputTypes>
|
||||
<InputTypes>wav</InputTypes>
|
||||
<InputTypes>3gp</InputTypes>
|
||||
<InputTypes>webm</InputTypes>
|
||||
<InputTypes>wmv</InputTypes>
|
||||
<InputTypes>m4v</InputTypes>
|
||||
<InputTypes>mpeg</InputTypes>
|
||||
<InputTypes>ogv</InputTypes>
|
||||
<InputTypes>oga</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="AudioEncodingMode" Value="Mp3VBR" />
|
||||
<Settings Key="AudioBitrate" Value="190" />
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="To Aac" OutputType="Aac" IsDefaultSettings="true">
|
||||
<InputTypes>aiff</InputTypes>
|
||||
<InputTypes>ape</InputTypes>
|
||||
<InputTypes>m4a</InputTypes>
|
||||
<InputTypes>mp3</InputTypes>
|
||||
<InputTypes>ogg</InputTypes>
|
||||
<InputTypes>wma</InputTypes>
|
||||
<InputTypes>avi</InputTypes>
|
||||
<InputTypes>bik</InputTypes>
|
||||
<InputTypes>flv</InputTypes>
|
||||
<InputTypes>mkv</InputTypes>
|
||||
<InputTypes>mov</InputTypes>
|
||||
<InputTypes>mp4</InputTypes>
|
||||
<InputTypes>wav</InputTypes>
|
||||
<InputTypes>flac</InputTypes>
|
||||
<InputTypes>3gp</InputTypes>
|
||||
<InputTypes>webm</InputTypes>
|
||||
<InputTypes>wmv</InputTypes>
|
||||
<InputTypes>m4v</InputTypes>
|
||||
<InputTypes>mpeg</InputTypes>
|
||||
<InputTypes>ogv</InputTypes>
|
||||
<InputTypes>oga</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="AudioBitrate" Value="128" />
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="Extract DVD to Mp4" OutputType="Mp4" IsDefaultSettings="true">
|
||||
<InputTypes>vob</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="EnableAudio" Value="True" />
|
||||
<Settings Key="VideoQuality" Value="30" />
|
||||
<Settings Key="VideoEncodingSpeed" Value="Medium" />
|
||||
<Settings Key="VideoScale" Value="1" />
|
||||
<Settings Key="VideoRotation" Value="0" />
|
||||
<Settings Key="AudioBitrate" Value="155" />
|
||||
<OutputFileNameTemplate>(p:v)DVD Extraction\(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="Extract DVD to Mkv" OutputType="Mkv" IsDefaultSettings="true">
|
||||
<InputTypes>vob</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="EnableAudio" Value="True" />
|
||||
<Settings Key="VideoQuality" Value="30" />
|
||||
<Settings Key="VideoEncodingSpeed" Value="Medium" />
|
||||
<Settings Key="VideoScale" Value="1" />
|
||||
<Settings Key="VideoRotation" Value="0" />
|
||||
<Settings Key="AudioBitrate" Value="155" />
|
||||
<OutputFileNameTemplate>(p:v)DVD Extraction\(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="Extract DVD to Flac" OutputType="Flac" IsDefaultSettings="true">
|
||||
<InputTypes>vob</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<OutputFileNameTemplate>(p:m)DVD Extraction\(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="Extract DVD to Ogg" OutputType="Ogg" IsDefaultSettings="true">
|
||||
<InputTypes>vob</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="AudioBitrate" Value="192" />
|
||||
<OutputFileNameTemplate>(p:m)DVD Extraction\(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="Extract DVD to Mp3" OutputType="Mp3" IsDefaultSettings="true">
|
||||
<InputTypes>vob</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="AudioEncodingMode" Value="Mp3VBR" />
|
||||
<Settings Key="AudioBitrate" Value="225" />
|
||||
<OutputFileNameTemplate>(p:m)DVD Extraction\(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="Extract CDA to Flac" OutputType="Flac" IsDefaultSettings="true">
|
||||
<InputTypes>cda</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<OutputFileNameTemplate>(p:m)CDA Extraction\(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="Extract CDA to Ogg" OutputType="Ogg" IsDefaultSettings="true">
|
||||
<InputTypes>cda</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="AudioBitrate" Value="192" />
|
||||
<OutputFileNameTemplate>(p:m)CDA Extraction\(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="Extract CDA to Mp3" OutputType="Mp3" IsDefaultSettings="true">
|
||||
<InputTypes>cda</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="AudioEncodingMode" Value="Mp3VBR" />
|
||||
<Settings Key="AudioBitrate" Value="225" />
|
||||
<OutputFileNameTemplate>(p:m)CDA Extraction\(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="To Png" OutputType="Png" IsDefaultSettings="true">
|
||||
<InputTypes>bmp</InputTypes>
|
||||
<InputTypes>exr</InputTypes>
|
||||
<InputTypes>ico</InputTypes>
|
||||
<InputTypes>jpg</InputTypes>
|
||||
<InputTypes>jpeg</InputTypes>
|
||||
<InputTypes>png</InputTypes>
|
||||
<InputTypes>psd</InputTypes>
|
||||
<InputTypes>svg</InputTypes>
|
||||
<InputTypes>tga</InputTypes>
|
||||
<InputTypes>tiff</InputTypes>
|
||||
<InputTypes>xcf</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="ImageScale" Value="1" />
|
||||
<Settings Key="ImageRotation" Value="0" />
|
||||
<Settings Key="ImageClampSizePowerOf2" Value="False" />
|
||||
<Settings Key="ImageMaximumSize" Value="0" />
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="To small Png (25%)" OutputType="Png" IsDefaultSettings="true">
|
||||
<InputTypes>bmp</InputTypes>
|
||||
<InputTypes>exr</InputTypes>
|
||||
<InputTypes>ico</InputTypes>
|
||||
<InputTypes>jpg</InputTypes>
|
||||
<InputTypes>jpeg</InputTypes>
|
||||
<InputTypes>png</InputTypes>
|
||||
<InputTypes>psd</InputTypes>
|
||||
<InputTypes>svg</InputTypes>
|
||||
<InputTypes>tga</InputTypes>
|
||||
<InputTypes>tiff</InputTypes>
|
||||
<InputTypes>xcf</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="ImageScale" Value="0,25" />
|
||||
<Settings Key="ImageRotation" Value="0" />
|
||||
<Settings Key="ImageClampSizePowerOf2" Value="False" />
|
||||
<Settings Key="ImageMaximumSize" Value="0" />
|
||||
<OutputFileNameTemplate>(p)(f)-small</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="To Png (rotate left)" OutputType="Png" IsDefaultSettings="true">
|
||||
<InputTypes>bmp</InputTypes>
|
||||
<InputTypes>exr</InputTypes>
|
||||
<InputTypes>ico</InputTypes>
|
||||
<InputTypes>jpg</InputTypes>
|
||||
<InputTypes>jpeg</InputTypes>
|
||||
<InputTypes>png</InputTypes>
|
||||
<InputTypes>psd</InputTypes>
|
||||
<InputTypes>svg</InputTypes>
|
||||
<InputTypes>tga</InputTypes>
|
||||
<InputTypes>tiff</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="ImageScale" Value="1" />
|
||||
<Settings Key="ImageRotation" Value="90" />
|
||||
<Settings Key="ImageClampSizePowerOf2" Value="False" />
|
||||
<Settings Key="ImageMaximumSize" Value="0" />
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="To Png (rotate right)" OutputType="Png" IsDefaultSettings="true">
|
||||
<InputTypes>bmp</InputTypes>
|
||||
<InputTypes>exr</InputTypes>
|
||||
<InputTypes>ico</InputTypes>
|
||||
<InputTypes>jpg</InputTypes>
|
||||
<InputTypes>jpeg</InputTypes>
|
||||
<InputTypes>png</InputTypes>
|
||||
<InputTypes>psd</InputTypes>
|
||||
<InputTypes>svg</InputTypes>
|
||||
<InputTypes>tga</InputTypes>
|
||||
<InputTypes>tiff</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="ImageScale" Value="1" />
|
||||
<Settings Key="ImageRotation" Value="270" />
|
||||
<Settings Key="ImageClampSizePowerOf2" Value="False" />
|
||||
<Settings Key="ImageMaximumSize" Value="0" />
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="To Jpg" OutputType="Jpg" IsDefaultSettings="true">
|
||||
<InputTypes>bmp</InputTypes>
|
||||
<InputTypes>exr</InputTypes>
|
||||
<InputTypes>ico</InputTypes>
|
||||
<InputTypes>jpg</InputTypes>
|
||||
<InputTypes>jpeg</InputTypes>
|
||||
<InputTypes>png</InputTypes>
|
||||
<InputTypes>psd</InputTypes>
|
||||
<InputTypes>svg</InputTypes>
|
||||
<InputTypes>tga</InputTypes>
|
||||
<InputTypes>tiff</InputTypes>
|
||||
<InputTypes>xcf</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="ImageQuality" Value="40" />
|
||||
<Settings Key="ImageScale" Value="1" />
|
||||
<Settings Key="ImageRotation" Value="0" />
|
||||
<Settings Key="ImageClampSizePowerOf2" Value="False" />
|
||||
<Settings Key="ImageMaximumSize" Value="0" />
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="To Ico" OutputType="Ico" IsDefaultSettings="true">
|
||||
<InputTypes>bmp</InputTypes>
|
||||
<InputTypes>exr</InputTypes>
|
||||
<InputTypes>ico</InputTypes>
|
||||
<InputTypes>jpg</InputTypes>
|
||||
<InputTypes>jpeg</InputTypes>
|
||||
<InputTypes>png</InputTypes>
|
||||
<InputTypes>psd</InputTypes>
|
||||
<InputTypes>svg</InputTypes>
|
||||
<InputTypes>tga</InputTypes>
|
||||
<InputTypes>tiff</InputTypes>
|
||||
<InputTypes>xcf</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<CheckUpgradeAtStartup>true</CheckUpgradeAtStartup>
|
||||
</Settings>
|
||||
@@ -1,164 +0,0 @@
|
||||
<?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" SerializationVersion="0">
|
||||
<ExitApplicationWhenConversionsFinished>true</ExitApplicationWhenConversionsFinished>
|
||||
<DurationBetweenEndOfConversionsAndApplicationExit>3</DurationBetweenEndOfConversionsAndApplicationExit>
|
||||
<ConversionPreset Name="To Mkv" OutputType="Mkv">
|
||||
<InputTypes>avi</InputTypes>
|
||||
<InputTypes>bik</InputTypes>
|
||||
<InputTypes>flv</InputTypes>
|
||||
<InputTypes>mkv</InputTypes>
|
||||
<InputTypes>mov</InputTypes>
|
||||
<InputTypes>mp4</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="VideoQuality" Value="30" />
|
||||
<Settings Key="VideoEncodingSpeed" Value="Very Slow" />
|
||||
<Settings Key="AudioBitrate" Value="155" />
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="To Mkv (low quality)" OutputType="Mkv">
|
||||
<InputTypes>avi</InputTypes>
|
||||
<InputTypes>bik</InputTypes>
|
||||
<InputTypes>flv</InputTypes>
|
||||
<InputTypes>mkv</InputTypes>
|
||||
<InputTypes>mov</InputTypes>
|
||||
<InputTypes>mp4</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="VideoQuality" Value="20" />
|
||||
<Settings Key="VideoEncodingSpeed" Value="Very Slow" />
|
||||
<Settings Key="AudioBitrate" Value="96" />
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="To Ogg" OutputType="Ogg">
|
||||
<InputTypes>aac</InputTypes>
|
||||
<InputTypes>aiff</InputTypes>
|
||||
<InputTypes>ape</InputTypes>
|
||||
<InputTypes>flac</InputTypes>
|
||||
<InputTypes>m4a</InputTypes>
|
||||
<InputTypes>mp3</InputTypes>
|
||||
<InputTypes>wma</InputTypes>
|
||||
<InputTypes>avi</InputTypes>
|
||||
<InputTypes>bik</InputTypes>
|
||||
<InputTypes>flv</InputTypes>
|
||||
<InputTypes>mkv</InputTypes>
|
||||
<InputTypes>mov</InputTypes>
|
||||
<InputTypes>mp4</InputTypes>
|
||||
<InputTypes>wav</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="AudioBitrate" Value="160" />
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="To Flac" OutputType="Flac">
|
||||
<InputTypes>avi</InputTypes>
|
||||
<InputTypes>bik</InputTypes>
|
||||
<InputTypes>flv</InputTypes>
|
||||
<InputTypes>mkv</InputTypes>
|
||||
<InputTypes>mov</InputTypes>
|
||||
<InputTypes>mp4</InputTypes>
|
||||
<InputTypes>wav</InputTypes>
|
||||
<InputTypes>ape</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="To Wav" OutputType="Wav">
|
||||
<InputTypes>aac</InputTypes>
|
||||
<InputTypes>aiff</InputTypes>
|
||||
<InputTypes>ape</InputTypes>
|
||||
<InputTypes>flac</InputTypes>
|
||||
<InputTypes>m4a</InputTypes>
|
||||
<InputTypes>mp3</InputTypes>
|
||||
<InputTypes>ogg</InputTypes>
|
||||
<InputTypes>wma</InputTypes>
|
||||
<InputTypes>avi</InputTypes>
|
||||
<InputTypes>bik</InputTypes>
|
||||
<InputTypes>flv</InputTypes>
|
||||
<InputTypes>mkv</InputTypes>
|
||||
<InputTypes>mov</InputTypes>
|
||||
<InputTypes>mp4</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="AudioEncodingMode" Value="Wav16" />
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="To Mp3" OutputType="Mp3">
|
||||
<InputTypes>aac</InputTypes>
|
||||
<InputTypes>aiff</InputTypes>
|
||||
<InputTypes>ape</InputTypes>
|
||||
<InputTypes>flac</InputTypes>
|
||||
<InputTypes>m4a</InputTypes>
|
||||
<InputTypes>ogg</InputTypes>
|
||||
<InputTypes>wma</InputTypes>
|
||||
<InputTypes>avi</InputTypes>
|
||||
<InputTypes>bik</InputTypes>
|
||||
<InputTypes>flv</InputTypes>
|
||||
<InputTypes>mkv</InputTypes>
|
||||
<InputTypes>mov</InputTypes>
|
||||
<InputTypes>mp4</InputTypes>
|
||||
<InputTypes>wav</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="AudioEncodingMode" Value="Mp3VBR" />
|
||||
<Settings Key="AudioBitrate" Value="190" />
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="To Aac" OutputType="Aac">
|
||||
<InputTypes>aiff</InputTypes>
|
||||
<InputTypes>ape</InputTypes>
|
||||
<InputTypes>m4a</InputTypes>
|
||||
<InputTypes>mp3</InputTypes>
|
||||
<InputTypes>ogg</InputTypes>
|
||||
<InputTypes>wma</InputTypes>
|
||||
<InputTypes>avi</InputTypes>
|
||||
<InputTypes>bik</InputTypes>
|
||||
<InputTypes>flv</InputTypes>
|
||||
<InputTypes>mkv</InputTypes>
|
||||
<InputTypes>mov</InputTypes>
|
||||
<InputTypes>mp4</InputTypes>
|
||||
<InputTypes>wav</InputTypes>
|
||||
<InputTypes>flac</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="Extract CDA to Flac" OutputType="Flac">
|
||||
<InputTypes>cda</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<OutputFileNameTemplate>(p:m)CDA Extraction\(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="Extract CDA to Ogg" OutputType="Ogg">
|
||||
<InputTypes>cda</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="AudioBitrate" Value="192" />
|
||||
<OutputFileNameTemplate>(p:m)CDA Extraction\(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="Extract CDA to Mp3" OutputType="Mp3">
|
||||
<InputTypes>cda</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="AudioEncodingMode" Value="Mp3VBR" />
|
||||
<Settings Key="AudioBitrate" Value="225" />
|
||||
<OutputFileNameTemplate>(p:m)CDA Extraction\(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="To Png" OutputType="Png">
|
||||
<InputTypes>bmp</InputTypes>
|
||||
<InputTypes>tiff</InputTypes>
|
||||
<InputTypes>ico</InputTypes>
|
||||
<InputTypes>jpg</InputTypes>
|
||||
<InputTypes>jpeg</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="To Jpg" OutputType="Jpg">
|
||||
<InputTypes>bmp</InputTypes>
|
||||
<InputTypes>png</InputTypes>
|
||||
<InputTypes>tiff</InputTypes>
|
||||
<InputTypes>ico</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="ImageQuality" Value="25" />
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="To Ico (max 256x256)" OutputType="Ico">
|
||||
<InputTypes>bmp</InputTypes>
|
||||
<InputTypes>jpg</InputTypes>
|
||||
<InputTypes>jpeg</InputTypes>
|
||||
<InputTypes>png</InputTypes>
|
||||
<InputTypes>tiff</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
</Settings>
|
||||
@@ -0,0 +1,130 @@
|
||||
// <copyright file="Helpers.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverter.Upgrade
|
||||
{
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
public static class Helpers
|
||||
{
|
||||
#if DEBUG
|
||||
private const string BaseURI = "https://raw.githubusercontent.com/Tichau/FileConverter/development/";
|
||||
#else
|
||||
private const string BaseURI = "https://raw.githubusercontent.com/Tichau/FileConverter/master/";
|
||||
#endif
|
||||
|
||||
private static WebClient webClient = new WebClient();
|
||||
|
||||
public delegate void OnUpgradeOperationCompletedEventHandler(UpgradeVersionDescription upgradeVersionDescription);
|
||||
|
||||
public static async Task<UpgradeVersionDescription> GetLatestVersionDescriptionAsync(OnUpgradeOperationCompletedEventHandler onGetCompleteDelegate = null)
|
||||
{
|
||||
Uri uri = new Uri(Helpers.BaseURI + "version.xml");
|
||||
Stream stream = await Helpers.webClient.OpenReadTaskAsync(uri);
|
||||
|
||||
UpgradeVersionDescription upgradeVersionDescription = null;
|
||||
try
|
||||
{
|
||||
XmlRootAttribute xmlRoot = new XmlRootAttribute
|
||||
{
|
||||
ElementName = "Version"
|
||||
};
|
||||
|
||||
XmlSerializer serializer = new XmlSerializer(typeof(UpgradeVersionDescription), xmlRoot);
|
||||
|
||||
XmlReaderSettings xmlReaderSettings = new XmlReaderSettings
|
||||
{
|
||||
IgnoreWhitespace = true,
|
||||
IgnoreComments = true
|
||||
};
|
||||
|
||||
using (XmlReader xmlReader = XmlReader.Create(stream, xmlReaderSettings))
|
||||
{
|
||||
upgradeVersionDescription = (UpgradeVersionDescription)serializer.Deserialize(xmlReader);
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
Diagnostics.Debug.LogError("Error while retrieving change log.");
|
||||
return null;
|
||||
}
|
||||
|
||||
onGetCompleteDelegate?.Invoke(upgradeVersionDescription);
|
||||
|
||||
return upgradeVersionDescription;
|
||||
}
|
||||
|
||||
public static async Task<string> GetChangeLogAsync(UpgradeVersionDescription upgradeVersionDescription, OnUpgradeOperationCompletedEventHandler onGetCompleteDelegate = null)
|
||||
{
|
||||
if (upgradeVersionDescription == null)
|
||||
{
|
||||
throw new ArgumentNullException("upgradeVersionDescription");
|
||||
}
|
||||
|
||||
Uri uri = new Uri(Helpers.BaseURI + "CHANGELOG.md");
|
||||
Stream stream = await Helpers.webClient.OpenReadTaskAsync(uri);
|
||||
try
|
||||
{
|
||||
using (StreamReader reader = new StreamReader(stream))
|
||||
{
|
||||
upgradeVersionDescription.ChangeLog = reader.ReadToEnd();
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
Diagnostics.Debug.LogError("Error while retrieving change log.");
|
||||
return null;
|
||||
}
|
||||
|
||||
onGetCompleteDelegate?.Invoke(upgradeVersionDescription);
|
||||
|
||||
return upgradeVersionDescription.ChangeLog;
|
||||
}
|
||||
|
||||
public static void DownloadInstallerAsync(UpgradeVersionDescription upgradeVersionDescription)
|
||||
{
|
||||
Thread thread = new Thread(Helpers.DownloadInstallerAsync);
|
||||
thread.Start(upgradeVersionDescription);
|
||||
}
|
||||
|
||||
private static void DownloadInstallerAsync(object parameter)
|
||||
{
|
||||
UpgradeVersionDescription upgradeVersionDescription = parameter as UpgradeVersionDescription;
|
||||
|
||||
if (upgradeVersionDescription == null)
|
||||
{
|
||||
throw new ArgumentNullException("upgradeVersionDescription");
|
||||
}
|
||||
|
||||
Uri uri = new Uri(upgradeVersionDescription.InstallerURL);
|
||||
|
||||
string fileName = "FileConverter-setup.msi";
|
||||
Regex retrieveFileNameRegex = new Regex("/([^/]*)");
|
||||
MatchCollection matchCollection = retrieveFileNameRegex.Matches(upgradeVersionDescription.InstallerURL);
|
||||
if (matchCollection.Count > 0)
|
||||
{
|
||||
Match match = matchCollection[matchCollection.Count - 1];
|
||||
if (match.Groups.Count > 1)
|
||||
{
|
||||
fileName = match.Groups[1].Value;
|
||||
}
|
||||
}
|
||||
|
||||
string tempPath = System.IO.Path.GetTempPath();
|
||||
string installerPath = System.IO.Path.Combine(tempPath, fileName);
|
||||
|
||||
upgradeVersionDescription.InstallerPath = installerPath;
|
||||
upgradeVersionDescription.InstallerDownloadInProgress = true;
|
||||
|
||||
Helpers.webClient.DownloadFile(uri, installerPath);
|
||||
|
||||
upgradeVersionDescription.InstallerDownloadInProgress = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
// <copyright file="UpgradeVersionDescription.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverter
|
||||
{
|
||||
using System.Xml.Serialization;
|
||||
|
||||
public class UpgradeVersionDescription
|
||||
{
|
||||
[XmlElement("Latest")]
|
||||
public Version LatestVersion
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
[XmlElement("URL")]
|
||||
public string InstallerURL
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
public string ChangeLog
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
public string InstallerPath
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
public bool InstallerDownloadInProgress
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
public bool NeedToUpgrade
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -41,8 +41,12 @@ namespace FileConverter.ValueConverters
|
||||
|
||||
string fileName = System.IO.Path.GetFileName(inputPathWithoutExtension);
|
||||
string parentDirectory = System.IO.Path.GetDirectoryName(inputPathWithoutExtension);
|
||||
string[] directories = parentDirectory.Split(System.IO.Path.DirectorySeparatorChar);
|
||||
parentDirectory += System.IO.Path.DirectorySeparatorChar;
|
||||
if (!parentDirectory.EndsWith(System.IO.Path.DirectorySeparatorChar.ToString()))
|
||||
{
|
||||
parentDirectory += System.IO.Path.DirectorySeparatorChar;
|
||||
}
|
||||
|
||||
string[] directories = parentDirectory.Substring(0, parentDirectory.Length - 1).Split(System.IO.Path.DirectorySeparatorChar);
|
||||
|
||||
// Generate output path from template.
|
||||
string outputPath = outputFileTemplate;
|
||||
@@ -62,19 +66,19 @@ namespace FileConverter.ValueConverters
|
||||
outputPath = outputPath.Replace("(i)", inputExtension);
|
||||
outputPath = outputPath.Replace("(I)", inputExtension.ToUpperInvariant());
|
||||
|
||||
string myDocumentsFolder = System.Environment.GetFolderPath((System.Environment.SpecialFolder.MyDocuments)) + "\\";
|
||||
string myDocumentsFolder = System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments) + "\\";
|
||||
outputPath = outputPath.Replace("(p:d)", myDocumentsFolder);
|
||||
outputPath = outputPath.Replace("(p:documents)", myDocumentsFolder);
|
||||
|
||||
string myMusicFolder = System.Environment.GetFolderPath((System.Environment.SpecialFolder.MyMusic)) + "\\";
|
||||
string myMusicFolder = System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyMusic) + "\\";
|
||||
outputPath = outputPath.Replace("(p:m)", myMusicFolder);
|
||||
outputPath = outputPath.Replace("(p:music)", myMusicFolder);
|
||||
|
||||
string myVideoFolder = System.Environment.GetFolderPath((System.Environment.SpecialFolder.MyVideos)) + "\\";
|
||||
string myVideoFolder = System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyVideos) + "\\";
|
||||
outputPath = outputPath.Replace("(p:v)", myVideoFolder);
|
||||
outputPath = outputPath.Replace("(p:videos)", myVideoFolder);
|
||||
|
||||
string myPictureFolder = System.Environment.GetFolderPath((System.Environment.SpecialFolder.MyPictures)) + "\\";
|
||||
string myPictureFolder = System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyPictures) + "\\";
|
||||
outputPath = outputPath.Replace("(p:p)", myPictureFolder);
|
||||
outputPath = outputPath.Replace("(p:pictures)", myPictureFolder);
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
// <copyright file="FormatStringConverter.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverter.ValueConverters.Generic
|
||||
{
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
|
||||
public class FormatStringConverter : IMultiValueConverter
|
||||
{
|
||||
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (values == null)
|
||||
{
|
||||
throw new ArgumentException("The values must not be null.");
|
||||
}
|
||||
|
||||
string format = parameter as string;
|
||||
if (format == null)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
return string.Format(format, values);
|
||||
}
|
||||
|
||||
public object[] ConvertBack(object value, Type[] targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
// <copyright file="ValueToString.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverter.ValueConverters.Generic
|
||||
{
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
|
||||
public class ValueToString : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
return value?.ToString();
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,14 +2,91 @@
|
||||
|
||||
namespace FileConverter
|
||||
{
|
||||
public struct Version
|
||||
using System.Xml.Serialization;
|
||||
|
||||
public struct Version : System.IComparable<Version>
|
||||
{
|
||||
[XmlAttribute]
|
||||
public int Major;
|
||||
|
||||
[XmlAttribute]
|
||||
public int Minor;
|
||||
|
||||
[XmlAttribute]
|
||||
public int Patch;
|
||||
|
||||
public static bool operator !=(Version a, Version b)
|
||||
{
|
||||
return a.CompareTo(b) != 0;
|
||||
}
|
||||
|
||||
public static bool operator ==(Version a, Version b)
|
||||
{
|
||||
return a.CompareTo(b) == 0;
|
||||
}
|
||||
|
||||
public static bool operator <=(Version a, Version b)
|
||||
{
|
||||
return a.CompareTo(b) <= 0;
|
||||
}
|
||||
|
||||
public static bool operator >=(Version a, Version b)
|
||||
{
|
||||
return a.CompareTo(b) >= 0;
|
||||
}
|
||||
|
||||
public static bool operator <(Version a, Version b)
|
||||
{
|
||||
return a.CompareTo(b) < 0;
|
||||
}
|
||||
|
||||
public static bool operator >(Version a, Version b)
|
||||
{
|
||||
return a.CompareTo(b) > 0;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("{0}.{1}", this.Major, this.Minor);
|
||||
if (this.Patch == 0)
|
||||
{
|
||||
return string.Format("{0}.{1}", this.Major, this.Minor);
|
||||
}
|
||||
|
||||
return string.Format("{0}.{1}.{2}", this.Major, this.Minor, this.Patch);
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (!(obj is Version))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Version other = (Version)obj;
|
||||
|
||||
return this.Major == other.Major && this.Minor == other.Minor && this.Patch == other.Patch;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
|
||||
public int CompareTo(Version other)
|
||||
{
|
||||
if (this.Major == other.Major && this.Minor == other.Minor && this.Patch == other.Patch)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (this.Major > other.Major ||
|
||||
(this.Major == other.Major && this.Minor > other.Minor) ||
|
||||
(this.Major == other.Major && this.Minor == other.Minor && this.Patch > other.Patch))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<Window x:Class="FileConverter.Windows.ApplicationStartHelp"
|
||||
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"
|
||||
xmlns:valueConverters="clr-namespace:FileConverter.ValueConverters"
|
||||
mc:Ignorable="d"
|
||||
Height="480" Width="640" Icon="/FileConverter;component/Resources/ApplicationIcon.ico" WindowStartupLocation="CenterScreen" WindowStyle="ToolWindow" ResizeMode="NoResize">
|
||||
<Window.Resources>
|
||||
</Window.Resources>
|
||||
<Window.Title>
|
||||
<Binding Converter="{StaticResource ApplicationVersionToApplicationName}" Mode="OneWay" Path="(fileConverter:Application.ApplicationVersion)"/>
|
||||
</Window.Title>
|
||||
<StackPanel Margin="5">
|
||||
<TextBlock Margin="0,0,0,4" Text="File Converter is a shell extension." TextWrapping="Wrap" FontWeight="Bold" FontSize="13.333"/>
|
||||
<TextBlock Text="That means it is integrated into the Windows explorer." TextWrapping="Wrap"/>
|
||||
<TextBlock Text="To use File Converter please open the explorer and right-click on any file you like to bring up the context menu where you will find File Converter commands (see the readme file to see the list of compatible file formats)." TextWrapping="Wrap" />
|
||||
<Image Margin="0,7,0,7" HorizontalAlignment="Left" Height="Auto" VerticalAlignment="Top" Width="Auto" Source="/FileConverter;component/Resources/ContextMenuScreenshot.png" Stretch="None"/>
|
||||
<Button Content="Ok" Height="28" Click="OkButton_Click"/>
|
||||
</StackPanel>
|
||||
</Window>
|
||||
@@ -0,0 +1,29 @@
|
||||
// <copyright file="ApplicationStartHelp.xaml.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverter.Windows
|
||||
{
|
||||
using System;
|
||||
using System.Windows;
|
||||
|
||||
public partial class ApplicationStartHelp : Window
|
||||
{
|
||||
public ApplicationStartHelp()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
}
|
||||
|
||||
public static FileConverter.Version ApplicationVersion
|
||||
{
|
||||
get
|
||||
{
|
||||
return FileConverter.Application.ApplicationVersion;
|
||||
}
|
||||
}
|
||||
|
||||
private void OkButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
Dispatcher.BeginInvoke((Action)(() => Application.Current.Shutdown()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,12 @@ namespace FileConverter.Windows
|
||||
set;
|
||||
}
|
||||
|
||||
public DataTemplate AviSettingsDataTemplate
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public DataTemplate WavSettingsDataTemplate
|
||||
{
|
||||
get;
|
||||
@@ -25,6 +31,12 @@ namespace FileConverter.Windows
|
||||
set;
|
||||
}
|
||||
|
||||
public DataTemplate Mp4SettingsDataTemplate
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public DataTemplate OggSettingsDataTemplate
|
||||
{
|
||||
get;
|
||||
@@ -37,11 +49,23 @@ namespace FileConverter.Windows
|
||||
set;
|
||||
}
|
||||
|
||||
public DataTemplate GifSettingsDataTemplate
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public DataTemplate JpgSettingsDataTemplate
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public DataTemplate PngSettingsDataTemplate
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public DataTemplate MkvSettingsDataTemplate
|
||||
{
|
||||
@@ -49,6 +73,12 @@ namespace FileConverter.Windows
|
||||
set;
|
||||
}
|
||||
|
||||
public DataTemplate WebmSettingsDataTemplate
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public override DataTemplate SelectTemplate(object item, DependencyObject container)
|
||||
{
|
||||
if (item == null)
|
||||
@@ -60,23 +90,38 @@ namespace FileConverter.Windows
|
||||
|
||||
switch (outputType)
|
||||
{
|
||||
case OutputType.Wav:
|
||||
return this.WavSettingsDataTemplate;
|
||||
|
||||
case OutputType.Mp3:
|
||||
return this.Mp3SettingsDataTemplate;
|
||||
|
||||
case OutputType.Ogg:
|
||||
return this.OggSettingsDataTemplate;
|
||||
|
||||
case OutputType.Aac:
|
||||
return this.AacSettingsDataTemplate;
|
||||
|
||||
case OutputType.Avi:
|
||||
return this.AviSettingsDataTemplate;
|
||||
|
||||
case OutputType.Gif:
|
||||
return this.GifSettingsDataTemplate;
|
||||
|
||||
case OutputType.Jpg:
|
||||
return this.JpgSettingsDataTemplate;
|
||||
|
||||
case OutputType.Mkv:
|
||||
return this.MkvSettingsDataTemplate;
|
||||
|
||||
case OutputType.Jpg:
|
||||
return this.JpgSettingsDataTemplate;
|
||||
case OutputType.Mp3:
|
||||
return this.Mp3SettingsDataTemplate;
|
||||
|
||||
case OutputType.Mp4:
|
||||
return this.Mp4SettingsDataTemplate;
|
||||
|
||||
case OutputType.Ogg:
|
||||
return this.OggSettingsDataTemplate;
|
||||
|
||||
case OutputType.Png:
|
||||
return this.PngSettingsDataTemplate;
|
||||
|
||||
case OutputType.Wav:
|
||||
return this.WavSettingsDataTemplate;
|
||||
|
||||
case OutputType.Webm:
|
||||
return this.WebmSettingsDataTemplate;
|
||||
}
|
||||
|
||||
return this.DefaultDataTemplate;
|
||||
|
||||
@@ -4,11 +4,19 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:FileConverter"
|
||||
xmlns:valueConverters="clr-namespace:FileConverter.ValueConverters"
|
||||
xmlns:conversionJobs="clr-namespace:FileConverter.ConversionJobs" mc:Ignorable="d" x:Class="FileConverter.MainWindow"
|
||||
x:Name="FileConverterMainWindow" Height="500" Width="950" MinHeight="250" MinWidth="450" WindowStartupLocation="CenterScreen" Icon="/FileConverter;component/Resources/ApplicationIcon.ico">
|
||||
xmlns:conversionJobs="clr-namespace:FileConverter.ConversionJobs"
|
||||
xmlns:generic="clr-namespace:FileConverter.ValueConverters.Generic"
|
||||
mc:Ignorable="d" x:Class="FileConverter.MainWindow"
|
||||
x:Name="FileConverterMainWindow" Height="500" Width="950" MinHeight="250" MinWidth="500" WindowStartupLocation="CenterScreen" Icon="/FileConverter;component/Resources/ApplicationIcon.ico">
|
||||
<Window.Resources>
|
||||
<valueConverters:ApplicationVersionToApplicationName x:Key="ApplicationVersionToApplicationName"/>
|
||||
<valueConverters:ConversionStateToBrush x:Key="ConversionStateToColor" />
|
||||
|
||||
<generic:ValueConverterGroup x:Key="EnumEqualsToVisibility">
|
||||
<generic:ValueToString/>
|
||||
<generic:EqualsConverter/>
|
||||
<!--<generic:BoolInverterConverter/>-->
|
||||
<generic:BoolToVisibility/>
|
||||
</generic:ValueConverterGroup>
|
||||
</Window.Resources>
|
||||
<Window.Title>
|
||||
<Binding Converter="{StaticResource ApplicationVersionToApplicationName}" Mode="OneWay" Path="(local:Application.ApplicationVersion)"/>
|
||||
@@ -27,7 +35,10 @@
|
||||
<ColumnDefinition Width="100" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Label x:Name="Title" Grid.Column="0" Content="Files to convert" VerticalAlignment="Top" Height="30" FontSize="16" FontWeight="Bold"/>
|
||||
<DockPanel Grid.Column="0">
|
||||
<Label Content="Files to convert" VerticalAlignment="Top" Height="30" FontSize="16" FontWeight="Bold"/>
|
||||
<Label Content="{Binding InformationMessage, ElementName=FileConverterMainWindow}" VerticalAlignment="Top" Height="30" FontSize="13.333" HorizontalAlignment="Right"/>
|
||||
</DockPanel>
|
||||
<Button x:Name="DiagnosticsButton" Grid.Column="1" Content="Logs" Margin="3,3" Click="DiagnosticsButton_OnClick"/>
|
||||
<Button x:Name="SettingsButton" Grid.Column="2" Content="Settings" Margin="3,3" Click="SettingsButton_OnClick"/>
|
||||
</Grid>
|
||||
@@ -36,8 +47,13 @@
|
||||
<ItemsControl x:Name="ConverterJobsList">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<DockPanel Background="{Binding State, ConverterParameter=Background, Converter={StaticResource ConversionStateToColor}}" Margin="0,4">
|
||||
<Grid Margin="10">
|
||||
<Grid Background="{Binding State, ConverterParameter=Background, Converter={StaticResource ConversionStateToColor}}" Margin="0,4">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="70"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Grid Margin="10" Grid.Column="0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="20" />
|
||||
<RowDefinition Height="Auto" />
|
||||
@@ -61,7 +77,15 @@
|
||||
|
||||
<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, ConverterParameter=Foreground, Converter={StaticResource ConversionStateToColor}}" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" MinWidth="100" LargeChange="0.1" />
|
||||
</Grid>
|
||||
</DockPanel>
|
||||
|
||||
<Button Margin="5" Grid.Column="1" Background="WhiteSmoke" Foreground="#FF3E3E3E" Visibility="{Binding State, Converter={StaticResource EnumEqualsToVisibility}, ConverterParameter=|InProgress|Collapsed}" Command="{Binding CancelCommand}" ToolTip="Cancel">
|
||||
<Button.Content>
|
||||
<Image Source="/FileConverter;component/Resources/CancelIcon.png" Width="48" Height="48" />
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Image Margin="5" Grid.Column="1" Source="/FileConverter;component/Resources/SuccessIcon.png" Width="48" Height="48" Visibility="{Binding State, Converter={StaticResource EnumEqualsToVisibility}, ConverterParameter=|Done|Collapsed}"/>
|
||||
<Image Margin="5" Grid.Column="1" Source="/FileConverter;component/Resources/FailIcon.png" Width="48" Height="48" Visibility="{Binding State, Converter={StaticResource EnumEqualsToVisibility}, ConverterParameter=|Failed|Collapsed}"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
<ItemsControl.DataContext>
|
||||
|
||||
@@ -13,6 +13,9 @@ namespace FileConverter
|
||||
{
|
||||
private DiagnosticsWindow diagnosticsWindow;
|
||||
private SettingsWindow settingsWindow;
|
||||
private UpgradeWindow upgradeWindow;
|
||||
|
||||
private string informationMessage;
|
||||
|
||||
public MainWindow()
|
||||
{
|
||||
@@ -20,7 +23,15 @@ namespace FileConverter
|
||||
|
||||
Application application = Application.Current as Application;
|
||||
|
||||
application.OnApplicationTerminate += this.Application_OnApplicationTerminate;
|
||||
|
||||
this.ConverterJobsList.ItemsSource = application.ConvertionJobs;
|
||||
|
||||
if (application.HideMainWindow)
|
||||
{
|
||||
this.Hide();
|
||||
}
|
||||
|
||||
if (application.Verbose)
|
||||
{
|
||||
this.ShowDiagnosticsWindow();
|
||||
@@ -28,15 +39,33 @@ namespace FileConverter
|
||||
|
||||
if (application.ShowSettings)
|
||||
{
|
||||
this.Hide();
|
||||
|
||||
this.ShowSettingsWindow();
|
||||
this.settingsWindow.OnSettingsWindowHide += this.SettingsWindow_Closed;
|
||||
}
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
|
||||
public string InformationMessage
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.informationMessage;
|
||||
}
|
||||
|
||||
private set
|
||||
{
|
||||
this.informationMessage = value;
|
||||
this.OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public void OnNewVersionReleased(UpgradeVersionDescription upgradeVersionDescription)
|
||||
{
|
||||
this.ShowUpgradeWindow();
|
||||
this.upgradeWindow.VersionDescription = upgradeVersionDescription;
|
||||
}
|
||||
|
||||
[NotifyPropertyChangedInvocator]
|
||||
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
|
||||
{
|
||||
@@ -94,5 +123,46 @@ namespace FileConverter
|
||||
application?.CancelAutoExit();
|
||||
this.settingsWindow.Show();
|
||||
}
|
||||
|
||||
private void ShowUpgradeWindow()
|
||||
{
|
||||
if (this.upgradeWindow != null && this.upgradeWindow.IsVisible)
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.upgradeWindow = new UpgradeWindow();
|
||||
}
|
||||
|
||||
Application application = Application.Current as Application;
|
||||
application?.CancelAutoExit();
|
||||
this.upgradeWindow.Show();
|
||||
}
|
||||
|
||||
private void Application_OnApplicationTerminate(object sender, ApplicationTerminateArgs eventArgs)
|
||||
{
|
||||
if (float.IsNaN(eventArgs.RemainingTimeBeforeTermination))
|
||||
{
|
||||
this.InformationMessage = string.Empty;
|
||||
return;
|
||||
}
|
||||
|
||||
int remaingingSeconds = (int)eventArgs.RemainingTimeBeforeTermination;
|
||||
|
||||
if (remaingingSeconds >= 2)
|
||||
{
|
||||
this.InformationMessage = string.Format("The application will automatically terminate in {0} seconds.", remaingingSeconds);
|
||||
}
|
||||
else if (remaingingSeconds == 1)
|
||||
{
|
||||
this.InformationMessage = string.Format("The application will automatically terminate in {0} second.", remaingingSeconds);
|
||||
}
|
||||
|
||||
if (remaingingSeconds <= 0)
|
||||
{
|
||||
this.InformationMessage = string.Format("The application is terminating.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,17 +6,89 @@
|
||||
xmlns:generic="clr-namespace:FileConverter.ValueConverters.Generic"
|
||||
xmlns:windows="clr-namespace:FileConverter.Windows"
|
||||
xmlns:project="clr-namespace:FileConverter.Properties"
|
||||
xmlns:System="clr-namespace:System;assembly=mscorlib" x:Name="window" x:Class="FileConverter.SettingsWindow"
|
||||
xmlns:System="clr-namespace:System;assembly=mscorlib"
|
||||
xmlns:xaml="clr-namespace:Markdown.Xaml;assembly=Markdown.Xaml"
|
||||
x:Name="window" x:Class="FileConverter.SettingsWindow"
|
||||
MinWidth="640" MinHeight="480"
|
||||
Width="800" Height="600"
|
||||
Width="900" Height="675"
|
||||
WindowStartupLocation="CenterScreen" Icon="/FileConverter;component/Resources/ApplicationIcon.ico"
|
||||
Closing="SettingsWindow_OnClosing">
|
||||
<Window.Resources>
|
||||
<!-- Donation button style -->
|
||||
|
||||
<Style x:Key="DonateFocusVisual">
|
||||
<Setter Property="Control.Background" Value="#037F4D"></Setter>
|
||||
<Setter Property="Control.Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type Control}">
|
||||
<Grid Margin="3 2">
|
||||
<Rectangle Name="r1" StrokeThickness="1" Stroke="Black" StrokeDashArray="2 2"/>
|
||||
<Border Name="border" Width="{TemplateBinding ActualWidth}" Height="{TemplateBinding ActualHeight}" CornerRadius="2" BorderThickness="1" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="ShadowStyle">
|
||||
<Setter Property="Control.Foreground" Value="LightGray" />
|
||||
</Style>
|
||||
|
||||
<Style x:Key="DonateButton" TargetType="Button">
|
||||
<Setter Property="OverridesDefaultStyle" Value="True"/>
|
||||
<Setter Property="FocusVisualStyle" Value="{StaticResource DonateFocusVisual}" />
|
||||
<Setter Property="Background" Value="#009E61"/>
|
||||
<Setter Property="Foreground" Value="WhiteSmoke"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Border Name="border" BorderThickness="1" Padding="4,2" BorderBrush="#026B38" CornerRadius="3" Background="{TemplateBinding Background}">
|
||||
<Grid>
|
||||
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" Name="contentShadow" Style="{StaticResource ShadowStyle}">
|
||||
<ContentPresenter.RenderTransform>
|
||||
<TranslateTransform X="1.0" Y="1.0" />
|
||||
</ContentPresenter.RenderTransform>
|
||||
</ContentPresenter>
|
||||
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" Name="content"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="border" Property="BorderBrush" Value="#015129" />
|
||||
<Setter Property="Foreground" Value="WhiteSmoke" />
|
||||
<Setter Property="Background" Value="#037F4D"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter TargetName="border" Property="BorderBrush" Value="#016332" />
|
||||
<Setter Property="Background" Value="#049156"/>
|
||||
<Setter TargetName="content" Property="RenderTransform" >
|
||||
<Setter.Value>
|
||||
<TranslateTransform Y="1.0" />
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Trigger>
|
||||
<Trigger Property="IsDefaulted" Value="True">
|
||||
<Setter TargetName="border" Property="BorderBrush" Value="#FF282828" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsFocused" Value="True">
|
||||
<Setter TargetName="border" Property="BorderBrush" Value="#FF282828" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter TargetName="border" Property="Opacity" Value="0.7" />
|
||||
<Setter Property="Foreground" Value="Gray" />
|
||||
</Trigger>
|
||||
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<generic:DoubleToTimeString x:Key="DoubleToTimeString"/>
|
||||
<valueConverters:FileNameConverter x:Key="FileNameConverter"/>
|
||||
<generic:BoolToVisibility x:Key="BoolToVisibility"/>
|
||||
<valueConverters:ApplicationVersionToApplicationName x:Key="ApplicationVersionToApplicationName"/>
|
||||
<generic:CollectionContainsElementToBool x:Key="CollectionContainsElementToBool"/>
|
||||
<generic:FormatStringConverter x:Key="FormatStringConverter"/>
|
||||
|
||||
<generic:ValueConverterGroup x:Key="ConversionSettingsToEnum">
|
||||
<valueConverters:ConversionSettingsToString/>
|
||||
@@ -99,7 +171,6 @@
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
|
||||
|
||||
<DataTemplate x:Key="AacSettingsDataTemplate">
|
||||
<StackPanel>
|
||||
<DockPanel>
|
||||
@@ -109,65 +180,360 @@
|
||||
</DockPanel>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate x:Key="GifSettingsDataTemplate">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<DataTemplate x:Key="MkvSettingsDataTemplate">
|
||||
<StackPanel>
|
||||
<DockPanel>
|
||||
<Label Content="Video" FontWeight="Bold" />
|
||||
<Label Content="(H.264)" FontWeight="Light" Foreground="#004B82" />
|
||||
</DockPanel>
|
||||
<DockPanel>
|
||||
<Label Content="Quality :" ToolTip="{x:Static project:Resources.VideoEncodingQualityTooltip}"/>
|
||||
<Slider x:Name="QualitySlider" Value="{Binding SelectedPreset.Settings, ConverterParameter=VideoQuality|System.Double, Converter={StaticResource ConversionSettingsToValueType}, ElementName=window, Mode=TwoWay}"
|
||||
Margin="0,2,0,0" VerticalAlignment="Top" AutoToolTipPlacement="TopLeft" IsSnapToTickEnabled="True" IsSelectionRangeEnabled="True" SelectionStart="20" SelectionEnd="33" Minimum="0" Maximum="51" TickPlacement="BottomRight" SmallChange="1" LargeChange="6" TickFrequency="1" Foreground="#004B82" />
|
||||
</DockPanel>
|
||||
<Label Content="Frames per second :" Grid.Row="0" Grid.Column="0" HorizontalContentAlignment="Right"/>
|
||||
<Slider x:Name="QualitySlider" Grid.Row="0" Grid.Column="1" Value="{Binding SelectedPreset.Settings, ConverterParameter=VideoFramesPerSecond|System.Int32, Converter={StaticResource ConversionSettingsToValueType}, ElementName=window, Mode=TwoWay}"
|
||||
Margin="0,2,0,0" VerticalAlignment="Top" AutoToolTipPlacement="TopLeft" IsSnapToTickEnabled="True" IsSelectionRangeEnabled="True" SelectionStart="10" SelectionEnd="20" Minimum="1" Maximum="30" TickPlacement="BottomRight" SmallChange="1" LargeChange="4" TickFrequency="1" Foreground="#004B82" />
|
||||
|
||||
<DockPanel>
|
||||
<Label Content="Encoding speed :" ToolTip="{x:Static project:Resources.VideoEncodingSpeedTooltip}" />
|
||||
<ComboBox SelectedValue="{Binding SelectedPreset.Settings, ConverterParameter=VideoEncodingSpeed|System.String, Converter={StaticResource ConversionSettingsToValueType}, ElementName=window, Mode=TwoWay, TargetNullValue=veryslow}">
|
||||
<System:String>Ultra Fast</System:String>
|
||||
<System:String>Super Fast</System:String>
|
||||
<System:String>Very Fast</System:String>
|
||||
<System:String>Faster</System:String>
|
||||
<System:String>Fast</System:String>
|
||||
<System:String>Medium</System:String>
|
||||
<System:String>Slow</System:String>
|
||||
<System:String>Slower</System:String>
|
||||
<System:String>Very Slow</System:String>
|
||||
</ComboBox>
|
||||
</DockPanel>
|
||||
<!-- Scale -->
|
||||
<Label Content="Scale :" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Right"/>
|
||||
<Grid Grid.Row="1" Grid.Column="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="60"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Slider x:Name="ScaleSlider" Grid.Column="0" Value="{Binding SelectedPreset.Settings, ConverterParameter=VideoScale|System.Double, Converter={StaticResource ConversionSettingsToValueType}, ElementName=window, Mode=TwoWay}" Margin="0,2,0,0" VerticalAlignment="Top" IsSnapToTickEnabled="True" Minimum="0.075" Maximum="2" SmallChange="0.075" LargeChange="0.25" TickPlacement="BottomRight" Ticks="0.075 0.125 0.25 0.5 0.75 1 1.25 1.5 1.75 2" Foreground="#004B82"/>
|
||||
<Label Grid.Column="1">
|
||||
<Label.Content>
|
||||
<MultiBinding Converter="{StaticResource FormatStringConverter}" Mode="OneWay">
|
||||
<MultiBinding.ConverterParameter>{0:P0}</MultiBinding.ConverterParameter>
|
||||
<Binding ElementName="ScaleSlider" Path="Value" Mode="OneWay"/>
|
||||
</MultiBinding>
|
||||
</Label.Content>
|
||||
</Label>
|
||||
</Grid>
|
||||
|
||||
<DockPanel>
|
||||
<Label Content="Audio" FontWeight="Bold" />
|
||||
<Label Content="(AAC)" FontWeight="Light" Foreground="#004B82" />
|
||||
</DockPanel>
|
||||
<DockPanel>
|
||||
<Label Content="Quality :" />
|
||||
<controls:EncodingQualitySliderControl x:Name="EncodingQualitySlider" EncodingMode="AacVBR"
|
||||
Bitrate="{Binding SelectedPreset.Settings, ConverterParameter=AudioBitrate|System.Double, Converter={StaticResource ConversionSettingsToValueType}, ElementName=window, Mode=TwoWay, TargetNullValue=128}" />
|
||||
</DockPanel>
|
||||
</StackPanel>
|
||||
<!--Rotate-->
|
||||
<Label Content="Rotate :" Grid.Row="2" Grid.Column="0" HorizontalAlignment="Right"/>
|
||||
<StackPanel Grid.Row="2" Grid.Column="1" Orientation="Horizontal">
|
||||
<RadioButton Content="None" IsChecked="{Binding SelectedPreset.Settings, ConverterParameter=VideoRotation|0, Converter={StaticResource ConversionSettingsEquals}, ElementName=window, Mode=TwoWay}" ToolTip="{x:Static project:Resources.ZeroDegreesRotationTooltip}" Margin="0,7,7,7"/>
|
||||
<RadioButton Content="90°" IsChecked="{Binding SelectedPreset.Settings, ConverterParameter=VideoRotation|90, Converter={StaticResource ConversionSettingsEquals}, ElementName=window, Mode=TwoWay}" ToolTip="{x:Static project:Resources.NinetyDegreesRotationTooltip}" Margin="7"/>
|
||||
<RadioButton Content="180°" IsChecked="{Binding SelectedPreset.Settings, ConverterParameter=VideoRotation|180, Converter={StaticResource ConversionSettingsEquals}, ElementName=window, Mode=TwoWay}" ToolTip="{x:Static project:Resources.OneEightyDegreesRotationTooltip}" Margin="7"/>
|
||||
<RadioButton Content="270°" IsChecked="{Binding SelectedPreset.Settings, ConverterParameter=VideoRotation|270, Converter={StaticResource ConversionSettingsEquals}, ElementName=window, Mode=TwoWay}" ToolTip="{x:Static project:Resources.TwoSeventyDegreesRotationTooltip}" Margin="7"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate x:Key="AviSettingsDataTemplate">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<DockPanel Grid.Row="0" Grid.Column="0">
|
||||
<Label Content="Video" FontWeight="Bold" Margin="17,0,0,0" />
|
||||
<Label Content="(Xvid)" FontWeight="Light" Foreground="#004B82" />
|
||||
</DockPanel>
|
||||
|
||||
<Label Content="Quality :" Grid.Row="1" Grid.Column="0" ToolTip="{x:Static project:Resources.VideoEncodingQualityTooltip}" HorizontalContentAlignment="Right"/>
|
||||
<Slider x:Name="QualitySlider" Grid.Row="1" Grid.Column="1" Value="{Binding SelectedPreset.Settings, ConverterParameter=VideoQuality|System.Double, Converter={StaticResource ConversionSettingsToValueType}, ElementName=window, Mode=TwoWay}"
|
||||
Margin="0,2,0,0" VerticalAlignment="Top" AutoToolTipPlacement="TopLeft" IsSnapToTickEnabled="True" IsSelectionRangeEnabled="True" SelectionStart="20" SelectionEnd="28" Minimum="0" Maximum="30" TickPlacement="BottomRight" SmallChange="1" LargeChange="5" TickFrequency="1" Foreground="#004B82" />
|
||||
|
||||
<!-- Scale -->
|
||||
<Label Content="Scale :" Grid.Row="2" Grid.Column="0" HorizontalAlignment="Right"/>
|
||||
<Grid Grid.Row="2" Grid.Column="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="60"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Slider x:Name="ScaleSlider" Grid.Column="0" Value="{Binding SelectedPreset.Settings, ConverterParameter=VideoScale|System.Double, Converter={StaticResource ConversionSettingsToValueType}, ElementName=window, Mode=TwoWay}" Margin="0,2,0,0" VerticalAlignment="Top" IsSnapToTickEnabled="True" Minimum="0.075" Maximum="2" SmallChange="0.075" LargeChange="0.25" TickPlacement="BottomRight" Ticks="0.075 0.125 0.25 0.5 0.75 1 1.25 1.5 1.75 2" Foreground="#004B82"/>
|
||||
<Label Grid.Column="1">
|
||||
<Label.Content>
|
||||
<MultiBinding Converter="{StaticResource FormatStringConverter}" Mode="OneWay">
|
||||
<MultiBinding.ConverterParameter>{0:P0}</MultiBinding.ConverterParameter>
|
||||
<Binding ElementName="ScaleSlider" Path="Value" Mode="OneWay"/>
|
||||
</MultiBinding>
|
||||
</Label.Content>
|
||||
</Label>
|
||||
</Grid>
|
||||
|
||||
<!--Rotate-->
|
||||
<Label Content="Rotate :" Grid.Row="3" Grid.Column="0" HorizontalAlignment="Right"/>
|
||||
<StackPanel Grid.Row="3" Grid.Column="1" Orientation="Horizontal">
|
||||
<RadioButton Content="None" IsChecked="{Binding SelectedPreset.Settings, ConverterParameter=VideoRotation|0, Converter={StaticResource ConversionSettingsEquals}, ElementName=window, Mode=TwoWay}" ToolTip="{x:Static project:Resources.ZeroDegreesRotationTooltip}" Margin="0,7,7,7"/>
|
||||
<RadioButton Content="90°" IsChecked="{Binding SelectedPreset.Settings, ConverterParameter=VideoRotation|90, Converter={StaticResource ConversionSettingsEquals}, ElementName=window, Mode=TwoWay}" ToolTip="{x:Static project:Resources.NinetyDegreesRotationTooltip}" Margin="7"/>
|
||||
<RadioButton Content="180°" IsChecked="{Binding SelectedPreset.Settings, ConverterParameter=VideoRotation|180, Converter={StaticResource ConversionSettingsEquals}, ElementName=window, Mode=TwoWay}" ToolTip="{x:Static project:Resources.OneEightyDegreesRotationTooltip}" Margin="7"/>
|
||||
<RadioButton Content="270°" IsChecked="{Binding SelectedPreset.Settings, ConverterParameter=VideoRotation|270, Converter={StaticResource ConversionSettingsEquals}, ElementName=window, Mode=TwoWay}" ToolTip="{x:Static project:Resources.TwoSeventyDegreesRotationTooltip}" Margin="7"/>
|
||||
</StackPanel>
|
||||
|
||||
<DockPanel Grid.Row="4" Grid.Column="0">
|
||||
<CheckBox IsChecked="{Binding SelectedPreset.Settings, ConverterParameter=EnableAudio|System.Boolean, Converter={StaticResource ConversionSettingsToValueType}, ElementName=window, Mode=TwoWay}" Margin="0,6,0,0" />
|
||||
<Label Content="Audio" FontWeight="Bold" IsEnabled="{Binding SelectedPreset.Settings, ConverterParameter=EnableAudio|System.Boolean, Converter={StaticResource ConversionSettingsToValueType}, ElementName=window, Mode=OneWay}"/>
|
||||
<Label Content="(Mp3)" FontWeight="Light" Foreground="#004B82" IsEnabled="{Binding SelectedPreset.Settings, ConverterParameter=EnableAudio|System.Boolean, Converter={StaticResource ConversionSettingsToValueType}, ElementName=window, Mode=OneWay}"/>
|
||||
</DockPanel>
|
||||
|
||||
<Label Content="Quality :" Grid.Row="5" Grid.Column="0" HorizontalContentAlignment="Right" IsEnabled="{Binding SelectedPreset.Settings, ConverterParameter=EnableAudio|System.Boolean, Converter={StaticResource ConversionSettingsToValueType}, ElementName=window, Mode=OneWay}"/>
|
||||
<controls:EncodingQualitySliderControl Grid.Row="5" Grid.Column="1" x:Name="EncodingQualitySlider" EncodingMode="Mp3VBR" IsEnabled="{Binding SelectedPreset.Settings, ConverterParameter=EnableAudio|System.Boolean, Converter={StaticResource ConversionSettingsToValueType}, ElementName=window, Mode=OneWay}"
|
||||
Bitrate="{Binding SelectedPreset.Settings, ConverterParameter=AudioBitrate|System.Double, Converter={StaticResource ConversionSettingsToValueType}, ElementName=window, Mode=TwoWay}" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate x:Key="MkvSettingsDataTemplate">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<DockPanel Grid.Row="0" Grid.Column="0">
|
||||
<Label Content="Video" FontWeight="Bold" Margin="17,0,0,0"/>
|
||||
<Label Content="(H.264)" FontWeight="Light" Foreground="#004B82" />
|
||||
</DockPanel>
|
||||
|
||||
<Label Content="Quality :" Grid.Row="1" Grid.Column="0" ToolTip="{x:Static project:Resources.VideoEncodingQualityTooltip}" HorizontalContentAlignment="Right"/>
|
||||
<Slider x:Name="QualitySlider" Grid.Row="1" Grid.Column="1" Value="{Binding SelectedPreset.Settings, ConverterParameter=VideoQuality|System.Double, Converter={StaticResource ConversionSettingsToValueType}, ElementName=window, Mode=TwoWay}"
|
||||
Margin="0,2,0,0" VerticalAlignment="Top" AutoToolTipPlacement="TopLeft" IsSnapToTickEnabled="True" IsSelectionRangeEnabled="True" SelectionStart="20" SelectionEnd="33" Minimum="0" Maximum="51" TickPlacement="BottomRight" SmallChange="1" LargeChange="6" TickFrequency="1" Foreground="#004B82" />
|
||||
|
||||
<Label Content="Encoding speed :" Grid.Row="2" Grid.Column="0" ToolTip="{x:Static project:Resources.VideoEncodingSpeedTooltip}" HorizontalContentAlignment="Right"/>
|
||||
<ComboBox Grid.Row="2" Grid.Column="1" SelectedValue="{Binding SelectedPreset.Settings, ConverterParameter=VideoEncodingSpeed|System.String, Converter={StaticResource ConversionSettingsToValueType}, ElementName=window, Mode=TwoWay, TargetNullValue=veryslow}">
|
||||
<System:String>Ultra Fast</System:String>
|
||||
<System:String>Super Fast</System:String>
|
||||
<System:String>Very Fast</System:String>
|
||||
<System:String>Faster</System:String>
|
||||
<System:String>Fast</System:String>
|
||||
<System:String>Medium</System:String>
|
||||
<System:String>Slow</System:String>
|
||||
<System:String>Slower</System:String>
|
||||
<System:String>Very Slow</System:String>
|
||||
</ComboBox>
|
||||
|
||||
<Label Content="Scale :" Grid.Row="3" Grid.Column="0" HorizontalAlignment="Right"/>
|
||||
<Grid Grid.Row="3" Grid.Column="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="60"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Slider x:Name="ScaleSlider" Grid.Column="0" Value="{Binding SelectedPreset.Settings, ConverterParameter=VideoScale|System.Double, Converter={StaticResource ConversionSettingsToValueType}, ElementName=window, Mode=TwoWay}" Margin="0,2,0,0" VerticalAlignment="Top" IsSnapToTickEnabled="True" Minimum="0.075" Maximum="2" SmallChange="0.075" LargeChange="0.25" TickPlacement="BottomRight" Ticks="0.075 0.125 0.25 0.5 0.75 1 1.25 1.5 1.75 2" Foreground="#004B82"/>
|
||||
<Label Grid.Column="1">
|
||||
<Label.Content>
|
||||
<MultiBinding Converter="{StaticResource FormatStringConverter}" Mode="OneWay">
|
||||
<MultiBinding.ConverterParameter>{0:P1}</MultiBinding.ConverterParameter>
|
||||
<Binding ElementName="ScaleSlider" Path="Value" Mode="OneWay"/>
|
||||
</MultiBinding>
|
||||
</Label.Content>
|
||||
</Label>
|
||||
</Grid>
|
||||
|
||||
<!--Rotate-->
|
||||
<Label Content="Rotate :" Grid.Row="4" Grid.Column="0" HorizontalAlignment="Right"/>
|
||||
<StackPanel Grid.Row="4" Grid.Column="1" Orientation="Horizontal">
|
||||
<RadioButton Content="None" IsChecked="{Binding SelectedPreset.Settings, ConverterParameter=VideoRotation|0, Converter={StaticResource ConversionSettingsEquals}, ElementName=window, Mode=TwoWay}" ToolTip="{x:Static project:Resources.ZeroDegreesRotationTooltip}" Margin="0,7,7,7"/>
|
||||
<RadioButton Content="90°" IsChecked="{Binding SelectedPreset.Settings, ConverterParameter=VideoRotation|90, Converter={StaticResource ConversionSettingsEquals}, ElementName=window, Mode=TwoWay}" ToolTip="{x:Static project:Resources.NinetyDegreesRotationTooltip}" Margin="7"/>
|
||||
<RadioButton Content="180°" IsChecked="{Binding SelectedPreset.Settings, ConverterParameter=VideoRotation|180, Converter={StaticResource ConversionSettingsEquals}, ElementName=window, Mode=TwoWay}" ToolTip="{x:Static project:Resources.OneEightyDegreesRotationTooltip}" Margin="7"/>
|
||||
<RadioButton Content="270°" IsChecked="{Binding SelectedPreset.Settings, ConverterParameter=VideoRotation|270, Converter={StaticResource ConversionSettingsEquals}, ElementName=window, Mode=TwoWay}" ToolTip="{x:Static project:Resources.TwoSeventyDegreesRotationTooltip}" Margin="7"/>
|
||||
</StackPanel>
|
||||
|
||||
<DockPanel Grid.Row="5" Grid.Column="0">
|
||||
<CheckBox IsChecked="{Binding SelectedPreset.Settings, ConverterParameter=EnableAudio|System.Boolean, Converter={StaticResource ConversionSettingsToValueType}, ElementName=window, Mode=TwoWay}" Margin="0,6,0,0" />
|
||||
<Label Content="Audio" FontWeight="Bold" IsEnabled="{Binding SelectedPreset.Settings, ConverterParameter=EnableAudio|System.Boolean, Converter={StaticResource ConversionSettingsToValueType}, ElementName=window, Mode=OneWay}"/>
|
||||
<Label Content="(AAC)" FontWeight="Light" Foreground="#004B82" IsEnabled="{Binding SelectedPreset.Settings, ConverterParameter=EnableAudio|System.Boolean, Converter={StaticResource ConversionSettingsToValueType}, ElementName=window, Mode=OneWay}"/>
|
||||
</DockPanel>
|
||||
|
||||
<Label Content="Quality :" Grid.Row="6" Grid.Column="0" HorizontalContentAlignment="Right" IsEnabled="{Binding SelectedPreset.Settings, ConverterParameter=EnableAudio|System.Boolean, Converter={StaticResource ConversionSettingsToValueType}, ElementName=window, Mode=OneWay}"/>
|
||||
<controls:EncodingQualitySliderControl Grid.Row="6" Grid.Column="1" x:Name="EncodingQualitySlider" EncodingMode="AacVBR" IsEnabled="{Binding SelectedPreset.Settings, ConverterParameter=EnableAudio|System.Boolean, Converter={StaticResource ConversionSettingsToValueType}, ElementName=window, Mode=OneWay}"
|
||||
Bitrate="{Binding SelectedPreset.Settings, ConverterParameter=AudioBitrate|System.Double, Converter={StaticResource ConversionSettingsToValueType}, ElementName=window, Mode=TwoWay, TargetNullValue=128}" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate x:Key="WebmSettingsDataTemplate">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<DockPanel Grid.Row="0" Grid.Column="0">
|
||||
<Label Content="Video" FontWeight="Bold" Margin="17,0,0,0" />
|
||||
<Label Content="(vp9)" FontWeight="Light" Foreground="#004B82" />
|
||||
</DockPanel>
|
||||
|
||||
<Label Content="Quality :" Grid.Row="1" Grid.Column="0" ToolTip="{x:Static project:Resources.VideoEncodingQualityTooltip}" HorizontalContentAlignment="Right"/>
|
||||
<Slider x:Name="QualitySlider" Grid.Row="1" Grid.Column="1" Value="{Binding SelectedPreset.Settings, ConverterParameter=VideoQuality|System.Double, Converter={StaticResource ConversionSettingsToValueType}, ElementName=window, Mode=TwoWay}"
|
||||
Margin="0,2,0,0" VerticalAlignment="Top" AutoToolTipPlacement="TopLeft" IsSnapToTickEnabled="True" IsSelectionRangeEnabled="True" SelectionStart="20" SelectionEnd="40" Minimum="0" Maximum="63" TickPlacement="BottomRight" SmallChange="1" LargeChange="5" TickFrequency="1" Foreground="#004B82" />
|
||||
|
||||
<!-- Scale -->
|
||||
<Label Content="Scale :" Grid.Row="2" Grid.Column="0" HorizontalAlignment="Right"/>
|
||||
<Grid Grid.Row="2" Grid.Column="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="60"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Slider x:Name="ScaleSlider" Grid.Column="0" Value="{Binding SelectedPreset.Settings, ConverterParameter=VideoScale|System.Double, Converter={StaticResource ConversionSettingsToValueType}, ElementName=window, Mode=TwoWay}" Margin="0,2,0,0" VerticalAlignment="Top" IsSnapToTickEnabled="True" Minimum="0.075" Maximum="2" SmallChange="0.075" LargeChange="0.25" TickPlacement="BottomRight" Ticks="0.075 0.125 0.25 0.5 0.75 1 1.25 1.5 1.75 2" Foreground="#004B82"/>
|
||||
<Label Grid.Column="1">
|
||||
<Label.Content>
|
||||
<MultiBinding Converter="{StaticResource FormatStringConverter}" Mode="OneWay">
|
||||
<MultiBinding.ConverterParameter>{0:P0}</MultiBinding.ConverterParameter>
|
||||
<Binding ElementName="ScaleSlider" Path="Value" Mode="OneWay"/>
|
||||
</MultiBinding>
|
||||
</Label.Content>
|
||||
</Label>
|
||||
</Grid>
|
||||
|
||||
<!--Rotate-->
|
||||
<Label Content="Rotate :" Grid.Row="3" Grid.Column="0" HorizontalAlignment="Right"/>
|
||||
<StackPanel Grid.Row="3" Grid.Column="1" Orientation="Horizontal">
|
||||
<RadioButton Content="None" IsChecked="{Binding SelectedPreset.Settings, ConverterParameter=VideoRotation|0, Converter={StaticResource ConversionSettingsEquals}, ElementName=window, Mode=TwoWay}" ToolTip="{x:Static project:Resources.ZeroDegreesRotationTooltip}" Margin="0,7,7,7"/>
|
||||
<RadioButton Content="90°" IsChecked="{Binding SelectedPreset.Settings, ConverterParameter=VideoRotation|90, Converter={StaticResource ConversionSettingsEquals}, ElementName=window, Mode=TwoWay}" ToolTip="{x:Static project:Resources.NinetyDegreesRotationTooltip}" Margin="7"/>
|
||||
<RadioButton Content="180°" IsChecked="{Binding SelectedPreset.Settings, ConverterParameter=VideoRotation|180, Converter={StaticResource ConversionSettingsEquals}, ElementName=window, Mode=TwoWay}" ToolTip="{x:Static project:Resources.OneEightyDegreesRotationTooltip}" Margin="7"/>
|
||||
<RadioButton Content="270°" IsChecked="{Binding SelectedPreset.Settings, ConverterParameter=VideoRotation|270, Converter={StaticResource ConversionSettingsEquals}, ElementName=window, Mode=TwoWay}" ToolTip="{x:Static project:Resources.TwoSeventyDegreesRotationTooltip}" Margin="7"/>
|
||||
</StackPanel>
|
||||
|
||||
<DockPanel Grid.Row="4" Grid.Column="0">
|
||||
<CheckBox IsChecked="{Binding SelectedPreset.Settings, ConverterParameter=EnableAudio|System.Boolean, Converter={StaticResource ConversionSettingsToValueType}, ElementName=window, Mode=TwoWay}" Margin="0,6,0,0" />
|
||||
<Label Content="Audio" FontWeight="Bold" IsEnabled="{Binding SelectedPreset.Settings, ConverterParameter=EnableAudio|System.Boolean, Converter={StaticResource ConversionSettingsToValueType}, ElementName=window, Mode=OneWay}"/>
|
||||
<Label Content="(Ogg vorbis)" FontWeight="Light" Foreground="#004B82" IsEnabled="{Binding SelectedPreset.Settings, ConverterParameter=EnableAudio|System.Boolean, Converter={StaticResource ConversionSettingsToValueType}, ElementName=window, Mode=OneWay}"/>
|
||||
</DockPanel>
|
||||
|
||||
<Label Content="Quality :" Grid.Row="5" Grid.Column="0" HorizontalContentAlignment="Right" IsEnabled="{Binding SelectedPreset.Settings, ConverterParameter=EnableAudio|System.Boolean, Converter={StaticResource ConversionSettingsToValueType}, ElementName=window, Mode=OneWay}"/>
|
||||
<controls:EncodingQualitySliderControl Grid.Row="5" Grid.Column="1" x:Name="EncodingQualitySlider" EncodingMode="OggVBR" IsEnabled="{Binding SelectedPreset.Settings, ConverterParameter=EnableAudio|System.Boolean, Converter={StaticResource ConversionSettingsToValueType}, ElementName=window, Mode=OneWay}"
|
||||
Bitrate="{Binding SelectedPreset.Settings, ConverterParameter=AudioBitrate|System.Double, Converter={StaticResource ConversionSettingsToValueType}, ElementName=window, Mode=TwoWay}" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate x:Key="JpgSettingsDataTemplate">
|
||||
<StackPanel>
|
||||
<DockPanel>
|
||||
<Label Content="Quality :" />
|
||||
<Slider x:Name="QualitySlider" Value="{Binding SelectedPreset.Settings, ConverterParameter=ImageQuality|System.Double, Converter={StaticResource ConversionSettingsToValueType}, ElementName=window, Mode=TwoWay, TargetNullValue=25}"
|
||||
Margin="0,2,0,0" VerticalAlignment="Top" AutoToolTipPlacement="TopLeft" IsSnapToTickEnabled="True" IsSelectionRangeEnabled="True" SelectionStart="20" SelectionEnd="30" Minimum="0" Maximum="30" TickPlacement="BottomRight" SmallChange="3" LargeChange="6" TickFrequency="1" Foreground="#004B82" />
|
||||
</DockPanel>
|
||||
</StackPanel>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<!--Quality-->
|
||||
<Label Content="Quality :" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Right"/>
|
||||
<Slider Grid.Row="0" Grid.Column="1" x:Name="QualitySlider" Value="{Binding SelectedPreset.Settings, ConverterParameter=ImageQuality|System.Double, Converter={StaticResource ConversionSettingsToValueType}, ElementName=window, Mode=TwoWay, TargetNullValue=25}"
|
||||
Margin="0,2,0,0" VerticalAlignment="Top" AutoToolTipPlacement="TopLeft" IsSnapToTickEnabled="True" IsSelectionRangeEnabled="True" SelectionStart="30" SelectionEnd="100" Minimum="0" Maximum="100" TickPlacement="BottomRight" SmallChange="5" LargeChange="15" TickFrequency="5" Foreground="#004B82" />
|
||||
<!--Scale-->
|
||||
<Label Content="Scale :" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Right"/>
|
||||
<Grid Grid.Row="1" Grid.Column="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="60"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Slider x:Name="ScaleSlider" Grid.Column="0" Value="{Binding SelectedPreset.Settings, ConverterParameter=ImageScale|System.Double, Converter={StaticResource ConversionSettingsToValueType}, ElementName=window, Mode=TwoWay}" Margin="0,2,0,0" VerticalAlignment="Top" IsSnapToTickEnabled="True" Minimum="0.075" Maximum="16" SmallChange="0.075" LargeChange="0.25" TickPlacement="BottomRight" Ticks="0.075 0.125 0.25 0.5 0.75 1 1.25 1.5 1.75 2 3 4 6 8 12 16" Foreground="#004B82"/>
|
||||
<Label Grid.Column="1">
|
||||
<Label.Content>
|
||||
<MultiBinding Converter="{StaticResource FormatStringConverter}" Mode="OneWay">
|
||||
<MultiBinding.ConverterParameter>{0:P1}</MultiBinding.ConverterParameter>
|
||||
<Binding ElementName="ScaleSlider" Path="Value" Mode="OneWay"/>
|
||||
</MultiBinding>
|
||||
</Label.Content>
|
||||
</Label>
|
||||
<CheckBox Grid.Row="1" Grid.Column="0" Content="Clamp to lowest power of 2 size" IsChecked="{Binding SelectedPreset.Settings, ConverterParameter=ImageClampSizePowerOf2|System.Boolean, Converter={StaticResource ConversionSettingsToValueType}, ElementName=window, Mode=TwoWay}" />
|
||||
</Grid>
|
||||
<!--Rotate-->
|
||||
<Label Content="Rotate :" Grid.Row="2" Grid.Column="0" HorizontalAlignment="Right"/>
|
||||
<StackPanel Grid.Row="2" Grid.Column="1" Orientation="Horizontal">
|
||||
<RadioButton Content="None" IsChecked="{Binding SelectedPreset.Settings, ConverterParameter=ImageRotation|0, Converter={StaticResource ConversionSettingsEquals}, ElementName=window, Mode=TwoWay}" ToolTip="{x:Static project:Resources.ZeroDegreesRotationTooltip}" Margin="0,7,7,7"/>
|
||||
<RadioButton Content="90°" IsChecked="{Binding SelectedPreset.Settings, ConverterParameter=ImageRotation|90, Converter={StaticResource ConversionSettingsEquals}, ElementName=window, Mode=TwoWay}" ToolTip="{x:Static project:Resources.NinetyDegreesRotationTooltip}" Margin="7"/>
|
||||
<RadioButton Content="180°" IsChecked="{Binding SelectedPreset.Settings, ConverterParameter=ImageRotation|180, Converter={StaticResource ConversionSettingsEquals}, ElementName=window, Mode=TwoWay}" ToolTip="{x:Static project:Resources.OneEightyDegreesRotationTooltip}" Margin="7"/>
|
||||
<RadioButton Content="270°" IsChecked="{Binding SelectedPreset.Settings, ConverterParameter=ImageRotation|270, Converter={StaticResource ConversionSettingsEquals}, ElementName=window, Mode=TwoWay}" ToolTip="{x:Static project:Resources.TwoSeventyDegreesRotationTooltip}" Margin="7"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate x:Key="PngSettingsDataTemplate">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<!--Scale-->
|
||||
<Label Content="Scale :" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Right"/>
|
||||
<Grid Grid.Row="0" Grid.Column="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="60"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Slider x:Name="ScaleSlider" Grid.Column="0" Value="{Binding SelectedPreset.Settings, ConverterParameter=ImageScale|System.Double, Converter={StaticResource ConversionSettingsToValueType}, ElementName=window, Mode=TwoWay}" Margin="0,2,0,0" VerticalAlignment="Top" IsSnapToTickEnabled="True" Minimum="0.075" Maximum="16" SmallChange="0.075" LargeChange="0.25" TickPlacement="BottomRight" Ticks="0.075 0.125 0.25 0.5 0.75 1 1.25 1.5 1.75 2 3 4 6 8 12 16" Foreground="#004B82"/>
|
||||
<Label Grid.Column="1">
|
||||
<Label.Content>
|
||||
<MultiBinding Converter="{StaticResource FormatStringConverter}" Mode="OneWay">
|
||||
<MultiBinding.ConverterParameter>{0:P1}</MultiBinding.ConverterParameter>
|
||||
<Binding ElementName="ScaleSlider" Path="Value" Mode="OneWay"/>
|
||||
</MultiBinding>
|
||||
</Label.Content>
|
||||
</Label>
|
||||
|
||||
<CheckBox Grid.Row="1" Grid.Column="0" Content="Clamp to lowest power of 2 size" Margin="5" IsChecked="{Binding SelectedPreset.Settings, ConverterParameter=ImageClampSizePowerOf2|System.Boolean, Converter={StaticResource ConversionSettingsToValueType}, ElementName=window, Mode=TwoWay}" />
|
||||
</Grid>
|
||||
<!--Rotate-->
|
||||
<Label Content="Rotate :" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Right"/>
|
||||
<StackPanel Grid.Row="1" Grid.Column="1" Orientation="Horizontal">
|
||||
<RadioButton Content="None" IsChecked="{Binding SelectedPreset.Settings, ConverterParameter=ImageRotation|0, Converter={StaticResource ConversionSettingsEquals}, ElementName=window, Mode=TwoWay}" ToolTip="{x:Static project:Resources.ZeroDegreesRotationTooltip}" Margin="0,7,7,7"/>
|
||||
<RadioButton Content="90°" IsChecked="{Binding SelectedPreset.Settings, ConverterParameter=ImageRotation|90, Converter={StaticResource ConversionSettingsEquals}, ElementName=window, Mode=TwoWay}" ToolTip="{x:Static project:Resources.NinetyDegreesRotationTooltip}" Margin="7"/>
|
||||
<RadioButton Content="180°" IsChecked="{Binding SelectedPreset.Settings, ConverterParameter=ImageRotation|180, Converter={StaticResource ConversionSettingsEquals}, ElementName=window, Mode=TwoWay}" ToolTip="{x:Static project:Resources.OneEightyDegreesRotationTooltip}" Margin="7"/>
|
||||
<RadioButton Content="270°" IsChecked="{Binding SelectedPreset.Settings, ConverterParameter=ImageRotation|270, Converter={StaticResource ConversionSettingsEquals}, ElementName=window, Mode=TwoWay}" ToolTip="{x:Static project:Resources.TwoSeventyDegreesRotationTooltip}" Margin="7"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
|
||||
<windows:ConversionSettingsTemplateSelector x:Key="ConversionSettingsSelector"
|
||||
DefaultDataTemplate="{StaticResource EmptyDataTemplate}"
|
||||
WavSettingsDataTemplate="{StaticResource WavSettingsDataTemplate}"
|
||||
Mp3SettingsDataTemplate="{StaticResource Mp3SettingsDataTemplate}"
|
||||
OggSettingsDataTemplate="{StaticResource OggSettingsDataTemplate}"
|
||||
MkvSettingsDataTemplate="{StaticResource MkvSettingsDataTemplate}"
|
||||
AacSettingsDataTemplate="{StaticResource AacSettingsDataTemplate}"
|
||||
JpgSettingsDataTemplate="{StaticResource JpgSettingsDataTemplate}" />
|
||||
AviSettingsDataTemplate="{StaticResource AviSettingsDataTemplate}"
|
||||
GifSettingsDataTemplate="{StaticResource GifSettingsDataTemplate}"
|
||||
JpgSettingsDataTemplate="{StaticResource JpgSettingsDataTemplate}"
|
||||
MkvSettingsDataTemplate="{StaticResource MkvSettingsDataTemplate}"
|
||||
Mp3SettingsDataTemplate="{StaticResource Mp3SettingsDataTemplate}"
|
||||
Mp4SettingsDataTemplate="{StaticResource MkvSettingsDataTemplate}"
|
||||
OggSettingsDataTemplate="{StaticResource OggSettingsDataTemplate}"
|
||||
PngSettingsDataTemplate="{StaticResource PngSettingsDataTemplate}"
|
||||
WavSettingsDataTemplate="{StaticResource WavSettingsDataTemplate}"
|
||||
WebmSettingsDataTemplate="{StaticResource WebmSettingsDataTemplate}" />
|
||||
</Window.Resources>
|
||||
<Window.Title>
|
||||
<Binding Converter="{StaticResource ApplicationVersionToApplicationName}" Mode="OneWay" Path="(local:Application.ApplicationVersion)"/>
|
||||
@@ -179,14 +545,13 @@
|
||||
</Grid.CommandBindings>
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="48"/>
|
||||
<RowDefinition Height="53"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="{Binding Height, ElementName=ApplicationSettingsPanel, Mode=OneWay}"/>
|
||||
<RowDefinition Height="28"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Header -->
|
||||
<Grid>
|
||||
<Grid Margin="0,0,0,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="48"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
@@ -201,158 +566,240 @@
|
||||
</Label.Content>
|
||||
</Label>
|
||||
</Grid>
|
||||
|
||||
<!-- Conversion presets settings -->
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="4*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Grid x:Name="PresetListGrid" Margin="5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="30"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="30"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Label Content="Presets" Grid.Row="0" VerticalAlignment="Top" HorizontalContentAlignment="Center" HorizontalAlignment="Left" Width="{Binding ActualWidth, ElementName=PresetListGrid, Mode=OneWay}" />
|
||||
<ListBox x:Name="PresetList" Grid.Row="1" HorizontalAlignment="Left" IsSynchronizedWithCurrentItem="True" SelectedItem="{Binding SelectedPreset, ElementName=window}" Width="{Binding ActualWidth, ElementName=PresetListGrid, Mode=OneWay}">
|
||||
<ListBox.DataContext>
|
||||
<local:ConversionPreset/>
|
||||
</ListBox.DataContext>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Label Content="{Binding Name}"/>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
|
||||
<DockPanel Grid.Row="2" Margin="0,5,0,0" HorizontalAlignment="Center">
|
||||
<Button x:Name="MoveUpPresetButton" Content="^" HorizontalAlignment="Left" Width="25" Margin="0,0,2,0" Click="MovePresetUpButton_Click"/>
|
||||
<Button x:Name="AddPresetButton" Content="+" HorizontalAlignment="Left" Width="25" Margin="2,0" Click="AddPresetButton_Click"/>
|
||||
<Button x:Name="RemovePresetButton" Content="-" HorizontalAlignment="Left" Width="25" Margin="2,0" Click="RemovePresetButton_Click"/>
|
||||
<Button x:Name="MoveDownPresetButton" Content="v" HorizontalAlignment="Left" Width="25" Margin="2,0,0,0" Click="MovePresetDownButton_Click"/>
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
|
||||
<!-- Preset settings -->
|
||||
<GroupBox Header="Preset" Margin="5,5,0,0" Grid.Column="1" Visibility="{Binding SelectedPreset, Converter={StaticResource ReferenceToVisibility}, ElementName=window}">
|
||||
<Grid Margin="5">
|
||||
|
||||
<TabControl Grid.Row="1">
|
||||
|
||||
<!-- Conversion presets settings -->
|
||||
<TabItem Header="Conversion Presets">
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" MaxWidth="240"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="3.5*"/>
|
||||
</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 x:Name="PresetNameTextBox" Grid.Row="0" Grid.Column="1" Margin="5,2,25,2" Text="{Binding SelectedPreset.Name, ElementName=window, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}" TextWrapping="Wrap" Width="Auto" />
|
||||
|
||||
<GroupBox Grid.Row="1" Grid.Column="0" Header="Input formats" Margin="5">
|
||||
<Grid x:Name="PresetListGrid" Margin="5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="30"/>
|
||||
</Grid.RowDefinitions>
|
||||
<ListBox x:Name="PresetList" Grid.Row="0" HorizontalAlignment="Left" IsSynchronizedWithCurrentItem="True" SelectedItem="{Binding SelectedPreset, ElementName=window}" Width="{Binding ActualWidth, ElementName=PresetListGrid, Mode=OneWay}">
|
||||
<ListBox.DataContext>
|
||||
<local:ConversionPreset/>
|
||||
</ListBox.DataContext>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Label Content="{Binding Name}"/>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
|
||||
<DockPanel Grid.Row="1" Margin="0,5,0,0" HorizontalAlignment="Center">
|
||||
<Button x:Name="MoveUpPresetButton" Content="^" HorizontalAlignment="Left" Width="25" Margin="0,0,2,0" Click="MovePresetUpButton_Click"/>
|
||||
<Button x:Name="AddPresetButton" Content="+" HorizontalAlignment="Left" Width="25" Margin="2,0" Click="AddPresetButton_Click"/>
|
||||
<Button x:Name="RemovePresetButton" Content="-" HorizontalAlignment="Left" Width="25" Margin="2,0" Click="RemovePresetButton_Click"/>
|
||||
<Button x:Name="MoveDownPresetButton" Content="v" HorizontalAlignment="Left" Width="25" Margin="2,0,0,0" Click="MovePresetDownButton_Click"/>
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
|
||||
<!-- Preset settings -->
|
||||
<GroupBox Header="Preset" Margin="5,5,0,0" Grid.Column="1" Visibility="{Binding SelectedPreset, Converter={StaticResource ReferenceToVisibility}, ElementName=window}">
|
||||
<Grid Margin="5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="*" MaxWidth="240"/>
|
||||
<ColumnDefinition Width="2.5*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="30"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="25"/>
|
||||
<RowDefinition Height="25"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Label Content="Preset name" Grid.Row="0" HorizontalContentAlignment="Right" Margin="0,0,5,0"/>
|
||||
<TextBox x:Name="PresetNameTextBox" Grid.Row="0" Grid.Column="1" Margin="5,2,25,2" Text="{Binding SelectedPreset.Name, ElementName=window, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}" TextWrapping="Wrap" Width="Auto" />
|
||||
|
||||
<TreeView x:Name="InputTypesTreeView" ItemsSource="{Binding InputCategories, ElementName=window}" >
|
||||
<TreeView.Resources>
|
||||
<HierarchicalDataTemplate DataType="{x:Type local:InputExtensionCategory}" ItemsSource="{Binding InputExtensions}">
|
||||
<CheckBox Content="{Binding Name}" Height="20" VerticalAlignment="Top" Margin="2" Checked="OnInputTypeCategoryChecked" Unchecked="OnInputTypeCategoryUnchecked" IsThreeState="True" >
|
||||
<CheckBox.IsChecked>
|
||||
<MultiBinding Converter="{StaticResource CollectionContainsElementToBool}" Mode="OneWay">
|
||||
<Binding ElementName="window" Path="SelectedPreset.InputTypes" Mode="OneWay"/>
|
||||
<Binding Path="InputExtensionNames" Mode="OneWay"/>
|
||||
</MultiBinding>
|
||||
</CheckBox.IsChecked>
|
||||
</CheckBox>
|
||||
</HierarchicalDataTemplate>
|
||||
<DataTemplate DataType="{x:Type local:InputExtension}">
|
||||
<CheckBox Content="{Binding Name}" Height="20" VerticalAlignment="Top" Margin="2" Checked="OnInputTypeChecked" Unchecked="OnInputTypeUnchecked">
|
||||
<CheckBox.IsChecked>
|
||||
<MultiBinding Converter="{StaticResource CollectionContainsElementToBool}" Mode="OneWay">
|
||||
<Binding ElementName="window" Path="SelectedPreset.InputTypes" Mode="OneWay"/>
|
||||
<Binding Path="Name" Mode="OneWay"/>
|
||||
</MultiBinding>
|
||||
</CheckBox.IsChecked>
|
||||
</CheckBox>
|
||||
</DataTemplate>
|
||||
</TreeView.Resources>
|
||||
<TreeView.ItemContainerStyle>
|
||||
<Style TargetType="TreeViewItem">
|
||||
<Setter Property="IsExpanded" Value="True"/>
|
||||
</Style>
|
||||
</TreeView.ItemContainerStyle>
|
||||
</TreeView>
|
||||
<GroupBox Grid.Row="1" Grid.Column="0" Header="Input formats" Margin="5">
|
||||
<Grid Margin="5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="25"/>
|
||||
<RowDefinition Height="25"/>
|
||||
<RowDefinition Height="22"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Label Grid.Row="1" Content="Action when conversion succeed"/>
|
||||
<ComboBox Grid.Row="2" x:Name="PostConversionActionComboBox" SelectedItem="{Binding SelectedPreset.InputPostConversionAction, ElementName=window, Mode=TwoWay}" />
|
||||
<TreeView x:Name="InputTypesTreeView" ItemsSource="{Binding InputCategories, ElementName=window}" >
|
||||
<TreeView.Resources>
|
||||
<HierarchicalDataTemplate DataType="{x:Type local:InputExtensionCategory}" ItemsSource="{Binding InputExtensions}">
|
||||
<CheckBox Content="{Binding Name}" Height="20" VerticalAlignment="Top" Margin="2" Checked="OnInputTypeCategoryChecked" Unchecked="OnInputTypeCategoryUnchecked" IsThreeState="True" >
|
||||
<CheckBox.IsChecked>
|
||||
<MultiBinding Converter="{StaticResource CollectionContainsElementToBool}" Mode="OneWay">
|
||||
<Binding ElementName="window" Path="SelectedPreset.InputTypes" Mode="OneWay"/>
|
||||
<Binding Path="InputExtensionNames" Mode="OneWay"/>
|
||||
</MultiBinding>
|
||||
</CheckBox.IsChecked>
|
||||
</CheckBox>
|
||||
</HierarchicalDataTemplate>
|
||||
<DataTemplate DataType="{x:Type local:InputExtension}">
|
||||
<CheckBox Content="{Binding Name}" Height="20" VerticalAlignment="Top" Margin="2" Checked="OnInputTypeChecked" Unchecked="OnInputTypeUnchecked">
|
||||
<CheckBox.IsChecked>
|
||||
<MultiBinding Converter="{StaticResource CollectionContainsElementToBool}" Mode="OneWay">
|
||||
<Binding ElementName="window" Path="SelectedPreset.InputTypes" Mode="OneWay"/>
|
||||
<Binding Path="Name" Mode="OneWay"/>
|
||||
</MultiBinding>
|
||||
</CheckBox.IsChecked>
|
||||
</CheckBox>
|
||||
</DataTemplate>
|
||||
</TreeView.Resources>
|
||||
<TreeView.ItemContainerStyle>
|
||||
<Style TargetType="TreeViewItem">
|
||||
<Setter Property="IsExpanded" Value="True"/>
|
||||
</Style>
|
||||
</TreeView.ItemContainerStyle>
|
||||
</TreeView>
|
||||
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
<Label Grid.Row="1" Content="Action when conversion succeed"/>
|
||||
<ComboBox Grid.Row="2" x:Name="PostConversionActionComboBox" SelectedItem="{Binding SelectedPreset.InputPostConversionAction, ElementName=window, Mode=TwoWay}" />
|
||||
|
||||
<GroupBox Header="Output format" Grid.Row="1" Grid.Column="1" Margin="5">
|
||||
<StackPanel>
|
||||
<ComboBox x:Name="OutputFormats" Margin="5" Height="25" VerticalAlignment="Top" SelectedItem="{Binding SelectedPreset.OutputType, ElementName=window, Mode=TwoWay}"/>
|
||||
<TextBlock Grid.Row="3" Margin="0,5,0,0">
|
||||
<Hyperlink CommandParameter="http://github.com/Tichau/FileConverter/wiki/Input-file-post-conversion-actions" Command="{Binding OpenUrlCommand, ElementName=window, Mode=OneWay}" Foreground="#1E6BB8">help ?</Hyperlink>
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
<ContentControl ContentTemplateSelector="{StaticResource ResourceKey=ConversionSettingsSelector}"
|
||||
<GroupBox Header="Output format" Grid.Row="1" Grid.Column="1" Margin="5">
|
||||
<StackPanel>
|
||||
<ComboBox x:Name="OutputFormats" Margin="5" Height="25" VerticalAlignment="Top" SelectedItem="{Binding SelectedPreset.OutputType, ElementName=window, Mode=TwoWay}"/>
|
||||
|
||||
<ContentControl ContentTemplateSelector="{StaticResource ResourceKey=ConversionSettingsSelector}"
|
||||
Content="{Binding SelectedPreset.OutputType, ElementName=window, UpdateSourceTrigger=PropertyChanged}" />
|
||||
|
||||
<Separator/>
|
||||
<Separator/>
|
||||
|
||||
<!-- Output file name template -->
|
||||
<Grid Margin="5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="30"/>
|
||||
<RowDefinition Height="23"/>
|
||||
<RowDefinition Height="23"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Label Content="File name template" Grid.Row="0" HorizontalContentAlignment="Right" Margin="0,0,5,0"/>
|
||||
<TextBox x:Name="FileNameTemplateTextBox" Grid.Row="0" Grid.Column="1" Margin="5,2,25,2" Text="{Binding SelectedPreset.OutputFileNameTemplate, ElementName=window, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}" TextWrapping="Wrap" Width="Auto" ToolTip="{x:Static project:Resources.OutputFilePathTemplateHelp}" />
|
||||
<Label Content="Input example" Grid.Row="1" Grid.Column="0" HorizontalContentAlignment="Right" Margin="0,0,5,0" Foreground="Gray" FontSize="10"/>
|
||||
<TextBlock Text="{x:Static project:Resources.OuputFileNameTemplateSample}" Grid.Row="1" Grid.Column="1" Margin="5,0,5,0" Foreground="Gray" FontSize="10" VerticalAlignment="Center"/>
|
||||
<Label Content="Output" Grid.Row="2" Grid.Column="0" HorizontalContentAlignment="Right" Margin="0,0,5,0" Foreground="Gray" FontSize="10"/>
|
||||
<TextBlock Grid.Row="2" Grid.Column="1" Margin="5,0,5,0" Foreground="Gray" FontSize="10" VerticalAlignment="Center">
|
||||
<TextBlock.Text>
|
||||
<MultiBinding Converter="{StaticResource FileNameConverter}">
|
||||
<Binding Source="{x:Static project:Resources.OuputFileNameTemplateSample}"/>
|
||||
<Binding ElementName="window" Path="SelectedPreset.OutputType" Mode="OneWay"/>
|
||||
<Binding ElementName="window" Path="SelectedPreset.OutputFileNameTemplate" Mode="OneWay"/>
|
||||
</MultiBinding>
|
||||
</TextBlock.Text>
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
<!-- Output file name template -->
|
||||
<Grid Margin="5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="30"/>
|
||||
<RowDefinition Height="23"/>
|
||||
<RowDefinition Height="23"/>
|
||||
<RowDefinition Height="23"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Label Content="File name template" Grid.Row="0" HorizontalContentAlignment="Right" Margin="0,0,5,0"/>
|
||||
<TextBox x:Name="FileNameTemplateTextBox" Grid.Row="0" Grid.Column="1" Margin="5,2,25,2" Text="{Binding SelectedPreset.OutputFileNameTemplate, ElementName=window, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}" TextWrapping="Wrap" Width="Auto" ToolTip="{x:Static project:Resources.OutputFilePathTemplateHelp}" />
|
||||
<Label Content="Input example" Grid.Row="1" Grid.Column="0" HorizontalContentAlignment="Right" Margin="0,0,5,0" Foreground="Gray" FontSize="10"/>
|
||||
<TextBlock Text="{x:Static project:Resources.OuputFileNameTemplateSample}" Grid.Row="1" Grid.Column="1" Margin="5,0,5,0" Foreground="Gray" FontSize="10" VerticalAlignment="Center"/>
|
||||
<Label Content="Output" Grid.Row="2" Grid.Column="0" HorizontalContentAlignment="Right" Margin="0,0,5,0" Foreground="Gray" FontSize="10"/>
|
||||
<TextBlock Grid.Row="2" Grid.Column="1" Margin="5,0,5,0" Foreground="Gray" FontSize="10" VerticalAlignment="Center">
|
||||
<TextBlock.Text>
|
||||
<MultiBinding Converter="{StaticResource FileNameConverter}">
|
||||
<Binding Source="{x:Static project:Resources.OuputFileNameTemplateSample}"/>
|
||||
<Binding ElementName="window" Path="SelectedPreset.OutputType" Mode="OneWay"/>
|
||||
<Binding ElementName="window" Path="SelectedPreset.OutputFileNameTemplate" Mode="OneWay"/>
|
||||
</MultiBinding>
|
||||
</TextBlock.Text>
|
||||
</TextBlock>
|
||||
<TextBlock Grid.Row="3" Grid.Column="1" Margin="5,0,5,0">
|
||||
<Hyperlink CommandParameter="http://github.com/Tichau/FileConverter/wiki/Output-file-path-template" Command="{Binding OpenUrlCommand, ElementName=window, Mode=OneWay}" Foreground="#1E6BB8">help ?</Hyperlink>
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</GroupBox>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
</Grid>
|
||||
</TabItem>
|
||||
|
||||
<!-- Application settings -->
|
||||
<StackPanel x:Name="ApplicationSettingsPanel" Grid.Row="2" Margin="5,10,5,5">
|
||||
<CheckBox x:Name="QuitAtEndCheckBox" Content="Automaticaly exit when all conversions finished" IsChecked="{Binding ApplicationSettings.ExitApplicationWhenConversionsFinished, ElementName=window, Mode=TwoWay}" />
|
||||
<DockPanel Margin="40,0,0,5" Visibility="{Binding IsChecked, Converter={StaticResource BoolToVisibility}, ConverterParameter=Collapsed, ElementName=QuitAtEndCheckBox}">
|
||||
<Label Content="Waiting duration :"/>
|
||||
<Slider x:Name="DurationBeforeQuitSlider" Value="{Binding ApplicationSettings.DurationBetweenEndOfConversionsAndApplicationExit, ElementName=window, Mode=TwoWay}" Minimum="0" Maximum="10" SmallChange="0.1" IsSnapToTickEnabled="True" Width="250" TickFrequency="0.1"/>
|
||||
<Label Content="{Binding Value, Converter={StaticResource DoubleToTimeString}, ElementName=DurationBeforeQuitSlider}"/>
|
||||
</DockPanel>
|
||||
</StackPanel>
|
||||
<!-- Application settings -->
|
||||
<TabItem Header="Application">
|
||||
<StackPanel Margin="5,10,5,5">
|
||||
<CheckBox x:Name="QuitAtEndCheckBox" Content="Automatically exit when all conversions finished" IsChecked="{Binding ApplicationSettings.ExitApplicationWhenConversionsFinished, ElementName=window, Mode=TwoWay}" Margin="0,0,0,5" />
|
||||
<DockPanel Margin="40,0,0,5" Visibility="{Binding IsChecked, Converter={StaticResource BoolToVisibility}, ConverterParameter=Collapsed, ElementName=QuitAtEndCheckBox}">
|
||||
<Label Content="Waiting duration :"/>
|
||||
<Slider x:Name="DurationBeforeQuitSlider" Value="{Binding ApplicationSettings.DurationBetweenEndOfConversionsAndApplicationExit, ElementName=window, Mode=TwoWay}" Minimum="0" Maximum="10" SmallChange="0.1" IsSnapToTickEnabled="True" Width="250" TickFrequency="0.1"/>
|
||||
<Label Content="{Binding Value, Converter={StaticResource DoubleToTimeString}, ElementName=DurationBeforeQuitSlider}"/>
|
||||
</DockPanel>
|
||||
<CheckBox Content="Automatically check for updates when File Converter starts" IsChecked="{Binding ApplicationSettings.CheckUpgradeAtStartup, ElementName=window, Mode=TwoWay}" />
|
||||
</StackPanel>
|
||||
</TabItem>
|
||||
|
||||
<!-- About -->
|
||||
<TabItem Header="About">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="256"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="50"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="35"/>
|
||||
<RowDefinition Height="30"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Button x:Name="CloseButton" Grid.Row="3" Content="Close" HorizontalAlignment="Right" Width="100" Margin="0,4,105,0" Click="CloseButton_Click" />
|
||||
<Button x:Name="SaveButton" Grid.Row="3" Content="Save" HorizontalAlignment="Right" Width="100" Margin="0,4,0,0" Click="SaveButton_Click" Command="New"/>
|
||||
<DockPanel Grid.Row="0" Grid.Column="0">
|
||||
<Label FontSize="28">
|
||||
<Label.Content>
|
||||
<Binding Path="(local:Application.ApplicationVersion)" Converter="{StaticResource ApplicationVersionToApplicationName}" Mode="OneWay" />
|
||||
</Label.Content>
|
||||
</Label>
|
||||
<TextBlock Margin="5" FontSize="16" HorizontalAlignment="Right" VerticalAlignment="Bottom" >
|
||||
<Hyperlink Foreground="#1E6BB8" Command="{Binding OpenUrlCommand, ElementName=window, Mode=OneWay}" CommandParameter="http://www.file-converter.org?from=about">www.file-converter.org</Hyperlink>
|
||||
</TextBlock>
|
||||
</DockPanel>
|
||||
<StackPanel Grid.Row="0" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,5,0,0">
|
||||
<Button ToolTip="Open GitHub project page" Background="WhiteSmoke" BorderBrush="DarkGray" Padding="1" Margin="5,0,5,0" Command="{Binding OpenUrlCommand, ElementName=window, Mode=OneWay}" CommandParameter="http://github.com/Tichau/FileConverter/?from=about">
|
||||
<Button.Content>
|
||||
<Image Source="/FileConverter;component/Resources/GitHub-Icon.png"></Image>
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button ToolTip="Report an issue" Background="WhiteSmoke" BorderBrush="DarkGray" Padding="1" Margin="5,0,5,0" Command="{Binding OpenUrlCommand, ElementName=window, Mode=OneWay}" CommandParameter="http://github.com/Tichau/FileConverter/issues?from=about">
|
||||
<Button.Content>
|
||||
<Image Source="/FileConverter;component/Resources/GitHub-Issue-Icon.png"></Image>
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button ToolTip="Open documentation" Background="WhiteSmoke" BorderBrush="DarkGray" Padding="1" Margin="5,0,5,0" Command="{Binding OpenUrlCommand, ElementName=window, Mode=OneWay}" CommandParameter="http://github.com/Tichau/FileConverter/wiki?from=about">
|
||||
<Button.Content>
|
||||
<Image Source="/FileConverter;component/Resources/GitHub-Documentation-Icon.png"></Image>
|
||||
</Button.Content>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
|
||||
<DockPanel Grid.Row="1" Grid.Column="0" Margin="0,0,5,0">
|
||||
<FlowDocumentScrollViewer Grid.Row="0" Grid.Column="0" Margin="5,10,5,10" HorizontalAlignment="Stretch" VerticalAlignment="Top" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled"
|
||||
Document="{Binding AboutSectionContent, Converter={StaticResource TextToFlowDocumentConverter}, ElementName=window}" DockPanel.Dock="Top"/>
|
||||
|
||||
<TextBlock Grid.Row="1" Margin="5" DockPanel.Dock="Top" FontSize="14" HorizontalAlignment="Center" Visibility="{Binding DisplaySeeChangeLogLink, ElementName=window, Mode=OneWay, Converter={StaticResource BoolToVisibility}}">
|
||||
<Hyperlink Foreground="#1E6BB8" Command="{Binding GetChangeLogContentCommand, ElementName=window, Mode=OneWay}">See change log ...</Hyperlink>
|
||||
</TextBlock>
|
||||
</DockPanel>
|
||||
|
||||
<Image Grid.Row="1" Grid.Column="1" Margin="0,5,0,5" Source="/FileConverter;component/Resources/ApplicationIcon.ico"></Image>
|
||||
|
||||
<StackPanel Grid.Row="2" Grid.Column="0" Orientation="Horizontal" HorizontalAlignment="Center">
|
||||
<Label Content="Don't forget to reward my work if you like it :)" VerticalAlignment="Center"/>
|
||||
<Button Style="{StaticResource DonateButton}" Margin="5,0,5,0" Command="{Binding OpenUrlCommand, ElementName=window, Mode=OneWay}" CommandParameter="http://pledgie.com/campaigns/31615?from=about">
|
||||
<Button.Content>
|
||||
<DockPanel>
|
||||
<Image Source="/FileConverter;component/Resources/Pledge-icon.png"></Image>
|
||||
<Label Margin="5,0,5,0" Content="Donate" Foreground="WhiteSmoke" FontWeight="Bold" FontSize="14"/>
|
||||
</DockPanel>
|
||||
</Button.Content>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
|
||||
<Label Grid.Row="3" Grid.Column="0" Content="Copyright @ 2016, Adrien Allard. All right reserved." Foreground="#FF4D4D4D" Margin="0,2,0,2"/>
|
||||
</Grid>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
|
||||
<Button x:Name="CloseButton" Grid.Row="2" Content="Close" HorizontalAlignment="Right" Width="100" Margin="0,4,105,0" Click="CloseButton_Click" />
|
||||
<Button x:Name="SaveButton" Grid.Row="2" Content="Save" HorizontalAlignment="Right" Width="100" Margin="0,4,0,0" Click="SaveButton_Click" Command="New"/>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -1,18 +1,19 @@
|
||||
// <copyright file="SettingsWindow.xaml.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
using System.Linq;
|
||||
|
||||
namespace FileConverter
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
|
||||
using FileConverter.Annotations;
|
||||
using FileConverter.Commands;
|
||||
using FileConverter.Upgrade;
|
||||
using Microsoft.Win32;
|
||||
|
||||
/// <summary>
|
||||
@@ -25,6 +26,11 @@ namespace FileConverter
|
||||
private Settings settings;
|
||||
|
||||
private InputExtensionCategory[] inputCategories;
|
||||
private string releaseNoteContent;
|
||||
|
||||
private OpenUrlCommand openUrlCommand;
|
||||
private DelegateCommand getChangeLogContentCommand;
|
||||
private bool displaySeeChangeLogLink = true;
|
||||
|
||||
public SettingsWindow()
|
||||
{
|
||||
@@ -38,13 +44,17 @@ namespace FileConverter
|
||||
{
|
||||
OutputType.Ogg,
|
||||
OutputType.Mp3,
|
||||
OutputType.Aac,
|
||||
OutputType.Aac,
|
||||
OutputType.Flac,
|
||||
OutputType.Wav,
|
||||
OutputType.Mkv,
|
||||
OutputType.Mp4,
|
||||
OutputType.Webm,
|
||||
OutputType.Avi,
|
||||
OutputType.Ico,
|
||||
OutputType.Jpg,
|
||||
OutputType.Png,
|
||||
OutputType.Gif,
|
||||
};
|
||||
|
||||
this.OutputFormats.ItemsSource = outputTypes;
|
||||
@@ -57,7 +67,7 @@ namespace FileConverter
|
||||
};
|
||||
|
||||
this.PostConversionActionComboBox.ItemsSource = postConversionActions;
|
||||
|
||||
|
||||
this.InitializeCompatibleInputExtensions();
|
||||
}
|
||||
|
||||
@@ -65,6 +75,32 @@ namespace FileConverter
|
||||
|
||||
public event System.EventHandler<System.EventArgs> OnSettingsWindowHide;
|
||||
|
||||
public ICommand OpenUrlCommand
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.openUrlCommand == null)
|
||||
{
|
||||
this.openUrlCommand = new OpenUrlCommand();
|
||||
}
|
||||
|
||||
return this.openUrlCommand;
|
||||
}
|
||||
}
|
||||
|
||||
public ICommand GetChangeLogContentCommand
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.getChangeLogContentCommand == null)
|
||||
{
|
||||
this.getChangeLogContentCommand = new DelegateCommand(this.DownloadChangeLogAction);
|
||||
}
|
||||
|
||||
return this.getChangeLogContentCommand;
|
||||
}
|
||||
}
|
||||
|
||||
public ConversionPreset SelectedPreset
|
||||
{
|
||||
get
|
||||
@@ -91,14 +127,6 @@ namespace FileConverter
|
||||
}
|
||||
}
|
||||
|
||||
private void SelectedPresetPropertyChanged(object sender, PropertyChangedEventArgs e)
|
||||
{
|
||||
if (e.PropertyName == "OutputType")
|
||||
{
|
||||
this.OnPropertyChanged("InputCategories");
|
||||
}
|
||||
}
|
||||
|
||||
public Settings ApplicationSettings
|
||||
{
|
||||
get
|
||||
@@ -133,12 +161,64 @@ namespace FileConverter
|
||||
}
|
||||
}
|
||||
|
||||
public string AboutSectionContent
|
||||
{
|
||||
get
|
||||
{
|
||||
return "**This program is free software**.\n You can redistribute it and/or modify it under the terms of the GNU General Public License.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. See the GNU General Public License (available in the installation folder: `LICENSE.md`) for more details.\n\n" + this.releaseNoteContent;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.releaseNoteContent = value;
|
||||
|
||||
this.OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public bool DisplaySeeChangeLogLink
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.displaySeeChangeLogLink;
|
||||
}
|
||||
|
||||
private set
|
||||
{
|
||||
this.displaySeeChangeLogLink = value;
|
||||
|
||||
this.OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
[NotifyPropertyChangedInvocator]
|
||||
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
|
||||
{
|
||||
this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
|
||||
private void DownloadChangeLogAction()
|
||||
{
|
||||
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
|
||||
Helpers.GetChangeLogAsync(new UpgradeVersionDescription(), this.OnChangeLogRetrieved);
|
||||
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
|
||||
this.AboutSectionContent = "###Downloading change log ...";
|
||||
this.DisplaySeeChangeLogLink = false;
|
||||
}
|
||||
|
||||
private void OnChangeLogRetrieved(UpgradeVersionDescription description)
|
||||
{
|
||||
this.AboutSectionContent = description.ChangeLog;
|
||||
}
|
||||
|
||||
private void SelectedPresetPropertyChanged(object sender, PropertyChangedEventArgs e)
|
||||
{
|
||||
if (e.PropertyName == "OutputType")
|
||||
{
|
||||
this.OnPropertyChanged("InputCategories");
|
||||
}
|
||||
}
|
||||
|
||||
private void OnInputTypeChecked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (this.selectedPreset == null)
|
||||
@@ -319,7 +399,7 @@ namespace FileConverter
|
||||
|
||||
private void InitializeCompatibleInputExtensions()
|
||||
{
|
||||
RegistryKey registryKey = Registry.CurrentUser.OpenSubKey(@"Software\FileConverter");
|
||||
RegistryKey registryKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(@"Software\FileConverter");
|
||||
if (registryKey == null)
|
||||
{
|
||||
MessageBox.Show("Can't retrieve the list of compatible input extensions. (code 0x09)", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
<Window x:Name="window" x:Class="FileConverter.Windows.UpgradeWindow"
|
||||
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"
|
||||
xmlns:valueConverters="clr-namespace:FileConverter.ValueConverters"
|
||||
xmlns:xaml="clr-namespace:Markdown.Xaml;assembly=Markdown.Xaml"
|
||||
mc:Ignorable="d"
|
||||
Title="File Converter Updates"
|
||||
WindowStartupLocation="CenterScreen" Icon="/FileConverter;component/Resources/ApplicationIcon.ico"
|
||||
MinHeight="300" MinWidth="450"
|
||||
Height="450" Width="450" WindowStyle="ToolWindow">
|
||||
<Window.Resources>
|
||||
</Window.Resources>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<!--<RowDefinition Height="{Binding Height, ElementName=ApplicationSettingsPanel, Mode=OneWay}"/>-->
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Margin="5"
|
||||
Text="An update for File Converter is available. It is strongly recommended that you install it as soon as possible!" TextWrapping="Wrap"/>
|
||||
|
||||
<!--<Label Grid.Row="1" Margin="5"
|
||||
Content="{Binding VersionDescription.LatestVersion, Converter={StaticResource ApplicationVersionToApplicationName}, ElementName=window}" FontWeight="Bold" FontSize="14.667"/>-->
|
||||
|
||||
<FlowDocumentScrollViewer Grid.Row="2" Margin="5" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
|
||||
Document="{Binding ReleaseNote, Converter={StaticResource TextToFlowDocumentConverter}, ElementName=window}"/>
|
||||
|
||||
<Button Background="WhiteSmoke" Grid.Row="3" Padding="10,5,10,5" Margin="5" HorizontalContentAlignment="Left" Click="OnInstallButtonClick" >
|
||||
<Button.Content>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="64"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Source="/FileConverter;component/Resources/DownloadIcon.png" Stretch="Fill"/>
|
||||
<Grid Grid.Column="1" Margin="10,0,0,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Label Grid.Row="0" Content="Install when I exit File Converter" FontSize="14.667"/>
|
||||
<TextBlock Grid.Row="1" Text="The update will be downloaded in background, and installed once you exit File Converter." TextWrapping="Wrap" FontSize="10.667"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Button.Content>
|
||||
</Button>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,80 @@
|
||||
// <copyright file="UpgradeWindow.xaml.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverter.Windows
|
||||
{
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
using FileConverter.Annotations;
|
||||
using FileConverter.Upgrade;
|
||||
|
||||
public partial class UpgradeWindow : Window, INotifyPropertyChanged
|
||||
{
|
||||
private UpgradeVersionDescription upgradeVersionDescription;
|
||||
private string releaseNoteContent;
|
||||
|
||||
public UpgradeWindow()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
public UpgradeVersionDescription VersionDescription
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.upgradeVersionDescription;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.upgradeVersionDescription = value;
|
||||
|
||||
Task<string> task = Helpers.GetChangeLogAsync(this.upgradeVersionDescription, this.OnChangeLogRetrieved);
|
||||
|
||||
this.OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public string ReleaseNote
|
||||
{
|
||||
get
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.releaseNoteContent))
|
||||
{
|
||||
return "###Downloading change log ...";
|
||||
}
|
||||
|
||||
return this.releaseNoteContent;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.releaseNoteContent = value;
|
||||
|
||||
this.OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
[NotifyPropertyChangedInvocator]
|
||||
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
|
||||
{
|
||||
this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
|
||||
private void OnChangeLogRetrieved(UpgradeVersionDescription versionDescription)
|
||||
{
|
||||
this.ReleaseNote = versionDescription.ChangeLog;
|
||||
}
|
||||
|
||||
private void OnInstallButtonClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.upgradeVersionDescription.NeedToUpgrade = true;
|
||||
Helpers.DownloadInstallerAsync(this.upgradeVersionDescription);
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -40,7 +40,7 @@ namespace FileConverter
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (System.Exception exception)
|
||||
catch (System.Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Magick.NET-Q16-AnyCPU" version="7.0.0.0101" targetFramework="net45" />
|
||||
</packages>
|
||||
@@ -133,7 +133,7 @@ namespace FileConverterExtension
|
||||
{
|
||||
ToolStripMenuItem subItem = new ToolStripMenuItem
|
||||
{
|
||||
Text = "Settings",
|
||||
Text = "Configure presets...",
|
||||
};
|
||||
|
||||
fileConverterItem.DropDownItems.Add(subItem);
|
||||
|
||||
@@ -46,8 +46,9 @@
|
||||
</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="SharpShell">
|
||||
<HintPath>..\..\Middleware\SharpShell\SharpShell.dll</HintPath>
|
||||
<Reference Include="SharpShell, Version=2.2.0.0, Culture=neutral, PublicKeyToken=f14dc899472fe6fb, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\SharpShell.2.2.0.0\lib\net40\SharpShell.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
@@ -63,7 +64,7 @@
|
||||
<Compile Include="FileConverterExtension.cs" />
|
||||
<Compile Include="PresetDefinition.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs">
|
||||
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
|
||||
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
@@ -82,6 +83,7 @@
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
<None Include="Resources\ApplicationIcon-16x16.ico" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
@@ -92,4 +94,4 @@
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
</Project>
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="SharpShell" version="2.2.0.0" targetFramework="net45" />
|
||||
</packages>
|
||||
@@ -1,5 +1,57 @@
|
||||
# Change Log
|
||||
|
||||
## Version 1.0
|
||||
- New: File Converter is now certified by Microsoft Authenticode.
|
||||
- New: Add an about section that contains information on the software development (change log, documentation link, report issue link).
|
||||
- New: Split conversion preset settings and application settings to improve ergonomy.
|
||||
- New: Add help shortcut in the conversion preset edition interface that links directly to the corresponding documentation page.
|
||||
- New: Add shortcuts in start menu.
|
||||
- New: Create a donation campaign on Pledgie and linked it in the about section.
|
||||
- Fixed: Issue with Avast antivirus where File Converter and Windows explorer was frozen when the user tried to use File Converter.
|
||||
- Fixed: Issue where it was impossible to convert files from a network path.
|
||||
|
||||
## Version 0.7
|
||||
- New: Possibility to encode videos using VP9 video codec and Ogg vorbis audio codec in a webm container.
|
||||
- New: Possibility to convert videos and images to gif.
|
||||
- New: Possibility to convert gif files to videos.
|
||||
- New: Possibility to remove audio from video files (mkv, mp4, avi and webm output file formats).
|
||||
- New: Add feedback to indicate that the application will automatically terminate (after conversions) (github issue #1).
|
||||
- New: Support new video input formats: ogv and mpeg.
|
||||
- New: Support new audio input format: oga.
|
||||
- New: Possibility to cancel some conversion jobs (gif/cda and image conversion jobs are not cancelable for now).
|
||||
- Fixed: Issue where video can't be compressed using H.264 codec (mp4 or mkv presets) when its size (width or height) is not divisible by 2 (append a lot when the user tries to scale a video) (github issue #2).
|
||||
- Fixed: Issue where "Clamp to power of 2 size" option didn't work well with images that already have a power of 2 size.
|
||||
- Fixed: Issue where conversion progress was not updated correctly (for converters based on ffmpeg).
|
||||
- Fixed: Issue where converting a video into the ogg format did not extract audio in an ogg file correctly.
|
||||
- Fixed: Issue where simultaneous read on the same CD drive was performed when files from differents conversions come from the same drive (other than cda extraction preset).
|
||||
- Fixed: Issue where the path generator was unable to create a valid path if the input file was at the root of a drive.
|
||||
- Tech: Annotate the conversion presets to know if there are default preset or user preset in order to improve the upgrade process.
|
||||
|
||||
## Version 0.6
|
||||
- New: Possibility to encode videos using H.264 video codec and AAC audio codec in a mp4 container (more portable than mkv).
|
||||
- New: Support new image input file formats: psd, tga, svg and exr.
|
||||
- New: Support new video input file format: m4v.
|
||||
- New: Possibility to rotate images and videos.
|
||||
- New: Remove restriction on image size to convert to ico file format (it is now possible to convert all images to ico).
|
||||
- New: Add "Clamp to power of 2 size" option in image conversion.
|
||||
- New: Support input images encoded in 16 bits or 32 bits per color channel.
|
||||
- Fixed: Issue where the installer detects the utilisation of the extension dll in explorer, ask the user to restart it and fail to do it.
|
||||
- Fixed: Issue where it is impossible to delete a conversion preset defined in default settings.
|
||||
- Fixed: Issue where the Windows context menu does not contain user preset after an application upgrade.
|
||||
- Fixed: Issue where some registry keys remain after file converter uninstallation.
|
||||
- Fixed: Issue where aac bitrate was not saved.
|
||||
- Fixed: Issue where settings serialization version was not updated.
|
||||
- Change: Allow the user to scale images until 1600% size (useful to scale pixel art images).
|
||||
|
||||
## Version 0.5
|
||||
- New: Software update system. The application now checks if a new version of File Converter is available.
|
||||
- New: Possibility to scale images and videos.
|
||||
- New: Possibility to encode videos (avi output file format) using Xvid video codec and Mp3 audio codec.
|
||||
- New: Support new video input file formats: 3gp, webm and wmv.
|
||||
- New: Add a help window to explain how file converter works when you launch it without using the context menu.
|
||||
- Fixed: Problem to convert images when accentuated characters were present in their path.
|
||||
- Tech: Update ffmpeg version (aac encoding is not anymore experimental).
|
||||
|
||||
## Version 0.4
|
||||
- New: Possibility to encode videos (mkv output file format) using H.264 video codec and AAC audio codec.
|
||||
- New: Possibility to extract Audio CD content.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.23107.0
|
||||
VisualStudioVersion = 14.0.25123.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FileConverter", "Application\FileConverter\FileConverter.csproj", "{D27A76D2-43E4-43CC-9DA3-334B0B46F4E5}"
|
||||
EndProject
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
<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>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_SIMPLE_ACCESSOR_ON_SINGLE_LINE/@EntryValue">False</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_LINES/@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>
|
||||
@@ -20,6 +21,42 @@
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=MethodPropertyEvent/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb_AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateInstanceFields/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticFields/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FCONSTRUCTOR/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FFUNCTION/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FGLOBAL_005FVARIABLE/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FLABEL/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FLOCAL_005FVARIABLE/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FOBJECT_005FPROPERTY_005FOF_005FFUNCTION/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FPARAMETER/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FCLASS/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FENUM/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FENUM_005FMEMBER/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FINTERFACE/@EntryIndexedValue"><Policy Inspect="True" Prefix="I" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FINTERFACE_005FFOR_005FJS_005FGLOBAL_005FVARIABLE/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FMODULE/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FMODULE_005FEXPORTED/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FMODULE_005FLOCAL/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FPRIVATE_005FMEMBER_005FACCESSOR/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FPRIVATE_005FSTATIC_005FTYPE_005FFIELD/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FPRIVATE_005FTYPE_005FFIELD/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FPRIVATE_005FTYPE_005FMETHOD/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FPROTECTED_005FMEMBER_005FACCESSOR/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FPROTECTED_005FSTATIC_005FTYPE_005FFIELD/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FPROTECTED_005FTYPE_005FFIELD/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FPROTECTED_005FTYPE_005FMETHOD/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FPUBLIC_005FMEMBER_005FACCESSOR/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FPUBLIC_005FSTATIC_005FTYPE_005FFIELD/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FPUBLIC_005FTYPE_005FFIELD/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FPUBLIC_005FTYPE_005FMETHOD/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FTYPE_005FPARAMETER/@EntryIndexedValue"><Policy Inspect="True" Prefix="T" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/WebNaming/UserRules/=ASP_005FFIELD/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/WebNaming/UserRules/=ASP_005FHTML_005FCONTROL/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/WebNaming/UserRules/=ASP_005FTAG_005FNAME/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/WebNaming/UserRules/=ASP_005FTAG_005FPREFIX/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/UserRules/=NAMESPACE_005FALIAS/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/UserRules/=XAML_005FFIELD/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/UserRules/=XAML_005FRESOURCE/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EAddAccessorOwnerDeclarationBracesMigration/@EntryIndexedValue">True</s:Boolean>
|
||||
<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>
|
||||
<s:Boolean x:Key="/Default/Environment/UpdatesManger/IsDownloadUpdateDataAllowed/@EntryValue">False</s:Boolean></wpf:ResourceDictionary>
|
||||
@@ -1,30 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<?if $(var.Platform) = x64 ?>
|
||||
<?define Win64 = "yes" ?>
|
||||
<?else ?>
|
||||
<?define Win64 = "no" ?>
|
||||
<?endif ?>
|
||||
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Fragment>
|
||||
<DirectoryRef Id="INSTALLFOLDER">
|
||||
<Component Id="FileConverterExtension.dll" Guid="{FEF385C4-C43F-44F9-92E2-06578A8BD96E}" Win64="$(var.Win64)">
|
||||
<Class Id="{AF9B72B5-F4E4-44B0-A3D9-B55B748EFE90}" Context="InprocServer32" Description="FileConverterExtension.FileConverterExtension" ThreadingModel="both" ForeignServer="mscoree.dll">
|
||||
<ProgId Id="FileConverterExtension.FileConverterExtension" Description="FileConverterExtension.FileConverterExtension" />
|
||||
</Class>
|
||||
<File Id="FileConverterExtension.dll" KeyPath="yes" Source="..\Application\FileConverterExtension\bin\$(var.Configuration)\FileConverterExtension.dll" />
|
||||
<RegistryValue Root="HKCR" Key="*\shellex\ContextMenuHandlers\FileConverterExtension" Value="{af9b72b5-f4e4-44b0-a3d9-b55b748efe90}" Type="string" Action="write" />
|
||||
<RegistryValue Root="HKCR" Key="CLSID\{AF9B72B5-F4E4-44B0-A3D9-B55B748EFE90}\Implemented Categories\{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}" Value="" Type="string" Action="write" />
|
||||
<RegistryValue Root="HKCR" Key="CLSID\{AF9B72B5-F4E4-44B0-A3D9-B55B748EFE90}\InprocServer32\1.0.0.0" Name="Class" Value="FileConverterExtension.FileConverterExtension" Type="string" Action="write" />
|
||||
<RegistryValue Root="HKCR" Key="CLSID\{AF9B72B5-F4E4-44B0-A3D9-B55B748EFE90}\InprocServer32\1.0.0.0" Name="Assembly" Value="FileConverterExtension, Version=1.0.0.0, Culture=neutral, PublicKeyToken=15400b1c4b948c8a" Type="string" Action="write" />
|
||||
<RegistryValue Root="HKCR" Key="CLSID\{AF9B72B5-F4E4-44B0-A3D9-B55B748EFE90}\InprocServer32\1.0.0.0" Name="RuntimeVersion" Value="v4.0.30319" Type="string" Action="write" />
|
||||
<RegistryValue Root="HKCR" Key="CLSID\{AF9B72B5-F4E4-44B0-A3D9-B55B748EFE90}\InprocServer32\1.0.0.0" Name="CodeBase" Value="file:///[#FileConverterExtension.dll]" Type="string" Action="write" />
|
||||
<RegistryValue Root="HKCR" Key="CLSID\{AF9B72B5-F4E4-44B0-A3D9-B55B748EFE90}\InprocServer32" Name="Class" Value="FileConverterExtension.FileConverterExtension" Type="string" Action="write" />
|
||||
<RegistryValue Root="HKCR" Key="CLSID\{AF9B72B5-F4E4-44B0-A3D9-B55B748EFE90}\InprocServer32" Name="Assembly" Value="FileConverterExtension, Version=1.0.0.0, Culture=neutral, PublicKeyToken=15400b1c4b948c8a" Type="string" Action="write" />
|
||||
<RegistryValue Root="HKCR" Key="CLSID\{AF9B72B5-F4E4-44B0-A3D9-B55B748EFE90}\InprocServer32" Name="RuntimeVersion" Value="v4.0.30319" Type="string" Action="write" />
|
||||
<RegistryValue Root="HKCR" Key="CLSID\{AF9B72B5-F4E4-44B0-A3D9-B55B748EFE90}\InprocServer32" Name="CodeBase" Value="file:///[#FileConverterExtension.dll]" Type="string" Action="write" />
|
||||
</Component>
|
||||
</DirectoryRef>
|
||||
</Fragment>
|
||||
</Wix>
|
||||
@@ -1 +0,0 @@
|
||||
"C:\Program Files (x86)\Wix Toolset v3.9\bin\Heat.exe" file "..\Application\FileConverterExtension\bin\Release\FileConverterExtension.dll" -dr INSTALLFOLDER -srd -gg -sfrag -suid -out "Extension.wxs" -b "..\Application\FileConverterExtension\bin\Release\"
|
||||
@@ -6,7 +6,7 @@
|
||||
<ProductVersion>3.9</ProductVersion>
|
||||
<ProjectGuid>f14673df-df38-44b4-ab1d-99a59182c24c</ProjectGuid>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<OutputName>Installer</OutputName>
|
||||
<OutputName>FileConverter-setup</OutputName>
|
||||
<OutputType>Package</OutputType>
|
||||
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' AND '$(MSBuildExtensionsPath32)' != '' ">$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
|
||||
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
|
||||
@@ -30,7 +30,6 @@
|
||||
<IntermediateOutputPath>obj\$(Platform)\$(Configuration)\</IntermediateOutputPath>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Extension.wxs" />
|
||||
<Compile Include="Product.wxs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@@ -49,7 +48,14 @@
|
||||
<RefTargetDir>INSTALLFOLDER</RefTargetDir>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(WixTargetsPath)" />
|
||||
|
||||
<!-- congigure the project to sign the installer. Comment this line to produce an unsigned installer. -->
|
||||
<Import Project=".\Installer.sign" />
|
||||
|
||||
<!--
|
||||
To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Wix.targets.
|
||||
|
||||
@@ -12,27 +12,36 @@
|
||||
|
||||
<!-- Upgrade documentation: http://wixtoolset.org/documentation/manual/v3/howtos/updates/major_upgrade.html -->
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Product Id="*" Name="$(var.ProductName)" Language="1033" Version="0.4.0" Manufacturer="AAllard" UpgradeCode="e3ca717b-a897-418a-bbef-5c7e35c76e4b">
|
||||
<Product Id="*" Name="$(var.ProductName)" Language="1033" Version="1.0.0" Manufacturer="Adrien Allard" UpgradeCode="e3ca717b-a897-418a-bbef-5c7e35c76e4b">
|
||||
<Package Id="*" InstallerVersion="200" Compressed="yes" InstallScope="perMachine" Platform="x64" />
|
||||
|
||||
<Icon Id="icon.ico" SourceFile="..\Resources\ApplicationIcon.ico"/>
|
||||
<Property Id="ARPPRODUCTICON" Value="icon.ico" />
|
||||
|
||||
<SetProperty Id="ARPINSTALLLOCATION" Value="[ApplicationFolder]" After="CostFinalize" />
|
||||
|
||||
<MajorUpgrade Schedule="afterInstallInitialize" DowngradeErrorMessage="A later version of [ProductName] is already installed. Setup will now exit." />
|
||||
|
||||
<Media Id="1" Cabinet="CabFile.cab" EmbedCab="yes" />
|
||||
|
||||
<Feature Id="ProductFeature" Title="Installer" Level="1">
|
||||
<Feature Id="Application" Title="Installer" Level="1">
|
||||
<ComponentGroupRef Id="ProductComponents" />
|
||||
</Feature>
|
||||
|
||||
<Feature Id="ShellExtensionFeature" Title="ShellExtension" Level="1" AllowAdvertise="no">
|
||||
<ComponentRef Id="FileConverterExtension.dll" />
|
||||
</Feature>
|
||||
<CustomAction Id="InstallShell" FileKey="srm.exe" ExeCommand='install "[INSTALLFOLDER]\FileConverterExtension.dll" -codebase' Execute="deferred" Return="check" Impersonate="no" />
|
||||
<CustomAction Id="UninstallShell" FileKey="srm.exe" ExeCommand='uninstall "[INSTALLFOLDER]\FileConverterExtension.dll"' Execute="deferred" Return="check" Impersonate="no" />
|
||||
<CustomAction Id='PostInstallInit' FileKey='FileConverter.exe' ExeCommand='--post-install-init' Return='asyncWait' />
|
||||
|
||||
<InstallExecuteSequence>
|
||||
<Custom Action="InstallShell" After="InstallFiles">NOT Installed</Custom>
|
||||
<Custom Action="UninstallShell" Before="RemoveFiles">(NOT UPGRADINGPRODUCTCODE) AND (REMOVE="ALL")</Custom>
|
||||
<Custom Action="PostInstallInit" After="InstallFinalize">NOT Installed</Custom>
|
||||
</InstallExecuteSequence>
|
||||
|
||||
<UIRef Id="WixUI_InstallDir" />
|
||||
<Property Id="MSIUSEREALADMINDETECTION" Value="1" />
|
||||
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
|
||||
|
||||
<Property Id="MSIRESTARTMANAGERCONTROL" Value="Disable" /> <!-- This avoid an issue where the installer detect the utilisation of the extension dll in explorer and then, ask to the user to restart these applications. The restart fails. -->
|
||||
|
||||
<WixVariable Id="WixUILicenseRtf" Value="License.rtf" />
|
||||
<WixVariable Id="WixUIBannerBmp" Value="..\Resources\Installer\Banner.bmp" />
|
||||
<WixVariable Id="WixUIDialogBmp" Value="..\Resources\Installer\UI.bmp" />
|
||||
@@ -47,23 +56,60 @@
|
||||
<Directory Id="$(var.PlatformProgramFilesFolder)">
|
||||
<Directory Id="INSTALLFOLDER" Name="File Converter" />
|
||||
</Directory>
|
||||
<Directory Id="ProgramMenuFolder">
|
||||
<Directory Id="ApplicationStartMenuShortcut" Name="File Converter"/>
|
||||
</Directory>
|
||||
</Directory>
|
||||
</Fragment>
|
||||
|
||||
<Fragment>
|
||||
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
|
||||
<!-- Resources -->
|
||||
<Component Guid="{9BF0AC45-A586-41C9-BA93-6048B46DA65F}" Win64="$(var.Win64)">
|
||||
<File Id="SharpShell.dll" KeyPath="yes" Source="..\Middleware\SharpShell\SharpShell.dll" />
|
||||
<!-- Application -->
|
||||
<Component Guid="{142FBD60-90A7-4753-95CE-7B2A2E20B785}" Win64="$(var.Win64)">
|
||||
<File Id="FileConverter.exe" Source="$(var.FileConverter.TargetPath)" KeyPath="yes" Checksum="yes">
|
||||
<Shortcut Id="ApplicationStartMenuShortcut" Directory="ApplicationStartMenuShortcut" Advertise="yes" WorkingDirectory="INSTALLDIR"
|
||||
Name="File Converter" Description="Convert and compress everything in 2 clicks!" Icon="Icon.exe">
|
||||
<Icon Id="Icon.exe" SourceFile="$(var.FileConverter.TargetPath)" />
|
||||
</Shortcut>
|
||||
<Shortcut Id="ApplicationSettingsStartMenuShortcut" Directory="ApplicationStartMenuShortcut" Advertise="yes" WorkingDirectory="INSTALLDIR"
|
||||
Name="File Converter Settings" Description="Configure the conversion and compression presets" Arguments="--settings" Icon="SettingsIcon.exe">
|
||||
<Icon Id="SettingsIcon.exe" SourceFile="$(var.FileConverter.TargetPath)" />
|
||||
</Shortcut>
|
||||
</File>
|
||||
<RemoveFolder Id='RemoveStartMenuDir' Directory='ApplicationStartMenuShortcut' On='uninstall' />
|
||||
</Component>
|
||||
|
||||
<!-- Extension -->
|
||||
<Component Guid="{AA5EA6F7-C443-488B-8E48-7CF000B9AD2A}" Win64="$(var.Win64)">
|
||||
<File Source="$(var.FileConverter.TargetPath)" KeyPath="yes" />
|
||||
<File Id="FileConverterExtension.dll" KeyPath="yes" Source="..\Application\FileConverterExtension\bin\$(var.Configuration)\FileConverterExtension.dll" Checksum="yes" />
|
||||
</Component>
|
||||
<Component Guid="{9BF0AC45-A586-41C9-BA93-6048B46DA65F}" Win64="$(var.Win64)">
|
||||
<File Id="SharpShell.dll" KeyPath="yes" Source="..\packages\SharpShell.2.2.0.0\lib\net40\SharpShell.dll" Checksum="yes"/>
|
||||
</Component>
|
||||
<Component Guid="{EC580BEF-F962-42BD-B46D-4E4C126F2641}" Win64="$(var.Win64)">
|
||||
<File Id="srm.exe" Source="..\packages\SharpShellTools.2.2.0.0\lib\srm.exe" KeyPath="yes" Checksum="yes"/>
|
||||
</Component>
|
||||
|
||||
<!-- Third parties -->
|
||||
<Component Guid="{1790B82E-86BC-4B95-AA1D-9859FF3B6CA4}" Win64="$(var.Win64)">
|
||||
<File Source="..\Middleware\ffmpeg.exe" KeyPath="yes" />
|
||||
<File Source="..\Middleware\ffmpeg.exe" KeyPath="yes" Checksum="yes" />
|
||||
</Component>
|
||||
<Component Guid="{C59B7F72-D8D6-47A3-B1D9-515CBC9FCE6F}" Win64="$(var.Win64)">
|
||||
<File Id="Magick.NET.dll" KeyPath="yes" Source="..\Application\FileConverter\bin\$(var.Configuration)\Magick.NET-Q16-AnyCPU.dll" Checksum="yes"/>
|
||||
</Component>
|
||||
<Component Guid="{E1B1C09C-B089-40D8-859B-0E55F640CAE1}" Win64="$(var.Win64)">
|
||||
<File Id="Markdown.Xaml.dll" KeyPath="yes" Source="..\Middleware\Markdown.Xaml.dll" Checksum="yes"/>
|
||||
</Component>
|
||||
<Component Guid="{55CD0B47-D5B0-4F0C-A54E-3E11DF345B48}" Win64="$(var.Win64)">
|
||||
<File Id="Ripper.dll" KeyPath="yes" Source="..\Middleware\Ripper.dll" Checksum="yes"/>
|
||||
</Component>
|
||||
<Component Guid="{3CE6CF1B-431C-41FD-8381-3F73EDAF7B8A}" Win64="$(var.Win64)">
|
||||
<File Id="yeti.mmedia.dll" KeyPath="yes" Source="..\Middleware\yeti.mmedia.dll" Checksum="yes"/>
|
||||
</Component>
|
||||
|
||||
<!-- Configuration and documentation -->
|
||||
<Component Guid="{86AEF5B3-C25B-4662-BAEF-20969D1821A5}" Win64="$(var.Win64)">
|
||||
<File Source="..\Application\FileConverter\Settings.xml" KeyPath="yes" />
|
||||
<File Source="..\Application\FileConverter\Settings.default.xml" KeyPath="yes" />
|
||||
</Component>
|
||||
<Component Guid="{A5158756-A107-4010-9E2F-3C0333F5A5F6}" Win64="$(var.Win64)">
|
||||
<File Source="..\README.md" KeyPath="yes" />
|
||||
@@ -74,85 +120,12 @@
|
||||
<Component Guid="{6378238B-E44F-414B-A7AE-7E72CFA8616D}" Win64="$(var.Win64)">
|
||||
<File Source="..\LICENSE.md" KeyPath="yes" />
|
||||
</Component>
|
||||
<Component Guid="{55CD0B47-D5B0-4F0C-A54E-3E11DF345B48}" Win64="$(var.Win64)">
|
||||
<File Id="Ripper.dll" KeyPath="yes" Source="..\Middleware\Ripper.dll" />
|
||||
</Component>
|
||||
<Component Guid="{3CE6CF1B-431C-41FD-8381-3F73EDAF7B8A}" Win64="$(var.Win64)">
|
||||
<File Id="yeti.mmedia.dll" KeyPath="yes" Source="..\Middleware\yeti.mmedia.dll" />
|
||||
</Component>
|
||||
|
||||
<!-- Registry entries -->
|
||||
<Component Id="RegistryEntries" Guid="{C3EF3D67-0206-4DBD-B2EA-78FF2E290093}">
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter">
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter" ForceDeleteOnUninstall="yes">
|
||||
<RegistryValue Name="Path" Type="string" Value="[INSTALLFOLDER]FileConverter.exe"/>
|
||||
<RegistryValue Name="CompatibleInputExtensions" Type="string" Value="aac;aiff;ape;avi;bik;bmp;cda;flac;flv;ico;jpg;jpeg;m4a;mkv;mov;mp3;mp4;ogg;png;tiff;wav;wma"/>
|
||||
</RegistryKey>
|
||||
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\aac">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Ogg;To Wav;To Mp3"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\aiff">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Ogg;To Wav;To Mp3;To Aac"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\ape">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Ogg;To Flac;To Wav;To Mp3;To Aac"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\avi">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Mkv;To Ogg;To Flac;To Wav;To Mp3;To Aac;To Mkv (low quality)"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\bik">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Mkv;To Ogg;To Flac;To Wav;To Mp3;To Aac;To Mkv (low quality)"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\bmp">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Png;To Jpg;To Ico (max 256x256)"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\cda">
|
||||
<RegistryValue Name="Presets" Type="string" Value="Extract CDA to Flac;Extract CDA to Ogg;Extract CDA to Mp3"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\flac">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Ogg;To Wav;To Mp3;To Aac"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\flv">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Mkv;To Mkv (low quality);To Ogg;To Flac;To Wav;To Mp3;To Aac"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\ico">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Png;To Jpg"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\jpeg">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Png;To Ico (max 256x256)"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\jpg">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Png;To Ico (max 256x256)"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\m4a">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Ogg;To Wav;To Mp3;To Aac"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\mkv">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Mkv;To Mkv (low quality);To Ogg;To Flac;To Wav;To Mp3;To Aac"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\mov">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Mkv;To Mkv (low quality);To Ogg;To Flac;To Wav;To Mp3;To Aac"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\mp3">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Ogg;To Wav;To Aac"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\mp4">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Mkv;To Mkv (low quality);To Ogg;To Flac;To Wav;To Mp3;To Aac"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\ogg">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Wav;To Mp3;To Aac"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\png">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Jpg;To Ico (max 256x256)"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\tiff">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Png;To Jpg;To Ico (max 256x256)"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\wav">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Ogg;To Flac;To Mp3;To Aac"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\wma">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Ogg;To Wav;To Mp3;To Aac"/>
|
||||
<RegistryValue Name="CompatibleInputExtensions" Type="string" Value="3gp;aac;aiff;ape;avi;bik;bmp;cda;exr;flac;flv;gif;ico;jpg;jpeg;m4a;m4v;mkv;mov;mp3;mp4;mpeg;oga;ogg;ogv;png;psd;svg;tga;tiff;vob;wav;webm;wma;wmv"/>
|
||||
</RegistryKey>
|
||||
</Component>
|
||||
</ComponentGroup>
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="SharpShellTools" version="2.2.0.0" />
|
||||
</packages>
|
||||
@@ -1,21 +1,13 @@
|
||||
# File Converter
|
||||
|
||||
## Description
|
||||
**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.
|
||||
**File Converter** is a very simple tool which allows you to convert and compress one or several file(s) using the context menu of windows explorer.
|
||||
|
||||
You can download it here: [www.file-converter.org](http://file-converter.org).
|
||||
You can download it here: [www.file-converter.org](http://file-converter.org/?from=readme.md).
|
||||
|
||||
## Supported file formats
|
||||
You can find more information about what's in File converter and how to use it on the [wiki](http://github.com/Tichau/FileConverter/wiki).
|
||||
|
||||
Category | Supported output formats | Compatible input formats
|
||||
------------|---------------------------|----------------------------------------------------------------------------
|
||||
Audio | flac, aac, ogg, mp3, wav | aiff, ape, avi, bik, cda, flac, flv, m4a, mkv, mov, mp3, mp4, ogg, wav, wma
|
||||
Video | mkv | avi, bik, flv, mkv, mov
|
||||
Image | png, jpg, ico | bmp, ico, jpg, jpeg, png, tiff
|
||||
|
||||
*Note: If your source file is a video, the conversion to an audio format will extract the audio part of the video.*
|
||||
|
||||
*Note 2: The mkv output file format encodes video using H.264 encoder for video and AAC encoder for audio.*
|
||||
You can help this project by contributing on [Github](http://github.com/Tichau/FileConverter/) or by making a donation on [Pledgie](http://pledgie.com/campaigns/31615) :).
|
||||
|
||||
## Thanks
|
||||
|
||||
@@ -24,12 +16,19 @@ File converter uses the following middlewares:
|
||||
**ffmpeg** as file conversion software.
|
||||
Thanks to ffmpeg devs for this awesome open source file conversion tool. [Web site link](https://www.ffmpeg.org/)
|
||||
|
||||
**ImageMagick** as image edition and conversion software.
|
||||
Thanks to image magick devs for this awesome open source image edition software suite. [Web site link](http://imagemagick.net/)
|
||||
And thanks to dlemstra for the C# wrapper of this software. [CodePlex link](https://magick.codeplex.com/)
|
||||
|
||||
**SharpShell** to easily create windows context menu extensions.
|
||||
Thanks to Dave Kerr for his work on SharpShell. [CodePlex link](https://sharpshell.codeplex.com/)
|
||||
|
||||
**Ripper** and **yeti.mmedia** for CD Audio extraction.
|
||||
Thanks to Idael Cardoso for his work on CD Audio ripper. [Code project link](http://www.codeproject.com/Articles/5458/C-Sharp-Ripper)
|
||||
|
||||
**Markdown.XAML** for markdown rendering in the wpf application.
|
||||
Thanks to Bevan Arps for his work on Markdown.XAML. [GitHub link](https://github.com/theunrepentantgeek/Markdown.XAML)
|
||||
|
||||
## License
|
||||
|
||||
File Converter is licensed under the GPL version 3 License.
|
||||
|
||||
|
Before Width: | Height: | Size: 294 KiB After Width: | Height: | Size: 117 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 551 B |
|
After Width: | Height: | Size: 376 KiB |
|
After Width: | Height: | Size: 376 KiB |
@@ -0,0 +1,66 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<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"
|
||||
width="48"
|
||||
height="48"
|
||||
viewBox="0 0 48.000001 48.000001"
|
||||
id="svg2"
|
||||
version="1.1"
|
||||
inkscape:version="0.91 r13725"
|
||||
sodipodi:docname="CancelIcon.svg"
|
||||
inkscape:export-filename="C:\Users\aallard\Documents\GitHub\FileConverter\Resources\CancelIcon.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90">
|
||||
<defs
|
||||
id="defs4" />
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="8"
|
||||
inkscape:cx="29.858285"
|
||||
inkscape:cy="23.115955"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
units="px"
|
||||
inkscape:window-width="1853"
|
||||
inkscape:window-height="1058"
|
||||
inkscape:window-x="59"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1" />
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<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>
|
||||
<g
|
||||
inkscape:label="Calque 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(0,-1004.3622)">
|
||||
<path
|
||||
style="opacity:1;fill:#d32f2f;fill-opacity:0.94117647;stroke:none"
|
||||
d="M 24 0 A 24 24 0 0 0 0 24 A 24 24 0 0 0 24 48 A 24 24 0 0 0 48 24 A 24 24 0 0 0 24 0 z M 24 4 A 20 20 0 0 1 44 24 A 20 20 0 0 1 40.560547 35.203125 L 10.087891 9.6328125 A 20 20 0 0 1 24 4 z M 7.4394531 12.796875 L 37.912109 38.367188 A 20 20 0 0 1 24 44 A 20 20 0 0 1 4 24 A 20 20 0 0 1 7.4394531 12.796875 z "
|
||||
transform="translate(0,1004.3622)"
|
||||
id="path3338" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.2 KiB |
@@ -0,0 +1,148 @@
|
||||
<?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="DownloadIcon.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="1288"
|
||||
inkscape:window-height="745"
|
||||
id="namedview3381"
|
||||
showgrid="false"
|
||||
showguides="true"
|
||||
inkscape:guide-bbox="true"
|
||||
inkscape:zoom="1"
|
||||
inkscape:cx="191.90166"
|
||||
inkscape:cy="457.15385"
|
||||
inkscape:window-x="70"
|
||||
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"
|
||||
inkscape:export-xdpi="11.52"
|
||||
inkscape:export-ydpi="11.52" /></g><g
|
||||
inkscape:groupmode="layer"
|
||||
id="layer4"
|
||||
inkscape:label="Pattern"
|
||||
style="display:inline"><path
|
||||
style="opacity:1;fill:#004b82;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 389.61583,449.76033 165.67008,134.05739 c 26.59169,-24.80671 68.12788,-66.81759 81.95332,-151.49 l -205.197,-169.24358 z"
|
||||
id="path4228"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccccc"
|
||||
inkscape:export-xdpi="11.52"
|
||||
inkscape:export-ydpi="11.52" /><path
|
||||
style="display:inline;opacity:1;fill:#004b82;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 489.67143,516.22836 88.80255,42.79772 c -29.63541,38.68967 -80.08418,69.5045 -134.68118,81.98886 L 290.26732,516.22836 Z"
|
||||
id="path4228-0"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccccc"
|
||||
inkscape:export-xdpi="11.52"
|
||||
inkscape:export-ydpi="11.52" /><path
|
||||
style="fill:#ffffff;fill-rule:evenodd;stroke:#ffffff;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 347.70439,264.18465 0,85.91347 -57.27565,0 98.99495,98.99494 99.3485,-99.3485 -56.9221,0 0,-85.55991 z"
|
||||
id="path3400"
|
||||
inkscape:connector-curvature="0"
|
||||
inkscape:export-xdpi="11.52"
|
||||
inkscape:export-ydpi="11.52" /><path
|
||||
style="fill:#ffffff;fill-rule:evenodd;stroke:#ffffff;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 488.59541,515.54472 0,-26.5165 -197.98989,0 0,26.5165 z"
|
||||
id="path3402"
|
||||
inkscape:connector-curvature="0"
|
||||
inkscape:export-xdpi="11.52"
|
||||
inkscape:export-ydpi="11.52" /></g><g
|
||||
inkscape:groupmode="layer"
|
||||
id="layer2"
|
||||
inkscape:label="Arrow"
|
||||
style="display:inline" /><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="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: 5.7 KiB |
@@ -0,0 +1,88 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<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"
|
||||
width="48"
|
||||
height="48"
|
||||
viewBox="0 0 48.000001 48.000001"
|
||||
id="svg2"
|
||||
version="1.1"
|
||||
inkscape:version="0.91 r13725"
|
||||
sodipodi:docname="FailIcon.svg"
|
||||
inkscape:export-filename="C:\Users\Adrien\Documents\GitHub\FileConverter\Resources\FailIcon.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90">
|
||||
<defs
|
||||
id="defs4" />
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="8"
|
||||
inkscape:cx="29.858285"
|
||||
inkscape:cy="28.115955"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
units="px"
|
||||
inkscape:window-width="1289"
|
||||
inkscape:window-height="745"
|
||||
inkscape:window-x="69"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1" />
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<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></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Calque 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(0,-1004.3622)">
|
||||
<flowRoot
|
||||
xml:space="preserve"
|
||||
id="flowRoot4348"
|
||||
style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#f44336;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;"
|
||||
transform="translate(0,1004.3622)"><flowRegion
|
||||
id="flowRegion4350"><rect
|
||||
id="rect4352"
|
||||
width="24"
|
||||
height="44.75"
|
||||
x="12"
|
||||
y="2.625"
|
||||
style="fill:#f44336;fill-opacity:1;" /></flowRegion><flowPara
|
||||
id="flowPara4354">!</flowPara></flowRoot> <flowRoot
|
||||
xml:space="preserve"
|
||||
id="flowRoot4356"
|
||||
style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#d32f2f;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;"
|
||||
transform="matrix(1.6923977,0,0,1.6923977,15.004532,977.45445)"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90"><flowRegion
|
||||
id="flowRegion4358"><rect
|
||||
id="rect4360"
|
||||
width="49.5"
|
||||
height="47.5"
|
||||
x="0.875"
|
||||
y="0.875"
|
||||
style="fill:#d32f2f;fill-opacity:1;" /></flowRegion><flowPara
|
||||
id="flowPara4362"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:'MS UI Gothic';-inkscape-font-specification:'MS UI Gothic';fill:#d32f2f;fill-opacity:1;">!</flowPara></flowRoot> </g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.3 KiB |
@@ -0,0 +1,67 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<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"
|
||||
width="48"
|
||||
height="48"
|
||||
viewBox="0 0 48.000001 48.000001"
|
||||
id="svg2"
|
||||
version="1.1"
|
||||
inkscape:version="0.91 r13725"
|
||||
sodipodi:docname="SuccessIcon.svg"
|
||||
inkscape:export-filename="C:\Users\Adrien\Documents\GitHub\FileConverter\Resources\SuccessIcon.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90">
|
||||
<defs
|
||||
id="defs4" />
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="8"
|
||||
inkscape:cx="29.858285"
|
||||
inkscape:cy="28.115955"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
units="px"
|
||||
inkscape:window-width="1289"
|
||||
inkscape:window-height="745"
|
||||
inkscape:window-x="69"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1" />
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<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>
|
||||
<g
|
||||
inkscape:label="Calque 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(0,-1004.3622)">
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#4caf50;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 2.125,1031.1122 13.625,19 29.875,-43.5"
|
||||
id="path3342"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccc" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
@@ -0,0 +1,4 @@
|
||||
<Version>
|
||||
<Latest Major="0" Minor="7" Patch="0"/>
|
||||
<URL>http://github.com/Tichau/FileConverter/releases/download/v0.7/FileConverter-0.7-x64-setup.msi</URL>
|
||||
</Version>
|
||||