mirror of
https://github.com/Tichau/FileConverter.git
synced 2026-11-20 17:42:20 +01:00
Merge remote-tracking branch 'refs/remotes/origin/master' into development
This commit is contained in:
commit
5b975fb463
8 files changed
+147
-185
No files matched your search
@@ -134,19 +134,11 @@ namespace FileConverter
|
||||
//System.Array.Resize(ref args, 2);
|
||||
//args[1] = "--settings";
|
||||
|
||||
//System.Array.Resize(ref args, 5);
|
||||
//args[1] = "--conversion-preset";
|
||||
//args[2] = "To Flac";
|
||||
//args[3] = "--verbose";
|
||||
//args[4] = @"D:\Test\02 - Corn on the Cob.mp3";
|
||||
|
||||
//System.Array.Resize(ref args, 6);
|
||||
//args[1] = "--conversion-preset";
|
||||
//args[2] = "Extract CDA To Ogg";
|
||||
//args[3] = "--verbose";
|
||||
|
||||
//args[4] = @"E:\Track01.cda";
|
||||
//args[5] = @"E:\Track02.cda";
|
||||
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";
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -447,40 +447,42 @@ namespace FileConverter
|
||||
|
||||
private void InitializeDefaultSettings(OutputType outputType)
|
||||
{
|
||||
if (outputType == OutputType.Wav)
|
||||
switch (outputType)
|
||||
{
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.AudioEncodingMode, EncodingMode.Wav16.ToString(), true);
|
||||
}
|
||||
case OutputType.Aac:
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.AudioBitrate, "128");
|
||||
break;
|
||||
|
||||
if (outputType == OutputType.Mp3)
|
||||
{
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.AudioEncodingMode, EncodingMode.Mp3VBR.ToString(), true);
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.AudioBitrate, "190");
|
||||
}
|
||||
case OutputType.Flac:
|
||||
case OutputType.Ico:
|
||||
case OutputType.Png:
|
||||
break;
|
||||
|
||||
if (outputType == OutputType.Ogg)
|
||||
{
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.AudioBitrate, "160");
|
||||
}
|
||||
case OutputType.Jpg:
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.ImageQuality, "25");
|
||||
break;
|
||||
|
||||
if (outputType == OutputType.Flac)
|
||||
{
|
||||
}
|
||||
case OutputType.Mkv:
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.VideoQuality, "28");
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.VideoEncodingSpeed, "Very Slow");
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.AudioBitrate, "128");
|
||||
break;
|
||||
|
||||
if (outputType == OutputType.Mkv)
|
||||
{
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.VideoQuality, "28");
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.VideoEncodingSpeed, "Very Slow");
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.AudioBitrate, "128");
|
||||
}
|
||||
case OutputType.Mp3:
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.AudioEncodingMode, EncodingMode.Mp3VBR.ToString(), true);
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.AudioBitrate, "190");
|
||||
break;
|
||||
|
||||
if (outputType == OutputType.Png)
|
||||
{
|
||||
}
|
||||
case OutputType.Ogg:
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.AudioBitrate, "160");
|
||||
break;
|
||||
|
||||
if (outputType == OutputType.Jpg)
|
||||
{
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.ImageQuality, "25");
|
||||
case OutputType.Wav:
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.AudioEncodingMode, EncodingMode.Wav16.ToString(), true);
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new System.Exception("Missing default settings for type " + outputType);
|
||||
}
|
||||
|
||||
this.OnPropertyChanged("Settings");
|
||||
|
||||
@@ -4,7 +4,6 @@ namespace FileConverter
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
@@ -71,8 +70,8 @@ namespace FileConverter
|
||||
return;
|
||||
}
|
||||
|
||||
Settings settings = new Settings();
|
||||
XmlHelpers.LoadFromFile("Settings", temporaryFilePath, ref settings);
|
||||
Settings settings = null;
|
||||
XmlHelpers.LoadFromFile("Settings", temporaryFilePath, out settings);
|
||||
|
||||
RegistryKey registryKey = Registry.CurrentUser.OpenSubKey(@"Software\FileConverter");
|
||||
if (registryKey == null)
|
||||
@@ -97,13 +96,33 @@ namespace FileConverter
|
||||
|
||||
public static Settings Load()
|
||||
{
|
||||
Settings settings = new Settings();
|
||||
Settings defaultSettings = null;
|
||||
|
||||
// Load the default settings.
|
||||
string defaultFilePath = Settings.GetDefaultSettingsFilePath();
|
||||
if (File.Exists(defaultFilePath))
|
||||
{
|
||||
try
|
||||
{
|
||||
XmlHelpers.LoadFromFile<Settings>("Settings", defaultFilePath, out defaultSettings);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
Diagnostics.Debug.LogError("Fail to load file converter default settings. {0}", exception.Message);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Diagnostics.Debug.LogError("Default settings not found at path {0}. You should try to reinstall the application.", defaultFilePath);
|
||||
}
|
||||
|
||||
Settings userSettings = null;
|
||||
string userFilePath = Settings.GetUserSettingsFilePath();
|
||||
if (File.Exists(userFilePath))
|
||||
{
|
||||
try
|
||||
{
|
||||
XmlHelpers.LoadFromFile<Settings>("Settings", userFilePath, ref settings);
|
||||
XmlHelpers.LoadFromFile<Settings>("Settings", userFilePath, out userSettings);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
@@ -119,33 +138,13 @@ namespace FileConverter
|
||||
}
|
||||
}
|
||||
|
||||
if (settings.SerializationVersion != Version)
|
||||
if (userSettings != null && userSettings.SerializationVersion != Version)
|
||||
{
|
||||
Diagnostics.Debug.Log("File converter settings has been imported from version {0} to version {1}.", settings.SerializationVersion, Version);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// If user settings doesn't exist, load the default settings.
|
||||
string defaultFilePath = Settings.GetDefaultSettingsFilePath();
|
||||
if (File.Exists(defaultFilePath))
|
||||
{
|
||||
try
|
||||
{
|
||||
XmlHelpers.LoadFromFile<Settings>("Settings", defaultFilePath, ref settings);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
Diagnostics.Debug.LogError("Fail to load file converter default settings. {0}", exception.Message);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Diagnostics.Debug.LogError("Default settings not found at path {0}. You should try to reinstall the application.", defaultFilePath);
|
||||
Diagnostics.Debug.Log("File converter settings has been imported from version {0} to version {1}.", userSettings.SerializationVersion, Version);
|
||||
}
|
||||
}
|
||||
|
||||
return settings;
|
||||
return userSettings != null ? userSettings.Merge(defaultSettings) : defaultSettings;
|
||||
}
|
||||
|
||||
public ConversionPreset GetPresetFromName(string presetName)
|
||||
@@ -404,5 +403,26 @@ namespace FileConverter
|
||||
{
|
||||
this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
|
||||
private Settings Merge(Settings settings)
|
||||
{
|
||||
if (settings == null)
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
for (int index = 0; index < settings.conversionPresets.Count; index++)
|
||||
{
|
||||
ConversionPreset conversionPreset = settings.conversionPresets[index];
|
||||
if (this.conversionPresets.Any(match => match.Name == conversionPreset.Name))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
this.conversionPresets.Add(conversionPreset);
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,18 +10,13 @@ namespace FileConverter
|
||||
|
||||
public class XmlHelpers
|
||||
{
|
||||
public static void LoadFromFile<T>(string root, string path, ref T deserializedObject)
|
||||
public static void LoadFromFile<T>(string root, string path, out T deserializedObject)
|
||||
{
|
||||
if (string.IsNullOrEmpty(path))
|
||||
{
|
||||
throw new ArgumentNullException("path");
|
||||
}
|
||||
|
||||
if (deserializedObject == null)
|
||||
{
|
||||
throw new ArgumentNullException("deserializedObject");
|
||||
}
|
||||
|
||||
XmlRootAttribute xmlRoot = new XmlRootAttribute
|
||||
{
|
||||
ElementName = root
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
# Change Log
|
||||
|
||||
## 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.
|
||||
- New: Possibility to encode audio in aac format.
|
||||
- New: Possibility to encode images (png, jpg and ico formats).
|
||||
- New: Support new audio input file format: aac
|
||||
- New: Support new video input file formats: bik, flv, mov, mkv
|
||||
- New: Support new image input file formats: bmp, tiff, png, jpg and ico.
|
||||
- New: Multi-thread conversion (file converter will now start multiple conversions at the time depending on your number of cores).
|
||||
- New: Copy the currently selected preset when clicking on the add preset button.
|
||||
- New: Add "My Documents", "My Music", "My Videos" and "My Pictures" folder to output file name generator.
|
||||
- New: Possibility to choose if the application quit after succeeded conversions.
|
||||
- Fixed: Reordering presets does not update the registry.
|
||||
- Fixed: Merge default settings with user settings to prevent errors when upgrading the application.
|
||||
- Tech: Handle incorrect user settings case.
|
||||
- Tech: Improve diagnostics system (compatibility with logs from multiple threads, dump files in AppData folder and error messages).
|
||||
- Tech: Update ffmpeg version.
|
||||
|
||||
## Version 0.3
|
||||
- New: Possibility to extract audio from videos.
|
||||
- New: Support new input file formats: aiff, m4a, avi, mp4.
|
||||
- New: Quality settings for Mp3 (Encoding mode vbr/cbr and bitrate).
|
||||
- New: Quality settings for Ogg (Bitrate).
|
||||
- New: Quality settings for Wav (bits per sample: 8, 16, 24 or 32).
|
||||
- New: Add output file path template system.
|
||||
- New: Add button to move up or down a preset.
|
||||
- New: Add input files post conversion action (No action, move in archive folder or delete).
|
||||
- New: Add categories on input file extensions.
|
||||
- Fixed: Lose focus of main window don't terminate the application.
|
||||
- Fixed: The application icon now have a correct resolution at any size.
|
||||
- Tech: Add error codes on error messages.
|
||||
|
||||
## Version 0.2
|
||||
- New: Support new input file format: ape.
|
||||
- New: Add notion of conversion preset (in order to customize the conversion possibilities).
|
||||
- New: Add settings window to edit conversion presets.
|
||||
- New: Add application icon.
|
||||
- New: Customize application installer.
|
||||
- New: Add diagnostic window to read the application logs.
|
||||
|
||||
## Version 0.1
|
||||
- New: Add decode support for file formats Mp3, Ogg, Wav, Flac, Wma
|
||||
- New: Add encode support for file formats Mp3, Ogg, Wav, Flac
|
||||
- New: UI to visualize the conversion progress
|
||||
@@ -68,6 +68,12 @@
|
||||
<Component Guid="{A5158756-A107-4010-9E2F-3C0333F5A5F6}" Win64="$(var.Win64)">
|
||||
<File Source="..\README.md" KeyPath="yes" />
|
||||
</Component>
|
||||
<Component Guid="{B57DCB2B-3520-4430-98CB-41B58F530D75}" Win64="$(var.Win64)">
|
||||
<File Source="..\CHANGELOG.md" KeyPath="yes" />
|
||||
</Component>
|
||||
<Component Guid="{6378238B-E44F-414B-A7AE-7E72CFA8616D}" Win64="$(var.Win64)">
|
||||
<File Source="..\LICENSE.md" KeyPath="yes" />
|
||||
</Component>
|
||||
<Component Guid="{55CD0B47-D5B0-4F0C-A54E-3E11DF345B48}" Win64="$(var.Win64)">
|
||||
<File Id="Ripper.dll" KeyPath="yes" Source="..\Middleware\Ripper.dll" />
|
||||
</Component>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
# GNU GENERAL PUBLIC LICENSE
|
||||
## Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
## Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
@@ -68,7 +68,7 @@ patents cannot be used to render the program non-free.
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
## TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
@@ -618,9 +618,9 @@ an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
## END OF TERMS AND CONDITIONS
|
||||
----
|
||||
## How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
@@ -3,10 +3,7 @@
|
||||
## 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.
|
||||
|
||||
This application is under GPL version 3 licence.
|
||||
For more informations check the LICENSE file in your installation folder or the [gnu website](http://www.gnu.org/licenses/gpl.html).
|
||||
|
||||
You can download it here: [http://tichau.github.io/FileConverter](http://tichau.github.io/FileConverter).
|
||||
You can download it here: [www.file-converter.org](http://file-converter.org).
|
||||
|
||||
## Supported file formats
|
||||
|
||||
@@ -20,68 +17,12 @@ Category | Supported output formats | Compatible input formats
|
||||
|
||||
*Note 2: The mkv output file format encodes video using H.264 encoder for video and AAC encoder for audio.*
|
||||
|
||||
## Input file post conversion actions
|
||||
|
||||
This actions allow you to chose what you want to do with your input files if the conversion succeed.
|
||||
|
||||
Action | Description
|
||||
----------------------------|------------------------------------------------------------------------------------------------
|
||||
**None** | Don't modify the input file. If the output file name conflict with the input, it will be renamed.
|
||||
**Move in archive folder** | Move the input file in a folder named *Conversion Archives* if the conversion is a success.
|
||||
**Delete** | Delete the input file if the conversion is a success (be careful no warning will be prompted).
|
||||
|
||||
## Output file path template
|
||||
|
||||
This template allow you to define how you want to generate the output file path (depending on the input file path).
|
||||
You have access to the following informations:
|
||||
|
||||
Pattern | Description | Example (with input path: *C:\Music\Artist\Album\Song.wav*)
|
||||
--------|-------------------------------|-----------------------------------------------------------------
|
||||
(p) | Input file path | C:\Music\Artist\Album\
|
||||
(p:d) | My documents folder path | C:\Users\UserName\Documents\
|
||||
(p:m) | My music folder path | C:\Users\UserName\Music\
|
||||
(p:v) | My videos folder path | C:\Users\UserName\Videos\
|
||||
(p:p) | My pictures path | C:\Users\UserName\Pictures\
|
||||
(f) | Input file name | Song
|
||||
(o) | Output file format | mp3
|
||||
(i) | Input file format | wav
|
||||
(d0) | Input parent folder name | Album
|
||||
(d1) | Input sub parent folder name | Artist
|
||||
|
||||
*Tips: You can use uppercase to retrieve caps lock informations. Example: (f) -> Default / (F) -> DEFAULT *
|
||||
|
||||
### Examples
|
||||
|
||||
Simple default template (just change the extension):
|
||||
|
||||
Input: C:\Music\Artist\Album\Song.wav
|
||||
Template: (p)(f)
|
||||
Generated output: C:\Music\Artist\Album\Song.mp3
|
||||
|
||||
File name customization:
|
||||
|
||||
Input: C:\Music\Artist\Album\Song.wav
|
||||
Template: (p)(O)_(f) (from (i))
|
||||
Generated output: C:\Music\Artist\Album\MP3_Song (from wav).mp3
|
||||
|
||||
File path customization:
|
||||
|
||||
Input: C:\Music\Artist\Album\Song.wav
|
||||
Template: D:\(o)\(d1)\(f)
|
||||
Generated output: D:\mp3\Artist\Song.mp3
|
||||
|
||||
CDA extraction:
|
||||
|
||||
Input: E:\Track01.cda
|
||||
Template: (p:m)CDA Extraction\(f)
|
||||
Generated output: C:\Users\UserName\Music\CDA Extraction\Track01.mp3
|
||||
|
||||
## Thanks
|
||||
|
||||
File converter uses the following middlewares:
|
||||
|
||||
**ffmpeg** as file conversion software.
|
||||
Thanks to ffmpeg devs for this awesome open source file convesion tool. [Web site link](https://www.ffmpeg.org/)
|
||||
Thanks to ffmpeg devs for this awesome open source file conversion tool. [Web site link](https://www.ffmpeg.org/)
|
||||
|
||||
**SharpShell** to easily create windows context menu extensions.
|
||||
Thanks to Dave Kerr for his work on SharpShell. [CodePlex link](https://sharpshell.codeplex.com/)
|
||||
@@ -89,47 +30,7 @@ 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)
|
||||
|
||||
## Change Log
|
||||
### v0.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.
|
||||
- New: Possibility to encode audio in aac format.
|
||||
- New: Possibility to encode images (png, jpg and ico formats).
|
||||
- New: Support new audio input file format: aac
|
||||
- New: Support new video input file formats: bik, flv, mov, mkv
|
||||
- New: Support new image input file formats: bmp, tiff, png, jpg and ico.
|
||||
- New: Multi-thread conversion (file converter will now start multiple conversions at the time depending on your number of cores).
|
||||
- New: Copy the currently selected preset when clicking on the add preset button.
|
||||
- New: Add "My Documents", "My Music", "My Videos" and "My Pictures" folder to output file name generator.
|
||||
- New: Possibily to chose if the application quit after succeeded conversions.
|
||||
- Fixed: Reordering presets does not update the registry.
|
||||
- Tech: Handle incorrect user settings case.
|
||||
- Tech: Improve diagnostics system (compatibility with logs from multiple threads, dump files in AppData folder and error messages).
|
||||
- Tech: Update ffmpeg version.
|
||||
## License
|
||||
|
||||
### v0.3
|
||||
- New: Possibility to extract audio from videos.
|
||||
- New: Support new input file formats: aiff, m4a, avi, mp4.
|
||||
- New: Quality settings for Mp3 (Encoding mode vbr/cbr and bitrate).
|
||||
- New: Quality settings for Ogg (Bitrate).
|
||||
- New: Quality settings for Wav (bits per sample: 8, 16, 24 or 32).
|
||||
- New: Add output file path template system.
|
||||
- New: Add button to move up or down a preset.
|
||||
- New: Add input files post conversion action (No action, move in archive folder or delete).
|
||||
- New: Add categories on input file extensions.
|
||||
- Fixed: Lose focus of main window don't terminate the application.
|
||||
- Fixed: The application icon now have a correct resolution at any size.
|
||||
- Tech: Add error codes on error messages.
|
||||
|
||||
### v0.2
|
||||
- New: Support new input file format: ape.
|
||||
- New: Add notion of conversion preset (in order to customize the conversion possibilities).
|
||||
- New: Add settings window to edit conversion presets.
|
||||
- New: Add application icon.
|
||||
- New: Customize application installer.
|
||||
- New: Add diagnostic window to read the application logs.
|
||||
|
||||
### v0.1
|
||||
- New: Add decode support for file formats Mp3, Ogg, Wav, Flac, Wma
|
||||
- New: Add encode support for file formats Mp3, Ogg, Wav, Flac
|
||||
- New: UI to visualize the conversion progress
|
||||
File Converter is licensed under the GPL version 3 License.
|
||||
For more information check the LICENSE.md file in your installation folder or the [gnu website](http://www.gnu.org/licenses/gpl.html).
|
||||
Reference in new issue
Block a user