Merge branch 'development'
No files matched your search
@@ -19,45 +19,35 @@ 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,
|
||||
Minor = 5,
|
||||
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 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 static Version ApplicationVersion
|
||||
{
|
||||
get
|
||||
@@ -84,6 +74,12 @@ namespace FileConverter
|
||||
set;
|
||||
}
|
||||
|
||||
public bool HideMainWindow
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public bool Verbose
|
||||
{
|
||||
get;
|
||||
@@ -94,7 +90,68 @@ namespace FileConverter
|
||||
{
|
||||
this.cancelAutoExit = true;
|
||||
}
|
||||
|
||||
|
||||
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.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);
|
||||
startInfo.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();
|
||||
}
|
||||
|
||||
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);
|
||||
@@ -109,7 +166,7 @@ namespace FileConverter
|
||||
Dispatcher.BeginInvoke((Action)(() => Application.Current.Shutdown()));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Retrieve arguments.
|
||||
Debug.Log("Retrieve arguments...");
|
||||
string[] args = Environment.GetCommandLineArgs();
|
||||
@@ -117,28 +174,27 @@ namespace FileConverter
|
||||
#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, 8);
|
||||
//args[1] = "--conversion-preset";
|
||||
//args[2] = "To Ogg";
|
||||
//args[3] = "--verbose";
|
||||
|
||||
//System.Array.Resize(ref args, 2);
|
||||
//args[1] = "--settings";
|
||||
//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, 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, 2);
|
||||
args[1] = "--settings";
|
||||
|
||||
//System.Array.Resize(ref args, 5);
|
||||
//args[1] = "--conversion-preset";
|
||||
//args[2] = "To Jpg";
|
||||
//args[3] = "--verbose";
|
||||
//args[4] = @"D:\Test\Test avec accents héhé\imagé.png";
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -150,6 +206,15 @@ namespace FileConverter
|
||||
|
||||
Debug.Log(string.Empty);
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
ConversionPreset conversionPreset = null;
|
||||
List<string> filePaths = new List<string>();
|
||||
|
||||
@@ -164,9 +229,15 @@ namespace FileConverter
|
||||
|
||||
switch (parameterTitle)
|
||||
{
|
||||
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();
|
||||
@@ -191,7 +262,7 @@ namespace FileConverter
|
||||
|
||||
index++;
|
||||
continue;
|
||||
|
||||
|
||||
case "verbose":
|
||||
{
|
||||
this.Verbose = true;
|
||||
@@ -200,7 +271,7 @@ namespace FileConverter
|
||||
break;
|
||||
|
||||
default:
|
||||
Debug.LogError("Unknown option {0}.", parameterTitle);
|
||||
Debug.LogError("Unknown application argument: '--{0}'.", parameterTitle);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -210,41 +281,41 @@ namespace FileConverter
|
||||
}
|
||||
}
|
||||
|
||||
if (conversionPreset == null)
|
||||
if (this.Settings.CheckUpgradeAtStartup)
|
||||
{
|
||||
Debug.LogError("Can't retrieve the conversion preset from arguments.");
|
||||
return;
|
||||
}
|
||||
long fileTime = Registry.GetValue<long>(Registry.Keys.LastUpdateCheckDate);
|
||||
DateTime lastUpdateDateTime = DateTime.FromFileTime(fileTime);
|
||||
|
||||
// Create convertion jobs.
|
||||
Debug.Log("Create jobs for conversion preset: '{0}'", conversionPreset.Name);
|
||||
try
|
||||
{
|
||||
for (int index = 0; index < filePaths.Count; index++)
|
||||
TimeSpan durationSinceLastUpdate = DateTime.Now.Subtract(lastUpdateDateTime);
|
||||
if (durationSinceLastUpdate > new TimeSpan(1, 0, 0, 0))
|
||||
{
|
||||
string inputFilePath = filePaths[index];
|
||||
ConversionJob conversionJob = ConversionJobFactory.Create(conversionPreset, inputFilePath);
|
||||
conversionJob.PrepareConversion(inputFilePath);
|
||||
|
||||
this.conversionJobs.Add(conversionJob);
|
||||
Task<UpgradeVersionDescription> task = Upgrade.Helpers.GetLatestVersionDescriptionAsync(this.OnGetLatestVersionDescription);
|
||||
}
|
||||
}
|
||||
catch (Exception exception)
|
||||
|
||||
if (conversionPreset != null)
|
||||
{
|
||||
Debug.LogError(exception.Message);
|
||||
throw;
|
||||
// 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);
|
||||
|
||||
this.conversionJobs.Add(conversionJob);
|
||||
}
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
Debug.LogError(exception.Message);
|
||||
throw;
|
||||
}
|
||||
|
||||
this.needToRunConversionThread = true;
|
||||
}
|
||||
|
||||
this.initialized = true;
|
||||
}
|
||||
|
||||
protected override void OnExit(ExitEventArgs e)
|
||||
{
|
||||
base.OnExit(e);
|
||||
|
||||
Debug.Log("Exit application.");
|
||||
|
||||
Debug.Release();
|
||||
}
|
||||
|
||||
private void ConvertFiles()
|
||||
@@ -352,5 +423,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
@@ -131,6 +131,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>
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace FileConverter.ConversionJobs
|
||||
{
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
@@ -27,6 +28,15 @@ namespace FileConverter.ConversionJobs
|
||||
{
|
||||
}
|
||||
|
||||
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()
|
||||
{
|
||||
base.Initialize();
|
||||
@@ -38,8 +48,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.");
|
||||
@@ -61,7 +70,7 @@ namespace FileConverter.ConversionJobs
|
||||
{
|
||||
// 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));
|
||||
string encoderArgs = string.Format("-c:a aac -q:a {0}", this.AACBitrateToQualityIndex(audioEncodingBitrate));
|
||||
arguments = string.Format("-n -stats -i \"{0}\" {2} \"{1}\"", this.InputFilePath, this.OutputFilePath, encoderArgs);
|
||||
}
|
||||
|
||||
@@ -108,6 +117,25 @@ namespace FileConverter.ConversionJobs
|
||||
|
||||
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);
|
||||
|
||||
float scaleFactor = this.ConversionPreset.GetSettingsValue<float>(ConversionPreset.ConversionSettingKeys.VideoScale);
|
||||
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("-c:v mpeg4 -vtag xvid -qscale:v {0} -c:a libmp3lame -qscale:a {1} {2}", this.MPEG4QualityToQualityIndex(videoEncodingQuality), this.MP3VBRBitrateToQualityIndex(audioEncodingBitrate), scaleArgs);
|
||||
arguments = string.Format("-n -stats -i \"{0}\" {2} \"{1}\"", this.InputFilePath, this.OutputFilePath, encoderArgs);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case OutputType.Mkv:
|
||||
{
|
||||
// https://trac.ffmpeg.org/wiki/Encode/H.264
|
||||
@@ -115,7 +143,15 @@ namespace FileConverter.ConversionJobs
|
||||
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));
|
||||
|
||||
float scaleFactor = this.ConversionPreset.GetSettingsValue<float>(ConversionPreset.ConversionSettingKeys.VideoScale);
|
||||
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("-c:v libx264 -preset {0} -crf {1} -c:a aac -q:a {2} {3}", this.H264EncodingSpeedToPreset(videoEncodingSpeed), this.H264QualityToCRF(videoEncodingQuality), this.AACBitrateToQualityIndex(audioEncodingBitrate), scaleArgs);
|
||||
arguments = string.Format("-n -stats -i \"{0}\" {2} \"{1}\"", this.InputFilePath, this.OutputFilePath, encoderArgs);
|
||||
}
|
||||
|
||||
@@ -132,8 +168,16 @@ namespace FileConverter.ConversionJobs
|
||||
|
||||
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");
|
||||
string encoderArgs = string.Format("-compression_level 100 {0}", scaleArgs);
|
||||
|
||||
arguments = string.Format("-n -stats -i \"{0}\" {2} \"{1}\"", this.InputFilePath, this.OutputFilePath, encoderArgs);
|
||||
}
|
||||
|
||||
@@ -142,7 +186,16 @@ namespace FileConverter.ConversionJobs
|
||||
case OutputType.Jpg:
|
||||
{
|
||||
int encodingQuality = this.ConversionPreset.GetSettingsValue<int>(ConversionPreset.ConversionSettingKeys.ImageQuality);
|
||||
string encoderArgs = string.Format("-q:v {0}", this.JPGQualityToQualityIndex(encodingQuality));
|
||||
|
||||
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);
|
||||
|
||||
arguments = string.Format("-n -stats -i \"{0}\" {2} \"{1}\"", this.InputFilePath, this.OutputFilePath, encoderArgs);
|
||||
}
|
||||
|
||||
@@ -206,7 +259,7 @@ namespace FileConverter.ConversionJobs
|
||||
throw;
|
||||
}
|
||||
|
||||
Diagnostics.Debug.Log("");
|
||||
Diagnostics.Debug.Log(string.Empty);
|
||||
}
|
||||
|
||||
private void ParseFFMPEGOutput(string input)
|
||||
|
||||
@@ -421,11 +421,23 @@ namespace FileConverter
|
||||
|
||||
break;
|
||||
|
||||
case OutputType.Avi:
|
||||
switch (settingsKey)
|
||||
{
|
||||
case ConversionPreset.ConversionSettingKeys.AudioBitrate:
|
||||
case ConversionPreset.ConversionSettingKeys.VideoQuality:
|
||||
case ConversionPreset.ConversionSettingKeys.VideoScale:
|
||||
return true;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case OutputType.Mkv:
|
||||
switch (settingsKey)
|
||||
{
|
||||
case ConversionPreset.ConversionSettingKeys.AudioBitrate:
|
||||
case ConversionPreset.ConversionSettingKeys.VideoQuality:
|
||||
case ConversionPreset.ConversionSettingKeys.VideoScale:
|
||||
case ConversionPreset.ConversionSettingKeys.VideoEncodingSpeed:
|
||||
return true;
|
||||
}
|
||||
@@ -436,6 +448,16 @@ namespace FileConverter
|
||||
switch (settingsKey)
|
||||
{
|
||||
case ConversionPreset.ConversionSettingKeys.ImageQuality:
|
||||
case ConversionPreset.ConversionSettingKeys.ImageScale:
|
||||
return true;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case OutputType.Png:
|
||||
switch (settingsKey)
|
||||
{
|
||||
case ConversionPreset.ConversionSettingKeys.ImageScale:
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -453,18 +475,29 @@ namespace FileConverter
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.AudioBitrate, "128");
|
||||
break;
|
||||
|
||||
case OutputType.Flac:
|
||||
case OutputType.Ico:
|
||||
case OutputType.Flac:
|
||||
break;
|
||||
|
||||
case OutputType.Png:
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.ImageScale, "1");
|
||||
break;
|
||||
|
||||
case OutputType.Jpg:
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.ImageQuality, "25");
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.ImageScale, "1");
|
||||
break;
|
||||
|
||||
case OutputType.Avi:
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.VideoQuality, "20");
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.VideoScale, "1");
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.AudioBitrate, "190");
|
||||
break;
|
||||
|
||||
case OutputType.Mkv:
|
||||
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.AudioBitrate, "128");
|
||||
break;
|
||||
|
||||
@@ -634,8 +667,10 @@ 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 VideoQuality = "VideoQuality";
|
||||
public const string VideoEncodingSpeed = "VideoEncodingSpeed";
|
||||
public const string VideoScale = "VideoScale";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
// <copyright file="Diagnostics.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
// <copyright file="Debug.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
using System.Linq;
|
||||
|
||||
namespace FileConverter.Diagnostics
|
||||
{
|
||||
@@ -9,7 +8,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,8 +17,6 @@ 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();
|
||||
@@ -42,6 +39,8 @@ namespace FileConverter.Diagnostics
|
||||
Directory.CreateDirectory(Debug.diagnosticsFolderPath);
|
||||
}
|
||||
|
||||
public static event EventHandler<PropertyChangedEventArgs> StaticPropertyChanged;
|
||||
|
||||
public static DiagnosticsData[] Data
|
||||
{
|
||||
get
|
||||
@@ -91,6 +90,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,9 @@
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Accessibility" />
|
||||
<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">
|
||||
@@ -101,7 +104,10 @@
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
</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 +118,16 @@
|
||||
<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\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 +138,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 +173,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" />
|
||||
@@ -199,7 +220,17 @@
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\ApplicationIcon.ico" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\DownloadIcon.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\ContextMenuScreenshot.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>copy /Y "$(SolutionDir)Middleware\ffmpeg.exe" "$(TargetDir)ffmpeg.exe"
|
||||
copy /Y "$(ProjectDir)Settings.xml" "$(TargetDir)Settings.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,6 +7,7 @@ namespace FileConverter
|
||||
None,
|
||||
|
||||
Aac,
|
||||
Avi,
|
||||
Flac,
|
||||
Ico,
|
||||
Jpg,
|
||||
|
||||
@@ -90,10 +90,13 @@ namespace FileConverter
|
||||
|
||||
case "avi":
|
||||
case "bik":
|
||||
case "3gp":
|
||||
case "flv":
|
||||
case "mp4":
|
||||
case "mov":
|
||||
case "mkv":
|
||||
case "webm":
|
||||
case "wmv":
|
||||
return InputCategoryNames.Video;
|
||||
|
||||
case "bmp":
|
||||
@@ -125,6 +128,7 @@ namespace FileConverter
|
||||
case OutputType.Wav:
|
||||
return category == InputCategoryNames.Audio || category == InputCategoryNames.Video;
|
||||
|
||||
case OutputType.Avi:
|
||||
case OutputType.Mkv:
|
||||
return category == InputCategoryNames.Video;
|
||||
|
||||
@@ -140,7 +144,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))
|
||||
|
||||
@@ -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 string LastUpdateCheckDate = "LastUpdateCheckDate";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 2.1 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)");
|
||||
@@ -124,7 +123,7 @@ 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);
|
||||
if (messageBoxResult == MessageBoxResult.Yes)
|
||||
@@ -212,7 +211,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);
|
||||
@@ -323,7 +322,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;
|
||||
|
||||
@@ -9,9 +9,13 @@
|
||||
<InputTypes>mkv</InputTypes>
|
||||
<InputTypes>mov</InputTypes>
|
||||
<InputTypes>mp4</InputTypes>
|
||||
<InputTypes>3gp</InputTypes>
|
||||
<InputTypes>webm</InputTypes>
|
||||
<InputTypes>wmv</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="VideoQuality" Value="30" />
|
||||
<Settings Key="VideoEncodingSpeed" Value="Very Slow" />
|
||||
<Settings Key="VideoEncodingSpeed" Value="Medium" />
|
||||
<Settings Key="VideoScale" Value="1" />
|
||||
<Settings Key="AudioBitrate" Value="155" />
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
@@ -22,12 +26,32 @@
|
||||
<InputTypes>mkv</InputTypes>
|
||||
<InputTypes>mov</InputTypes>
|
||||
<InputTypes>mp4</InputTypes>
|
||||
<InputTypes>3gp</InputTypes>
|
||||
<InputTypes>webm</InputTypes>
|
||||
<InputTypes>wmv</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="VideoQuality" Value="20" />
|
||||
<Settings Key="VideoEncodingSpeed" Value="Very Slow" />
|
||||
<Settings Key="VideoEncodingSpeed" Value="Medium" />
|
||||
<Settings Key="VideoScale" Value="1" />
|
||||
<Settings Key="AudioBitrate" Value="96" />
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="To Avi" OutputType="Avi">
|
||||
<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>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="VideoQuality" Value="27" />
|
||||
<Settings Key="VideoScale" Value="1" />
|
||||
<Settings Key="AudioBitrate" Value="190" />
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="To Ogg" OutputType="Ogg">
|
||||
<InputTypes>aac</InputTypes>
|
||||
<InputTypes>aiff</InputTypes>
|
||||
@@ -43,6 +67,9 @@
|
||||
<InputTypes>mov</InputTypes>
|
||||
<InputTypes>mp4</InputTypes>
|
||||
<InputTypes>wav</InputTypes>
|
||||
<InputTypes>3gp</InputTypes>
|
||||
<InputTypes>webm</InputTypes>
|
||||
<InputTypes>wmv</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="AudioBitrate" Value="160" />
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
@@ -56,6 +83,9 @@
|
||||
<InputTypes>mp4</InputTypes>
|
||||
<InputTypes>wav</InputTypes>
|
||||
<InputTypes>ape</InputTypes>
|
||||
<InputTypes>3gp</InputTypes>
|
||||
<InputTypes>webm</InputTypes>
|
||||
<InputTypes>wmv</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
@@ -74,6 +104,9 @@
|
||||
<InputTypes>mkv</InputTypes>
|
||||
<InputTypes>mov</InputTypes>
|
||||
<InputTypes>mp4</InputTypes>
|
||||
<InputTypes>3gp</InputTypes>
|
||||
<InputTypes>webm</InputTypes>
|
||||
<InputTypes>wmv</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="AudioEncodingMode" Value="Wav16" />
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
@@ -93,6 +126,9 @@
|
||||
<InputTypes>mov</InputTypes>
|
||||
<InputTypes>mp4</InputTypes>
|
||||
<InputTypes>wav</InputTypes>
|
||||
<InputTypes>3gp</InputTypes>
|
||||
<InputTypes>webm</InputTypes>
|
||||
<InputTypes>wmv</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="AudioEncodingMode" Value="Mp3VBR" />
|
||||
<Settings Key="AudioBitrate" Value="190" />
|
||||
@@ -113,6 +149,9 @@
|
||||
<InputTypes>mp4</InputTypes>
|
||||
<InputTypes>wav</InputTypes>
|
||||
<InputTypes>flac</InputTypes>
|
||||
<InputTypes>3gp</InputTypes>
|
||||
<InputTypes>webm</InputTypes>
|
||||
<InputTypes>wmv</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
@@ -141,6 +180,7 @@
|
||||
<InputTypes>jpg</InputTypes>
|
||||
<InputTypes>jpeg</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="ImageScale" Value="1" />
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="To Jpg" OutputType="Jpg">
|
||||
@@ -150,6 +190,7 @@
|
||||
<InputTypes>ico</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="ImageQuality" Value="25" />
|
||||
<Settings Key="ImageScale" Value="1" />
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="To Ico (max 256x256)" OutputType="Ico">
|
||||
@@ -161,4 +202,15 @@
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="To small Png" OutputType="Png">
|
||||
<InputTypes>bmp</InputTypes>
|
||||
<InputTypes>jpg</InputTypes>
|
||||
<InputTypes>jpeg</InputTypes>
|
||||
<InputTypes>png</InputTypes>
|
||||
<InputTypes>tiff</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="ImageScale" Value="0,2" />
|
||||
<OutputFileNameTemplate>(p)(f)-small</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<CheckUpgradeAtStartup>true</CheckUpgradeAtStartup>
|
||||
</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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -62,19 +62,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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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,24 @@
|
||||
<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>
|
||||
<valueConverters:ApplicationVersionToApplicationName x:Key="ApplicationVersionToApplicationName"/>
|
||||
</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;
|
||||
@@ -42,6 +48,12 @@ namespace FileConverter.Windows
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public DataTemplate PngSettingsDataTemplate
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public DataTemplate MkvSettingsDataTemplate
|
||||
{
|
||||
@@ -60,8 +72,17 @@ namespace FileConverter.Windows
|
||||
|
||||
switch (outputType)
|
||||
{
|
||||
case OutputType.Wav:
|
||||
return this.WavSettingsDataTemplate;
|
||||
case OutputType.Aac:
|
||||
return this.AacSettingsDataTemplate;
|
||||
|
||||
case OutputType.Avi:
|
||||
return this.AviSettingsDataTemplate;
|
||||
|
||||
case OutputType.Jpg:
|
||||
return this.JpgSettingsDataTemplate;
|
||||
|
||||
case OutputType.Mkv:
|
||||
return this.MkvSettingsDataTemplate;
|
||||
|
||||
case OutputType.Mp3:
|
||||
return this.Mp3SettingsDataTemplate;
|
||||
@@ -69,14 +90,11 @@ namespace FileConverter.Windows
|
||||
case OutputType.Ogg:
|
||||
return this.OggSettingsDataTemplate;
|
||||
|
||||
case OutputType.Aac:
|
||||
return this.AacSettingsDataTemplate;
|
||||
case OutputType.Png:
|
||||
return this.PngSettingsDataTemplate;
|
||||
|
||||
case OutputType.Mkv:
|
||||
return this.MkvSettingsDataTemplate;
|
||||
|
||||
case OutputType.Jpg:
|
||||
return this.JpgSettingsDataTemplate;
|
||||
case OutputType.Wav:
|
||||
return this.WavSettingsDataTemplate;
|
||||
}
|
||||
|
||||
return this.DefaultDataTemplate;
|
||||
|
||||
@@ -13,6 +13,7 @@ namespace FileConverter
|
||||
{
|
||||
private DiagnosticsWindow diagnosticsWindow;
|
||||
private SettingsWindow settingsWindow;
|
||||
private UpgradeWindow upgradeWindow;
|
||||
|
||||
public MainWindow()
|
||||
{
|
||||
@@ -21,6 +22,12 @@ namespace FileConverter
|
||||
Application application = Application.Current as Application;
|
||||
|
||||
this.ConverterJobsList.ItemsSource = application.ConvertionJobs;
|
||||
|
||||
if (application.HideMainWindow)
|
||||
{
|
||||
this.Hide();
|
||||
}
|
||||
|
||||
if (application.Verbose)
|
||||
{
|
||||
this.ShowDiagnosticsWindow();
|
||||
@@ -28,15 +35,19 @@ namespace FileConverter
|
||||
|
||||
if (application.ShowSettings)
|
||||
{
|
||||
this.Hide();
|
||||
|
||||
this.ShowSettingsWindow();
|
||||
this.settingsWindow.OnSettingsWindowHide += this.SettingsWindow_Closed;
|
||||
}
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
|
||||
public void OnNewVersionReleased(UpgradeVersionDescription upgradeVersionDescription)
|
||||
{
|
||||
this.ShowUpgradeWindow();
|
||||
this.upgradeWindow.VersionDescription = upgradeVersionDescription;
|
||||
}
|
||||
|
||||
[NotifyPropertyChangedInvocator]
|
||||
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
|
||||
{
|
||||
@@ -94,5 +105,21 @@ 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
xmlns:project="clr-namespace:FileConverter.Properties"
|
||||
xmlns:System="clr-namespace:System;assembly=mscorlib" 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>
|
||||
@@ -17,6 +17,7 @@
|
||||
<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 +100,6 @@
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
|
||||
|
||||
<DataTemplate x:Key="AacSettingsDataTemplate">
|
||||
<StackPanel>
|
||||
<DockPanel>
|
||||
@@ -110,64 +110,195 @@
|
||||
</StackPanel>
|
||||
</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"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<DockPanel Grid.Row="0" Grid.Column="0">
|
||||
<Label Content="Video" FontWeight="Bold" />
|
||||
<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" />
|
||||
|
||||
<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.01" Maximum="2" SmallChange="0.01" LargeChange="0.1" TickFrequency="0.01" 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 Grid.Row="3" Grid.Column="0" >
|
||||
<Label Content="Audio" FontWeight="Bold" />
|
||||
<Label Content="(Mp3)" FontWeight="Light" Foreground="#004B82" />
|
||||
</DockPanel>
|
||||
|
||||
<Label Content="Quality :" Grid.Row="4" Grid.Column="0" HorizontalContentAlignment="Right"/>
|
||||
<controls:EncodingQualitySliderControl Grid.Row="4" Grid.Column="1" x:Name="EncodingQualitySlider" EncodingMode="Mp3VBR"
|
||||
Bitrate="{Binding SelectedPreset.Settings, ConverterParameter=AudioBitrate|System.Double, Converter={StaticResource ConversionSettingsToValueType}, ElementName=window, Mode=TwoWay}" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate x:Key="MkvSettingsDataTemplate">
|
||||
<StackPanel>
|
||||
<DockPanel>
|
||||
<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" />
|
||||
<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}"
|
||||
|
||||
<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" />
|
||||
</DockPanel>
|
||||
|
||||
<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>
|
||||
<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>
|
||||
|
||||
<DockPanel>
|
||||
<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.01" Maximum="2" SmallChange="0.01" LargeChange="0.1" TickFrequency="0.01" 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 Grid.Row="4" Grid.Column="0" >
|
||||
<Label Content="Audio" FontWeight="Bold" />
|
||||
<Label Content="(AAC)" FontWeight="Light" Foreground="#004B82" />
|
||||
</DockPanel>
|
||||
<DockPanel>
|
||||
<Label Content="Quality :" />
|
||||
<controls:EncodingQualitySliderControl x:Name="EncodingQualitySlider" EncodingMode="AacVBR"
|
||||
|
||||
<Label Content="Quality :" Grid.Row="5" Grid.Column="0" HorizontalContentAlignment="Right"/>
|
||||
<controls:EncodingQualitySliderControl Grid.Row="5" Grid.Column="1" x:Name="EncodingQualitySlider" EncodingMode="AacVBR"
|
||||
Bitrate="{Binding SelectedPreset.Settings, ConverterParameter=AudioBitrate|System.Double, Converter={StaticResource ConversionSettingsToValueType}, ElementName=window, Mode=TwoWay, TargetNullValue=128}" />
|
||||
</DockPanel>
|
||||
</StackPanel>
|
||||
</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"/>
|
||||
</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="20" SelectionEnd="30" Minimum="0" Maximum="30" TickPlacement="BottomRight" SmallChange="3" LargeChange="6" TickFrequency="1" 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>
|
||||
<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.01" Maximum="2" SmallChange="0.01" LargeChange="0.1" TickFrequency="0.01" 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>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate x:Key="PngSettingsDataTemplate">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<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>
|
||||
<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.01" Maximum="2" SmallChange="0.01" LargeChange="0.1" TickFrequency="0.01" 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>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
|
||||
<windows:ConversionSettingsTemplateSelector x:Key="ConversionSettingsSelector"
|
||||
DefaultDataTemplate="{StaticResource EmptyDataTemplate}"
|
||||
WavSettingsDataTemplate="{StaticResource WavSettingsDataTemplate}"
|
||||
AacSettingsDataTemplate="{StaticResource AacSettingsDataTemplate}"
|
||||
AviSettingsDataTemplate="{StaticResource AviSettingsDataTemplate}"
|
||||
JpgSettingsDataTemplate="{StaticResource JpgSettingsDataTemplate}"
|
||||
MkvSettingsDataTemplate="{StaticResource MkvSettingsDataTemplate}"
|
||||
Mp3SettingsDataTemplate="{StaticResource Mp3SettingsDataTemplate}"
|
||||
OggSettingsDataTemplate="{StaticResource OggSettingsDataTemplate}"
|
||||
MkvSettingsDataTemplate="{StaticResource MkvSettingsDataTemplate}"
|
||||
AacSettingsDataTemplate="{StaticResource AacSettingsDataTemplate}"
|
||||
JpgSettingsDataTemplate="{StaticResource JpgSettingsDataTemplate}" />
|
||||
PngSettingsDataTemplate="{StaticResource PngSettingsDataTemplate}"
|
||||
WavSettingsDataTemplate="{StaticResource WavSettingsDataTemplate}" />
|
||||
</Window.Resources>
|
||||
<Window.Title>
|
||||
<Binding Converter="{StaticResource ApplicationVersionToApplicationName}" Mode="OneWay" Path="(local:Application.ApplicationVersion)"/>
|
||||
@@ -206,7 +337,7 @@
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="4*"/>
|
||||
<ColumnDefinition Width="3.5*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Grid x:Name="PresetListGrid" Margin="5">
|
||||
@@ -243,7 +374,7 @@
|
||||
<Grid Margin="5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" MaxWidth="240"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2.5*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="30"/>
|
||||
@@ -343,16 +474,16 @@
|
||||
|
||||
<!-- 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}" />
|
||||
<CheckBox x:Name="QuitAtEndCheckBox" Content="Automatically 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>
|
||||
<CheckBox Content="Automatically check for updates when File Converter starts" IsChecked="{Binding ApplicationSettings.CheckUpgradeAtStartup, ElementName=window, Mode=TwoWay}" />
|
||||
</StackPanel>
|
||||
|
||||
<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"/>
|
||||
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -1,12 +1,11 @@
|
||||
// <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;
|
||||
@@ -38,10 +37,11 @@ namespace FileConverter
|
||||
{
|
||||
OutputType.Ogg,
|
||||
OutputType.Mp3,
|
||||
OutputType.Aac,
|
||||
OutputType.Aac,
|
||||
OutputType.Flac,
|
||||
OutputType.Wav,
|
||||
OutputType.Mkv,
|
||||
OutputType.Avi,
|
||||
OutputType.Ico,
|
||||
OutputType.Jpg,
|
||||
OutputType.Png,
|
||||
@@ -57,7 +57,7 @@ namespace FileConverter
|
||||
};
|
||||
|
||||
this.PostConversionActionComboBox.ItemsSource = postConversionActions;
|
||||
|
||||
|
||||
this.InitializeCompatibleInputExtensions();
|
||||
}
|
||||
|
||||
@@ -91,14 +91,6 @@ namespace FileConverter
|
||||
}
|
||||
}
|
||||
|
||||
private void SelectedPresetPropertyChanged(object sender, PropertyChangedEventArgs e)
|
||||
{
|
||||
if (e.PropertyName == "OutputType")
|
||||
{
|
||||
this.OnPropertyChanged("InputCategories");
|
||||
}
|
||||
}
|
||||
|
||||
public Settings ApplicationSettings
|
||||
{
|
||||
get
|
||||
@@ -139,6 +131,14 @@ namespace FileConverter
|
||||
this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
|
||||
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 +319,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,95 @@
|
||||
<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>
|
||||
<valueConverters:ApplicationVersionToApplicationName x:Key="ApplicationVersionToApplicationName"/>
|
||||
|
||||
<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}"/>
|
||||
</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;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
# Change Log
|
||||
|
||||
## 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.24720.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FileConverter", "Application\FileConverter\FileConverter.csproj", "{D27A76D2-43E4-43CC-9DA3-334B0B46F4E5}"
|
||||
EndProject
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
<!-- 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="0.5.0" Manufacturer="AAllard" UpgradeCode="e3ca717b-a897-418a-bbef-5c7e35c76e4b">
|
||||
<Package Id="*" InstallerVersion="200" Compressed="yes" InstallScope="perMachine" Platform="x64" />
|
||||
|
||||
<Icon Id="icon.ico" SourceFile="..\Resources\ApplicationIcon.ico"/>
|
||||
@@ -56,6 +56,9 @@
|
||||
<Component Guid="{9BF0AC45-A586-41C9-BA93-6048B46DA65F}" Win64="$(var.Win64)">
|
||||
<File Id="SharpShell.dll" KeyPath="yes" Source="..\Middleware\SharpShell\SharpShell.dll" />
|
||||
</Component>
|
||||
<Component Guid="{E1B1C09C-B089-40D8-859B-0E55F640CAE1}" Win64="$(var.Win64)">
|
||||
<File Id="Markdown.Xaml.dll" KeyPath="yes" Source="..\Middleware\Markdown.Xaml.dll" />
|
||||
</Component>
|
||||
<Component Guid="{AA5EA6F7-C443-488B-8E48-7CF000B9AD2A}" Win64="$(var.Win64)">
|
||||
<File Source="$(var.FileConverter.TargetPath)" KeyPath="yes" />
|
||||
</Component>
|
||||
@@ -85,9 +88,12 @@
|
||||
<Component Id="RegistryEntries" Guid="{C3EF3D67-0206-4DBD-B2EA-78FF2E290093}">
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter">
|
||||
<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"/>
|
||||
<RegistryValue Name="CompatibleInputExtensions" Type="string" Value="3gp;aac;aiff;ape;avi;bik;bmp;cda;flac;flv;ico;jpg;jpeg;m4a;mkv;mov;mp3;mp4;ogg;png;tiff;wav;webm;wma;wmv"/>
|
||||
</RegistryKey>
|
||||
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\3gp">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Mkv;To Mkv (low quality);To Avi;To Ogg;To Flac;To Wav;To Mp3;To Aac"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\aac">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Ogg;To Wav;To Mp3"/>
|
||||
</RegistryKey>
|
||||
@@ -98,13 +104,13 @@
|
||||
<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)"/>
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Mkv;To Mkv (low quality);To Avi;To Ogg;To Flac;To Wav;To Mp3;To Aac"/>
|
||||
</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)"/>
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Mkv;To Mkv (low quality);To Avi;To Ogg;To Flac;To Wav;To Mp3;To Aac"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\bmp">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Png;To Jpg;To Ico (max 256x256)"/>
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Png;To Jpg;To Ico (max 256x256);To small Png"/>
|
||||
</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"/>
|
||||
@@ -113,47 +119,53 @@
|
||||
<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"/>
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Mkv;To Mkv (low quality);To Avi;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)"/>
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Png;To Ico (max 256x256);To small Png"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\jpg">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Png;To Ico (max 256x256)"/>
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Png;To Ico (max 256x256);To small Png"/>
|
||||
</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"/>
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Mkv;To Mkv (low quality);To Avi;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"/>
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Mkv;To Mkv (low quality);To Avi;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"/>
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Mkv;To Mkv (low quality);To Avi;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)"/>
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Jpg;To Ico (max 256x256);To small Png"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\tiff">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Png;To Jpg;To Ico (max 256x256)"/>
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Png;To Jpg;To Ico (max 256x256);To small Png"/>
|
||||
</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\webm">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Mkv;To Mkv (low quality);To Avi;To Ogg;To Flac;To Wav;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"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\wmv">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Mkv;To Mkv (low quality);To Avi;To Ogg;To Flac;To Wav;To Mp3;To Aac"/>
|
||||
</RegistryKey>
|
||||
</Component>
|
||||
</ComponentGroup>
|
||||
</Fragment>
|
||||
|
||||
@@ -1,22 +1,24 @@
|
||||
# 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
|
||||
|
||||
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, mp4
|
||||
Image | png, jpg, ico | bmp, ico, jpg, jpeg, png, tiff
|
||||
------------|---------------------------|--------------------------------------------------------------------------------------------
|
||||
Audio | aac, flac, mp3, ogg, wav | 3gp, aiff, ape, avi, bik, cda, flac, flv, m4a, mkv, mov, mp3, mp4, ogg, wav, wma, webm, wmv
|
||||
Video | avi, mkv | 3gp, avi, bik, flv, mkv, mov, mp4, webm, wmv
|
||||
Image | ico, jpg, png, | 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.*
|
||||
|
||||
*Note 3: The avi output file format encodes video using Xvid encoder for video and Mp3 encoder for audio.*
|
||||
|
||||
## Thanks
|
||||
|
||||
File converter uses the following middlewares:
|
||||
@@ -30,6 +32,9 @@ Thanks to Dave Kerr for his work on SharpShell. [CodePlex link](https://sharpshe
|
||||
**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.
|
||||
|
||||
|
After Width: | Height: | Size: 2.1 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 |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 37 KiB |
@@ -0,0 +1,4 @@
|
||||
<Version>
|
||||
<Latest Major="0" Minor="4" Patch="1"/>
|
||||
<URL>http://github.com/Tichau/FileConverter/releases/download/v0.4/FileConverter-0.4-x64-setup.msi</URL>
|
||||
</Version>
|
||||