Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
36792c31ab | ||
|
|
07f2f9a2dd | ||
|
|
b6980780a8 | ||
|
|
4f38accc9e | ||
|
|
1d64c778e7 | ||
|
|
9ea7abd160 | ||
|
|
7f27737481 | ||
|
|
54d8c4094e | ||
|
|
4fa0863fe7 | ||
|
|
15bef45d4f | ||
|
|
ee1e04f3ff | ||
|
|
6166bd60d5 | ||
|
|
db86b6c372 | ||
|
|
d2b05c9933 | ||
|
|
386e61fec4 | ||
|
|
c0a1ac18e8 | ||
|
|
c327eae1f6 | ||
|
|
ee791bcc11 | ||
|
|
8990efddda | ||
|
|
3a2950190f | ||
|
|
45162328a9 | ||
|
|
1e05944566 | ||
|
|
f58cc625a1 | ||
|
|
09e60f7fa5 | ||
|
|
5732007afb | ||
|
|
69d06f5cde | ||
|
|
dd1d5da176 | ||
|
|
aad9deb7e6 | ||
|
|
40272e58e4 | ||
|
|
8434b00fe6 | ||
|
|
a6d2786749 | ||
|
|
9d659a0178 | ||
|
|
73cecd2722 | ||
|
|
8ca9734298 | ||
|
|
866844e369 | ||
|
|
8007b723a5 | ||
|
|
673f715ed0 | ||
|
|
43cfa7cd11 | ||
|
|
1f94578556 | ||
|
|
73d3255e76 | ||
|
|
9b0777d54d | ||
|
|
fedd6fa02d | ||
|
|
8343bc3e6c | ||
|
|
e656462c11 | ||
|
|
181578ef62 | ||
|
|
3ee0587d24 | ||
|
|
d4d8e175e8 | ||
|
|
fb15d8e833 | ||
|
|
c6e88b320d | ||
|
|
e804355034 | ||
|
|
34a2990e9d | ||
|
|
24f999d859 | ||
|
|
bfa8fd7d4f | ||
|
|
3da4e0ea84 | ||
|
|
28c9ae94b0 | ||
|
|
1210637f59 | ||
|
|
509d47fb91 | ||
|
|
1b4e39df45 | ||
|
|
8dbf692855 | ||
|
|
7b0af841ab | ||
|
|
d66723d510 | ||
|
|
8963bdb6c0 | ||
|
|
4cd9a851e8 | ||
|
|
77c5d94b74 | ||
|
|
5f7b2911da | ||
|
|
96a2d4f52f | ||
|
|
12cfaaefc6 | ||
|
|
d4cf9d9649 | ||
|
|
e0d290306b | ||
|
|
1d66f9fef0 | ||
|
|
6f7b0386cd | ||
|
|
228217e79b | ||
|
|
06589d6cf8 | ||
|
|
b88bdcb8be | ||
|
|
06f5b818bb | ||
|
|
8a7e8b0262 | ||
|
|
a223ee1610 | ||
|
|
19e9e1d50a | ||
|
|
afe7c4048a | ||
|
|
a0fbf28e42 | ||
|
|
915f93defd | ||
|
|
3e7c7a4a30 | ||
|
|
5db9c09cff | ||
|
|
82be95fb43 | ||
|
|
132e254f25 | ||
|
|
7352f2a0e3 | ||
|
|
a3a930d44c | ||
|
|
ae3328b029 | ||
|
|
c9d2c77340 | ||
|
|
890ed87cf8 | ||
|
|
f6547941bc | ||
|
|
00d380f92e | ||
|
|
d7f25f6ab2 | ||
|
|
ef566be2bf | ||
|
|
c5b73b32b3 | ||
|
|
359a445126 | ||
|
|
a3cddcc75c | ||
|
|
b8a46ac0ef | ||
|
|
3b2adcc941 | ||
|
|
b4058b2ed6 | ||
|
|
18d616050a | ||
|
|
1b6984c378 | ||
|
|
a589aa53a4 | ||
|
|
0793a25ebc | ||
|
|
4a02a02083 | ||
|
|
c929221c60 | ||
|
|
ec98a107e4 | ||
|
|
68327299c0 | ||
|
|
4c7ff20193 | ||
|
|
5b49da745a | ||
|
|
6944180acd | ||
|
|
fbb1146931 | ||
|
|
81ea226e84 | ||
|
|
b0a1c57dd8 | ||
|
|
45625d18e4 | ||
|
|
6d1c8f3ff3 | ||
|
|
fbc080f935 | ||
|
|
9400f742d8 | ||
|
|
6dfd1f4bbf | ||
|
|
96988cd131 | ||
|
|
df80137624 | ||
|
|
03e975b371 | ||
|
|
43f5cb91cd | ||
|
|
be875bdf03 | ||
|
|
7147d670c1 | ||
|
|
390cfdc81b | ||
|
|
62636bd730 | ||
|
|
2abd88a76b | ||
|
|
4695ee2008 | ||
|
|
646b7fffd1 | ||
|
|
0e471b0456 | ||
|
|
db955d01d0 | ||
|
|
bf06685d6f | ||
|
|
21e045e9f6 | ||
|
|
86cf38c2af | ||
|
|
299e2c0ac4 | ||
|
|
714ead809c | ||
|
|
478627d8b3 |
No files matched your search
@@ -1,10 +1,196 @@
|
||||
obj/
|
||||
.vs/
|
||||
.vscode/
|
||||
Application/
|
||||
Installer/
|
||||
packages/
|
||||
TestData/
|
||||
Certificate/
|
||||
## Ignore Visual Studio temporary files, build results, and
|
||||
## files generated by popular Visual Studio add-ons.
|
||||
|
||||
# User-specific files
|
||||
*.suo
|
||||
*.user
|
||||
*.userosscache
|
||||
*.sln.docstates
|
||||
|
||||
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||
*.userprefs
|
||||
|
||||
# Build results
|
||||
[Dd]ebug/
|
||||
[Dd]ebugPublic/
|
||||
[Rr]elease/
|
||||
[Rr]eleases/
|
||||
x64/
|
||||
x86/
|
||||
build/
|
||||
bld/
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
|
||||
# Visual Studo 2015 cache/options directory
|
||||
.vs/
|
||||
|
||||
# MSTest test Results
|
||||
[Tt]est[Rr]esult*/
|
||||
[Bb]uild[Ll]og.*
|
||||
|
||||
# NUNIT
|
||||
*.VisualState.xml
|
||||
TestResult.xml
|
||||
|
||||
# Build Results of an ATL Project
|
||||
[Dd]ebugPS/
|
||||
[Rr]eleasePS/
|
||||
dlldata.c
|
||||
|
||||
*_i.c
|
||||
*_p.c
|
||||
*_i.h
|
||||
*.ilk
|
||||
*.meta
|
||||
*.obj
|
||||
*.pch
|
||||
*.pdb
|
||||
*.pgc
|
||||
*.pgd
|
||||
*.rsp
|
||||
*.sbr
|
||||
*.tlb
|
||||
*.tli
|
||||
*.tlh
|
||||
*.tmp
|
||||
*.tmp_proj
|
||||
*.log
|
||||
*.vspscc
|
||||
*.vssscc
|
||||
.builds
|
||||
*.pidb
|
||||
*.svclog
|
||||
*.scc
|
||||
|
||||
# Chutzpah Test files
|
||||
_Chutzpah*
|
||||
|
||||
# Visual C++ cache files
|
||||
ipch/
|
||||
*.aps
|
||||
*.ncb
|
||||
*.opensdf
|
||||
*.sdf
|
||||
*.cachefile
|
||||
|
||||
# Visual Studio profiler
|
||||
*.psess
|
||||
*.vsp
|
||||
*.vspx
|
||||
|
||||
# TFS 2012 Local Workspace
|
||||
$tf/
|
||||
|
||||
# Guidance Automation Toolkit
|
||||
*.gpState
|
||||
|
||||
# ReSharper is a .NET coding add-in
|
||||
_ReSharper*/
|
||||
*.[Rr]e[Ss]harper
|
||||
*.DotSettings.user
|
||||
|
||||
# JustCode is a .NET coding addin-in
|
||||
.JustCode
|
||||
|
||||
# TeamCity is a build add-in
|
||||
_TeamCity*
|
||||
|
||||
# DotCover is a Code Coverage Tool
|
||||
*.dotCover
|
||||
|
||||
# NCrunch
|
||||
_NCrunch_*
|
||||
.*crunch*.local.xml
|
||||
|
||||
# MightyMoose
|
||||
*.mm.*
|
||||
AutoTest.Net/
|
||||
|
||||
# Web workbench (sass)
|
||||
.sass-cache/
|
||||
|
||||
# Installshield output folder
|
||||
[Ee]xpress/
|
||||
|
||||
# DocProject is a documentation generator add-in
|
||||
DocProject/buildhelp/
|
||||
DocProject/Help/*.HxT
|
||||
DocProject/Help/*.HxC
|
||||
DocProject/Help/*.hhc
|
||||
DocProject/Help/*.hhk
|
||||
DocProject/Help/*.hhp
|
||||
DocProject/Help/Html2
|
||||
DocProject/Help/html
|
||||
|
||||
# Click-Once directory
|
||||
publish/
|
||||
|
||||
# Publish Web Output
|
||||
*.[Pp]ublish.xml
|
||||
*.azurePubxml
|
||||
# TODO: Comment the next line if you want to checkin your web deploy settings
|
||||
# but database connection strings (with potential passwords) will be unencrypted
|
||||
*.pubxml
|
||||
*.publishproj
|
||||
|
||||
# NuGet Packages
|
||||
*.nupkg
|
||||
# The packages folder can be ignored because of Package Restore
|
||||
**/packages/*
|
||||
# except build/, which is used as an MSBuild target.
|
||||
!**/packages/build/
|
||||
# Uncomment if necessary however generally it will be regenerated when needed
|
||||
#!**/packages/repositories.config
|
||||
|
||||
# Windows Azure Build Output
|
||||
csx/
|
||||
*.build.csdef
|
||||
|
||||
# Windows Store app package directory
|
||||
AppPackages/
|
||||
|
||||
# Others
|
||||
*.[Cc]ache
|
||||
ClientBin/
|
||||
[Ss]tyle[Cc]op.*
|
||||
~$*
|
||||
*~
|
||||
*.dbmdl
|
||||
*.dbproj.schemaview
|
||||
*.pfx
|
||||
*.publishsettings
|
||||
node_modules/
|
||||
bower_components/
|
||||
|
||||
# RIA/Silverlight projects
|
||||
Generated_Code/
|
||||
|
||||
# Backup & report files from converting an old project file
|
||||
# to a newer Visual Studio version. Backup files are not needed,
|
||||
# because we have git ;-)
|
||||
_UpgradeReport_Files/
|
||||
Backup*/
|
||||
UpgradeLog*.XML
|
||||
UpgradeLog*.htm
|
||||
|
||||
# SQL Server files
|
||||
*.mdf
|
||||
*.ldf
|
||||
|
||||
# Business Intelligence projects
|
||||
*.rdl.data
|
||||
*.bim.layout
|
||||
*.bim_*.settings
|
||||
|
||||
# Microsoft Fakes
|
||||
FakesAssemblies/
|
||||
|
||||
# Node.js Tools for Visual Studio
|
||||
.ntvs_analysis.dat
|
||||
|
||||
# Visual Studio 6 build log
|
||||
*.plg
|
||||
|
||||
# Visual Studio 6 workspace options file
|
||||
*.opt
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
|
||||
</startup>
|
||||
</configuration>
|
||||
@@ -0,0 +1,8 @@
|
||||
<Application x:Class="FileConverter.Application"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
StartupUri="Windows/MainWindow.xaml" ShutdownMode="OnMainWindowClose">
|
||||
<Application.Resources>
|
||||
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
@@ -0,0 +1,356 @@
|
||||
// <copyright file="Application.xaml.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
/* File Converter - This program allow you to convert file format to another.
|
||||
Copyright (C) 2015 Adrien Allard
|
||||
email: adrien.allard.pro@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace FileConverter
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Threading;
|
||||
using System.Windows;
|
||||
|
||||
using FileConverter.ConversionJobs;
|
||||
using FileConverter.Diagnostics;
|
||||
|
||||
public partial class Application : System.Windows.Application
|
||||
{
|
||||
private int numberOfConversionThread = 1;
|
||||
|
||||
private static readonly Version Version = new Version()
|
||||
{
|
||||
Major = 0,
|
||||
Minor = 4,
|
||||
};
|
||||
|
||||
private readonly List<ConversionJob> conversionJobs = new List<ConversionJob>();
|
||||
|
||||
private bool debugMode;
|
||||
private bool initialized;
|
||||
private bool cancelAutoExit;
|
||||
|
||||
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
|
||||
{
|
||||
return Application.Version;
|
||||
}
|
||||
}
|
||||
|
||||
public ReadOnlyCollection<ConversionJob> ConvertionJobs
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public Settings Settings
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public bool ShowSettings
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public bool Verbose
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public void CancelAutoExit()
|
||||
{
|
||||
this.cancelAutoExit = true;
|
||||
}
|
||||
|
||||
private void Initialize()
|
||||
{
|
||||
Diagnostics.Debug.Log("The number of processors on this computer is {0}. Set the default number of conversion threads to {0}", Environment.ProcessorCount);
|
||||
this.numberOfConversionThread = Environment.ProcessorCount;
|
||||
|
||||
// Load settigns.
|
||||
Debug.Log("Load settings...");
|
||||
this.Settings = Settings.Load();
|
||||
if (this.Settings == null)
|
||||
{
|
||||
Diagnostics.Debug.LogError("The application will now shutdown. If you want to fix the problem yourself please edit or delete the file: C:\\Users\\UserName\\AppData\\Local\\FileConverter\\Settings.user.xml.");
|
||||
Dispatcher.BeginInvoke((Action)(() => Application.Current.Shutdown()));
|
||||
return;
|
||||
}
|
||||
|
||||
// Retrieve arguments.
|
||||
Debug.Log("Retrieve arguments...");
|
||||
string[] args = Environment.GetCommandLineArgs();
|
||||
|
||||
#if (DEBUG)
|
||||
if (args.Length <= 1)
|
||||
{
|
||||
this.debugMode = true;
|
||||
System.Array.Resize(ref args, 8);
|
||||
args[1] = "--conversion-preset";
|
||||
args[2] = "To Ogg";
|
||||
args[3] = "--verbose";
|
||||
|
||||
args[4] = @"D:\Test\TrailerV2 compressed.mkv";
|
||||
args[4] = @"D:\Test\image.png";
|
||||
args[4] = @"E:\Track01.cda";
|
||||
args[4] = @"D:\Test\Track01.mp3";
|
||||
args[5] = @"D:\Test\Track02.mp3";
|
||||
args[6] = @"D:\Test\Track03.mp3";
|
||||
args[7] = @"D:\Test\Track04.mp3";
|
||||
|
||||
//System.Array.Resize(ref args, 2);
|
||||
//args[1] = "--settings";
|
||||
|
||||
System.Array.Resize(ref args, 5);
|
||||
args[1] = "--conversion-preset";
|
||||
args[2] = "To Aac";
|
||||
args[3] = "--verbose";
|
||||
args[4] = @"D:\Test\02 - Corn on the Cob.flac";
|
||||
}
|
||||
#endif
|
||||
|
||||
for (int index = 0; index < args.Length; index++)
|
||||
{
|
||||
string argument = args[index];
|
||||
Debug.Log("Arg{0}: {1}", index, argument);
|
||||
}
|
||||
|
||||
Debug.Log(string.Empty);
|
||||
|
||||
ConversionPreset conversionPreset = null;
|
||||
List<string> filePaths = new List<string>();
|
||||
|
||||
// Parse arguments.
|
||||
for (int index = 1; index < args.Length; index++)
|
||||
{
|
||||
string argument = args[index];
|
||||
if (argument.StartsWith("--"))
|
||||
{
|
||||
// This is an optional parameter.
|
||||
string parameterTitle = argument.Substring(2).ToLowerInvariant();
|
||||
|
||||
switch (parameterTitle)
|
||||
{
|
||||
case "settings":
|
||||
this.ShowSettings = true;
|
||||
return;
|
||||
|
||||
case "apply-settings":
|
||||
Settings.ApplyTemporarySettings();
|
||||
Dispatcher.BeginInvoke((Action)(() => Application.Current.Shutdown()));
|
||||
return;
|
||||
|
||||
case "conversion-preset":
|
||||
if (index >= args.Length - 1)
|
||||
{
|
||||
Debug.LogError("Invalid format. (code 0x01)");
|
||||
Dispatcher.BeginInvoke((Action)(() => Application.Current.Shutdown()));
|
||||
return;
|
||||
}
|
||||
|
||||
conversionPreset = this.Settings.GetPresetFromName(args[index + 1]);
|
||||
if (conversionPreset == null)
|
||||
{
|
||||
Debug.LogError("Invalid conversion preset '{0}'. (code 0x02)", args[index + 1]);
|
||||
Dispatcher.BeginInvoke((Action)(() => Application.Current.Shutdown()));
|
||||
return;
|
||||
}
|
||||
|
||||
index++;
|
||||
continue;
|
||||
|
||||
case "verbose":
|
||||
{
|
||||
this.Verbose = true;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
Debug.LogError("Unknown option {0}.", parameterTitle);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
filePaths.Add(argument);
|
||||
}
|
||||
}
|
||||
|
||||
if (conversionPreset == null)
|
||||
{
|
||||
Debug.LogError("Can't retrieve the conversion preset from arguments.");
|
||||
return;
|
||||
}
|
||||
|
||||
// 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.initialized = true;
|
||||
}
|
||||
|
||||
protected override void OnExit(ExitEventArgs e)
|
||||
{
|
||||
base.OnExit(e);
|
||||
|
||||
Debug.Log("Exit application.");
|
||||
|
||||
Debug.Release();
|
||||
}
|
||||
|
||||
private void ConvertFiles()
|
||||
{
|
||||
Thread[] jobThreads = new Thread[this.numberOfConversionThread];
|
||||
|
||||
while (true)
|
||||
{
|
||||
// Compute conversion flags.
|
||||
ConversionFlags conversionFlags = ConversionFlags.None;
|
||||
bool allJobAreFinished = true;
|
||||
for (int jobIndex = 0; jobIndex < this.conversionJobs.Count; jobIndex++)
|
||||
{
|
||||
ConversionJob conversionJob = this.conversionJobs[jobIndex];
|
||||
allJobAreFinished &= !(conversionJob.State == ConversionJob.ConversionState.Ready ||
|
||||
conversionJob.State == ConversionJob.ConversionState.InProgress);
|
||||
|
||||
if (conversionJob.State == ConversionJob.ConversionState.InProgress)
|
||||
{
|
||||
conversionFlags |= conversionJob.StateFlags;
|
||||
}
|
||||
}
|
||||
|
||||
if (allJobAreFinished)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
// Start job if possible.
|
||||
for (int jobIndex = 0; jobIndex < this.conversionJobs.Count; jobIndex++)
|
||||
{
|
||||
ConversionJob conversionJob = this.conversionJobs[jobIndex];
|
||||
if (conversionJob.State == ConversionJob.ConversionState.Ready &&
|
||||
conversionJob.CanStartConversion(conversionFlags))
|
||||
{
|
||||
// Find a thread to execute the job.
|
||||
Thread jobThread = null;
|
||||
for (int threadIndex = 0; threadIndex < jobThreads.Length; threadIndex++)
|
||||
{
|
||||
Thread thread = jobThreads[threadIndex];
|
||||
if (thread == null || !thread.IsAlive)
|
||||
{
|
||||
jobThread = new Thread(this.ExecuteConversionJob);
|
||||
jobThreads[threadIndex] = jobThread;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (jobThread != null)
|
||||
{
|
||||
jobThread.Start(conversionJob);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Thread.Sleep(50);
|
||||
}
|
||||
|
||||
if (this.Settings.ExitApplicationWhenConversionsFinished)
|
||||
{
|
||||
bool allConversionsSucceed = true;
|
||||
for (int index = 0; index < this.conversionJobs.Count; index++)
|
||||
{
|
||||
allConversionsSucceed &= this.conversionJobs[index].State == ConversionJob.ConversionState.Done;
|
||||
}
|
||||
|
||||
if (allConversionsSucceed)
|
||||
{
|
||||
System.Threading.Thread.Sleep((int)this.Settings.DurationBetweenEndOfConversionsAndApplicationExit * 1000);
|
||||
|
||||
if (this.cancelAutoExit)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Dispatcher.BeginInvoke((Action)(() => Application.Current.Shutdown()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ExecuteConversionJob(object parameter)
|
||||
{
|
||||
ConversionJob conversionJob = parameter as ConversionJob;
|
||||
if (conversionJob == null)
|
||||
{
|
||||
throw new System.ArgumentException("The parameter must be a conversion job.", "parameter");
|
||||
}
|
||||
|
||||
if (conversionJob.State != ConversionJob.ConversionState.Ready)
|
||||
{
|
||||
Debug.LogError("Fail to execute conversion job.");
|
||||
return;
|
||||
}
|
||||
|
||||
conversionJob.StartConvertion();
|
||||
|
||||
if (conversionJob.State == ConversionJob.ConversionState.Done && !System.IO.File.Exists(conversionJob.OutputFilePath))
|
||||
{
|
||||
Debug.LogError("Can't find the output file.");
|
||||
}
|
||||
else if (conversionJob.State == ConversionJob.ConversionState.Failed && System.IO.File.Exists(conversionJob.OutputFilePath))
|
||||
{
|
||||
Debug.Log("The conversion job failed but there is an output file that does exists.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
// <copyright file="EncodingMode.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverter.Controls
|
||||
{
|
||||
public enum EncodingMode
|
||||
{
|
||||
Wav8,
|
||||
Wav16,
|
||||
Wav24,
|
||||
Wav32,
|
||||
|
||||
Mp3VBR,
|
||||
Mp3CBR,
|
||||
|
||||
OggVBR,
|
||||
|
||||
AacVBR,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<UserControl
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:valueConverters="clr-namespace:FileConverter.ValueConverters" x:Name="userControl"
|
||||
x:Class="FileConverter.Controls.EncodingQualitySliderControl"
|
||||
mc:Ignorable="d" d:DesignWidth="300" Height="50">
|
||||
<UserControl.Resources>
|
||||
<valueConverters:BitrateToString x:Key="BitrateToString"/>
|
||||
</UserControl.Resources>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="65"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Slider Grid.Column="0" x:Name="slider" Margin="0,2,0,0" VerticalAlignment="Top" Maximum="245" AutoToolTipPlacement="TopLeft" SmallChange="8" IsSnapToTickEnabled="True" IsSelectionRangeEnabled="True" SelectionStart="115" SelectionEnd="245" Minimum="65" TickPlacement="BottomRight" LargeChange="32" TickFrequency="8" Ticks="65 85 100 115 130 165 175 190 225 245" Foreground="#004B82" />
|
||||
<Label Grid.Column="1" Content="{Binding Value, Converter={StaticResource BitrateToString}, ElementName=slider, Mode=OneWay}" Width="65" />
|
||||
<Label Grid.Column="0" Grid.Row="1" Content="Recommended bitrate range in blue" Foreground="#E5004B82" FontSize="11" />
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,205 @@
|
||||
// <copyright file="EncodingQualitySliderControl.xaml.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverter.Controls
|
||||
{
|
||||
using System.Diagnostics;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
/// <summary>
|
||||
/// Interaction logic for EncodingQualitySliderControl.
|
||||
/// </summary>
|
||||
public partial class EncodingQualitySliderControl : UserControl
|
||||
{
|
||||
public static readonly DependencyProperty BitrateProperty = DependencyProperty.Register(
|
||||
"Bitrate",
|
||||
typeof(double),
|
||||
typeof(EncodingQualitySliderControl),
|
||||
new FrameworkPropertyMetadata(new PropertyChangedCallback(EncodingQualitySliderControl.OnBitrateValueChanged), new CoerceValueCallback(EncodingQualitySliderControl.CoerceBitrateValue)));
|
||||
|
||||
public static readonly DependencyProperty EncodingModeProperty = DependencyProperty.Register(
|
||||
"EncodingMode",
|
||||
typeof(EncodingMode),
|
||||
typeof(EncodingQualitySliderControl),
|
||||
new PropertyMetadata(new PropertyChangedCallback(EncodingQualitySliderControl.OnEncodingModeValueChanged)));
|
||||
|
||||
public EncodingQualitySliderControl()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
|
||||
this.CoerceValue(EncodingQualitySliderControl.BitrateProperty);
|
||||
|
||||
this.slider.ValueChanged += this.Slider_ValueChanged;
|
||||
}
|
||||
|
||||
public EncodingMode EncodingMode
|
||||
{
|
||||
get
|
||||
{
|
||||
return (EncodingMode)this.GetValue(EncodingQualitySliderControl.EncodingModeProperty);
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.SetCurrentValue(EncodingQualitySliderControl.EncodingModeProperty, value);
|
||||
}
|
||||
}
|
||||
|
||||
public double Bitrate
|
||||
{
|
||||
get
|
||||
{
|
||||
return (double)this.GetValue(EncodingQualitySliderControl.BitrateProperty);
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.SetCurrentValue(EncodingQualitySliderControl.BitrateProperty, this.GetNearestTickValue(value));
|
||||
}
|
||||
}
|
||||
|
||||
private static void OnBitrateValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs eventArgs)
|
||||
{
|
||||
EncodingQualitySliderControl encodingQualitySliderControl = sender as EncodingQualitySliderControl;
|
||||
encodingQualitySliderControl.slider.Value = (double)eventArgs.NewValue;
|
||||
}
|
||||
|
||||
private static object CoerceBitrateValue(DependencyObject sender, object basevalue)
|
||||
{
|
||||
EncodingQualitySliderControl encodingQualitySliderControl = sender as EncodingQualitySliderControl;
|
||||
return encodingQualitySliderControl.GetNearestTickValue((double)basevalue);
|
||||
}
|
||||
|
||||
private static void OnEncodingModeValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs eventArgs)
|
||||
{
|
||||
EncodingQualitySliderControl encodingQualitySliderControl = sender as EncodingQualitySliderControl;
|
||||
Slider sliderControl = encodingQualitySliderControl.slider;
|
||||
|
||||
switch (encodingQualitySliderControl.EncodingMode)
|
||||
{
|
||||
case EncodingMode.Mp3VBR:
|
||||
{
|
||||
sliderControl.Minimum = 65;
|
||||
sliderControl.Maximum = 245;
|
||||
sliderControl.SelectionStart = 115;
|
||||
sliderControl.SelectionEnd = 245;
|
||||
sliderControl.Ticks.Clear();
|
||||
sliderControl.Ticks.Add(65);
|
||||
sliderControl.Ticks.Add(85);
|
||||
sliderControl.Ticks.Add(100);
|
||||
sliderControl.Ticks.Add(115);
|
||||
sliderControl.Ticks.Add(130);
|
||||
sliderControl.Ticks.Add(165);
|
||||
sliderControl.Ticks.Add(175);
|
||||
sliderControl.Ticks.Add(190);
|
||||
sliderControl.Ticks.Add(225);
|
||||
sliderControl.Ticks.Add(245);
|
||||
break;
|
||||
}
|
||||
|
||||
case EncodingMode.Mp3CBR:
|
||||
{
|
||||
sliderControl.Minimum = 8;
|
||||
sliderControl.Maximum = 320;
|
||||
sliderControl.SelectionStart = 128;
|
||||
sliderControl.SelectionEnd = 256;
|
||||
sliderControl.Ticks.Clear();
|
||||
sliderControl.Ticks.Add(8);
|
||||
sliderControl.Ticks.Add(16);
|
||||
sliderControl.Ticks.Add(24);
|
||||
sliderControl.Ticks.Add(32);
|
||||
sliderControl.Ticks.Add(40);
|
||||
sliderControl.Ticks.Add(48);
|
||||
sliderControl.Ticks.Add(64);
|
||||
sliderControl.Ticks.Add(80);
|
||||
sliderControl.Ticks.Add(96);
|
||||
sliderControl.Ticks.Add(112);
|
||||
sliderControl.Ticks.Add(128);
|
||||
sliderControl.Ticks.Add(160);
|
||||
sliderControl.Ticks.Add(192);
|
||||
sliderControl.Ticks.Add(224);
|
||||
sliderControl.Ticks.Add(256);
|
||||
sliderControl.Ticks.Add(320);
|
||||
break;
|
||||
}
|
||||
|
||||
case EncodingMode.OggVBR:
|
||||
{
|
||||
sliderControl.Minimum = 32;
|
||||
sliderControl.Maximum = 500;
|
||||
sliderControl.SelectionStart = 80;
|
||||
sliderControl.SelectionEnd = 192;
|
||||
sliderControl.Ticks.Clear();
|
||||
sliderControl.Ticks.Add(32);
|
||||
sliderControl.Ticks.Add(48);
|
||||
sliderControl.Ticks.Add(64);
|
||||
sliderControl.Ticks.Add(80);
|
||||
sliderControl.Ticks.Add(96);
|
||||
sliderControl.Ticks.Add(112);
|
||||
sliderControl.Ticks.Add(128);
|
||||
sliderControl.Ticks.Add(160);
|
||||
sliderControl.Ticks.Add(192);
|
||||
sliderControl.Ticks.Add(224);
|
||||
sliderControl.Ticks.Add(256);
|
||||
sliderControl.Ticks.Add(320);
|
||||
sliderControl.Ticks.Add(500);
|
||||
break;
|
||||
}
|
||||
|
||||
case EncodingMode.AacVBR:
|
||||
{
|
||||
sliderControl.Minimum = 16;
|
||||
sliderControl.Maximum = 460;
|
||||
sliderControl.SelectionStart = 96;
|
||||
sliderControl.SelectionEnd = 256;
|
||||
sliderControl.Ticks.Clear();
|
||||
sliderControl.Ticks.Add(16);
|
||||
sliderControl.Ticks.Add(32);
|
||||
sliderControl.Ticks.Add(48);
|
||||
sliderControl.Ticks.Add(64);
|
||||
sliderControl.Ticks.Add(80);
|
||||
sliderControl.Ticks.Add(96);
|
||||
sliderControl.Ticks.Add(112);
|
||||
sliderControl.Ticks.Add(128);
|
||||
sliderControl.Ticks.Add(155);
|
||||
sliderControl.Ticks.Add(192);
|
||||
sliderControl.Ticks.Add(224);
|
||||
sliderControl.Ticks.Add(256);
|
||||
sliderControl.Ticks.Add(340);
|
||||
sliderControl.Ticks.Add(460);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
encodingQualitySliderControl.CoerceValue(EncodingQualitySliderControl.BitrateProperty);
|
||||
}
|
||||
|
||||
private void Slider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
|
||||
{
|
||||
if (this.Bitrate == e.NewValue)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this.SetCurrentValue(EncodingQualitySliderControl.BitrateProperty, e.NewValue);
|
||||
}
|
||||
|
||||
private double GetNearestTickValue(double value)
|
||||
{
|
||||
double minimumDifference = float.PositiveInfinity;
|
||||
double nearestTick = value;
|
||||
for (int index = 0; index < this.slider.Ticks.Count; index++)
|
||||
{
|
||||
double tick = this.slider.Ticks[index];
|
||||
double difference = System.Math.Abs(value - tick);
|
||||
if (difference < minimumDifference)
|
||||
{
|
||||
minimumDifference = difference;
|
||||
nearestTick = tick;
|
||||
}
|
||||
}
|
||||
|
||||
return nearestTick;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// // <copyright file="ConversionFlags.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
namespace FileConverter.ConversionJobs
|
||||
{
|
||||
/// <summary>
|
||||
/// This enum describe the special conversion state that need to be multi-threads prerequisites.
|
||||
/// </summary>
|
||||
[System.Flags]
|
||||
public enum ConversionFlags
|
||||
{
|
||||
None = 0x00,
|
||||
|
||||
CdaExtraction = 0x01,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,345 @@
|
||||
// <copyright file="ConversionJob.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverter.ConversionJobs
|
||||
{
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
|
||||
using FileConverter.Diagnostics;
|
||||
|
||||
public class ConversionJob : INotifyPropertyChanged
|
||||
{
|
||||
private float progress = 0f;
|
||||
private ConversionState state = ConversionState.Unknown;
|
||||
private string errorMessage = string.Empty;
|
||||
private string initialInputPath = string.Empty;
|
||||
private string userState = string.Empty;
|
||||
|
||||
public ConversionJob()
|
||||
{
|
||||
this.State = ConversionState.Unknown;
|
||||
this.ConversionPreset = null;
|
||||
this.InputFilePath = string.Empty;
|
||||
}
|
||||
|
||||
public ConversionJob(ConversionPreset conversionPreset) : this()
|
||||
{
|
||||
if (conversionPreset == null)
|
||||
{
|
||||
throw new ArgumentNullException("conversionPreset");
|
||||
}
|
||||
|
||||
this.ConversionPreset = conversionPreset;
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
public enum ConversionState
|
||||
{
|
||||
Unknown,
|
||||
|
||||
Ready,
|
||||
InProgress,
|
||||
Done,
|
||||
Failed,
|
||||
}
|
||||
|
||||
public ConversionPreset ConversionPreset
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public string InputFilePath
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public string OutputFilePath
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public ConversionState State
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.state;
|
||||
}
|
||||
|
||||
private set
|
||||
{
|
||||
this.state = value;
|
||||
this.NotifyPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public string UserState
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.userState;
|
||||
}
|
||||
|
||||
protected set
|
||||
{
|
||||
this.userState = value;
|
||||
this.NotifyPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public float Progress
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.progress;
|
||||
}
|
||||
|
||||
protected set
|
||||
{
|
||||
this.progress = value;
|
||||
this.NotifyPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public string ErrorMessage
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.errorMessage;
|
||||
}
|
||||
|
||||
private set
|
||||
{
|
||||
this.errorMessage = value;
|
||||
this.NotifyPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public ConversionFlags StateFlags
|
||||
{
|
||||
get;
|
||||
protected set;
|
||||
}
|
||||
|
||||
protected virtual InputPostConversionAction InputPostConversionAction
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.ConversionPreset == null)
|
||||
{
|
||||
return InputPostConversionAction.None;
|
||||
}
|
||||
|
||||
return this.ConversionPreset.InputPostConversionAction;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool CanStartConversion(ConversionFlags conversionFlags)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public void PrepareConversion(string inputFilePath, string outputFilePath = null)
|
||||
{
|
||||
if (string.IsNullOrEmpty(inputFilePath))
|
||||
{
|
||||
throw new ArgumentNullException("inputFilePath");
|
||||
}
|
||||
|
||||
if (this.ConversionPreset == null)
|
||||
{
|
||||
throw new Exception("The conversion preset must be valid.");
|
||||
}
|
||||
|
||||
string extension = System.IO.Path.GetExtension(inputFilePath);
|
||||
extension = extension.Substring(1, extension.Length - 1);
|
||||
string extensionCategory = PathHelpers.GetExtensionCategory(extension);
|
||||
if (!PathHelpers.IsOutputTypeCompatibleWithCategory(this.ConversionPreset.OutputType, extensionCategory))
|
||||
{
|
||||
this.ConversionFailed("The input file type is not compatible with the output file type.");
|
||||
return;
|
||||
}
|
||||
|
||||
this.initialInputPath = inputFilePath;
|
||||
this.InputFilePath = inputFilePath;
|
||||
this.OutputFilePath = outputFilePath ?? this.ConversionPreset.GenerateOutputFilePath(inputFilePath);
|
||||
|
||||
if (!PathHelpers.IsPathValid(this.OutputFilePath))
|
||||
{
|
||||
this.ConversionFailed("Invalid output path generated by output file path template.");
|
||||
Debug.Log(string.Format("Invalid output path generated: {0} from input: {1}.", this.OutputFilePath, this.InputFilePath));
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.OutputFilePath == this.InputFilePath)
|
||||
{
|
||||
// If the input post conversion action is to move or delete the input file, change its name in order to keep the output name intact.
|
||||
if (this.ConversionPreset.InputPostConversionAction == InputPostConversionAction.MoveInArchiveFolder ||
|
||||
this.ConversionPreset.InputPostConversionAction == InputPostConversionAction.Delete)
|
||||
{
|
||||
string inputExtension = System.IO.Path.GetExtension(this.InputFilePath);
|
||||
string pathWithoutExtension = this.InputFilePath.Substring(0, this.InputFilePath.Length - inputExtension.Length);
|
||||
this.InputFilePath = PathHelpers.GenerateUniquePath(pathWithoutExtension + "_TEMP" + inputExtension);
|
||||
System.IO.File.Move(inputFilePath, this.InputFilePath);
|
||||
}
|
||||
}
|
||||
|
||||
// Create output folder that doesn't exist.
|
||||
{
|
||||
StringBuilder path = new StringBuilder(this.OutputFilePath.Length);
|
||||
foreach (string directory in PathHelpers.GetDirectories(this.OutputFilePath))
|
||||
{
|
||||
path.Append(directory);
|
||||
path.Append('\\');
|
||||
|
||||
if (!System.IO.Directory.Exists(path.ToString()))
|
||||
{
|
||||
try
|
||||
{
|
||||
System.IO.Directory.CreateDirectory(path.ToString());
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
this.ConversionFailed("Invalid output path generated by output file path template.");
|
||||
Debug.Log(string.Format("Can't create directories for path {0}", this.OutputFilePath));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Make the output path valid.
|
||||
try
|
||||
{
|
||||
this.OutputFilePath = PathHelpers.GenerateUniquePath(this.OutputFilePath);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
this.ConversionFailed("Can't generate a valid output filename.");
|
||||
Debug.Log(exception.Message);
|
||||
return;
|
||||
}
|
||||
|
||||
this.Initialize();
|
||||
|
||||
if (this.State == ConversionState.Unknown)
|
||||
{
|
||||
this.State = ConversionState.Ready;
|
||||
}
|
||||
|
||||
Debug.Log("Job initialized: Preset: '{0}' Input: {1} Output: {2}", this.ConversionPreset.Name, this.InputFilePath, this.OutputFilePath);
|
||||
|
||||
this.UserState = "In Queue";
|
||||
}
|
||||
|
||||
public void StartConvertion()
|
||||
{
|
||||
if (this.ConversionPreset == null)
|
||||
{
|
||||
throw new Exception("The conversion preset must be valid.");
|
||||
}
|
||||
|
||||
if (this.State != ConversionState.Ready)
|
||||
{
|
||||
throw new Exception("Invalid conversion state.");
|
||||
}
|
||||
|
||||
Debug.Log("Convert file {0} to {1}.", this.InputFilePath, this.OutputFilePath);
|
||||
|
||||
this.State = ConversionState.InProgress;
|
||||
|
||||
this.Convert();
|
||||
|
||||
if (this.State == ConversionState.Failed)
|
||||
{
|
||||
this.OnConversionFailed();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.OnConversionSucceed();
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void Convert()
|
||||
{
|
||||
}
|
||||
|
||||
protected virtual void Initialize()
|
||||
{
|
||||
}
|
||||
|
||||
protected virtual void OnConversionFailed()
|
||||
{
|
||||
Debug.Log("Conversion Failed.");
|
||||
|
||||
if (System.IO.File.Exists(this.OutputFilePath))
|
||||
{
|
||||
System.IO.File.Delete(this.OutputFilePath);
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void OnConversionSucceed()
|
||||
{
|
||||
Debug.Log("Conversion Succeed!");
|
||||
|
||||
// Apply the input post conversion action.
|
||||
switch (this.InputPostConversionAction)
|
||||
{
|
||||
case InputPostConversionAction.None:
|
||||
break;
|
||||
|
||||
case InputPostConversionAction.MoveInArchiveFolder:
|
||||
string basePath = System.IO.Path.GetDirectoryName(this.initialInputPath);
|
||||
string inputFilename = System.IO.Path.GetFileName(this.initialInputPath);
|
||||
string archivePath = basePath + "\\" + this.ConversionPreset.ConversionArchiveFolderName;
|
||||
if (!System.IO.Directory.Exists(archivePath))
|
||||
{
|
||||
System.IO.Directory.CreateDirectory(archivePath);
|
||||
}
|
||||
|
||||
string newPath = PathHelpers.GenerateUniquePath(archivePath + "\\" + inputFilename);
|
||||
System.IO.File.Move(this.InputFilePath, newPath);
|
||||
Debug.Log("Input file moved in archive folder: '{0}'", newPath);
|
||||
break;
|
||||
|
||||
case InputPostConversionAction.Delete:
|
||||
System.IO.File.Delete(this.InputFilePath);
|
||||
Debug.Log("Input file deleted: '{0}'", this.initialInputPath);
|
||||
break;
|
||||
}
|
||||
|
||||
Debug.Log(string.Empty);
|
||||
|
||||
this.Progress = 1f;
|
||||
this.State = ConversionState.Done;
|
||||
this.UserState = "Done";
|
||||
Debug.Log("Conversion Done!");
|
||||
}
|
||||
|
||||
protected void ConversionFailed(string exitingMessage)
|
||||
{
|
||||
if (this.State == ConversionState.Failed)
|
||||
{
|
||||
// Already failed, don't override informations.
|
||||
return;
|
||||
}
|
||||
|
||||
this.State = ConversionState.Failed;
|
||||
this.UserState = "Failed";
|
||||
this.ErrorMessage = exitingMessage;
|
||||
}
|
||||
|
||||
protected void NotifyPropertyChanged([CallerMemberName] string propertyName = "")
|
||||
{
|
||||
if (this.PropertyChanged != null)
|
||||
{
|
||||
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
// <copyright file="ConversionJobFactory.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverter.ConversionJobs
|
||||
{
|
||||
public static class ConversionJobFactory
|
||||
{
|
||||
public static ConversionJob Create(ConversionPreset conversionPreset, string inputFilePath)
|
||||
{
|
||||
ConversionJob conversionJob = null;
|
||||
|
||||
string extension = System.IO.Path.GetExtension(inputFilePath);
|
||||
extension = extension.ToLowerInvariant().Substring(1, extension.Length - 1);
|
||||
if (extension == "cda")
|
||||
{
|
||||
conversionJob = new ConversionJob_ExtractCDA(conversionPreset);
|
||||
}
|
||||
else
|
||||
{
|
||||
conversionJob = new ConversionJob_FFMPEG(conversionPreset);
|
||||
}
|
||||
|
||||
return conversionJob;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,216 @@
|
||||
// <copyright file="ConversionJob_ExtractCDA.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverter.ConversionJobs
|
||||
{
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
|
||||
using Ripper;
|
||||
|
||||
using WaveLib;
|
||||
using Yeti.MMedia;
|
||||
|
||||
using FileConverter.Diagnostics;
|
||||
|
||||
public class ConversionJob_ExtractCDA : ConversionJob
|
||||
{
|
||||
private Ripper.CDDrive cdDrive;
|
||||
private int cdaTrackNumber = -1;
|
||||
private WaveWriter waveWriter;
|
||||
private string intermediateFilePath;
|
||||
private ConversionJob compressionConversionJob;
|
||||
private System.Threading.Thread compressionThread;
|
||||
|
||||
public ConversionJob_ExtractCDA() : base()
|
||||
{
|
||||
}
|
||||
|
||||
public ConversionJob_ExtractCDA(ConversionPreset conversionPreset) : base(conversionPreset)
|
||||
{
|
||||
}
|
||||
|
||||
protected override InputPostConversionAction InputPostConversionAction
|
||||
{
|
||||
get
|
||||
{
|
||||
return InputPostConversionAction.None;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CanStartConversion(ConversionFlags conversionFlags)
|
||||
{
|
||||
return (conversionFlags & ConversionFlags.CdaExtraction) == 0;
|
||||
}
|
||||
|
||||
protected override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
if (this.ConversionPreset == null)
|
||||
{
|
||||
throw new Exception("The conversion preset must be valid.");
|
||||
}
|
||||
|
||||
// Retrieve and check drive letter.
|
||||
string pathDriveLetter = PathHelpers.GetPathDriveLetter(this.InputFilePath);
|
||||
if (pathDriveLetter.Length == 0)
|
||||
{
|
||||
this.ConversionFailed("Can't retrieve input path drive letter.");
|
||||
return;
|
||||
}
|
||||
|
||||
char driveLetter = pathDriveLetter[0];
|
||||
|
||||
this.cdDrive = new Ripper.CDDrive();
|
||||
this.cdDrive.CDRemoved += new EventHandler(this.CdDriveCdRemoved);
|
||||
|
||||
bool driveLetterFound = false;
|
||||
char[] driveLetters = Ripper.CDDrive.GetCDDriveLetters();
|
||||
for (int index = 0; index < driveLetters.Length; index++)
|
||||
{
|
||||
driveLetterFound |= driveLetters[index] == driveLetter;
|
||||
}
|
||||
|
||||
if (!driveLetterFound)
|
||||
{
|
||||
this.ConversionFailed(string.Format("Invalid drive letter {0}.", driveLetter));
|
||||
return;
|
||||
}
|
||||
|
||||
// Retrieve and track number.
|
||||
try
|
||||
{
|
||||
this.cdaTrackNumber = PathHelpers.GetCDATrackNumber(this.InputFilePath);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
this.ConversionFailed(string.Format("Can't retrieve the track number from input path '{0}'.", this.InputFilePath));
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.cdDrive.IsOpened)
|
||||
{
|
||||
this.ConversionFailed(string.Format("CD drive already used."));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.cdDrive.Open(driveLetter))
|
||||
{
|
||||
this.ConversionFailed(string.Format("Fail to open cd drive {0}.", driveLetter));
|
||||
return;
|
||||
}
|
||||
|
||||
// Generate intermediate file path.
|
||||
string fileName = Path.GetFileName(this.OutputFilePath);
|
||||
string tempPath = Path.GetTempPath();
|
||||
this.intermediateFilePath = PathHelpers.GenerateUniquePath(tempPath + fileName + ".wav");
|
||||
|
||||
// Sub conversion job (for compression).
|
||||
this.compressionConversionJob = ConversionJobFactory.Create(this.ConversionPreset, this.intermediateFilePath);
|
||||
this.compressionConversionJob.PrepareConversion(this.intermediateFilePath, this.OutputFilePath);
|
||||
this.compressionThread = new Thread(this.CompressAsync);
|
||||
|
||||
this.StateFlags = ConversionFlags.CdaExtraction;
|
||||
}
|
||||
|
||||
protected override void Convert()
|
||||
{
|
||||
if (this.ConversionPreset == null)
|
||||
{
|
||||
throw new Exception("The conversion preset must be valid.");
|
||||
}
|
||||
|
||||
Debug.Log("Starting CDA extraction.");
|
||||
|
||||
this.UserState = "Extraction";
|
||||
|
||||
if (!this.cdDrive.IsCDReady())
|
||||
{
|
||||
this.ConversionFailed(string.Format("CD drive is not ready."));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.cdDrive.Refresh())
|
||||
{
|
||||
this.ConversionFailed(string.Format("Can't refresh CD drive data."));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.cdDrive.LockCD())
|
||||
{
|
||||
this.ConversionFailed(string.Format("Can't lock cd."));
|
||||
return;
|
||||
}
|
||||
|
||||
WaveFormat waveFormat = new WaveFormat(44100, 16, 2);
|
||||
|
||||
using (Stream waveStream = new FileStream(this.intermediateFilePath, FileMode.Create, FileAccess.Write))
|
||||
using (this.waveWriter = new WaveWriter(waveStream, waveFormat, this.cdDrive.TrackSize(this.cdaTrackNumber)))
|
||||
{
|
||||
this.cdDrive.ReadTrack(this.cdaTrackNumber, this.WriteWaveData, this.CdReadProgress);
|
||||
}
|
||||
|
||||
this.waveWriter = null;
|
||||
|
||||
this.cdDrive.UnLockCD();
|
||||
|
||||
this.cdDrive.Close();
|
||||
|
||||
this.StateFlags = ConversionFlags.None;
|
||||
|
||||
if (!File.Exists(this.intermediateFilePath))
|
||||
{
|
||||
this.ConversionFailed("Extraction failed.");
|
||||
return;
|
||||
}
|
||||
|
||||
Debug.Log("CDA extracted to {0}.", this.intermediateFilePath);
|
||||
Debug.Log(string.Empty);
|
||||
Debug.Log("Start compression.");
|
||||
|
||||
this.UserState = "Conversion";
|
||||
|
||||
this.compressionThread.Start();
|
||||
|
||||
while (this.compressionConversionJob.State != ConversionState.Done &&
|
||||
this.compressionConversionJob.State != ConversionState.Failed)
|
||||
{
|
||||
this.Progress = this.compressionConversionJob.Progress;
|
||||
}
|
||||
|
||||
if (this.compressionConversionJob.State == ConversionState.Failed)
|
||||
{
|
||||
this.ConversionFailed(this.compressionConversionJob.ErrorMessage);
|
||||
return;
|
||||
}
|
||||
|
||||
Debug.Log(string.Empty);
|
||||
Debug.Log("Delete intermediate file {0}.", this.intermediateFilePath);
|
||||
|
||||
File.Delete(this.intermediateFilePath);
|
||||
}
|
||||
|
||||
private void WriteWaveData(object sender, DataReadEventArgs eventArgs)
|
||||
{
|
||||
this.waveWriter?.Write(eventArgs.Data, 0, (int)eventArgs.DataSize);
|
||||
}
|
||||
|
||||
private void CdReadProgress(object sender, ReadProgressEventArgs eventArgs)
|
||||
{
|
||||
this.Progress = (float)eventArgs.BytesRead / (float)eventArgs.Bytes2Read;
|
||||
|
||||
eventArgs.CancelRead |= this.State != ConversionState.InProgress;
|
||||
}
|
||||
|
||||
private void CdDriveCdRemoved(object sender, System.EventArgs eventArgs)
|
||||
{
|
||||
this.ConversionFailed("The CD has been ejected.");
|
||||
}
|
||||
|
||||
private void CompressAsync()
|
||||
{
|
||||
this.compressionConversionJob.StartConvertion();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,255 @@
|
||||
// <copyright file="ConversionJob_FFMPEG.Converters.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverter.ConversionJobs
|
||||
{
|
||||
using System;
|
||||
|
||||
using FileConverter.Controls;
|
||||
|
||||
public partial class ConversionJob_FFMPEG
|
||||
{
|
||||
/// <summary>
|
||||
/// Convert bitrate in <c>mp3</c> encoder quality index.
|
||||
/// </summary>
|
||||
/// <param name="bitrate">Wanted bitrate value.</param>
|
||||
/// <returns>The <c>mp3</c> encoder quality index associated to the given bitrate value.</returns>
|
||||
/// https://trac.ffmpeg.org/wiki/Encode/MP3
|
||||
private int MP3VBRBitrateToQualityIndex(int bitrate)
|
||||
{
|
||||
switch (bitrate)
|
||||
{
|
||||
case 245:
|
||||
return 0;
|
||||
|
||||
case 225:
|
||||
return 1;
|
||||
|
||||
case 190:
|
||||
return 2;
|
||||
|
||||
case 175:
|
||||
return 3;
|
||||
|
||||
case 165:
|
||||
return 4;
|
||||
|
||||
case 130:
|
||||
return 5;
|
||||
|
||||
case 115:
|
||||
return 6;
|
||||
|
||||
case 100:
|
||||
return 7;
|
||||
|
||||
case 85:
|
||||
return 8;
|
||||
|
||||
case 65:
|
||||
return 9;
|
||||
}
|
||||
|
||||
throw new Exception("Unknown VBR bitrate.");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Convert bitrate in <c>vorbis</c> encoder quality index.
|
||||
/// </summary>
|
||||
/// <param name="bitrate">Wanted bitrate value.</param>
|
||||
/// <returns>The <c>vorbis</c> encoder quality index associated to the given bitrate value.</returns>
|
||||
/// http://wiki.hydrogenaud.io/index.php?title=Recommended_Ogg_Vorbis
|
||||
private int OGGVBRBitrateToQualityIndex(int bitrate)
|
||||
{
|
||||
switch (bitrate)
|
||||
{
|
||||
case 500:
|
||||
return 10;
|
||||
|
||||
case 320:
|
||||
return 9;
|
||||
|
||||
case 256:
|
||||
return 8;
|
||||
|
||||
case 224:
|
||||
return 7;
|
||||
|
||||
case 192:
|
||||
return 6;
|
||||
|
||||
case 160:
|
||||
return 5;
|
||||
|
||||
case 128:
|
||||
return 4;
|
||||
|
||||
case 112:
|
||||
return 3;
|
||||
|
||||
case 96:
|
||||
return 2;
|
||||
|
||||
case 80:
|
||||
return 1;
|
||||
|
||||
case 64:
|
||||
return 0;
|
||||
|
||||
case 48:
|
||||
return -1;
|
||||
|
||||
case 32:
|
||||
return -2;
|
||||
}
|
||||
|
||||
throw new Exception("Unknown Ogg VBR bitrate.");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Convert encoding mode setting to <c>ffmpeg</c> argument option.
|
||||
/// </summary>
|
||||
/// <param name="encoding">The encoding mode setting.</param>
|
||||
/// <returns>Returns the <c>ffmpeg</c> argument corresponding to the given encoding mode.</returns>
|
||||
/// https://trac.ffmpeg.org/wiki/audio%20types
|
||||
private string WAVEncodingToCodecArgument(EncodingMode encoding)
|
||||
{
|
||||
switch (encoding)
|
||||
{
|
||||
case EncodingMode.Wav8:
|
||||
return "pcm_s8le";
|
||||
|
||||
case EncodingMode.Wav16:
|
||||
return "pcm_s16le";
|
||||
|
||||
case EncodingMode.Wav24:
|
||||
return "pcm_s24le";
|
||||
|
||||
case EncodingMode.Wav32:
|
||||
return "pcm_s32le";
|
||||
}
|
||||
|
||||
throw new Exception("Unknown Wav encoding.");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Convert video quality index to H264 constant rate factor.
|
||||
/// </summary>
|
||||
/// <param name="quality">The quality index.</param>
|
||||
/// <returns>Returns the H264 constant rate factor.</returns>
|
||||
/// The range of the quantizer scale is 0-51: where 0 is lossless, 23 is default, and 51 is worst possible.
|
||||
/// A lower value is a higher quality and a subjectively sane range is 18-28.
|
||||
/// https://trac.ffmpeg.org/wiki/Encode/H.264
|
||||
private int H264QualityToCRF(int quality)
|
||||
{
|
||||
return 51 - quality;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Convert image quality index to JPG quality index.
|
||||
/// </summary>
|
||||
/// <param name="quality">The quality index.</param>
|
||||
/// <returns>Returns the JPG quality index.</returns>
|
||||
/// The range of the quantizer scale is 1-31: where 1 is better quality, and 31 is worst possible.
|
||||
/// http://superuser.com/questions/318845/improve-quality-of-ffmpeg-created-jpgs
|
||||
private int JPGQualityToQualityIndex(int quality)
|
||||
{
|
||||
return 31 - quality;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Convert video encoding speed to H264 preset.
|
||||
/// </summary>
|
||||
/// <param name="encodingSpeed">The encoding speed.</param>
|
||||
/// <returns>The H264 preset.</returns>
|
||||
private string H264EncodingSpeedToPreset(string encodingSpeed)
|
||||
{
|
||||
switch (encodingSpeed)
|
||||
{
|
||||
case "Ultra Fast":
|
||||
return "ultrafast";
|
||||
|
||||
case "Super Fast":
|
||||
return "superfast";
|
||||
|
||||
case "Very Fast":
|
||||
return "veryfast";
|
||||
|
||||
case "Faster":
|
||||
return "faster";
|
||||
|
||||
case "Fast":
|
||||
return "fast";
|
||||
|
||||
case "Medium":
|
||||
return "medium";
|
||||
|
||||
case "Slow":
|
||||
return "slow";
|
||||
|
||||
case "Slower":
|
||||
return "slower";
|
||||
|
||||
case "Very Slow":
|
||||
return "veryslow";
|
||||
}
|
||||
|
||||
throw new Exception("Unknown H264 encoding speed.");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Convert bitrate in <c>aac</c> encoder quality index.
|
||||
/// </summary>
|
||||
/// <param name="bitrate">Wanted bitrate value.</param>
|
||||
/// <returns>The <c>aac</c> encoder quality index associated to the given bitrate value.</returns>
|
||||
/// See the file Resources/FFMPEG retro engineering.ods for details.
|
||||
private string AACBitrateToQualityIndex(int bitrate)
|
||||
{
|
||||
switch (bitrate)
|
||||
{
|
||||
case 460:
|
||||
return "3.9";
|
||||
|
||||
case 340:
|
||||
return "3";
|
||||
|
||||
case 256:
|
||||
return "2.2";
|
||||
|
||||
case 224:
|
||||
return "1.9";
|
||||
|
||||
case 192:
|
||||
return "1.6";
|
||||
|
||||
case 155:
|
||||
return "1.3";
|
||||
|
||||
case 128:
|
||||
return "1";
|
||||
|
||||
case 112:
|
||||
return "0.9";
|
||||
|
||||
case 96:
|
||||
return "0.75";
|
||||
|
||||
case 80:
|
||||
return "0.6";
|
||||
|
||||
case 64:
|
||||
return "0.45";
|
||||
|
||||
case 48:
|
||||
return "0.3";
|
||||
|
||||
case 32:
|
||||
return "0.2";
|
||||
|
||||
case 16:
|
||||
return "0.1";
|
||||
}
|
||||
|
||||
throw new Exception("Unknown VBR bitrate.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,249 @@
|
||||
// <copyright file="ConversionJob_FFMPEG.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverter.ConversionJobs
|
||||
{
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
using FileConverter.Controls;
|
||||
|
||||
public partial class ConversionJob_FFMPEG : ConversionJob
|
||||
{
|
||||
private readonly Regex durationRegex = new Regex(@"Duration:\s*([0-9][0-9]):([0-9][0-9]):([0-9][0-9])\.([0-9][0-9]),.*bitrate:\s*([0-9]+) kb\/s");
|
||||
private readonly Regex progressRegex = new Regex(@"size=\s*([0-9]+)kB\s+time=([0-9][0-9]):([0-9][0-9]):([0-9][0-9]).([0-9][0-9])\s+bitrate=\s*([0-9]+.[0-9])kbits\/s");
|
||||
|
||||
private TimeSpan fileDuration;
|
||||
private TimeSpan actualConvertedDuration;
|
||||
|
||||
private ProcessStartInfo ffmpegProcessStartInfo;
|
||||
|
||||
public ConversionJob_FFMPEG() : base()
|
||||
{
|
||||
}
|
||||
|
||||
public ConversionJob_FFMPEG(ConversionPreset conversionPreset) : base(conversionPreset)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
if (this.ConversionPreset == null)
|
||||
{
|
||||
throw new Exception("The conversion preset must be valid.");
|
||||
}
|
||||
|
||||
this.ffmpegProcessStartInfo = null;
|
||||
|
||||
string applicationDirectory = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
|
||||
string ffmpegPath = string.Format("{0}\\ffmpeg.exe", applicationDirectory);
|
||||
if (!System.IO.File.Exists(ffmpegPath))
|
||||
{
|
||||
this.ConversionFailed("Can't find ffmpeg executable. You should try to reinstall the application.");
|
||||
Diagnostics.Debug.Log("Can't find ffmpeg executable ({0}). Try to reinstall the application.", ffmpegPath);
|
||||
return;
|
||||
}
|
||||
|
||||
this.ffmpegProcessStartInfo = new ProcessStartInfo(ffmpegPath);
|
||||
|
||||
this.ffmpegProcessStartInfo.CreateNoWindow = true;
|
||||
this.ffmpegProcessStartInfo.UseShellExecute = false;
|
||||
this.ffmpegProcessStartInfo.RedirectStandardOutput = true;
|
||||
this.ffmpegProcessStartInfo.RedirectStandardError = true;
|
||||
|
||||
string arguments = string.Empty;
|
||||
switch (this.ConversionPreset.OutputType)
|
||||
{
|
||||
case OutputType.Aac:
|
||||
{
|
||||
// https://trac.ffmpeg.org/wiki/Encode/AAC
|
||||
int audioEncodingBitrate = this.ConversionPreset.GetSettingsValue<int>(ConversionPreset.ConversionSettingKeys.AudioBitrate);
|
||||
string encoderArgs = string.Format("-c:a aac -q:a {0} -strict experimental", this.AACBitrateToQualityIndex(audioEncodingBitrate));
|
||||
arguments = string.Format("-n -stats -i \"{0}\" {2} \"{1}\"", this.InputFilePath, this.OutputFilePath, encoderArgs);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case OutputType.Flac:
|
||||
{
|
||||
// http://taer-naguur.blogspot.fr/2013/11/flac-audio-encoding-with-ffmpeg.html
|
||||
string encoderArgs = string.Format("-compression_level 12");
|
||||
arguments = string.Format("-n -stats -i \"{0}\" {2} \"{1}\"", this.InputFilePath, this.OutputFilePath, encoderArgs);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case OutputType.Ico:
|
||||
{
|
||||
string encoderArgs = string.Empty;
|
||||
arguments = string.Format("-n -stats -i \"{0}\" {2} \"{1}\"", this.InputFilePath, this.OutputFilePath, encoderArgs);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case OutputType.Mp3:
|
||||
{
|
||||
string encoderArgs = string.Empty;
|
||||
EncodingMode encodingMode = this.ConversionPreset.GetSettingsValue<EncodingMode>(ConversionPreset.ConversionSettingKeys.AudioEncodingMode);
|
||||
int encodingQuality = this.ConversionPreset.GetSettingsValue<int>(ConversionPreset.ConversionSettingKeys.AudioBitrate);
|
||||
switch (encodingMode)
|
||||
{
|
||||
case EncodingMode.Mp3VBR:
|
||||
encoderArgs = string.Format("-codec:a libmp3lame -q:a {0}", this.MP3VBRBitrateToQualityIndex(encodingQuality));
|
||||
break;
|
||||
|
||||
case EncodingMode.Mp3CBR:
|
||||
encoderArgs = string.Format("-codec:a libmp3lame -b:a {0}k", encodingQuality);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
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
|
||||
// https://trac.ffmpeg.org/wiki/Encode/AAC
|
||||
int videoEncodingQuality = this.ConversionPreset.GetSettingsValue<int>(ConversionPreset.ConversionSettingKeys.VideoQuality);
|
||||
string videoEncodingSpeed = this.ConversionPreset.GetSettingsValue<string>(ConversionPreset.ConversionSettingKeys.VideoEncodingSpeed);
|
||||
int audioEncodingBitrate = this.ConversionPreset.GetSettingsValue<int>(ConversionPreset.ConversionSettingKeys.AudioBitrate);
|
||||
string encoderArgs = string.Format("-c:v libx264 -preset {0} -crf {1} -c:a aac -q:a {2} -strict experimental", this.H264EncodingSpeedToPreset(videoEncodingSpeed), this.H264QualityToCRF(videoEncodingQuality), this.AACBitrateToQualityIndex(audioEncodingBitrate));
|
||||
arguments = string.Format("-n -stats -i \"{0}\" {2} \"{1}\"", this.InputFilePath, this.OutputFilePath, encoderArgs);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case OutputType.Ogg:
|
||||
{
|
||||
int encodingQuality = this.ConversionPreset.GetSettingsValue<int>(ConversionPreset.ConversionSettingKeys.AudioBitrate);
|
||||
string encoderArgs = string.Format("-codec:a libvorbis -qscale:a {0}", this.OGGVBRBitrateToQualityIndex(encodingQuality));
|
||||
arguments = string.Format("-n -stats -i \"{0}\" {2} \"{1}\"", this.InputFilePath, this.OutputFilePath, encoderArgs);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case OutputType.Png:
|
||||
{
|
||||
// http://www.howtogeek.com/203979/is-the-png-format-lossless-since-it-has-a-compression-parameter/
|
||||
string encoderArgs = string.Format("-compression_level 100");
|
||||
arguments = string.Format("-n -stats -i \"{0}\" {2} \"{1}\"", this.InputFilePath, this.OutputFilePath, encoderArgs);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case OutputType.Jpg:
|
||||
{
|
||||
int encodingQuality = this.ConversionPreset.GetSettingsValue<int>(ConversionPreset.ConversionSettingKeys.ImageQuality);
|
||||
string encoderArgs = string.Format("-q:v {0}", this.JPGQualityToQualityIndex(encodingQuality));
|
||||
arguments = string.Format("-n -stats -i \"{0}\" {2} \"{1}\"", this.InputFilePath, this.OutputFilePath, encoderArgs);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case OutputType.Wav:
|
||||
{
|
||||
EncodingMode encodingMode = this.ConversionPreset.GetSettingsValue<EncodingMode>(ConversionPreset.ConversionSettingKeys.AudioEncodingMode);
|
||||
string encoderArgs = string.Format("-acodec {0}", this.WAVEncodingToCodecArgument(encodingMode));
|
||||
arguments = string.Format("-n -stats -i \"{0}\" {2} \"{1}\"", this.InputFilePath, this.OutputFilePath, encoderArgs);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new NotImplementedException("Converter not implemented for output file type " + this.ConversionPreset.OutputType);
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(arguments))
|
||||
{
|
||||
throw new Exception("Invalid ffmpeg process arguments.");
|
||||
}
|
||||
|
||||
this.ffmpegProcessStartInfo.Arguments = arguments;
|
||||
}
|
||||
|
||||
protected override void Convert()
|
||||
{
|
||||
if (this.ConversionPreset == null)
|
||||
{
|
||||
throw new Exception("The conversion preset must be valid.");
|
||||
}
|
||||
|
||||
this.UserState = "Conversion";
|
||||
|
||||
Diagnostics.Debug.Log("Execute command: {0} {1}.", this.ffmpegProcessStartInfo.FileName, this.ffmpegProcessStartInfo.Arguments);
|
||||
Diagnostics.Debug.Log(string.Empty);
|
||||
|
||||
try
|
||||
{
|
||||
using (Process exeProcess = Process.Start(this.ffmpegProcessStartInfo))
|
||||
{
|
||||
using (StreamReader reader = exeProcess.StandardError)
|
||||
{
|
||||
while (!reader.EndOfStream)
|
||||
{
|
||||
string result = reader.ReadLine();
|
||||
|
||||
this.ParseFFMPEGOutput(result);
|
||||
|
||||
Diagnostics.Debug.Log("ffmpeg output: {0}", result);
|
||||
}
|
||||
}
|
||||
|
||||
exeProcess.WaitForExit();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
this.ConversionFailed("Failed to launch FFMPEG process.");
|
||||
throw;
|
||||
}
|
||||
|
||||
Diagnostics.Debug.Log("");
|
||||
}
|
||||
|
||||
private void ParseFFMPEGOutput(string input)
|
||||
{
|
||||
Match match = this.durationRegex.Match(input);
|
||||
if (match.Success && match.Groups.Count >= 6)
|
||||
{
|
||||
int hours = int.Parse(match.Groups[1].Value);
|
||||
int minutes = int.Parse(match.Groups[2].Value);
|
||||
int seconds = int.Parse(match.Groups[3].Value);
|
||||
int milliseconds = int.Parse(match.Groups[4].Value);
|
||||
float bitrate = float.Parse(match.Groups[5].Value);
|
||||
this.fileDuration = new TimeSpan(0, hours, minutes, seconds, milliseconds);
|
||||
return;
|
||||
}
|
||||
|
||||
match = this.progressRegex.Match(input);
|
||||
if (match.Success && match.Groups.Count >= 7)
|
||||
{
|
||||
int size = int.Parse(match.Groups[1].Value);
|
||||
int hours = int.Parse(match.Groups[2].Value);
|
||||
int minutes = int.Parse(match.Groups[3].Value);
|
||||
int seconds = int.Parse(match.Groups[4].Value);
|
||||
int milliseconds = int.Parse(match.Groups[5].Value);
|
||||
float bitrate = 0f;
|
||||
float.TryParse(match.Groups[6].Value, out bitrate);
|
||||
|
||||
this.actualConvertedDuration = new TimeSpan(0, hours, minutes, seconds, milliseconds);
|
||||
|
||||
this.Progress = this.actualConvertedDuration.Ticks / (float)this.fileDuration.Ticks;
|
||||
return;
|
||||
}
|
||||
|
||||
if (input.Contains("Exiting.") || input.Contains("Error") || input.Contains("Unsupported dimensions") || input.Contains("No such file or directory"))
|
||||
{
|
||||
this.ConversionFailed(input);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,641 @@
|
||||
// <copyright file="ConversionPreset.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.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
using FileConverter.Annotations;
|
||||
using FileConverter.Controls;
|
||||
using FileConverter.ValueConverters;
|
||||
|
||||
[XmlRoot]
|
||||
[XmlType]
|
||||
public class ConversionPreset : INotifyPropertyChanged, IDataErrorInfo, IXmlSerializable
|
||||
{
|
||||
private string name;
|
||||
private OutputType outputType;
|
||||
private List<string> inputTypes;
|
||||
private InputPostConversionAction inputPostConversionAction;
|
||||
private ConversionSettings settings = new ConversionSettings();
|
||||
private string outputFileNameTemplate;
|
||||
private FileNameConverter outputFileNameConverter = new FileNameConverter();
|
||||
|
||||
public ConversionPreset()
|
||||
{
|
||||
this.Name = "New Preset";
|
||||
}
|
||||
|
||||
public ConversionPreset(string name, OutputType outputType, string[] inputTypes)
|
||||
{
|
||||
this.Name = name;
|
||||
this.OutputType = outputType;
|
||||
List<string> inputTypeList = new List<string>();
|
||||
inputTypeList.AddRange(inputTypes);
|
||||
this.InputTypes = inputTypeList;
|
||||
|
||||
this.outputFileNameTemplate = "(p)(f)";
|
||||
}
|
||||
|
||||
public ConversionPreset(string name, ConversionPreset source)
|
||||
{
|
||||
this.Name = name;
|
||||
this.OutputType = source.outputType;
|
||||
List<string> inputTypeList = new List<string>();
|
||||
if (source.inputTypes != null)
|
||||
{
|
||||
inputTypeList.AddRange(source.inputTypes);
|
||||
}
|
||||
|
||||
this.InputTypes = inputTypeList;
|
||||
|
||||
this.outputFileNameTemplate = source.OutputFileNameTemplate;
|
||||
|
||||
foreach (KeyValuePair<string, string> conversionSetting in source.settings)
|
||||
{
|
||||
this.SetSettingsValue(conversionSetting.Key, conversionSetting.Value);
|
||||
}
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
[XmlAttribute]
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.name;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.name = value;
|
||||
this.OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
[XmlAttribute]
|
||||
public OutputType OutputType
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.outputType;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.outputType = value;
|
||||
this.InitializeDefaultSettings(this.outputType);
|
||||
this.OnPropertyChanged();
|
||||
this.CoerceInputTypes();
|
||||
}
|
||||
}
|
||||
|
||||
[XmlElement]
|
||||
public List<string> InputTypes
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.inputTypes;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.inputTypes = value;
|
||||
for (int index = 0; index < this.inputTypes.Count; index++)
|
||||
{
|
||||
this.inputTypes[index] = this.inputTypes[index].ToLowerInvariant();
|
||||
}
|
||||
|
||||
this.OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
[XmlElement]
|
||||
public InputPostConversionAction InputPostConversionAction
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.inputPostConversionAction;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.inputPostConversionAction = value;
|
||||
this.OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
[XmlElement("Settings")]
|
||||
public ConversionSetting[] XmlSerializableSettings
|
||||
{
|
||||
get
|
||||
{
|
||||
int index = 0;
|
||||
ConversionSetting[] settings = new ConversionSetting[this.settings.Count];
|
||||
foreach (KeyValuePair<string, string> keyValuePair in this.settings)
|
||||
{
|
||||
settings[index] = new ConversionSetting(keyValuePair);
|
||||
index++;
|
||||
}
|
||||
|
||||
return settings;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value != null)
|
||||
{
|
||||
for (int index = 0; index < value.Length; index++)
|
||||
{
|
||||
// Compatibility issues.
|
||||
if (value[index].Key == "Bitrate")
|
||||
{
|
||||
this.SetSettingsValue(ConversionSettingKeys.AudioBitrate, value[index].Value);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (value[index].Key == "Encoding")
|
||||
{
|
||||
this.SetSettingsValue(ConversionSettingKeys.AudioEncodingMode, value[index].Value);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Load settings.
|
||||
this.SetSettingsValue(value[index].Key, value[index].Value);
|
||||
}
|
||||
}
|
||||
|
||||
this.OnPropertyChanged("Settings");
|
||||
}
|
||||
}
|
||||
|
||||
[XmlElement]
|
||||
public string OutputFileNameTemplate
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.outputFileNameTemplate;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.outputFileNameTemplate = value;
|
||||
this.OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
public string ConversionArchiveFolderName
|
||||
{
|
||||
get
|
||||
{
|
||||
return "Conversion Archives";
|
||||
}
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
public IConversionSettings Settings
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.settings;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (KeyValuePair<string, string> conversionSetting in value)
|
||||
{
|
||||
if (!this.settings.ContainsKey(conversionSetting.Key))
|
||||
{
|
||||
this.settings.Add(conversionSetting.Key, conversionSetting.Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.settings[conversionSetting.Key] = conversionSetting.Value;
|
||||
}
|
||||
}
|
||||
|
||||
this.OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public string Error
|
||||
{
|
||||
get
|
||||
{
|
||||
string errorString = this.Validate("Name");
|
||||
if (!string.IsNullOrEmpty(errorString))
|
||||
{
|
||||
return errorString;
|
||||
}
|
||||
|
||||
errorString = this.Validate("OutputFileNameTemplate");
|
||||
if (!string.IsNullOrEmpty(errorString))
|
||||
{
|
||||
return errorString;
|
||||
}
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
public string this[string columnName]
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.Validate(columnName);
|
||||
}
|
||||
}
|
||||
|
||||
public void Clean()
|
||||
{
|
||||
// Remove unrelevant settings.
|
||||
List<string> settingsToRemove = new List<string>();
|
||||
foreach (string settingsKey in this.settings.Keys)
|
||||
{
|
||||
if (!this.IsRelevantSetting(settingsKey))
|
||||
{
|
||||
settingsToRemove.Add(settingsKey);
|
||||
}
|
||||
}
|
||||
|
||||
for (int index = 0; index < settingsToRemove.Count; index++)
|
||||
{
|
||||
this.settings.Remove(settingsToRemove[index]);
|
||||
}
|
||||
}
|
||||
|
||||
public void OnDeserializationComplete()
|
||||
{
|
||||
for (int index = 0; index < this.InputTypes.Count; index++)
|
||||
{
|
||||
this.InputTypes[index] = this.InputTypes[index].ToLowerInvariant();
|
||||
}
|
||||
|
||||
this.CoerceInputTypes();
|
||||
}
|
||||
|
||||
public void AddInputType(string inputType)
|
||||
{
|
||||
if (this.inputTypes.Contains(inputType))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this.inputTypes.Add(inputType);
|
||||
this.OnPropertyChanged("InputTypes");
|
||||
}
|
||||
|
||||
public void RemoveInputType(string inputType)
|
||||
{
|
||||
if (this.inputTypes.Remove(inputType))
|
||||
{
|
||||
this.OnPropertyChanged("InputTypes");
|
||||
}
|
||||
}
|
||||
|
||||
public string GenerateOutputFilePath(string inputFilePath)
|
||||
{
|
||||
return (string)this.outputFileNameConverter.Convert(new object[] { inputFilePath, this.OutputType, this.OutputFileNameTemplate }, typeof(string), null, null);
|
||||
}
|
||||
|
||||
public void SetSettingsValue(string settingsKey, string value)
|
||||
{
|
||||
if (string.IsNullOrEmpty(settingsKey))
|
||||
{
|
||||
throw new ArgumentNullException("key");
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(value))
|
||||
{
|
||||
throw new ArgumentNullException("value");
|
||||
}
|
||||
|
||||
if (!this.IsRelevantSetting(settingsKey))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.settings.ContainsKey(settingsKey))
|
||||
{
|
||||
this.settings.Add(settingsKey, value);
|
||||
}
|
||||
|
||||
this.settings[settingsKey] = value;
|
||||
|
||||
this.OnPropertyChanged("Settings");
|
||||
}
|
||||
|
||||
public string GetSettingsValue(string settingsKey)
|
||||
{
|
||||
if (string.IsNullOrEmpty(settingsKey))
|
||||
{
|
||||
throw new ArgumentNullException("key");
|
||||
}
|
||||
|
||||
if (this.settings.ContainsKey(settingsKey))
|
||||
{
|
||||
return this.settings[settingsKey];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public T GetSettingsValue<T>(string settingsKey)
|
||||
{
|
||||
string settingsValue = this.GetSettingsValue(settingsKey);
|
||||
|
||||
Type type = typeof(T);
|
||||
if (type.IsEnum)
|
||||
{
|
||||
return (T)System.Enum.Parse(type, settingsValue);
|
||||
}
|
||||
|
||||
return (T)System.Convert.ChangeType(settingsValue, type);
|
||||
}
|
||||
|
||||
[NotifyPropertyChangedInvocator]
|
||||
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
|
||||
{
|
||||
this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
|
||||
private void CoerceInputTypes()
|
||||
{
|
||||
if (this.inputTypes == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (int index = 0; index < this.inputTypes.Count; index++)
|
||||
{
|
||||
string inputType = this.inputTypes[index];
|
||||
string inputCategory = PathHelpers.GetExtensionCategory(inputType);
|
||||
if (!PathHelpers.IsOutputTypeCompatibleWithCategory(this.OutputType, inputCategory))
|
||||
{
|
||||
this.RemoveInputType(inputType);
|
||||
index--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private bool IsRelevantSetting(string settingsKey)
|
||||
{
|
||||
switch (this.OutputType)
|
||||
{
|
||||
case OutputType.Wav:
|
||||
switch (settingsKey)
|
||||
{
|
||||
case ConversionPreset.ConversionSettingKeys.AudioEncodingMode:
|
||||
return true;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case OutputType.Mp3:
|
||||
switch (settingsKey)
|
||||
{
|
||||
case ConversionPreset.ConversionSettingKeys.AudioEncodingMode:
|
||||
case ConversionPreset.ConversionSettingKeys.AudioBitrate:
|
||||
return true;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case OutputType.Ogg:
|
||||
switch (settingsKey)
|
||||
{
|
||||
case ConversionPreset.ConversionSettingKeys.AudioBitrate:
|
||||
return true;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case OutputType.Mkv:
|
||||
switch (settingsKey)
|
||||
{
|
||||
case ConversionPreset.ConversionSettingKeys.AudioBitrate:
|
||||
case ConversionPreset.ConversionSettingKeys.VideoQuality:
|
||||
case ConversionPreset.ConversionSettingKeys.VideoEncodingSpeed:
|
||||
return true;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case OutputType.Jpg:
|
||||
switch (settingsKey)
|
||||
{
|
||||
case ConversionPreset.ConversionSettingKeys.ImageQuality:
|
||||
return true;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private void InitializeDefaultSettings(OutputType outputType)
|
||||
{
|
||||
switch (outputType)
|
||||
{
|
||||
case OutputType.Aac:
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.AudioBitrate, "128");
|
||||
break;
|
||||
|
||||
case OutputType.Flac:
|
||||
case OutputType.Ico:
|
||||
case OutputType.Png:
|
||||
break;
|
||||
|
||||
case OutputType.Jpg:
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.ImageQuality, "25");
|
||||
break;
|
||||
|
||||
case OutputType.Mkv:
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.VideoQuality, "28");
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.VideoEncodingSpeed, "Very Slow");
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.AudioBitrate, "128");
|
||||
break;
|
||||
|
||||
case OutputType.Mp3:
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.AudioEncodingMode, EncodingMode.Mp3VBR.ToString(), true);
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.AudioBitrate, "190");
|
||||
break;
|
||||
|
||||
case OutputType.Ogg:
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.AudioBitrate, "160");
|
||||
break;
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
private void InitializeSettingsValue(string settingsKey, string value, bool force = false)
|
||||
{
|
||||
if (string.IsNullOrEmpty(settingsKey))
|
||||
{
|
||||
throw new ArgumentNullException("key");
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(value))
|
||||
{
|
||||
throw new ArgumentNullException("value");
|
||||
}
|
||||
|
||||
if (!this.settings.ContainsKey(settingsKey))
|
||||
{
|
||||
this.settings.Add(settingsKey, value);
|
||||
}
|
||||
else if (force)
|
||||
{
|
||||
this.settings[settingsKey] = value;
|
||||
}
|
||||
}
|
||||
|
||||
private string Validate(string propertyName)
|
||||
{
|
||||
// Return error message if there is an error, else return empty or null string.
|
||||
switch (propertyName)
|
||||
{
|
||||
case "Name":
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.Name))
|
||||
{
|
||||
return "The preset name can't be empty.";
|
||||
}
|
||||
|
||||
if (this.Name.Contains(";"))
|
||||
{
|
||||
return "The preset name can't contains the character ';'.";
|
||||
}
|
||||
|
||||
Application application = Application.Current as Application;
|
||||
int? count = application?.Settings?.ConversionPresets?.Count(match => match?.name == this.Name);
|
||||
if (count > 1)
|
||||
{
|
||||
return "The preset name is already used.";
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case "OutputFileNameTemplate":
|
||||
{
|
||||
string sampleOutputFilePath = this.GenerateOutputFilePath(FileConverter.Properties.Resources.OuputFileNameTemplateSample);
|
||||
if (string.IsNullOrEmpty(sampleOutputFilePath))
|
||||
{
|
||||
return "The output filename template must produce a non empty result.";
|
||||
}
|
||||
|
||||
if (!PathHelpers.IsPathValid(sampleOutputFilePath))
|
||||
{
|
||||
// Diagnostic to feedback purpose.
|
||||
// Drive letter.
|
||||
if (!PathHelpers.IsPathDriveLetterValid(sampleOutputFilePath))
|
||||
{
|
||||
return "The output filename template must define a root (for example c:\\, use (p) to use the input file path).";
|
||||
}
|
||||
|
||||
// File name.
|
||||
string filename = PathHelpers.GetFileName(sampleOutputFilePath);
|
||||
if (filename == null)
|
||||
{
|
||||
return "The output file name must not be empty (use (f) to use the name of the input file).";
|
||||
}
|
||||
|
||||
char[] invalidFileNameChars = System.IO.Path.GetInvalidFileNameChars();
|
||||
for (int index = 0; index < invalidFileNameChars.Length; index++)
|
||||
{
|
||||
if (filename.Contains(invalidFileNameChars[index]))
|
||||
{
|
||||
return "The output file name must not contains the character '" + invalidFileNameChars[index] + "'.";
|
||||
}
|
||||
}
|
||||
|
||||
// Directory names.
|
||||
string path = sampleOutputFilePath.Substring(3, sampleOutputFilePath.Length - 3 - filename.Length);
|
||||
char[] invalidPathChars = System.IO.Path.GetInvalidPathChars();
|
||||
for (int index = 0; index < invalidPathChars.Length; index++)
|
||||
{
|
||||
if (string.IsNullOrEmpty(path))
|
||||
{
|
||||
return "The output directory name must not be empty (use (d0), (d1), ... to use the name of the parent directories of the input file).";
|
||||
}
|
||||
|
||||
if (path.Contains(invalidPathChars[index]))
|
||||
{
|
||||
return "The output directory name must not contains the character '" + invalidPathChars[index] + "'.";
|
||||
}
|
||||
}
|
||||
|
||||
string[] directories = path.Split('\\');
|
||||
for (int index = 0; index < directories.Length; ++index)
|
||||
{
|
||||
string directoryName = directories[index];
|
||||
if (string.IsNullOrEmpty(directoryName))
|
||||
{
|
||||
return "The output directory name must not be empty (use (d0), (d1), ... to use the name of the parent directories of the input file).";
|
||||
}
|
||||
}
|
||||
|
||||
return "The output filename template is invalid";
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
public struct ConversionSetting
|
||||
{
|
||||
public ConversionSetting(KeyValuePair<string, string> keyValuePair)
|
||||
{
|
||||
this.Key = keyValuePair.Key;
|
||||
this.Value = keyValuePair.Value;
|
||||
}
|
||||
|
||||
[XmlAttribute]
|
||||
public string Key
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
[XmlAttribute]
|
||||
public string Value
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
}
|
||||
|
||||
public struct ConversionSettingKeys
|
||||
{
|
||||
public const string AudioEncodingMode = "AudioEncodingMode";
|
||||
public const string AudioBitrate = "AudioBitrate";
|
||||
public const string ImageQuality = "ImageQuality";
|
||||
public const string VideoQuality = "VideoQuality";
|
||||
public const string VideoEncodingSpeed = "VideoEncodingSpeed";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// <copyright file="ConversionSettings.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverter
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class ConversionSettings : Dictionary<string, string>, IConversionSettings
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
// <copyright file="ConversionSettingsOverride.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverter
|
||||
{
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public struct ConversionSettingsOverride : IConversionSettings
|
||||
{
|
||||
private string key;
|
||||
private string value;
|
||||
|
||||
public ConversionSettingsOverride(string key, string value)
|
||||
{
|
||||
this.key = key;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public int Count
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<string> Keys
|
||||
{
|
||||
get
|
||||
{
|
||||
yield return this.key;
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<string> Values
|
||||
{
|
||||
get
|
||||
{
|
||||
yield return this.value;
|
||||
}
|
||||
}
|
||||
|
||||
public string this[string key]
|
||||
{
|
||||
get
|
||||
{
|
||||
if (key == this.key)
|
||||
{
|
||||
return this.value;
|
||||
}
|
||||
|
||||
throw new KeyNotFoundException();
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerator<KeyValuePair<string, string>> GetEnumerator()
|
||||
{
|
||||
yield return new KeyValuePair<string, string>(this.key, this.value);
|
||||
}
|
||||
|
||||
public bool ContainsKey(string key)
|
||||
{
|
||||
return key == this.key;
|
||||
}
|
||||
|
||||
public bool TryGetValue(string key, out string value)
|
||||
{
|
||||
value = null;
|
||||
|
||||
if (key == this.key)
|
||||
{
|
||||
value = this.value;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return this.GetEnumerator();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// <copyright file="IConversionSettings.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverter
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
|
||||
public interface IConversionSettings : IReadOnlyDictionary<string, string>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
// <copyright file="Diagnostics.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
using System.Linq;
|
||||
|
||||
namespace FileConverter.Diagnostics
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
|
||||
public static class Debug
|
||||
{
|
||||
private static string diagnosticsFolderPath;
|
||||
private static Dictionary<int, DiagnosticsData> diagnosticsDataById = new Dictionary<int, DiagnosticsData>();
|
||||
private static int threadCount = 0;
|
||||
|
||||
public static event EventHandler<PropertyChangedEventArgs> StaticPropertyChanged;
|
||||
|
||||
static Debug()
|
||||
{
|
||||
string path = PathHelpers.GetUserDataFolderPath();
|
||||
|
||||
// Delete old diagnostics folder (1 day).
|
||||
DateTime expirationDate = DateTime.Now.Subtract(new TimeSpan(1, 0, 0, 0));
|
||||
string[] diagnosticsDirectories = Directory.GetDirectories(path, "Diagnostics.*");
|
||||
for (int index = 0; index < diagnosticsDirectories.Length; index++)
|
||||
{
|
||||
string directory = diagnosticsDirectories[index];
|
||||
DateTime creationTime = Directory.GetCreationTime(directory);
|
||||
if (creationTime < expirationDate)
|
||||
{
|
||||
Directory.Delete(directory, true);
|
||||
}
|
||||
}
|
||||
|
||||
Debug.diagnosticsFolderPath = Path.Combine(path, "Diagnostics." + Process.GetCurrentProcess().Id);
|
||||
Debug.diagnosticsFolderPath = PathHelpers.GenerateUniquePath(Debug.diagnosticsFolderPath);
|
||||
Directory.CreateDirectory(Debug.diagnosticsFolderPath);
|
||||
}
|
||||
|
||||
public static DiagnosticsData[] Data
|
||||
{
|
||||
get
|
||||
{
|
||||
return Debug.diagnosticsDataById.Values.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
public static void Log(string message, params object[] arguments)
|
||||
{
|
||||
DiagnosticsData diagnosticsData;
|
||||
|
||||
int threadId = System.Threading.Thread.CurrentThread.ManagedThreadId;
|
||||
lock (Debug.diagnosticsDataById)
|
||||
{
|
||||
if (!Debug.diagnosticsDataById.TryGetValue(threadId, out diagnosticsData))
|
||||
{
|
||||
diagnosticsData = new DiagnosticsData(Debug.threadCount > 0 ? string.Format("Thread {0}", Debug.threadCount) : "Application");
|
||||
diagnosticsData.Initialize(Debug.diagnosticsFolderPath, threadId);
|
||||
Debug.diagnosticsDataById.Add(threadId, diagnosticsData);
|
||||
Debug.threadCount++;
|
||||
|
||||
StaticPropertyChanged?.Invoke(null, new PropertyChangedEventArgs("Data"));
|
||||
}
|
||||
}
|
||||
|
||||
diagnosticsData.Log(message, arguments);
|
||||
}
|
||||
|
||||
public static void LogError(string message, params object[] arguments)
|
||||
{
|
||||
string log = string.Format(message, arguments);
|
||||
|
||||
MessageBox.Show(log, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
|
||||
Debug.Log("Error: " + message, arguments);
|
||||
}
|
||||
|
||||
public static void Release()
|
||||
{
|
||||
Debug.Log("Diagnostics manager released correctly.");
|
||||
|
||||
foreach (KeyValuePair<int, DiagnosticsData> kvp in Debug.diagnosticsDataById)
|
||||
{
|
||||
kvp.Value.Release();
|
||||
}
|
||||
|
||||
Debug.diagnosticsDataById.Clear();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
// <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.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
using FileConverter.Annotations;
|
||||
|
||||
public class DiagnosticsData : INotifyPropertyChanged
|
||||
{
|
||||
private List<string> logMessages = new List<string>();
|
||||
private StringBuilder stringBuilder = new StringBuilder();
|
||||
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 string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.name;
|
||||
}
|
||||
|
||||
private set
|
||||
{
|
||||
this.name = value;
|
||||
this.OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public string Content
|
||||
{
|
||||
get
|
||||
{
|
||||
this.stringBuilder.Clear();
|
||||
for (int index = 0; index < this.LogMessages.Count; index++)
|
||||
{
|
||||
this.stringBuilder.AppendLine(this.LogMessages[index]);
|
||||
}
|
||||
|
||||
return this.stringBuilder.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
public ReadOnlyCollection<string> LogMessages
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public void Initialize(string diagnosticsFolderPath, int id)
|
||||
{
|
||||
string path = Path.Combine(diagnosticsFolderPath, string.Format("Diagnostics{0}.log", id));
|
||||
path = PathHelpers.GenerateUniquePath(path);
|
||||
this.logFileWriter = new StreamWriter(File.Open(path, FileMode.Create));
|
||||
|
||||
this.Log("{0} {1}\n", System.DateTime.Now.ToLongDateString(), System.DateTime.Now.ToLongTimeString());
|
||||
}
|
||||
|
||||
public void Release()
|
||||
{
|
||||
this.logFileWriter.Close();
|
||||
this.logFileWriter = null;
|
||||
}
|
||||
|
||||
public void Log(string message, params object[] arguments)
|
||||
{
|
||||
string log = string.Format(message, arguments);
|
||||
|
||||
this.logMessages.Add(log);
|
||||
this.logFileWriter.WriteLine(log);
|
||||
this.logFileWriter.Flush();
|
||||
|
||||
this.OnPropertyChanged("Content");
|
||||
}
|
||||
|
||||
[NotifyPropertyChangedInvocator]
|
||||
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
|
||||
{
|
||||
PropertyChangedEventHandler handler = this.PropertyChanged;
|
||||
if (handler != null)
|
||||
{
|
||||
handler(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,210 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{D27A76D2-43E4-43CC-9DA3-334B0B46F4E5}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>FileConverter</RootNamespace>
|
||||
<AssemblyName>FileConverter</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<OutputPath>bin\x64\Debug\</OutputPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<OutputPath>bin\x64\Release\</OutputPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationIcon>Resources\ApplicationIcon.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Accessibility" />
|
||||
<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">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\Middleware\Ripper.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Printing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Xaml">
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="UIAutomationProvider" />
|
||||
<Reference Include="UIAutomationTypes" />
|
||||
<Reference Include="WindowsBase" />
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="yeti.mmedia">
|
||||
<HintPath>..\..\Middleware\yeti.mmedia.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Include="Application.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Compile Include="Controls\EncodingQualitySliderControl.xaml.cs">
|
||||
<DependentUpon>EncodingQualitySliderControl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ConversionJobs\ConversionFlags.cs" />
|
||||
<Compile Include="ConversionJobs\ConversionJob_ExtractCDA.cs" />
|
||||
<Compile Include="ConversionJobs\ConversionJobFactory.cs" />
|
||||
<Compile Include="ConversionJobs\ConversionJob_FFMPEG.Converters.cs" />
|
||||
<Compile Include="ConversionJobs\ConversionJob_FFMPEG.cs" />
|
||||
<Compile Include="ConversionPreset\ConversionSettingsOverride.cs" />
|
||||
<Compile Include="ConversionPreset\ConversionSettings.cs" />
|
||||
<Compile Include="Diagnostics\DiagnosticsData.cs" />
|
||||
<Compile Include="Controls\EncodingMode.cs" />
|
||||
<Compile Include="ConversionPreset\IConversionSettings.cs" />
|
||||
<Compile Include="InputPostConversionAction.cs" />
|
||||
<Compile Include="IXmlSerializable.cs" />
|
||||
<Compile Include="PathHelpers.cs" />
|
||||
<Compile Include="Properties\Resources.en.Designer.cs">
|
||||
<DependentUpon>Resources.en.resx</DependentUpon>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<Compile Include="Settings.Settings.cs" />
|
||||
<Compile Include="ValueConverters\ApplicationVersionToApplicationName.cs" />
|
||||
<Compile Include="ConversionPreset\ConversionPreset.cs" />
|
||||
<Compile Include="ValueConverters\BitrateToString.cs" />
|
||||
<Compile Include="ValueConverters\FileNameConverter.cs" />
|
||||
<Compile Include="ValueConverters\Generic\BoolToVisibility.cs" />
|
||||
<Compile Include="ValueConverters\ConversionSettingsToString.cs" />
|
||||
<Compile Include="ValueConverters\Generic\BoolInverterConverter.cs" />
|
||||
<Compile Include="ValueConverters\Generic\DoubleToTimeString.cs" />
|
||||
<Compile Include="ValueConverters\Generic\EqualsConverter.cs" />
|
||||
<Compile Include="ValueConverters\Generic\CollectionContainsElementToBool.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\DiagnosticsWindow.xaml.cs">
|
||||
<DependentUpon>DiagnosticsWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Windows\ConversionSettingsTemplateSelector.cs" />
|
||||
<Compile Include="Windows\InputExtension.cs" />
|
||||
<Compile Include="Windows\InputExtensionCategory.cs" />
|
||||
<Compile Include="Windows\SettingsWindow.xaml.cs">
|
||||
<DependentUpon>SettingsWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Version.cs" />
|
||||
<Compile Include="XmlHelpers.cs" />
|
||||
<Page Include="Controls\EncodingQualitySliderControl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Windows\DiagnosticsWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Windows\MainWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Compile Include="Application.xaml.cs">
|
||||
<DependentUpon>Application.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ValueConverters\ConversionStateToBrush.cs" />
|
||||
<Compile Include="ConversionJobs\ConversionJob.cs" />
|
||||
<Compile Include="Diagnostics\Debug.cs" />
|
||||
<Compile Include="Windows\MainWindow.xaml.cs">
|
||||
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Page Include="Windows\SettingsWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="OutputType.cs" />
|
||||
<Compile Include="Properties\Annotations.cs">
|
||||
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs">
|
||||
<SubType>Code</SubType>
|
||||
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="Properties\Resources.en.resx">
|
||||
<Generator>PublicResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.en.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>PublicResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<AppDesigner Include="Properties\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\ApplicationIcon.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\ApplicationIcon.ico" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -0,0 +1,9 @@
|
||||
// <copyright file="IXmlSerializable.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverter
|
||||
{
|
||||
public interface IXmlSerializable
|
||||
{
|
||||
void OnDeserializationComplete();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// <copyright file="InputPostConversionAction.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverter
|
||||
{
|
||||
public enum InputPostConversionAction
|
||||
{
|
||||
None,
|
||||
MoveInArchiveFolder,
|
||||
Delete,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
// <copyright file="OutputType.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverter
|
||||
{
|
||||
public enum OutputType
|
||||
{
|
||||
None,
|
||||
|
||||
Aac,
|
||||
Flac,
|
||||
Ico,
|
||||
Jpg,
|
||||
Mkv,
|
||||
Mp3,
|
||||
Ogg,
|
||||
Png,
|
||||
Wav,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,162 @@
|
||||
// <copyright file="PathHelpers.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverter
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
public static class PathHelpers
|
||||
{
|
||||
private static Regex driveLetterRegex = new Regex(@"[a-zA-Z]:\\");
|
||||
private static Regex cdaTrackNumberRegex = new Regex(@"[a-zA-Z]:\\Track([0-9]+)\.cda");
|
||||
private static Regex pathRegex = new Regex(@"^[a-zA-Z]:\\(?:[^\\/:*?""<>|\r\n]+\\)*[^\.\\/:*?""<>|\r\n][^\\/:*?""<>|\r\n]*$");
|
||||
private static Regex filenameRegex = new Regex(@"[^\\]*", RegexOptions.RightToLeft);
|
||||
private static Regex directoryRegex = new Regex(@"(?:([^\\]*)\\)*");
|
||||
|
||||
public static bool IsPathDriveLetterValid(string path)
|
||||
{
|
||||
return PathHelpers.driveLetterRegex.IsMatch(path);
|
||||
}
|
||||
|
||||
public static string GetPathDriveLetter(string path)
|
||||
{
|
||||
return PathHelpers.driveLetterRegex.Match(path).Groups[0].Value;
|
||||
}
|
||||
|
||||
public static int GetCDATrackNumber(string path)
|
||||
{
|
||||
Match match = PathHelpers.cdaTrackNumberRegex.Match(path);
|
||||
string stringNumber = match.Groups[1].Value;
|
||||
return int.Parse(stringNumber);
|
||||
}
|
||||
|
||||
public static bool IsPathValid(string path)
|
||||
{
|
||||
return PathHelpers.pathRegex.IsMatch(path);
|
||||
}
|
||||
|
||||
public static string GetFileName(string path)
|
||||
{
|
||||
MatchCollection matchCollection = PathHelpers.filenameRegex.Matches(path);
|
||||
Match filenameMatch = matchCollection.Count > 0 ? matchCollection[0] : null;
|
||||
return filenameMatch?.Groups[0].Value;
|
||||
}
|
||||
|
||||
public static IEnumerable<string> GetDirectories(string path)
|
||||
{
|
||||
MatchCollection matchCollection = PathHelpers.directoryRegex.Matches(path);
|
||||
Match match = matchCollection.Count > 0 ? matchCollection[0] : null;
|
||||
if (match == null || match.Groups.Count < 2)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
|
||||
Group matchGroup = match.Groups[1];
|
||||
for (int index = 0; index < matchGroup.Captures.Count; index++)
|
||||
{
|
||||
yield return matchGroup.Captures[index].Value;
|
||||
}
|
||||
}
|
||||
|
||||
public static string GenerateUniquePath(string path)
|
||||
{
|
||||
string baseExtension = System.IO.Path.GetExtension(path);
|
||||
string basePath = path.Substring(0, path.Length - baseExtension.Length);
|
||||
int index = 2;
|
||||
while (System.IO.File.Exists(path))
|
||||
{
|
||||
path = string.Format("{0} ({1}){2}", basePath, index, baseExtension);
|
||||
index++;
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
public static string GetExtensionCategory(string extension)
|
||||
{
|
||||
switch (extension)
|
||||
{
|
||||
case "aac":
|
||||
case "aiff":
|
||||
case "ape":
|
||||
case "cda":
|
||||
case "flac":
|
||||
case "mp3":
|
||||
case "m4a":
|
||||
case "ogg":
|
||||
case "wav":
|
||||
case "wma":
|
||||
return InputCategoryNames.Audio;
|
||||
|
||||
case "avi":
|
||||
case "bik":
|
||||
case "flv":
|
||||
case "mp4":
|
||||
case "mov":
|
||||
case "mkv":
|
||||
return InputCategoryNames.Video;
|
||||
|
||||
case "bmp":
|
||||
case "ico":
|
||||
case "jpg":
|
||||
case "jpeg":
|
||||
case "png":
|
||||
case "tiff":
|
||||
return InputCategoryNames.Image;
|
||||
}
|
||||
|
||||
return InputCategoryNames.Misc;
|
||||
}
|
||||
|
||||
public static bool IsOutputTypeCompatibleWithCategory(OutputType outputType, string category)
|
||||
{
|
||||
if (category == InputCategoryNames.Misc)
|
||||
{
|
||||
// Misc category contains unsorted input extensions, so we consider that they are compatible to be tolerant.
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (outputType)
|
||||
{
|
||||
case OutputType.Aac:
|
||||
case OutputType.Flac:
|
||||
case OutputType.Mp3:
|
||||
case OutputType.Ogg:
|
||||
case OutputType.Wav:
|
||||
return category == InputCategoryNames.Audio || category == InputCategoryNames.Video;
|
||||
|
||||
case OutputType.Mkv:
|
||||
return category == InputCategoryNames.Video;
|
||||
|
||||
case OutputType.Ico:
|
||||
case OutputType.Png:
|
||||
case OutputType.Jpg:
|
||||
return category == InputCategoryNames.Image;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetUserDataFolderPath()
|
||||
{
|
||||
string path = System.Environment.GetFolderPath((System.Environment.SpecialFolder.LocalApplicationData));
|
||||
path = System.IO.Path.Combine(path, "FileConverter");
|
||||
|
||||
if (!System.IO.Directory.Exists(path))
|
||||
{
|
||||
System.IO.Directory.CreateDirectory(path);
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
public static class InputCategoryNames
|
||||
{
|
||||
public const string Audio = "Audio";
|
||||
public const string Video = "Video";
|
||||
public const string Image = "Image";
|
||||
public const string Misc = "Misc";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,664 @@
|
||||
/*
|
||||
* Copyright 2007-2012 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
using System;
|
||||
|
||||
namespace FileConverter.Annotations
|
||||
{
|
||||
/// <summary>
|
||||
/// Indicates that marked element should be localized or not.
|
||||
/// </summary>
|
||||
/// <example>
|
||||
/// <code>
|
||||
/// [LocalizationRequiredAttribute(true)]
|
||||
/// public class Foo
|
||||
/// {
|
||||
/// private string str = "my string"; // Warning: Localizable string
|
||||
/// }
|
||||
/// </code>
|
||||
/// </example>
|
||||
[AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)]
|
||||
public sealed class LocalizationRequiredAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="LocalizationRequiredAttribute"/> class with
|
||||
/// <see cref="Required"/> set to <see langword="true"/>.
|
||||
/// </summary>
|
||||
public LocalizationRequiredAttribute() : this(true)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="LocalizationRequiredAttribute"/> class.
|
||||
/// </summary>
|
||||
/// <param name="required"><c>true</c> if a element should be localized; otherwise, <c>false</c>.</param>
|
||||
public LocalizationRequiredAttribute(bool required)
|
||||
{
|
||||
Required = required;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether a element should be localized.
|
||||
/// <value><c>true</c> if a element should be localized; otherwise, <c>false</c>.</value>
|
||||
/// </summary>
|
||||
[UsedImplicitly] public bool Required { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns whether the value of the given object is equal to the current <see cref="LocalizationRequiredAttribute"/>.
|
||||
/// </summary>
|
||||
/// <param name="obj">The object to test the value equality of. </param>
|
||||
/// <returns>
|
||||
/// <c>true</c> if the value of the given object is equal to that of the current; otherwise, <c>false</c>.
|
||||
/// </returns>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
var attribute = obj as LocalizationRequiredAttribute;
|
||||
return attribute != null && attribute.Required == Required;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the hash code for this instance.
|
||||
/// </summary>
|
||||
/// <returns>A hash code for the current <see cref="LocalizationRequiredAttribute"/>.</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Indicates that the marked method builds string by format pattern and (optional) arguments.
|
||||
/// Parameter, which contains format string, should be given in constructor.
|
||||
/// The format string should be in <see cref="string.Format(IFormatProvider,string,object[])"/> -like form
|
||||
/// </summary>
|
||||
/// <example>
|
||||
/// <code>
|
||||
/// [StringFormatMethod("message")]
|
||||
/// public void ShowError(string message, params object[] args)
|
||||
/// {
|
||||
/// //Do something
|
||||
/// }
|
||||
/// public void Foo()
|
||||
/// {
|
||||
/// ShowError("Failed: {0}"); // Warning: Non-existing argument in format string
|
||||
/// }
|
||||
/// </code>
|
||||
/// </example>
|
||||
[AttributeUsage(AttributeTargets.Constructor | AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
|
||||
public sealed class StringFormatMethodAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes new instance of StringFormatMethodAttribute
|
||||
/// </summary>
|
||||
/// <param name="formatParameterName">Specifies which parameter of an annotated method should be treated as format-string</param>
|
||||
public StringFormatMethodAttribute(string formatParameterName)
|
||||
{
|
||||
FormatParameterName = formatParameterName;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets format parameter name
|
||||
/// </summary>
|
||||
[UsedImplicitly] public string FormatParameterName { get; private set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Indicates that the function argument should be string literal and match one of the parameters
|
||||
/// of the caller function.
|
||||
/// For example, ReSharper annotates the parameter of <see cref="System.ArgumentNullException"/>.
|
||||
/// </summary>
|
||||
/// <example>
|
||||
/// <code>
|
||||
/// public void Foo(string param)
|
||||
/// {
|
||||
/// if (param == null)
|
||||
/// throw new ArgumentNullException("par"); // Warning: Cannot resolve symbol
|
||||
/// }
|
||||
/// </code>
|
||||
/// </example>
|
||||
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = true)]
|
||||
public sealed class InvokerParameterNameAttribute : Attribute { }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates that the method is contained in a type that implements
|
||||
/// <see cref="System.ComponentModel.INotifyPropertyChanged"/> interface
|
||||
/// and this method is used to notify that some property value changed.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The method should be non-static and conform to one of the supported signatures:
|
||||
/// <list>
|
||||
/// <item><c>NotifyChanged(string)</c></item>
|
||||
/// <item><c>NotifyChanged(params string[])</c></item>
|
||||
/// <item><c>NotifyChanged{T}(Expression{Func{T}})</c></item>
|
||||
/// <item><c>NotifyChanged{T,U}(Expression{Func{T,U}})</c></item>
|
||||
/// <item><c>SetProperty{T}(ref T, T, string)</c></item>
|
||||
/// </list>
|
||||
/// </remarks>
|
||||
/// <example>
|
||||
/// <code>
|
||||
/// public class Foo : INotifyPropertyChanged
|
||||
/// {
|
||||
/// public event PropertyChangedEventHandler PropertyChanged;
|
||||
///
|
||||
/// [NotifyPropertyChangedInvocator]
|
||||
/// protected virtual void NotifyChanged(string propertyName)
|
||||
/// {}
|
||||
///
|
||||
/// private string _name;
|
||||
/// public string Name
|
||||
/// {
|
||||
/// get { return _name; }
|
||||
/// set
|
||||
/// {
|
||||
/// _name = value;
|
||||
/// NotifyChanged("LastName"); // Warning
|
||||
/// }
|
||||
/// }
|
||||
/// }
|
||||
/// </code>
|
||||
/// Examples of generated notifications:
|
||||
/// <list>
|
||||
/// <item><c>NotifyChanged("Property")</c></item>
|
||||
/// <item><c>NotifyChanged(() => Property)</c></item>
|
||||
/// <item><c>NotifyChanged((VM x) => x.Property)</c></item>
|
||||
/// <item><c>SetProperty(ref myField, value, "Property")</c></item>
|
||||
/// </list>
|
||||
/// </example>
|
||||
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
|
||||
public sealed class NotifyPropertyChangedInvocatorAttribute : Attribute
|
||||
{
|
||||
public NotifyPropertyChangedInvocatorAttribute() { }
|
||||
public NotifyPropertyChangedInvocatorAttribute(string parameterName)
|
||||
{
|
||||
ParameterName = parameterName;
|
||||
}
|
||||
|
||||
[UsedImplicitly] public string ParameterName { get; private set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Indicates that the value of the marked element could be <c>null</c> sometimes,
|
||||
/// so the check for <c>null</c> is necessary before its usage.
|
||||
/// </summary>
|
||||
/// <example>
|
||||
/// <code>
|
||||
/// [CanBeNull]
|
||||
/// public object Test()
|
||||
/// {
|
||||
/// return null;
|
||||
/// }
|
||||
///
|
||||
/// public void UseTest()
|
||||
/// {
|
||||
/// var p = Test();
|
||||
/// var s = p.ToString(); // Warning: Possible 'System.NullReferenceException'
|
||||
/// }
|
||||
/// </code>
|
||||
/// </example>
|
||||
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.Delegate | AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
|
||||
public sealed class CanBeNullAttribute : Attribute { }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates that the value of the marked element could never be <c>null</c>
|
||||
/// </summary>
|
||||
/// <example>
|
||||
/// <code>
|
||||
/// [NotNull]
|
||||
/// public object Foo()
|
||||
/// {
|
||||
/// return null; // Warning: Possible 'null' assignment
|
||||
/// }
|
||||
/// </code>
|
||||
/// </example>
|
||||
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.Delegate | AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
|
||||
public sealed class NotNullAttribute : Attribute { }
|
||||
|
||||
/// <summary>
|
||||
/// Describes dependency between method input and output.
|
||||
/// </summary>
|
||||
/// <syntax>
|
||||
/// <p>Function Definition Table syntax:</p>
|
||||
/// <list>
|
||||
/// <item>FDT ::= FDTRow [;FDTRow]*</item>
|
||||
/// <item>FDTRow ::= Input => Output | Output <= Input</item>
|
||||
/// <item>Input ::= ParameterName: Value [, Input]*</item>
|
||||
/// <item>Output ::= [ParameterName: Value]* {halt|stop|void|nothing|Value}</item>
|
||||
/// <item>Value ::= true | false | null | notnull | canbenull</item>
|
||||
/// </list>
|
||||
/// If method has single input parameter, it's name could be omitted. <br/>
|
||||
/// Using <c>halt</c> (or <c>void</c>/<c>nothing</c>, which is the same) for method output means that the methos doesn't return normally. <br/>
|
||||
/// <c>canbenull</c> annotation is only applicable for output parameters. <br/>
|
||||
/// You can use multiple <c>[ContractAnnotation]</c> for each FDT row, or use single attribute with rows separated by semicolon. <br/>
|
||||
/// </syntax>
|
||||
/// <examples>
|
||||
/// <list>
|
||||
/// <item><code>
|
||||
/// [ContractAnnotation("=> halt")]
|
||||
/// public void TerminationMethod()
|
||||
/// </code></item>
|
||||
/// <item><code>
|
||||
/// [ContractAnnotation("halt <= condition: false")]
|
||||
/// public void Assert(bool condition, string text) // Regular Assertion method
|
||||
/// </code></item>
|
||||
/// <item><code>
|
||||
/// [ContractAnnotation("s:null => true")]
|
||||
/// public bool IsNullOrEmpty(string s) // String.IsNullOrEmpty
|
||||
/// </code></item>
|
||||
/// <item><code>
|
||||
/// // A method that returns null if the parameter is null, and not null if the parameter is not null
|
||||
/// [ContractAnnotation("null => null; notnull => notnull")]
|
||||
/// public object Transform(object data)
|
||||
/// </code></item>
|
||||
/// <item><code>
|
||||
/// [ContractAnnotation("s:null=>false; =>true,result:notnull; =>false, result:null")]
|
||||
/// public bool TryParse(string s, out Person result)
|
||||
/// </code></item>
|
||||
/// </list>
|
||||
/// </examples>
|
||||
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true, Inherited = true)]
|
||||
public sealed class ContractAnnotationAttribute : Attribute
|
||||
{
|
||||
public ContractAnnotationAttribute([NotNull] string fdt) : this (fdt, false)
|
||||
{
|
||||
}
|
||||
|
||||
public ContractAnnotationAttribute([NotNull] string fdt, bool forceFullStates)
|
||||
{
|
||||
FDT = fdt;
|
||||
ForceFullStates = forceFullStates;
|
||||
}
|
||||
|
||||
public string FDT { get; private set; }
|
||||
public bool ForceFullStates { get; private set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Indicates that the value of the marked type (or its derivatives)
|
||||
/// cannot be compared using '==' or '!=' operators and <c>Equals()</c> should be used instead.
|
||||
/// However, using '==' or '!=' for comparison with <c>null</c> is always permitted.
|
||||
/// </summary>
|
||||
/// <example>
|
||||
/// <code>
|
||||
/// [CannotApplyEqualityOperator]
|
||||
/// class NoEquality
|
||||
/// {
|
||||
/// }
|
||||
///
|
||||
/// class UsesNoEquality
|
||||
/// {
|
||||
/// public void Test()
|
||||
/// {
|
||||
/// var ca1 = new NoEquality();
|
||||
/// var ca2 = new NoEquality();
|
||||
///
|
||||
/// if (ca1 != null) // OK
|
||||
/// {
|
||||
/// bool condition = ca1 == ca2; // Warning
|
||||
/// }
|
||||
/// }
|
||||
/// }
|
||||
/// </code>
|
||||
/// </example>
|
||||
[AttributeUsage(AttributeTargets.Interface | AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple = false, Inherited = true)]
|
||||
public sealed class CannotApplyEqualityOperatorAttribute : Attribute { }
|
||||
|
||||
/// <summary>
|
||||
/// When applied to a target attribute, specifies a requirement for any type marked with
|
||||
/// the target attribute to implement or inherit specific type or types.
|
||||
/// </summary>
|
||||
/// <example>
|
||||
/// <code>
|
||||
/// [BaseTypeRequired(typeof(IComponent)] // Specify requirement
|
||||
/// public class ComponentAttribute : Attribute
|
||||
/// {}
|
||||
///
|
||||
/// [Component] // ComponentAttribute requires implementing IComponent interface
|
||||
/// public class MyComponent : IComponent
|
||||
/// {}
|
||||
/// </code>
|
||||
/// </example>
|
||||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
|
||||
[BaseTypeRequired(typeof(Attribute))]
|
||||
public sealed class BaseTypeRequiredAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes new instance of BaseTypeRequiredAttribute
|
||||
/// </summary>
|
||||
/// <param name="baseType">Specifies which types are required</param>
|
||||
public BaseTypeRequiredAttribute(Type baseType)
|
||||
{
|
||||
BaseTypes = new[] { baseType };
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets enumerations of specified base types
|
||||
/// </summary>
|
||||
public Type[] BaseTypes { get; private set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Indicates that the marked symbol is used implicitly (e.g. via reflection, in external library),
|
||||
/// so this symbol will not be marked as unused (as well as by other usage inspections)
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)]
|
||||
public sealed class UsedImplicitlyAttribute : Attribute
|
||||
{
|
||||
[UsedImplicitly] public UsedImplicitlyAttribute()
|
||||
: this(ImplicitUseKindFlags.Default, ImplicitUseTargetFlags.Default) { }
|
||||
|
||||
[UsedImplicitly]
|
||||
public UsedImplicitlyAttribute(ImplicitUseKindFlags useKindFlags, ImplicitUseTargetFlags targetFlags)
|
||||
{
|
||||
UseKindFlags = useKindFlags;
|
||||
TargetFlags = targetFlags;
|
||||
}
|
||||
|
||||
[UsedImplicitly] public UsedImplicitlyAttribute(ImplicitUseKindFlags useKindFlags)
|
||||
: this(useKindFlags, ImplicitUseTargetFlags.Default) { }
|
||||
|
||||
[UsedImplicitly] public UsedImplicitlyAttribute(ImplicitUseTargetFlags targetFlags)
|
||||
: this(ImplicitUseKindFlags.Default, targetFlags) { }
|
||||
|
||||
[UsedImplicitly] public ImplicitUseKindFlags UseKindFlags { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets value indicating what is meant to be used
|
||||
/// </summary>
|
||||
[UsedImplicitly] public ImplicitUseTargetFlags TargetFlags { get; private set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Should be used on attributes and causes ReSharper
|
||||
/// to not mark symbols marked with such attributes as unused (as well as by other usage inspections)
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
|
||||
public sealed class MeansImplicitUseAttribute : Attribute
|
||||
{
|
||||
[UsedImplicitly] public MeansImplicitUseAttribute()
|
||||
: this(ImplicitUseKindFlags.Default, ImplicitUseTargetFlags.Default) { }
|
||||
|
||||
[UsedImplicitly]
|
||||
public MeansImplicitUseAttribute(ImplicitUseKindFlags useKindFlags, ImplicitUseTargetFlags targetFlags)
|
||||
{
|
||||
UseKindFlags = useKindFlags;
|
||||
TargetFlags = targetFlags;
|
||||
}
|
||||
|
||||
[UsedImplicitly] public MeansImplicitUseAttribute(ImplicitUseKindFlags useKindFlags)
|
||||
: this(useKindFlags, ImplicitUseTargetFlags.Default)
|
||||
{
|
||||
}
|
||||
|
||||
[UsedImplicitly] public MeansImplicitUseAttribute(ImplicitUseTargetFlags targetFlags)
|
||||
: this(ImplicitUseKindFlags.Default, targetFlags) { }
|
||||
|
||||
[UsedImplicitly] public ImplicitUseKindFlags UseKindFlags { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets value indicating what is meant to be used
|
||||
/// </summary>
|
||||
[UsedImplicitly] public ImplicitUseTargetFlags TargetFlags { get; private set; }
|
||||
}
|
||||
|
||||
[Flags]
|
||||
public enum ImplicitUseKindFlags
|
||||
{
|
||||
Default = Access | Assign | InstantiatedWithFixedConstructorSignature,
|
||||
|
||||
/// <summary>
|
||||
/// Only entity marked with attribute considered used
|
||||
/// </summary>
|
||||
Access = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Indicates implicit assignment to a member
|
||||
/// </summary>
|
||||
Assign = 2,
|
||||
|
||||
/// <summary>
|
||||
/// Indicates implicit instantiation of a type with fixed constructor signature.
|
||||
/// That means any unused constructor parameters won't be reported as such.
|
||||
/// </summary>
|
||||
InstantiatedWithFixedConstructorSignature = 4,
|
||||
|
||||
/// <summary>
|
||||
/// Indicates implicit instantiation of a type
|
||||
/// </summary>
|
||||
InstantiatedNoFixedConstructorSignature = 8,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Specify what is considered used implicitly when marked with <see cref="MeansImplicitUseAttribute"/> or <see cref="UsedImplicitlyAttribute"/>
|
||||
/// </summary>
|
||||
[Flags]
|
||||
public enum ImplicitUseTargetFlags
|
||||
{
|
||||
Default = Itself,
|
||||
|
||||
Itself = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Members of entity marked with attribute are considered used
|
||||
/// </summary>
|
||||
Members = 2,
|
||||
|
||||
/// <summary>
|
||||
/// Entity marked with attribute and all its members considered used
|
||||
/// </summary>
|
||||
WithMembers = Itself | Members
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This attribute is intended to mark publicly available API which should not be removed and so is treated as used.
|
||||
/// </summary>
|
||||
[MeansImplicitUse]
|
||||
public sealed class PublicAPIAttribute : Attribute
|
||||
{
|
||||
public PublicAPIAttribute() { }
|
||||
public PublicAPIAttribute(string comment) { }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tells code analysis engine if the parameter is completely handled when the invoked method is on stack.
|
||||
/// If the parameter is a delegate, indicates that delegate is executed while the method is executed.
|
||||
/// If the parameter is an enumerable, indicates that it is enumerated while the method is executed.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Parameter, Inherited = true)]
|
||||
public sealed class InstantHandleAttribute : Attribute { }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Indicates that a method does not make any observable state changes.
|
||||
/// The same as <see cref="System.Diagnostics.Contracts.PureAttribute"/>
|
||||
/// </summary>
|
||||
/// <example>
|
||||
/// <code>
|
||||
/// [Pure]
|
||||
/// private int Multiply(int x, int y)
|
||||
/// {
|
||||
/// return x*y;
|
||||
/// }
|
||||
///
|
||||
/// public void Foo()
|
||||
/// {
|
||||
/// const int a=2, b=2;
|
||||
/// Multiply(a, b); // Waring: Return value of pure method is not used
|
||||
/// }
|
||||
/// </code>
|
||||
/// </example>
|
||||
[AttributeUsage(AttributeTargets.Method, Inherited = true)]
|
||||
public sealed class PureAttribute : Attribute { }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates that a parameter is a path to a file or a folder within a web project.
|
||||
/// Path can be relative or absolute, starting from web root (~).
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Parameter)]
|
||||
public class PathReferenceAttribute : Attribute
|
||||
{
|
||||
public PathReferenceAttribute() { }
|
||||
|
||||
[UsedImplicitly]
|
||||
public PathReferenceAttribute([PathReference] string basePath)
|
||||
{
|
||||
BasePath = basePath;
|
||||
}
|
||||
|
||||
[UsedImplicitly] public string BasePath { get; private set; }
|
||||
}
|
||||
|
||||
// ASP.NET MVC attributes
|
||||
|
||||
/// <summary>
|
||||
/// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter is an MVC action.
|
||||
/// If applied to a method, the MVC action name is calculated implicitly from the context.
|
||||
/// Use this attribute for custom wrappers similar to
|
||||
/// <see cref="System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper, String)"/>
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)]
|
||||
public sealed class AspMvcActionAttribute : Attribute
|
||||
{
|
||||
[UsedImplicitly] public string AnonymousProperty { get; private set; }
|
||||
|
||||
public AspMvcActionAttribute() { }
|
||||
|
||||
public AspMvcActionAttribute(string anonymousProperty)
|
||||
{
|
||||
AnonymousProperty = anonymousProperty;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ASP.NET MVC attribute. Indicates that a parameter is an MVC araa.
|
||||
/// Use this attribute for custom wrappers similar to
|
||||
/// <see cref="System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper, String)"/>
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Parameter)]
|
||||
public sealed class AspMvcAreaAttribute : PathReferenceAttribute
|
||||
{
|
||||
[UsedImplicitly] public string AnonymousProperty { get; private set; }
|
||||
|
||||
[UsedImplicitly] public AspMvcAreaAttribute() { }
|
||||
|
||||
public AspMvcAreaAttribute(string anonymousProperty)
|
||||
{
|
||||
AnonymousProperty = anonymousProperty;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter is an MVC controller.
|
||||
/// If applied to a method, the MVC controller name is calculated implicitly from the context.
|
||||
/// Use this attribute for custom wrappers similar to
|
||||
/// <see cref="System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper, String, String)"/>
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)]
|
||||
public sealed class AspMvcControllerAttribute : Attribute
|
||||
{
|
||||
[UsedImplicitly] public string AnonymousProperty { get; private set; }
|
||||
|
||||
public AspMvcControllerAttribute() { }
|
||||
|
||||
public AspMvcControllerAttribute(string anonymousProperty)
|
||||
{
|
||||
AnonymousProperty = anonymousProperty;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ASP.NET MVC attribute. Indicates that a parameter is an MVC Master.
|
||||
/// Use this attribute for custom wrappers similar to
|
||||
/// <see cref="System.Web.Mvc.Controller.View(String, String)"/>
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Parameter)]
|
||||
public sealed class AspMvcMasterAttribute : Attribute { }
|
||||
|
||||
/// <summary>
|
||||
/// ASP.NET MVC attribute. Indicates that a parameter is an MVC model type.
|
||||
/// Use this attribute for custom wrappers similar to
|
||||
/// <see cref="System.Web.Mvc.Controller.View(String, Object)"/>
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Parameter)]
|
||||
public sealed class AspMvcModelTypeAttribute : Attribute { }
|
||||
|
||||
/// <summary>
|
||||
/// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter is an MVC partial view.
|
||||
/// If applied to a method, the MVC partial view name is calculated implicitly from the context.
|
||||
/// Use this attribute for custom wrappers similar to
|
||||
/// <see cref="System.Web.Mvc.Html.RenderPartialExtensions.RenderPartial(HtmlHelper, String)"/>
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)]
|
||||
public sealed class AspMvcPartialViewAttribute : PathReferenceAttribute { }
|
||||
|
||||
/// <summary>
|
||||
/// ASP.NET MVC attribute. Allows disabling all inspections for MVC views within a class or a method.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]
|
||||
public sealed class AspMvcSupressViewErrorAttribute : Attribute { }
|
||||
|
||||
/// <summary>
|
||||
/// ASP.NET MVC attribute. Indicates that a parameter is an MVC display template.
|
||||
/// Use this attribute for custom wrappers similar to
|
||||
/// <see cref="System.Web.Mvc.Html.DisplayExtensions.DisplayForModel(HtmlHelper, String)"/>
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Parameter)]
|
||||
public sealed class AspMvcDisplayTemplateAttribute : Attribute { }
|
||||
|
||||
/// <summary>
|
||||
/// ASP.NET MVC attribute. Indicates that a parameter is an MVC editor template.
|
||||
/// Use this attribute for custom wrappers similar to
|
||||
/// <see cref="System.Web.Mvc.Html.EditorExtensions.EditorForModel(HtmlHelper, String)"/>
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Parameter)]
|
||||
public sealed class AspMvcEditorTemplateAttribute : Attribute { }
|
||||
|
||||
/// <summary>
|
||||
/// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter is an MVC view.
|
||||
/// If applied to a method, the MVC view name is calculated implicitly from the context.
|
||||
/// Use this attribute for custom wrappers similar to
|
||||
/// <see cref="System.Web.Mvc.Controller.View(Object)"/>
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)]
|
||||
public sealed class AspMvcViewAttribute : PathReferenceAttribute { }
|
||||
|
||||
/// <summary>
|
||||
/// ASP.NET MVC attribute. When applied to a parameter of an attribute,
|
||||
/// indicates that this parameter is an MVC action name.
|
||||
/// </summary>
|
||||
/// <example>
|
||||
/// <code>
|
||||
/// [ActionName("Foo")]
|
||||
/// public ActionResult Login(string returnUrl)
|
||||
/// {
|
||||
/// ViewBag.ReturnUrl = Url.Action("Foo"); // OK
|
||||
/// return RedirectToAction("Bar"); // Error: Cannot resolve action
|
||||
/// }
|
||||
/// </code>
|
||||
/// </example>
|
||||
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property)]
|
||||
public sealed class AspMvcActionSelectorAttribute : Attribute { }
|
||||
|
||||
// Razor attributes
|
||||
|
||||
/// <summary>
|
||||
/// Razor attribute. Indicates that a parameter or a method is a Razor section.
|
||||
/// Use this attribute for custom wrappers similar to
|
||||
/// <see cref="System.Web.WebPages.WebPageBase.RenderSection(String)"/>
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method, Inherited = true)]
|
||||
public sealed class RazorSectionAttribute : Attribute { }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
using System.Reflection;
|
||||
using System.Resources;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("FileConverter")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("FileConverter")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2014")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// In order to begin building localizable applications, set
|
||||
// <UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
|
||||
// inside a <PropertyGroup>. For example, if you are using US english
|
||||
// in your source files, set the <UICulture> to en-US. Then uncomment
|
||||
// the NeutralResourceLanguage attribute below. Update the "en-US" in
|
||||
// the line below to match the UICulture setting in the project file.
|
||||
|
||||
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
|
||||
|
||||
|
||||
[assembly: ThemeInfo(
|
||||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
|
||||
//(used if a resource is not found in the page,
|
||||
// or application resource dictionaries)
|
||||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
|
||||
//(used if a resource is not found in the page,
|
||||
// app, or any theme specific resource dictionaries)
|
||||
)]
|
||||
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -0,0 +1,112 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FileConverter.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
public class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
public static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("FileConverter.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
public static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to C:\Music\Artist\Album\Song.wav.
|
||||
/// </summary>
|
||||
public static string OuputFileNameTemplateSample {
|
||||
get {
|
||||
return ResourceManager.GetString("OuputFileNameTemplateSample", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to (p): input file path
|
||||
///(f): input filename
|
||||
///(o): output extension type
|
||||
///(i): input extension type
|
||||
///(d0): input parent folder
|
||||
///(d1): input sub parent folder
|
||||
///...
|
||||
///use maj for uppercase version
|
||||
///
|
||||
///Special paths:
|
||||
///(p:d): my documents path
|
||||
///(p:m): my music path
|
||||
///(p:v): my videos path
|
||||
///(p:p): my pictures path.
|
||||
/// </summary>
|
||||
public static string OutputFilePathTemplateHelp {
|
||||
get {
|
||||
return ResourceManager.GetString("OutputFilePathTemplateHelp", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Define the ratio 'file size' versus 'video quality'. A lower value will give you a smaller file, a greater value give you a better video quality..
|
||||
/// </summary>
|
||||
public static string VideoEncodingQualityTooltip {
|
||||
get {
|
||||
return ResourceManager.GetString("VideoEncodingQualityTooltip", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Define the ratio 'file size' versus 'compression duration'. A slow compression will give you a smaller file (for the same video quality) than a faster compression..
|
||||
/// </summary>
|
||||
public static string VideoEncodingSpeedTooltip {
|
||||
get {
|
||||
return ResourceManager.GetString("VideoEncodingSpeedTooltip", resourceCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,145 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="OuputFileNameTemplateSample" xml:space="preserve">
|
||||
<value>C:\Music\Artist\Album\Song.wav</value>
|
||||
</data>
|
||||
<data name="OutputFilePathTemplateHelp" xml:space="preserve">
|
||||
<value>(p): input file path
|
||||
(f): input filename
|
||||
(o): output extension type
|
||||
(i): input extension type
|
||||
(d0): input parent folder
|
||||
(d1): input sub parent folder
|
||||
...
|
||||
use maj for uppercase version
|
||||
|
||||
Special paths:
|
||||
(p:d): my documents path
|
||||
(p:m): my music path
|
||||
(p:v): my videos path
|
||||
(p:p): my pictures path</value>
|
||||
</data>
|
||||
<data name="VideoEncodingQualityTooltip" xml:space="preserve">
|
||||
<value>Define the ratio 'file size' versus 'video quality'. A lower value will give you a smaller file, a greater value give you a better video quality.</value>
|
||||
</data>
|
||||
<data name="VideoEncodingSpeedTooltip" xml:space="preserve">
|
||||
<value>Define the ratio 'file size' versus 'compression duration'. A slow compression will give you a smaller file (for the same video quality) than a faster compression.</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -0,0 +1,145 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="OuputFileNameTemplateSample" xml:space="preserve">
|
||||
<value>C:\Music\Artist\Album\Song.wav</value>
|
||||
</data>
|
||||
<data name="OutputFilePathTemplateHelp" xml:space="preserve">
|
||||
<value>(p): input file path
|
||||
(f): input filename
|
||||
(o): output extension type
|
||||
(i): input extension type
|
||||
(d0): input parent folder
|
||||
(d1): input sub parent folder
|
||||
...
|
||||
use maj for uppercase version
|
||||
|
||||
Special paths:
|
||||
(p:d): my documents path
|
||||
(p:m): my music path
|
||||
(p:v): my videos path
|
||||
(p:p): my pictures path</value>
|
||||
</data>
|
||||
<data name="VideoEncodingQualityTooltip" xml:space="preserve">
|
||||
<value>Define the ratio 'file size' versus 'video quality'. A lower value will give you a smaller file, a greater value give you a better video quality.</value>
|
||||
</data>
|
||||
<data name="VideoEncodingSpeedTooltip" xml:space="preserve">
|
||||
<value>Define the ratio 'file size' versus 'compression duration'. A slow compression will give you a smaller file (for the same video quality) than a faster compression.</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -0,0 +1,30 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.18444
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FileConverter.Properties
|
||||
{
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||
{
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default
|
||||
{
|
||||
get
|
||||
{
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
|
After Width: | Height: | Size: 294 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
@@ -0,0 +1,98 @@
|
||||
// <copyright file="Settings.Settings.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverter
|
||||
{
|
||||
using System.Linq;
|
||||
using System.Collections.ObjectModel;
|
||||
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>();
|
||||
|
||||
[XmlAttribute]
|
||||
public int SerializationVersion
|
||||
{
|
||||
get;
|
||||
set;
|
||||
} = Version;
|
||||
|
||||
[XmlIgnore]
|
||||
public ObservableCollection<ConversionPreset> ConversionPresets
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.conversionPresets;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.conversionPresets = value;
|
||||
this.OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
[XmlElement]
|
||||
public bool ExitApplicationWhenConversionsFinished
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.exitApplicationWhenConversionsFinished;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.exitApplicationWhenConversionsFinished = value;
|
||||
this.OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
[XmlElement]
|
||||
public float DurationBetweenEndOfConversionsAndApplicationExit
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.durationBetweenEndOfConversionsAndApplicationExit;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.durationBetweenEndOfConversionsAndApplicationExit = value;
|
||||
this.OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
[XmlElement("ConversionPreset")]
|
||||
public ConversionPreset[] SerializableConversionPresets
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.ConversionPresets.ToArray();
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
for (int index = 0; index < value.Length; index++)
|
||||
{
|
||||
this.ConversionPresets.Add(value[index]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void OnDeserializationComplete()
|
||||
{
|
||||
this.DurationBetweenEndOfConversionsAndApplicationExit = System.Math.Max(0, System.Math.Min(10, this.DurationBetweenEndOfConversionsAndApplicationExit));
|
||||
|
||||
for (int index = 0; index < this.ConversionPresets.Count; index++)
|
||||
{
|
||||
this.ConversionPresets[index].OnDeserializationComplete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<StyleCopSettings Version="105">
|
||||
<Analyzers>
|
||||
<Analyzer AnalyzerId="StyleCop.CSharp.DocumentationRules">
|
||||
<Rules>
|
||||
<Rule Name="ElementsMustBeDocumented">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="EnumerationItemsMustBeDocumented">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="PartialElementsMustBeDocumented">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
</Rules>
|
||||
<AnalyzerSettings />
|
||||
</Analyzer>
|
||||
</Analyzers>
|
||||
</StyleCopSettings>
|
||||
@@ -0,0 +1,428 @@
|
||||
// <copyright file="Settings.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverter
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Security.Principal;
|
||||
using System.Xml.Serialization;
|
||||
using System.Windows;
|
||||
|
||||
using Microsoft.Win32;
|
||||
|
||||
using FileConverter.Annotations;
|
||||
|
||||
[XmlRoot]
|
||||
[XmlType]
|
||||
public partial class Settings : INotifyPropertyChanged, IDataErrorInfo
|
||||
{
|
||||
private const char PresetSeparator = ';';
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
[XmlIgnore]
|
||||
public string Error
|
||||
{
|
||||
get
|
||||
{
|
||||
for (int index = 0; index < this.ConversionPresets.Count; index++)
|
||||
{
|
||||
string error = this.ConversionPresets[index].Error;
|
||||
if (!string.IsNullOrEmpty(error))
|
||||
{
|
||||
return error;
|
||||
}
|
||||
}
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
private static bool IsInAdmininstratorPrivileges
|
||||
{
|
||||
get
|
||||
{
|
||||
return new WindowsPrincipal(WindowsIdentity.GetCurrent()).IsInRole(WindowsBuiltInRole.Administrator);
|
||||
}
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
public string this[string columnName]
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.Error;
|
||||
}
|
||||
}
|
||||
|
||||
public static void ApplyTemporarySettings()
|
||||
{
|
||||
// Load temporary settings.
|
||||
string temporaryFilePath = Settings.GetUserSettingsTemporaryFilePath();
|
||||
if (!File.Exists(temporaryFilePath))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Settings settings = null;
|
||||
XmlHelpers.LoadFromFile("Settings", temporaryFilePath, out settings);
|
||||
|
||||
RegistryKey registryKey = Registry.CurrentUser.OpenSubKey(@"Software\FileConverter");
|
||||
if (registryKey == null)
|
||||
{
|
||||
Diagnostics.Debug.LogError("Can't apply settings in registry. (code 0x03)");
|
||||
return;
|
||||
}
|
||||
|
||||
// Compute the registry entries data from settings.
|
||||
Dictionary<string, List<string>> registryEntries = ComputeRegistryEntriesFromConvertionPresets(settings.ConversionPresets);
|
||||
|
||||
bool succeed = Settings.ApplyRegistryModifications(registryEntries);
|
||||
|
||||
if (succeed)
|
||||
{
|
||||
// Copy temporary settings file to the real settings file.
|
||||
string userFilePath = Settings.GetUserSettingsFilePath();
|
||||
File.Copy(temporaryFilePath, userFilePath, true);
|
||||
File.Delete(temporaryFilePath);
|
||||
}
|
||||
}
|
||||
|
||||
public static Settings Load()
|
||||
{
|
||||
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, out userSettings);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
MessageBoxResult messageBoxResult = MessageBox.Show("Can't load file converter user settings. Do you want to fall back to default settings ?", "Error", MessageBoxButton.YesNo, MessageBoxImage.Exclamation);
|
||||
if (messageBoxResult == MessageBoxResult.Yes)
|
||||
{
|
||||
System.IO.File.Delete(userFilePath);
|
||||
return Settings.Load();
|
||||
}
|
||||
else if (messageBoxResult == MessageBoxResult.No)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
if (userSettings != null && userSettings.SerializationVersion != Version)
|
||||
{
|
||||
Diagnostics.Debug.Log("File converter settings has been imported from version {0} to version {1}.", userSettings.SerializationVersion, Version);
|
||||
}
|
||||
}
|
||||
|
||||
return userSettings != null ? userSettings.Merge(defaultSettings) : defaultSettings;
|
||||
}
|
||||
|
||||
public ConversionPreset GetPresetFromName(string presetName)
|
||||
{
|
||||
return this.conversionPresets.FirstOrDefault(match => match.Name == presetName);
|
||||
}
|
||||
|
||||
public void Save()
|
||||
{
|
||||
this.Clean();
|
||||
|
||||
// Save the settings in a temporary files (we'll write the settings file when we'll succeed to write the registry keys).
|
||||
string temporaryFilePath = Settings.GetUserSettingsTemporaryFilePath();
|
||||
XmlHelpers.SaveToFile("Settings", temporaryFilePath, this);
|
||||
|
||||
// Compute the registry entries data from settings.
|
||||
Dictionary<string, List<string>> registryEntries = Settings.ComputeRegistryEntriesFromConvertionPresets(this.ConversionPresets);
|
||||
|
||||
// Detect if existing registry configuration need to be modified.
|
||||
bool registryNeedModifications = Settings.IsRegistryNeedModifications(registryEntries);
|
||||
|
||||
if (registryNeedModifications)
|
||||
{
|
||||
// Write the settings in registry.
|
||||
if (Settings.IsInAdmininstratorPrivileges)
|
||||
{
|
||||
// We are in admin mode, write reigstry ...
|
||||
bool succeed = Settings.ApplyRegistryModifications(registryEntries);
|
||||
if (succeed)
|
||||
{
|
||||
// ... and copy temporary settings file to the real settings file.
|
||||
string userFilePath = Settings.GetUserSettingsFilePath();
|
||||
File.Copy(temporaryFilePath, userFilePath, true);
|
||||
File.Delete(temporaryFilePath);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Run the application in admin mode in order to perform modifications.
|
||||
Settings.RunSaveInAdminMode();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Copy temporary settings file to the real settings file.
|
||||
string userFilePath = Settings.GetUserSettingsFilePath();
|
||||
File.Copy(temporaryFilePath, userFilePath, true);
|
||||
File.Delete(temporaryFilePath);
|
||||
}
|
||||
}
|
||||
|
||||
public void Clean()
|
||||
{
|
||||
for (int index = 0; index < this.ConversionPresets.Count; index++)
|
||||
{
|
||||
this.ConversionPresets[index].Clean();
|
||||
}
|
||||
}
|
||||
|
||||
private static bool ApplyRegistryModifications(Dictionary<string, List<string>> registryEntries)
|
||||
{
|
||||
if (!Settings.IsInAdmininstratorPrivileges)
|
||||
{
|
||||
MessageBox.Show("Can't apply settings in registry because the application is not in administrator privileges. (code 0x04)", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
return false;
|
||||
}
|
||||
|
||||
RegistryKey registryKey = Registry.CurrentUser.OpenSubKey(@"Software\FileConverter", RegistryKeyPermissionCheck.ReadWriteSubTree);
|
||||
if (registryKey == null)
|
||||
{
|
||||
MessageBox.Show("Can't apply settings in registry. (code 0x05)", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Delete previous settings.
|
||||
string[] subKeyNames = registryKey.GetSubKeyNames();
|
||||
for (int index = 0; index < subKeyNames.Length; index++)
|
||||
{
|
||||
try
|
||||
{
|
||||
registryKey.DeleteSubKey(subKeyNames[index]);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
MessageBox.Show("Can't apply settings in registry. (code 0x06)", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Apply settings in registry.
|
||||
foreach (KeyValuePair<string, List<string>> registryEntry in registryEntries)
|
||||
{
|
||||
string presets = string.Empty;
|
||||
for (int index = 0; index < registryEntry.Value.Count; index++)
|
||||
{
|
||||
if (index > 0)
|
||||
{
|
||||
presets += ";";
|
||||
}
|
||||
|
||||
presets += registryEntry.Value[index];
|
||||
}
|
||||
|
||||
RegistryKey subKey = null;
|
||||
try
|
||||
{
|
||||
subKey = registryKey.CreateSubKey(registryEntry.Key);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
Diagnostics.Debug.Log(exception.Message);
|
||||
}
|
||||
|
||||
if (subKey == null)
|
||||
{
|
||||
MessageBox.Show("Can't apply settings in registry. (code 0x07)", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
return false;
|
||||
}
|
||||
|
||||
subKey.SetValue("Presets", presets);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private static Dictionary<string, List<string>> ComputeRegistryEntriesFromConvertionPresets(ICollection<ConversionPreset> conversionPresets)
|
||||
{
|
||||
Dictionary<string, List<string>> registryEntries = new Dictionary<string, List<string>>();
|
||||
|
||||
foreach (ConversionPreset conversionPreset in conversionPresets)
|
||||
{
|
||||
List<string> inputTypes = conversionPreset.InputTypes;
|
||||
for (int inputIndex = 0; inputIndex < inputTypes.Count; inputIndex++)
|
||||
{
|
||||
string inputType = inputTypes[inputIndex].ToLowerInvariant();
|
||||
if (!registryEntries.ContainsKey(inputType))
|
||||
{
|
||||
registryEntries.Add(inputType, new List<string>());
|
||||
}
|
||||
|
||||
registryEntries[inputType].Add(conversionPreset.Name);
|
||||
}
|
||||
}
|
||||
|
||||
return registryEntries;
|
||||
}
|
||||
|
||||
private static string GetDefaultSettingsFilePath()
|
||||
{
|
||||
string path = Assembly.GetEntryAssembly().Location;
|
||||
path = Path.GetDirectoryName(path);
|
||||
|
||||
if (!Directory.Exists(path))
|
||||
{
|
||||
Directory.CreateDirectory(path);
|
||||
}
|
||||
|
||||
path = Path.Combine(path, "Settings.xml");
|
||||
return path;
|
||||
}
|
||||
|
||||
private static string GetUserSettingsFilePath()
|
||||
{
|
||||
string path = PathHelpers.GetUserDataFolderPath();
|
||||
path = Path.Combine(path, "Settings.user.xml");
|
||||
return path;
|
||||
}
|
||||
|
||||
private static string GetUserSettingsTemporaryFilePath()
|
||||
{
|
||||
string path = PathHelpers.GetUserDataFolderPath();
|
||||
path = Path.Combine(path, "Settings.temp.xml");
|
||||
return path;
|
||||
}
|
||||
|
||||
private static bool IsRegistryNeedModifications(Dictionary<string, List<string>> registryEntries)
|
||||
{
|
||||
// Compare to registry entries.
|
||||
RegistryKey registryKey = Registry.CurrentUser.OpenSubKey(@"Software\FileConverter");
|
||||
if (registryKey == null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
string[] subKeyNames = registryKey.GetSubKeyNames();
|
||||
if (subKeyNames.Length == registryEntries.Count)
|
||||
{
|
||||
for (int index = 0; index < subKeyNames.Length; index++)
|
||||
{
|
||||
string subKeyName = subKeyNames[index];
|
||||
if (!registryEntries.ContainsKey(subKeyName))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
List<string> presetsList = registryEntries[subKeyName];
|
||||
|
||||
RegistryKey subKey = registryKey.OpenSubKey(subKeyName);
|
||||
if (subKey == null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
string presetsString = subKey.GetValue("Presets", string.Empty) as string;
|
||||
string[] presets = presetsString != null ? presetsString.Split(Settings.PresetSeparator) : new string[0];
|
||||
if (presets.Length != presetsList.Count)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
for (int presetIndex = 0; presetIndex < presets.Length; presetIndex++)
|
||||
{
|
||||
if (presetsList[presetIndex] != presets[presetIndex])
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private static void RunSaveInAdminMode()
|
||||
{
|
||||
ProcessStartInfo processStartInfo = new ProcessStartInfo(Assembly.GetEntryAssembly().Location, "--apply-settings")
|
||||
{
|
||||
UseShellExecute = true,
|
||||
Verb = "runas", // indicates to elevate privileges
|
||||
};
|
||||
|
||||
Process process = new Process
|
||||
{
|
||||
EnableRaisingEvents = true, // enable WaitForExit()
|
||||
StartInfo = processStartInfo
|
||||
};
|
||||
|
||||
try
|
||||
{
|
||||
process.Start();
|
||||
process.WaitForExit();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
MessageBox.Show("Can't apply settings in registry because the application has no administrator privileges. (code 0x08)", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
[NotifyPropertyChangedInvocator]
|
||||
private void OnPropertyChanged([CallerMemberName] string propertyName = null)
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,164 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Settings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" SerializationVersion="0">
|
||||
<ExitApplicationWhenConversionsFinished>true</ExitApplicationWhenConversionsFinished>
|
||||
<DurationBetweenEndOfConversionsAndApplicationExit>3</DurationBetweenEndOfConversionsAndApplicationExit>
|
||||
<ConversionPreset Name="To Mkv" OutputType="Mkv">
|
||||
<InputTypes>avi</InputTypes>
|
||||
<InputTypes>bik</InputTypes>
|
||||
<InputTypes>flv</InputTypes>
|
||||
<InputTypes>mkv</InputTypes>
|
||||
<InputTypes>mov</InputTypes>
|
||||
<InputTypes>mp4</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="VideoQuality" Value="30" />
|
||||
<Settings Key="VideoEncodingSpeed" Value="Very Slow" />
|
||||
<Settings Key="AudioBitrate" Value="155" />
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="To Mkv (low quality)" OutputType="Mkv">
|
||||
<InputTypes>avi</InputTypes>
|
||||
<InputTypes>bik</InputTypes>
|
||||
<InputTypes>flv</InputTypes>
|
||||
<InputTypes>mkv</InputTypes>
|
||||
<InputTypes>mov</InputTypes>
|
||||
<InputTypes>mp4</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="VideoQuality" Value="20" />
|
||||
<Settings Key="VideoEncodingSpeed" Value="Very Slow" />
|
||||
<Settings Key="AudioBitrate" Value="96" />
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="To Ogg" OutputType="Ogg">
|
||||
<InputTypes>aac</InputTypes>
|
||||
<InputTypes>aiff</InputTypes>
|
||||
<InputTypes>ape</InputTypes>
|
||||
<InputTypes>flac</InputTypes>
|
||||
<InputTypes>m4a</InputTypes>
|
||||
<InputTypes>mp3</InputTypes>
|
||||
<InputTypes>wma</InputTypes>
|
||||
<InputTypes>avi</InputTypes>
|
||||
<InputTypes>bik</InputTypes>
|
||||
<InputTypes>flv</InputTypes>
|
||||
<InputTypes>mkv</InputTypes>
|
||||
<InputTypes>mov</InputTypes>
|
||||
<InputTypes>mp4</InputTypes>
|
||||
<InputTypes>wav</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="AudioBitrate" Value="160" />
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="To Flac" OutputType="Flac">
|
||||
<InputTypes>avi</InputTypes>
|
||||
<InputTypes>bik</InputTypes>
|
||||
<InputTypes>flv</InputTypes>
|
||||
<InputTypes>mkv</InputTypes>
|
||||
<InputTypes>mov</InputTypes>
|
||||
<InputTypes>mp4</InputTypes>
|
||||
<InputTypes>wav</InputTypes>
|
||||
<InputTypes>ape</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="To Wav" OutputType="Wav">
|
||||
<InputTypes>aac</InputTypes>
|
||||
<InputTypes>aiff</InputTypes>
|
||||
<InputTypes>ape</InputTypes>
|
||||
<InputTypes>flac</InputTypes>
|
||||
<InputTypes>m4a</InputTypes>
|
||||
<InputTypes>mp3</InputTypes>
|
||||
<InputTypes>ogg</InputTypes>
|
||||
<InputTypes>wma</InputTypes>
|
||||
<InputTypes>avi</InputTypes>
|
||||
<InputTypes>bik</InputTypes>
|
||||
<InputTypes>flv</InputTypes>
|
||||
<InputTypes>mkv</InputTypes>
|
||||
<InputTypes>mov</InputTypes>
|
||||
<InputTypes>mp4</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="AudioEncodingMode" Value="Wav16" />
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="To Mp3" OutputType="Mp3">
|
||||
<InputTypes>aac</InputTypes>
|
||||
<InputTypes>aiff</InputTypes>
|
||||
<InputTypes>ape</InputTypes>
|
||||
<InputTypes>flac</InputTypes>
|
||||
<InputTypes>m4a</InputTypes>
|
||||
<InputTypes>ogg</InputTypes>
|
||||
<InputTypes>wma</InputTypes>
|
||||
<InputTypes>avi</InputTypes>
|
||||
<InputTypes>bik</InputTypes>
|
||||
<InputTypes>flv</InputTypes>
|
||||
<InputTypes>mkv</InputTypes>
|
||||
<InputTypes>mov</InputTypes>
|
||||
<InputTypes>mp4</InputTypes>
|
||||
<InputTypes>wav</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="AudioEncodingMode" Value="Mp3VBR" />
|
||||
<Settings Key="AudioBitrate" Value="190" />
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="To Aac" OutputType="Aac">
|
||||
<InputTypes>aiff</InputTypes>
|
||||
<InputTypes>ape</InputTypes>
|
||||
<InputTypes>m4a</InputTypes>
|
||||
<InputTypes>mp3</InputTypes>
|
||||
<InputTypes>ogg</InputTypes>
|
||||
<InputTypes>wma</InputTypes>
|
||||
<InputTypes>avi</InputTypes>
|
||||
<InputTypes>bik</InputTypes>
|
||||
<InputTypes>flv</InputTypes>
|
||||
<InputTypes>mkv</InputTypes>
|
||||
<InputTypes>mov</InputTypes>
|
||||
<InputTypes>mp4</InputTypes>
|
||||
<InputTypes>wav</InputTypes>
|
||||
<InputTypes>flac</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="Extract CDA to Flac" OutputType="Flac">
|
||||
<InputTypes>cda</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<OutputFileNameTemplate>(p:m)CDA Extraction\(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="Extract CDA to Ogg" OutputType="Ogg">
|
||||
<InputTypes>cda</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="AudioBitrate" Value="192" />
|
||||
<OutputFileNameTemplate>(p:m)CDA Extraction\(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="Extract CDA to Mp3" OutputType="Mp3">
|
||||
<InputTypes>cda</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="AudioEncodingMode" Value="Mp3VBR" />
|
||||
<Settings Key="AudioBitrate" Value="225" />
|
||||
<OutputFileNameTemplate>(p:m)CDA Extraction\(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="To Png" OutputType="Png">
|
||||
<InputTypes>bmp</InputTypes>
|
||||
<InputTypes>tiff</InputTypes>
|
||||
<InputTypes>ico</InputTypes>
|
||||
<InputTypes>jpg</InputTypes>
|
||||
<InputTypes>jpeg</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="To Jpg" OutputType="Jpg">
|
||||
<InputTypes>bmp</InputTypes>
|
||||
<InputTypes>png</InputTypes>
|
||||
<InputTypes>tiff</InputTypes>
|
||||
<InputTypes>ico</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<Settings Key="ImageQuality" Value="25" />
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
<ConversionPreset Name="To Ico (max 256x256)" OutputType="Ico">
|
||||
<InputTypes>bmp</InputTypes>
|
||||
<InputTypes>jpg</InputTypes>
|
||||
<InputTypes>jpeg</InputTypes>
|
||||
<InputTypes>png</InputTypes>
|
||||
<InputTypes>tiff</InputTypes>
|
||||
<InputPostConversionAction>None</InputPostConversionAction>
|
||||
<OutputFileNameTemplate>(p)(f)</OutputFileNameTemplate>
|
||||
</ConversionPreset>
|
||||
</Settings>
|
||||
@@ -0,0 +1,28 @@
|
||||
// <copyright file="ApplicationVersionToApplicationName.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverter.ValueConverters
|
||||
{
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
|
||||
public class ApplicationVersionToApplicationName : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (!(value is FileConverter.Version))
|
||||
{
|
||||
return "File Converter";
|
||||
}
|
||||
|
||||
FileConverter.Version version = (FileConverter.Version)value;
|
||||
|
||||
return string.Format("File Converter v{0}", version.ToString());
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
// <copyright file="BitrateToString.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverter.ValueConverters
|
||||
{
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
|
||||
public class BitrateToString : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (!(value is double))
|
||||
{
|
||||
throw new ArgumentException("The value must be a double value.");
|
||||
}
|
||||
|
||||
double bitrate = (double)value;
|
||||
|
||||
return string.Format("{0} kbit/s", bitrate.ToString("0"));
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
// <copyright file="ConversionSettingsToString.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverter.ValueConverters
|
||||
{
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
|
||||
public class ConversionSettingsToString : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!(value is IConversionSettings))
|
||||
{
|
||||
throw new ArgumentException("The value must be a conversion preset array.");
|
||||
}
|
||||
|
||||
IConversionSettings settings = (IConversionSettings)value;
|
||||
|
||||
string parameterString = parameter as string;
|
||||
if (parameterString == null)
|
||||
{
|
||||
throw new ArgumentException("The parameter must be a string value.");
|
||||
}
|
||||
|
||||
string[] parameters = parameterString.Split(',');
|
||||
if (parameters.Length < 1 || parameters.Length > 2)
|
||||
{
|
||||
throw new ArgumentException("The parameter format must be 'SettingsKey[,DefaultValue]'.");
|
||||
}
|
||||
|
||||
string key = parameters[0];
|
||||
string setting;
|
||||
if (settings.TryGetValue(key, out setting))
|
||||
{
|
||||
return setting;
|
||||
}
|
||||
|
||||
if (parameters.Length >= 2)
|
||||
{
|
||||
return parameters[1];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!(value is string))
|
||||
{
|
||||
throw new ArgumentException("value");
|
||||
}
|
||||
|
||||
string settingsValue = (string)value;
|
||||
|
||||
if (!(parameter is string))
|
||||
{
|
||||
throw new ArgumentException("parameter");
|
||||
}
|
||||
|
||||
string settingsKey = (string)parameter;
|
||||
|
||||
return new ConversionSettingsOverride(settingsKey, settingsValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
// <copyright file="ConversionStateToBrush.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverter.ValueConverters
|
||||
{
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Media;
|
||||
|
||||
using FileConverter.ConversionJobs;
|
||||
|
||||
public class ConversionStateToBrush : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (!(value is ConversionJob.ConversionState))
|
||||
{
|
||||
throw new ArgumentException("The value must be a conversion state.");
|
||||
}
|
||||
|
||||
ConversionJob.ConversionState conversionState = (ConversionJob.ConversionState)value;
|
||||
string type = parameter as string;
|
||||
|
||||
if (type == "Background")
|
||||
{
|
||||
switch (conversionState)
|
||||
{
|
||||
case ConversionJob.ConversionState.Unknown:
|
||||
return new SolidColorBrush(Color.FromRgb(230, 230, 230));
|
||||
|
||||
case ConversionJob.ConversionState.Ready:
|
||||
return new SolidColorBrush(Color.FromRgb(230, 230, 230));
|
||||
|
||||
case ConversionJob.ConversionState.InProgress:
|
||||
return new SolidColorBrush(Color.FromRgb(250, 236, 179));
|
||||
|
||||
case ConversionJob.ConversionState.Done:
|
||||
return new SolidColorBrush(Color.FromRgb(200, 230, 201));
|
||||
|
||||
case ConversionJob.ConversionState.Failed:
|
||||
return new SolidColorBrush(Color.FromRgb(255, 205, 210));
|
||||
}
|
||||
}
|
||||
else if (type == "Foreground")
|
||||
{
|
||||
switch (conversionState)
|
||||
{
|
||||
case ConversionJob.ConversionState.Unknown:
|
||||
return new SolidColorBrush(Color.FromRgb(128, 128, 128));
|
||||
|
||||
case ConversionJob.ConversionState.Ready:
|
||||
return new SolidColorBrush(Color.FromRgb(32, 32, 32));
|
||||
|
||||
case ConversionJob.ConversionState.InProgress:
|
||||
return new SolidColorBrush(Color.FromRgb(255, 160, 0));
|
||||
|
||||
case ConversionJob.ConversionState.Done:
|
||||
return new SolidColorBrush(Color.FromRgb(56, 142, 60));
|
||||
|
||||
case ConversionJob.ConversionState.Failed:
|
||||
return new SolidColorBrush(Color.FromRgb(255, 82, 82));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SystemException("Unknown type.");
|
||||
}
|
||||
|
||||
throw new SystemException("Unknown state.");
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
// <copyright file="FileNameConverter.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverter.ValueConverters
|
||||
{
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
|
||||
public class FileNameConverter : IMultiValueConverter
|
||||
{
|
||||
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (values == null || values.Length != 3)
|
||||
{
|
||||
throw new ArgumentException("The values must contains the input file path, the output file extension and the ouput file template.");
|
||||
}
|
||||
|
||||
if (!(values[1] is OutputType))
|
||||
{
|
||||
return "Invalid output file extension (argument 1).";
|
||||
}
|
||||
|
||||
string inputFilePath = values[0] as string;
|
||||
OutputType outputFileExtension = (OutputType)values[1];
|
||||
string outputFileTemplate = values[2] as string;
|
||||
|
||||
if (inputFilePath == null)
|
||||
{
|
||||
return "Invalid input file path (argument 0).";
|
||||
}
|
||||
|
||||
string inputExtension = System.IO.Path.GetExtension(inputFilePath).Substring(1);
|
||||
string inputPathWithoutExtension = inputFilePath.Substring(0, inputFilePath.Length - inputExtension.Length - 1);
|
||||
string outputExtension = outputFileExtension.ToString().ToLowerInvariant();
|
||||
|
||||
if (outputFileTemplate == null)
|
||||
{
|
||||
// Default output path.
|
||||
return inputPathWithoutExtension + "." + outputExtension;
|
||||
}
|
||||
|
||||
string fileName = System.IO.Path.GetFileName(inputPathWithoutExtension);
|
||||
string parentDirectory = System.IO.Path.GetDirectoryName(inputPathWithoutExtension);
|
||||
string[] directories = parentDirectory.Split(System.IO.Path.DirectorySeparatorChar);
|
||||
parentDirectory += System.IO.Path.DirectorySeparatorChar;
|
||||
|
||||
// Generate output path from template.
|
||||
string outputPath = outputFileTemplate;
|
||||
|
||||
outputPath = outputPath.Replace("(path)", parentDirectory);
|
||||
outputPath = outputPath.Replace("(p)", parentDirectory);
|
||||
|
||||
outputPath = outputPath.Replace("(filename)", fileName);
|
||||
outputPath = outputPath.Replace("(f)", fileName);
|
||||
outputPath = outputPath.Replace("(F)", fileName.ToUpperInvariant());
|
||||
|
||||
outputPath = outputPath.Replace("(outputext)", outputExtension);
|
||||
outputPath = outputPath.Replace("(o)", outputExtension);
|
||||
outputPath = outputPath.Replace("(O)", outputExtension.ToUpperInvariant());
|
||||
|
||||
outputPath = outputPath.Replace("(inputext)", inputExtension);
|
||||
outputPath = outputPath.Replace("(i)", inputExtension);
|
||||
outputPath = outputPath.Replace("(I)", inputExtension.ToUpperInvariant());
|
||||
|
||||
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)) + "\\";
|
||||
outputPath = outputPath.Replace("(p:m)", myMusicFolder);
|
||||
outputPath = outputPath.Replace("(p:music)", myMusicFolder);
|
||||
|
||||
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)) + "\\";
|
||||
outputPath = outputPath.Replace("(p:p)", myPictureFolder);
|
||||
outputPath = outputPath.Replace("(p:pictures)", myPictureFolder);
|
||||
|
||||
for (int index = 0; index < directories.Length; index++)
|
||||
{
|
||||
outputPath = outputPath.Replace(string.Format("(d{0})", directories.Length - index - 1), directories[index]);
|
||||
outputPath = outputPath.Replace(string.Format("(D{0})", directories.Length - index - 1), directories[index].ToUpperInvariant());
|
||||
}
|
||||
|
||||
outputPath += "." + outputExtension;
|
||||
|
||||
return outputPath;
|
||||
}
|
||||
|
||||
public object[] ConvertBack(object value, Type[] targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
// <copyright file="BoolInverterConverter.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 BoolInverterConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (!(value is bool))
|
||||
{
|
||||
throw new System.ArgumentException("The object must be a boolean value.");
|
||||
}
|
||||
|
||||
bool boolValue = (bool)value;
|
||||
|
||||
return !boolValue;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
// <copyright file="BoolToVisibility.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 BoolToVisibility : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (!(value is bool))
|
||||
{
|
||||
throw new ArgumentException("The value must be a boolean.");
|
||||
}
|
||||
|
||||
string stringParameter = parameter as string;
|
||||
|
||||
string falseResult = stringParameter ?? "Hidden";
|
||||
|
||||
bool booleanValue = (bool)value;
|
||||
|
||||
return booleanValue ? "Visible" : falseResult;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
// <copyright file="CollectionContainsElementToBool.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverter.ValueConverters.Generic
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
|
||||
public class CollectionContainsElementToBool : IMultiValueConverter
|
||||
{
|
||||
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (values == null || values.Length != 2)
|
||||
{
|
||||
throw new ArgumentException("The values must contains the collection of elements and the researched element.");
|
||||
}
|
||||
|
||||
//// TODO: Make this converter generic.
|
||||
|
||||
if (!(values[0] is ICollection<string>))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool? result = null;
|
||||
if (values[1] is IEnumerable<string>)
|
||||
{
|
||||
ICollection<string> collection = values[0] as ICollection<string>;
|
||||
IEnumerable<string> objectsToFind = values[1] as IEnumerable<string>;
|
||||
|
||||
bool all = true;
|
||||
bool none = true;
|
||||
foreach (string objectToFind in objectsToFind)
|
||||
{
|
||||
bool contains = collection.Contains(objectToFind);
|
||||
all &= contains;
|
||||
none &= !contains;
|
||||
}
|
||||
|
||||
if (all)
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
else if (none)
|
||||
{
|
||||
result = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ICollection<string> collection = values[0] as ICollection<string>;
|
||||
string objectToFind = values[1] as string;
|
||||
|
||||
result = collection.Contains(objectToFind);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public object[] ConvertBack(object value, Type[] targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
// <copyright file="DoubleToTimeString.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 DoubleToTimeString : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (!(value is double))
|
||||
{
|
||||
throw new ArgumentException("The value must be a boolean.");
|
||||
}
|
||||
|
||||
double doubleValue = (double)value;
|
||||
|
||||
return string.Format("{0} second{1}", doubleValue.ToString("0.#"), doubleValue >= 2 ? "s" : string.Empty);
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
// <copyright file="EqualsConverter.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 EqualsConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
return parameter == null;
|
||||
}
|
||||
|
||||
return value.Equals(parameter);
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (!(value is bool))
|
||||
{
|
||||
throw new ArgumentException("value");
|
||||
}
|
||||
|
||||
bool equals = (bool)value;
|
||||
if (equals)
|
||||
{
|
||||
return parameter;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
// <copyright file="StringToEnum.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 StringToEnum : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
string stringValue = value as string;
|
||||
if (value == null)
|
||||
{
|
||||
// TODO default value ?
|
||||
return null;
|
||||
}
|
||||
|
||||
string typeName = parameter as string;
|
||||
if (typeName == null)
|
||||
{
|
||||
throw new ArgumentNullException("parameter", "The parameter must contains the enum type.");
|
||||
}
|
||||
|
||||
Type enumType = Type.GetType(typeName);
|
||||
if (enumType == null)
|
||||
{
|
||||
throw new Exception("Invalid enum type " + typeName + ".");
|
||||
}
|
||||
|
||||
return Enum.Parse(enumType, stringValue);
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
// <copyright file="StringToValueType.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 StringToValueType : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
string typeName = parameter as string;
|
||||
if (typeName == null)
|
||||
{
|
||||
throw new ArgumentNullException("parameter", "The parameter must contains a convertible type.");
|
||||
}
|
||||
|
||||
Type type = Type.GetType(typeName);
|
||||
if (type == null)
|
||||
{
|
||||
throw new Exception("Invalid enum type " + typeName + ".");
|
||||
}
|
||||
|
||||
return System.Convert.ChangeType(value, type);
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return value.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
// <copyright file="ValueConverterGroup.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverter.ValueConverters.Generic
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Windows.Data;
|
||||
|
||||
public class ValueConverterGroup : List<IValueConverter>, IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
||||
{
|
||||
string[] parameters = null;
|
||||
if (parameter == null)
|
||||
{
|
||||
parameters = new string[this.Count];
|
||||
}
|
||||
else
|
||||
{
|
||||
string parameterString = parameter as string;
|
||||
if (parameterString == null)
|
||||
{
|
||||
throw new ArgumentException("The parameter must be a string value.");
|
||||
}
|
||||
|
||||
parameters = parameterString.Split('|');
|
||||
if (parameters.Length != this.Count)
|
||||
{
|
||||
throw new ArgumentException("The parameter format must be 'Converter1Parameters|Converter2Parameters|...'.");
|
||||
}
|
||||
}
|
||||
|
||||
object result = value;
|
||||
for (int index = 0; index < this.Count; index++)
|
||||
{
|
||||
IValueConverter converter = this[index];
|
||||
result = converter.Convert(result, targetType, parameters[index], culture);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
||||
{
|
||||
string parameterString = parameter as string;
|
||||
if (parameterString == null)
|
||||
{
|
||||
throw new ArgumentException("The parameter must be a string value.");
|
||||
}
|
||||
|
||||
string[] parameters = parameterString.Split('|');
|
||||
if (parameters.Length != this.Count)
|
||||
{
|
||||
throw new ArgumentException("The parameter format must be 'Converter1Parameters|Converter2Parameters|...'.");
|
||||
}
|
||||
|
||||
object result = value;
|
||||
for (int index = this.Count - 1; index >= 0; index--)
|
||||
{
|
||||
IValueConverter converter = this[index];
|
||||
result = converter.ConvertBack(result, targetType, parameters[index], culture);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
// <copyright file="InputTypesToBool.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverter.ValueConverters
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
|
||||
public class InputTypesToBool : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
List<string> intputTypes = value as List<string>;
|
||||
if (intputTypes == null)
|
||||
{
|
||||
throw new ArgumentException("The value must be an list of string.");
|
||||
}
|
||||
|
||||
string referenceTypeName = parameter as string;
|
||||
if (string.IsNullOrEmpty(referenceTypeName))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return intputTypes.Contains(referenceTypeName);
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
// <copyright file="OutputTypeToVisibility.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverter.ValueConverters
|
||||
{
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
|
||||
public class OutputTypeToVisibility : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (!(value is OutputType))
|
||||
{
|
||||
throw new ArgumentException("The value must be an output type enum value.");
|
||||
}
|
||||
|
||||
OutputType outputType = (OutputType)value;
|
||||
|
||||
string referenceTypeName = parameter as string;
|
||||
if (string.IsNullOrEmpty(referenceTypeName))
|
||||
{
|
||||
return "Hidden";
|
||||
}
|
||||
|
||||
OutputType referenceType;
|
||||
if (!Enum.TryParse<OutputType>(referenceTypeName, out referenceType))
|
||||
{
|
||||
return "Hidden";
|
||||
}
|
||||
|
||||
return outputType == referenceType ? "Visible" : "Hidden";
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// <copyright file="Version.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverter
|
||||
{
|
||||
public struct Version
|
||||
{
|
||||
public int Major;
|
||||
public int Minor;
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("{0}.{1}", this.Major, this.Minor);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
// <copyright file="ConversionSettingsTemplateSelector.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverter.Windows
|
||||
{
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
public class ConversionSettingsTemplateSelector : DataTemplateSelector
|
||||
{
|
||||
public DataTemplate DefaultDataTemplate
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public DataTemplate WavSettingsDataTemplate
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public DataTemplate Mp3SettingsDataTemplate
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public DataTemplate OggSettingsDataTemplate
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public DataTemplate AacSettingsDataTemplate
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public DataTemplate JpgSettingsDataTemplate
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public DataTemplate MkvSettingsDataTemplate
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public override DataTemplate SelectTemplate(object item, DependencyObject container)
|
||||
{
|
||||
if (item == null)
|
||||
{
|
||||
return this.DefaultDataTemplate;
|
||||
}
|
||||
|
||||
OutputType outputType = (OutputType)item;
|
||||
|
||||
switch (outputType)
|
||||
{
|
||||
case OutputType.Wav:
|
||||
return this.WavSettingsDataTemplate;
|
||||
|
||||
case OutputType.Mp3:
|
||||
return this.Mp3SettingsDataTemplate;
|
||||
|
||||
case OutputType.Ogg:
|
||||
return this.OggSettingsDataTemplate;
|
||||
|
||||
case OutputType.Aac:
|
||||
return this.AacSettingsDataTemplate;
|
||||
|
||||
case OutputType.Mkv:
|
||||
return this.MkvSettingsDataTemplate;
|
||||
|
||||
case OutputType.Jpg:
|
||||
return this.JpgSettingsDataTemplate;
|
||||
}
|
||||
|
||||
return this.DefaultDataTemplate;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<Window x:Class="FileConverter.Windows.DiagnosticsWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:FileConverter.Windows"
|
||||
xmlns:fileConverter="clr-namespace:FileConverter"
|
||||
xmlns:diagnostics="clr-namespace:FileConverter.Diagnostics"
|
||||
mc:Ignorable="d"
|
||||
Title="Diagnostics" Height="600" Width="800" Icon="/FileConverter;component/Resources/ApplicationIcon.ico">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="30" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Label Grid.Row="0" Content="Logs" VerticalAlignment="Top" Height="30" FontSize="16" FontWeight="Bold" />
|
||||
|
||||
<TabControl Grid.Row="1" Margin="5" ItemsSource="{Binding Path=(diagnostics:Debug.Data), Mode=OneWay}">
|
||||
<TabControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Name}"/>
|
||||
</DataTemplate>
|
||||
</TabControl.ItemTemplate>
|
||||
<TabControl.ContentTemplate>
|
||||
<DataTemplate>
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" CanContentScroll="True">
|
||||
<TextBlock Name="Diagnostics" TextWrapping="NoWrap" Text="{Binding Content}" FontFamily="Consolas" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.CanContentScroll="False"/>
|
||||
</ScrollViewer>
|
||||
</DataTemplate>
|
||||
</TabControl.ContentTemplate>
|
||||
</TabControl>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,17 @@
|
||||
// <copyright file="DiagnosticsWindow.xaml.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverter.Windows
|
||||
{
|
||||
using System.Windows;
|
||||
|
||||
/// <summary>
|
||||
/// Interaction logic for DiagnosticsWindow.
|
||||
/// </summary>
|
||||
public partial class DiagnosticsWindow : Window
|
||||
{
|
||||
public DiagnosticsWindow()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
// <copyright file="InputExtension.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverter
|
||||
{
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
using FileConverter.Annotations;
|
||||
|
||||
public class InputExtension : INotifyPropertyChanged
|
||||
{
|
||||
private string name;
|
||||
|
||||
public InputExtension(string name)
|
||||
{
|
||||
this.Name = name;
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.name;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.name = value;
|
||||
this.OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
[NotifyPropertyChangedInvocator]
|
||||
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
|
||||
{
|
||||
this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
// <copyright file="InputExtensionCategory.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverter
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
using FileConverter.Annotations;
|
||||
|
||||
public class InputExtensionCategory : INotifyPropertyChanged
|
||||
{
|
||||
private string name;
|
||||
private List<InputExtension> inputExtensions = new List<InputExtension>();
|
||||
|
||||
public InputExtensionCategory(string name)
|
||||
{
|
||||
this.Name = name;
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.name;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.name = value;
|
||||
this.OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<InputExtension> InputExtensions
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.inputExtensions;
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<string> InputExtensionNames
|
||||
{
|
||||
get
|
||||
{
|
||||
foreach (InputExtension inputExtension in this.inputExtensions)
|
||||
{
|
||||
yield return inputExtension.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void AddExtension(string extension)
|
||||
{
|
||||
InputExtension inputExtension = this.inputExtensions.Find(match => match.Name == extension);
|
||||
if (inputExtension == null)
|
||||
{
|
||||
inputExtension = new InputExtension(extension);
|
||||
this.inputExtensions.Add(inputExtension);
|
||||
this.OnPropertyChanged("InputExtensions");
|
||||
this.OnPropertyChanged("InputExtensionNames");
|
||||
}
|
||||
}
|
||||
|
||||
[NotifyPropertyChangedInvocator]
|
||||
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
|
||||
{
|
||||
this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
<Window
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:FileConverter"
|
||||
xmlns:valueConverters="clr-namespace:FileConverter.ValueConverters"
|
||||
xmlns:conversionJobs="clr-namespace:FileConverter.ConversionJobs" mc:Ignorable="d" x:Class="FileConverter.MainWindow"
|
||||
x:Name="FileConverterMainWindow" Height="500" Width="950" MinHeight="250" MinWidth="450" WindowStartupLocation="CenterScreen" Icon="/FileConverter;component/Resources/ApplicationIcon.ico">
|
||||
<Window.Resources>
|
||||
<valueConverters:ApplicationVersionToApplicationName x:Key="ApplicationVersionToApplicationName"/>
|
||||
<valueConverters:ConversionStateToBrush x:Key="ConversionStateToColor" />
|
||||
</Window.Resources>
|
||||
<Window.Title>
|
||||
<Binding Converter="{StaticResource ApplicationVersionToApplicationName}" Mode="OneWay" Path="(local:Application.ApplicationVersion)"/>
|
||||
</Window.Title>
|
||||
|
||||
<Grid Margin="10">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="30" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid Grid.Row="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="100" />
|
||||
<ColumnDefinition Width="100" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Label x:Name="Title" Grid.Column="0" Content="Files to convert" VerticalAlignment="Top" Height="30" FontSize="16" FontWeight="Bold"/>
|
||||
<Button x:Name="DiagnosticsButton" Grid.Column="1" Content="Logs" Margin="3,3" Click="DiagnosticsButton_OnClick"/>
|
||||
<Button x:Name="SettingsButton" Grid.Column="2" Content="Settings" Margin="3,3" Click="SettingsButton_OnClick"/>
|
||||
</Grid>
|
||||
|
||||
<ScrollViewer x:Name="ScrollViewer" Grid.Row="1" VerticalScrollBarVisibility="Auto" CanContentScroll="True">
|
||||
<ItemsControl x:Name="ConverterJobsList">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<DockPanel Background="{Binding State, ConverterParameter=Background, Converter={StaticResource ConversionStateToColor}}" Margin="0,4">
|
||||
<Grid Margin="10">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="20" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2.5*" MinWidth="300" />
|
||||
<ColumnDefinition Width="*" MinWidth="100" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock Grid.Row="0" Grid.Column="0" Text="{Binding OutputFilePath}" FontWeight="Bold" />
|
||||
|
||||
<StackPanel Grid.Row="1" Grid.Column="0" Margin="10,0,0,0">
|
||||
<WrapPanel>
|
||||
<TextBlock Text="Converted from " FontSize="11" FontStyle="Italic" />
|
||||
<TextBlock Text="{Binding InputFilePath}" FontSize="11" FontStyle="Italic" />
|
||||
</WrapPanel>
|
||||
<TextBlock Text="{Binding ErrorMessage}" Foreground="{Binding State, ConverterParameter=Foreground, Converter={StaticResource ConversionStateToColor}}" />
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding UserState}" FontWeight="Bold" Foreground="{Binding State, ConverterParameter=Foreground, Converter={StaticResource ConversionStateToColor}}" />
|
||||
|
||||
<ProgressBar Grid.Row="1" Grid.Column="1" Height="18" Width="Auto" Minimum="0" Maximum="1" SmallChange="0.001" Value="{Binding Progress, Mode=OneWay}" Foreground="{Binding State, ConverterParameter=Foreground, Converter={StaticResource ConversionStateToColor}}" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" MinWidth="100" LargeChange="0.1" />
|
||||
</Grid>
|
||||
</DockPanel>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
<ItemsControl.DataContext>
|
||||
<conversionJobs:ConversionJob/>
|
||||
</ItemsControl.DataContext>
|
||||
</ItemsControl>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,98 @@
|
||||
// <copyright file="MainWindow.xaml.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverter
|
||||
{
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Windows;
|
||||
|
||||
using FileConverter.Annotations;
|
||||
using FileConverter.Windows;
|
||||
|
||||
public partial class MainWindow : Window, INotifyPropertyChanged
|
||||
{
|
||||
private DiagnosticsWindow diagnosticsWindow;
|
||||
private SettingsWindow settingsWindow;
|
||||
|
||||
public MainWindow()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
|
||||
Application application = Application.Current as Application;
|
||||
|
||||
this.ConverterJobsList.ItemsSource = application.ConvertionJobs;
|
||||
if (application.Verbose)
|
||||
{
|
||||
this.ShowDiagnosticsWindow();
|
||||
}
|
||||
|
||||
if (application.ShowSettings)
|
||||
{
|
||||
this.Hide();
|
||||
|
||||
this.ShowSettingsWindow();
|
||||
this.settingsWindow.OnSettingsWindowHide += this.SettingsWindow_Closed;
|
||||
}
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
[NotifyPropertyChangedInvocator]
|
||||
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
|
||||
{
|
||||
PropertyChangedEventHandler handler = this.PropertyChanged;
|
||||
if (handler != null)
|
||||
{
|
||||
handler(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
}
|
||||
|
||||
private void SettingsButton_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.ShowSettingsWindow();
|
||||
}
|
||||
|
||||
private void SettingsWindow_Closed(object sender, System.EventArgs e)
|
||||
{
|
||||
this.settingsWindow.OnSettingsWindowHide -= this.SettingsWindow_Closed;
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void DiagnosticsButton_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.ShowDiagnosticsWindow();
|
||||
}
|
||||
|
||||
private void ShowDiagnosticsWindow()
|
||||
{
|
||||
if (this.diagnosticsWindow != null && this.diagnosticsWindow.IsVisible)
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.diagnosticsWindow = new DiagnosticsWindow();
|
||||
}
|
||||
|
||||
Application application = Application.Current as Application;
|
||||
application?.CancelAutoExit();
|
||||
this.diagnosticsWindow.Show();
|
||||
}
|
||||
|
||||
private void ShowSettingsWindow()
|
||||
{
|
||||
if (this.settingsWindow != null && this.settingsWindow.IsVisible)
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.settingsWindow = new SettingsWindow();
|
||||
}
|
||||
|
||||
Application application = Application.Current as Application;
|
||||
application?.CancelAutoExit();
|
||||
this.settingsWindow.Show();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,358 @@
|
||||
<Window
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:FileConverter"
|
||||
xmlns:controls="clr-namespace:FileConverter.Controls"
|
||||
xmlns:valueConverters="clr-namespace:FileConverter.ValueConverters"
|
||||
xmlns:generic="clr-namespace:FileConverter.ValueConverters.Generic"
|
||||
xmlns:windows="clr-namespace:FileConverter.Windows"
|
||||
xmlns:project="clr-namespace:FileConverter.Properties"
|
||||
xmlns:System="clr-namespace:System;assembly=mscorlib" x:Name="window" x:Class="FileConverter.SettingsWindow"
|
||||
MinWidth="640" MinHeight="480"
|
||||
Width="800" Height="600"
|
||||
WindowStartupLocation="CenterScreen" Icon="/FileConverter;component/Resources/ApplicationIcon.ico"
|
||||
Closing="SettingsWindow_OnClosing">
|
||||
<Window.Resources>
|
||||
<generic:DoubleToTimeString x:Key="DoubleToTimeString"/>
|
||||
<valueConverters:FileNameConverter x:Key="FileNameConverter"/>
|
||||
<generic:BoolToVisibility x:Key="BoolToVisibility"/>
|
||||
<valueConverters:ApplicationVersionToApplicationName x:Key="ApplicationVersionToApplicationName"/>
|
||||
<generic:CollectionContainsElementToBool x:Key="CollectionContainsElementToBool"/>
|
||||
|
||||
<generic:ValueConverterGroup x:Key="ConversionSettingsToEnum">
|
||||
<valueConverters:ConversionSettingsToString/>
|
||||
<generic:StringToEnum/>
|
||||
</generic:ValueConverterGroup>
|
||||
|
||||
<generic:ValueConverterGroup x:Key="ConversionSettingsEquals">
|
||||
<valueConverters:ConversionSettingsToString/>
|
||||
<generic:EqualsConverter/>
|
||||
</generic:ValueConverterGroup>
|
||||
|
||||
<generic:ValueConverterGroup x:Key="ConversionSettingsToValueType">
|
||||
<valueConverters:ConversionSettingsToString/>
|
||||
<generic:StringToValueType/>
|
||||
</generic:ValueConverterGroup>
|
||||
|
||||
<generic:ValueConverterGroup x:Key="ReferenceToVisibility">
|
||||
<generic:EqualsConverter/>
|
||||
<generic:BoolInverterConverter/>
|
||||
<generic:BoolToVisibility/>
|
||||
</generic:ValueConverterGroup>
|
||||
|
||||
<Style TargetType="{x:Type TextBox}">
|
||||
<Setter Property="Validation.ErrorTemplate">
|
||||
<Setter.Value>
|
||||
<ControlTemplate>
|
||||
<DockPanel LastChildFill="true">
|
||||
<Border Background="#F44336" DockPanel.Dock="right" Margin="5,0,0,0" Width="20" Height="20" CornerRadius="10"
|
||||
ToolTip="{Binding AdornedElement.(Validation.Errors)[0].ErrorContent, ElementName=customAdorner}">
|
||||
<TextBlock Text="!" VerticalAlignment="center" HorizontalAlignment="center" FontWeight="Bold" Foreground="white"/>
|
||||
</Border>
|
||||
<AdornedElementPlaceholder x:Name="customAdorner" VerticalAlignment="Center" >
|
||||
<Border BorderBrush="#F44336" BorderThickness="1" />
|
||||
</AdornedElementPlaceholder>
|
||||
</DockPanel>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<DataTemplate x:Key="EmptyDataTemplate">
|
||||
<StackPanel/>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate x:Key="WavSettingsDataTemplate">
|
||||
<StackPanel>
|
||||
<DockPanel>
|
||||
<Label Content="Encoding :" />
|
||||
<RadioButton x:Name="WAV8radioButton" Content="8-bits" ToolTip="PCM signed 8-bit little-endian" Margin="5" IsChecked="{Binding SelectedPreset.Settings, ConverterParameter=AudioEncodingMode|Wav8, Converter={StaticResource ConversionSettingsEquals}, ElementName=window, Mode=TwoWay}" />
|
||||
<RadioButton x:Name="WAV16radioButton" Content="16-bits" ToolTip="PCM signed 16-bit little-endian" Margin="5" IsChecked="{Binding SelectedPreset.Settings, ConverterParameter=AudioEncodingMode|Wav16, Converter={StaticResource ConversionSettingsEquals}, ElementName=window, Mode=TwoWay}"/>
|
||||
<RadioButton x:Name="WAV24radioButton" Content="24-bits" ToolTip="PCM signed 24-bit little-endian" Margin="5" IsChecked="{Binding SelectedPreset.Settings, ConverterParameter=AudioEncodingMode|Wav24, Converter={StaticResource ConversionSettingsEquals}, ElementName=window, Mode=TwoWay}"/>
|
||||
<RadioButton x:Name="WAV32radioButton" Content="32-bits" ToolTip="PCM signed 32-bit little-endian" Margin="5" IsChecked="{Binding SelectedPreset.Settings, ConverterParameter=AudioEncodingMode|Wav32, Converter={StaticResource ConversionSettingsEquals}, ElementName=window, Mode=TwoWay}"/>
|
||||
</DockPanel>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate x:Key="Mp3SettingsDataTemplate">
|
||||
<StackPanel>
|
||||
<DockPanel>
|
||||
<Label Content="Encoding :" />
|
||||
<RadioButton x:Name="VBRradioButton" Content="VBR" ToolTip="Variable bitrate encoding" Margin="5" IsChecked="{Binding SelectedPreset.Settings, ConverterParameter=AudioEncodingMode|Mp3VBR, Converter={StaticResource ConversionSettingsEquals}, ElementName=window, Mode=TwoWay}" />
|
||||
<RadioButton x:Name="CBRradioButton" Content="CBR" ToolTip="Constant bitrate encoding" Margin="5" IsChecked="{Binding SelectedPreset.Settings, ConverterParameter=AudioEncodingMode|Mp3CBR, Converter={StaticResource ConversionSettingsEquals}, ElementName=window, Mode=TwoWay}"/>
|
||||
</DockPanel>
|
||||
<DockPanel>
|
||||
<Label Content="Quality :" />
|
||||
<controls:EncodingQualitySliderControl x:Name="EncodingQualitySlider"
|
||||
EncodingMode="{Binding SelectedPreset.Settings, ConverterParameter=AudioEncodingMode|FileConverter.Controls.EncodingMode, Converter={StaticResource ConversionSettingsToEnum}, ElementName=window, Mode=OneWay, TargetNullValue=VBR}"
|
||||
Bitrate="{Binding SelectedPreset.Settings, ConverterParameter=AudioBitrate|System.Double, Converter={StaticResource ConversionSettingsToValueType}, ElementName=window, Mode=TwoWay, TargetNullValue=190}" />
|
||||
</DockPanel>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate x:Key="OggSettingsDataTemplate">
|
||||
<StackPanel>
|
||||
<DockPanel>
|
||||
<Label Content="Quality :" />
|
||||
<controls:EncodingQualitySliderControl x:Name="EncodingQualitySlider" EncodingMode="OggVBR"
|
||||
Bitrate="{Binding SelectedPreset.Settings, ConverterParameter=AudioBitrate|System.Double, Converter={StaticResource ConversionSettingsToValueType}, ElementName=window, Mode=TwoWay, TargetNullValue=160}" />
|
||||
</DockPanel>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
|
||||
|
||||
<DataTemplate x:Key="AacSettingsDataTemplate">
|
||||
<StackPanel>
|
||||
<DockPanel>
|
||||
<Label Content="Quality :" />
|
||||
<controls:EncodingQualitySliderControl x:Name="EncodingQualitySlider" EncodingMode="AacVBR"
|
||||
Bitrate="{Binding SelectedPreset.Settings, ConverterParameter=AudioBitrate|System.Double, Converter={StaticResource ConversionSettingsToValueType}, ElementName=window, Mode=TwoWay, TargetNullValue=128}" />
|
||||
</DockPanel>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate x:Key="MkvSettingsDataTemplate">
|
||||
<StackPanel>
|
||||
<DockPanel>
|
||||
<Label Content="Video" FontWeight="Bold" />
|
||||
<Label Content="(H.264)" FontWeight="Light" Foreground="#004B82" />
|
||||
</DockPanel>
|
||||
<DockPanel>
|
||||
<Label Content="Quality :" ToolTip="{x:Static project:Resources.VideoEncodingQualityTooltip}"/>
|
||||
<Slider x:Name="QualitySlider" Value="{Binding SelectedPreset.Settings, ConverterParameter=VideoQuality|System.Double, Converter={StaticResource ConversionSettingsToValueType}, ElementName=window, Mode=TwoWay}"
|
||||
Margin="0,2,0,0" VerticalAlignment="Top" AutoToolTipPlacement="TopLeft" IsSnapToTickEnabled="True" IsSelectionRangeEnabled="True" SelectionStart="20" SelectionEnd="33" Minimum="0" Maximum="51" TickPlacement="BottomRight" SmallChange="1" LargeChange="6" TickFrequency="1" Foreground="#004B82" />
|
||||
</DockPanel>
|
||||
|
||||
<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>
|
||||
|
||||
<DockPanel>
|
||||
<Label Content="Audio" FontWeight="Bold" />
|
||||
<Label Content="(AAC)" FontWeight="Light" Foreground="#004B82" />
|
||||
</DockPanel>
|
||||
<DockPanel>
|
||||
<Label Content="Quality :" />
|
||||
<controls:EncodingQualitySliderControl x:Name="EncodingQualitySlider" EncodingMode="AacVBR"
|
||||
Bitrate="{Binding SelectedPreset.Settings, ConverterParameter=AudioBitrate|System.Double, Converter={StaticResource ConversionSettingsToValueType}, ElementName=window, Mode=TwoWay, TargetNullValue=128}" />
|
||||
</DockPanel>
|
||||
</StackPanel>
|
||||
</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>
|
||||
</DataTemplate>
|
||||
|
||||
<windows:ConversionSettingsTemplateSelector x:Key="ConversionSettingsSelector"
|
||||
DefaultDataTemplate="{StaticResource EmptyDataTemplate}"
|
||||
WavSettingsDataTemplate="{StaticResource WavSettingsDataTemplate}"
|
||||
Mp3SettingsDataTemplate="{StaticResource Mp3SettingsDataTemplate}"
|
||||
OggSettingsDataTemplate="{StaticResource OggSettingsDataTemplate}"
|
||||
MkvSettingsDataTemplate="{StaticResource MkvSettingsDataTemplate}"
|
||||
AacSettingsDataTemplate="{StaticResource AacSettingsDataTemplate}"
|
||||
JpgSettingsDataTemplate="{StaticResource JpgSettingsDataTemplate}" />
|
||||
</Window.Resources>
|
||||
<Window.Title>
|
||||
<Binding Converter="{StaticResource ApplicationVersionToApplicationName}" Mode="OneWay" Path="(local:Application.ApplicationVersion)"/>
|
||||
</Window.Title>
|
||||
|
||||
<Grid x:Name="MainGrid" Margin="10">
|
||||
<Grid.CommandBindings>
|
||||
<CommandBinding Command="New" CanExecute="CanSaveSettings" />
|
||||
</Grid.CommandBindings>
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="48"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="{Binding Height, ElementName=ApplicationSettingsPanel, Mode=OneWay}"/>
|
||||
<RowDefinition Height="28"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Header -->
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="48"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Image HorizontalAlignment="Left" Height="48" Width="48" VerticalAlignment="Top" Source="..\Resources\ApplicationIcon.png" />
|
||||
<Label Grid.Column="1" Content="Settings" FontSize="20" Margin="4" VerticalAlignment="Center" />
|
||||
<Label Grid.Column="2" HorizontalAlignment="Right" FontStyle="Italic" FontSize="14" VerticalAlignment="Center">
|
||||
<Label.Content>
|
||||
<Binding Path="(local:Application.ApplicationVersion)" Converter="{StaticResource ApplicationVersionToApplicationName}" Mode="OneWay" />
|
||||
</Label.Content>
|
||||
</Label>
|
||||
</Grid>
|
||||
|
||||
<!-- Conversion presets settings -->
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="4*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Grid x:Name="PresetListGrid" Margin="5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="30"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="30"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Label Content="Presets" Grid.Row="0" VerticalAlignment="Top" HorizontalContentAlignment="Center" HorizontalAlignment="Left" Width="{Binding ActualWidth, ElementName=PresetListGrid, Mode=OneWay}" />
|
||||
<ListBox x:Name="PresetList" Grid.Row="1" HorizontalAlignment="Left" IsSynchronizedWithCurrentItem="True" SelectedItem="{Binding SelectedPreset, ElementName=window}" Width="{Binding ActualWidth, ElementName=PresetListGrid, Mode=OneWay}">
|
||||
<ListBox.DataContext>
|
||||
<local:ConversionPreset/>
|
||||
</ListBox.DataContext>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Label Content="{Binding Name}"/>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
|
||||
<DockPanel Grid.Row="2" Margin="0,5,0,0" HorizontalAlignment="Center">
|
||||
<Button x:Name="MoveUpPresetButton" Content="^" HorizontalAlignment="Left" Width="25" Margin="0,0,2,0" Click="MovePresetUpButton_Click"/>
|
||||
<Button x:Name="AddPresetButton" Content="+" HorizontalAlignment="Left" Width="25" Margin="2,0" Click="AddPresetButton_Click"/>
|
||||
<Button x:Name="RemovePresetButton" Content="-" HorizontalAlignment="Left" Width="25" Margin="2,0" Click="RemovePresetButton_Click"/>
|
||||
<Button x:Name="MoveDownPresetButton" Content="v" HorizontalAlignment="Left" Width="25" Margin="2,0,0,0" Click="MovePresetDownButton_Click"/>
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
|
||||
<!-- Preset settings -->
|
||||
<GroupBox Header="Preset" Margin="5,5,0,0" Grid.Column="1" Visibility="{Binding SelectedPreset, Converter={StaticResource ReferenceToVisibility}, ElementName=window}">
|
||||
<Grid Margin="5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" MaxWidth="240"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="30"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Label Content="Preset name" Grid.Row="0" HorizontalContentAlignment="Right" Margin="0,0,5,0"/>
|
||||
<TextBox x:Name="PresetNameTextBox" Grid.Row="0" Grid.Column="1" Margin="5,2,25,2" Text="{Binding SelectedPreset.Name, ElementName=window, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}" TextWrapping="Wrap" Width="Auto" />
|
||||
|
||||
<GroupBox Grid.Row="1" Grid.Column="0" Header="Input formats" Margin="5">
|
||||
<Grid Margin="5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="25"/>
|
||||
<RowDefinition Height="25"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TreeView x:Name="InputTypesTreeView" ItemsSource="{Binding InputCategories, ElementName=window}" >
|
||||
<TreeView.Resources>
|
||||
<HierarchicalDataTemplate DataType="{x:Type local:InputExtensionCategory}" ItemsSource="{Binding InputExtensions}">
|
||||
<CheckBox Content="{Binding Name}" Height="20" VerticalAlignment="Top" Margin="2" Checked="OnInputTypeCategoryChecked" Unchecked="OnInputTypeCategoryUnchecked" IsThreeState="True" >
|
||||
<CheckBox.IsChecked>
|
||||
<MultiBinding Converter="{StaticResource CollectionContainsElementToBool}" Mode="OneWay">
|
||||
<Binding ElementName="window" Path="SelectedPreset.InputTypes" Mode="OneWay"/>
|
||||
<Binding Path="InputExtensionNames" Mode="OneWay"/>
|
||||
</MultiBinding>
|
||||
</CheckBox.IsChecked>
|
||||
</CheckBox>
|
||||
</HierarchicalDataTemplate>
|
||||
<DataTemplate DataType="{x:Type local:InputExtension}">
|
||||
<CheckBox Content="{Binding Name}" Height="20" VerticalAlignment="Top" Margin="2" Checked="OnInputTypeChecked" Unchecked="OnInputTypeUnchecked">
|
||||
<CheckBox.IsChecked>
|
||||
<MultiBinding Converter="{StaticResource CollectionContainsElementToBool}" Mode="OneWay">
|
||||
<Binding ElementName="window" Path="SelectedPreset.InputTypes" Mode="OneWay"/>
|
||||
<Binding Path="Name" Mode="OneWay"/>
|
||||
</MultiBinding>
|
||||
</CheckBox.IsChecked>
|
||||
</CheckBox>
|
||||
</DataTemplate>
|
||||
</TreeView.Resources>
|
||||
<TreeView.ItemContainerStyle>
|
||||
<Style TargetType="TreeViewItem">
|
||||
<Setter Property="IsExpanded" Value="True"/>
|
||||
</Style>
|
||||
</TreeView.ItemContainerStyle>
|
||||
</TreeView>
|
||||
|
||||
<Label Grid.Row="1" Content="Action when conversion succeed"/>
|
||||
<ComboBox Grid.Row="2" x:Name="PostConversionActionComboBox" SelectedItem="{Binding SelectedPreset.InputPostConversionAction, ElementName=window, Mode=TwoWay}" />
|
||||
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Header="Output format" Grid.Row="1" Grid.Column="1" Margin="5">
|
||||
<StackPanel>
|
||||
<ComboBox x:Name="OutputFormats" Margin="5" Height="25" VerticalAlignment="Top" SelectedItem="{Binding SelectedPreset.OutputType, ElementName=window, Mode=TwoWay}"/>
|
||||
|
||||
<ContentControl ContentTemplateSelector="{StaticResource ResourceKey=ConversionSettingsSelector}"
|
||||
Content="{Binding SelectedPreset.OutputType, ElementName=window, UpdateSourceTrigger=PropertyChanged}" />
|
||||
|
||||
<Separator/>
|
||||
|
||||
<!-- Output file name template -->
|
||||
<Grid Margin="5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="30"/>
|
||||
<RowDefinition Height="23"/>
|
||||
<RowDefinition Height="23"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Label Content="File name template" Grid.Row="0" HorizontalContentAlignment="Right" Margin="0,0,5,0"/>
|
||||
<TextBox x:Name="FileNameTemplateTextBox" Grid.Row="0" Grid.Column="1" Margin="5,2,25,2" Text="{Binding SelectedPreset.OutputFileNameTemplate, ElementName=window, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}" TextWrapping="Wrap" Width="Auto" ToolTip="{x:Static project:Resources.OutputFilePathTemplateHelp}" />
|
||||
<Label Content="Input example" Grid.Row="1" Grid.Column="0" HorizontalContentAlignment="Right" Margin="0,0,5,0" Foreground="Gray" FontSize="10"/>
|
||||
<TextBlock Text="{x:Static project:Resources.OuputFileNameTemplateSample}" Grid.Row="1" Grid.Column="1" Margin="5,0,5,0" Foreground="Gray" FontSize="10" VerticalAlignment="Center"/>
|
||||
<Label Content="Output" Grid.Row="2" Grid.Column="0" HorizontalContentAlignment="Right" Margin="0,0,5,0" Foreground="Gray" FontSize="10"/>
|
||||
<TextBlock Grid.Row="2" Grid.Column="1" Margin="5,0,5,0" Foreground="Gray" FontSize="10" VerticalAlignment="Center">
|
||||
<TextBlock.Text>
|
||||
<MultiBinding Converter="{StaticResource FileNameConverter}">
|
||||
<Binding Source="{x:Static project:Resources.OuputFileNameTemplateSample}"/>
|
||||
<Binding ElementName="window" Path="SelectedPreset.OutputType" Mode="OneWay"/>
|
||||
<Binding ElementName="window" Path="SelectedPreset.OutputFileNameTemplate" Mode="OneWay"/>
|
||||
</MultiBinding>
|
||||
</TextBlock.Text>
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
|
||||
</StackPanel>
|
||||
</GroupBox>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
</Grid>
|
||||
|
||||
<!-- Application settings -->
|
||||
<StackPanel x:Name="ApplicationSettingsPanel" Grid.Row="2" Margin="5,10,5,5">
|
||||
<CheckBox x:Name="QuitAtEndCheckBox" Content="Automaticaly exit when all conversions finished" IsChecked="{Binding ApplicationSettings.ExitApplicationWhenConversionsFinished, ElementName=window, Mode=TwoWay}" />
|
||||
<DockPanel Margin="40,0,0,5" Visibility="{Binding IsChecked, Converter={StaticResource BoolToVisibility}, ConverterParameter=Collapsed, ElementName=QuitAtEndCheckBox}">
|
||||
<Label Content="Waiting duration :"/>
|
||||
<Slider x:Name="DurationBeforeQuitSlider" Value="{Binding ApplicationSettings.DurationBetweenEndOfConversionsAndApplicationExit, ElementName=window, Mode=TwoWay}" Minimum="0" Maximum="10" SmallChange="0.1" IsSnapToTickEnabled="True" Width="250" TickFrequency="0.1"/>
|
||||
<Label Content="{Binding Value, Converter={StaticResource DoubleToTimeString}, ElementName=DurationBeforeQuitSlider}"/>
|
||||
</DockPanel>
|
||||
</StackPanel>
|
||||
|
||||
<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>
|
||||
@@ -0,0 +1,357 @@
|
||||
// <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.Runtime.CompilerServices;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
|
||||
using FileConverter.Annotations;
|
||||
using Microsoft.Win32;
|
||||
|
||||
/// <summary>
|
||||
/// Interaction logic for Settings.
|
||||
/// </summary>
|
||||
public partial class SettingsWindow : Window, INotifyPropertyChanged
|
||||
{
|
||||
private ConversionPreset selectedPreset;
|
||||
|
||||
private Settings settings;
|
||||
|
||||
private InputExtensionCategory[] inputCategories;
|
||||
|
||||
public SettingsWindow()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
|
||||
Application application = Application.Current as Application;
|
||||
this.ApplicationSettings = application.Settings;
|
||||
this.PresetList.ItemsSource = this.settings.ConversionPresets;
|
||||
|
||||
OutputType[] outputTypes = new[]
|
||||
{
|
||||
OutputType.Ogg,
|
||||
OutputType.Mp3,
|
||||
OutputType.Aac,
|
||||
OutputType.Flac,
|
||||
OutputType.Wav,
|
||||
OutputType.Mkv,
|
||||
OutputType.Ico,
|
||||
OutputType.Jpg,
|
||||
OutputType.Png,
|
||||
};
|
||||
|
||||
this.OutputFormats.ItemsSource = outputTypes;
|
||||
|
||||
InputPostConversionAction[] postConversionActions = new[]
|
||||
{
|
||||
InputPostConversionAction.None,
|
||||
InputPostConversionAction.MoveInArchiveFolder,
|
||||
InputPostConversionAction.Delete,
|
||||
};
|
||||
|
||||
this.PostConversionActionComboBox.ItemsSource = postConversionActions;
|
||||
|
||||
this.InitializeCompatibleInputExtensions();
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
public event System.EventHandler<System.EventArgs> OnSettingsWindowHide;
|
||||
|
||||
public ConversionPreset SelectedPreset
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.selectedPreset;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (this.selectedPreset != null)
|
||||
{
|
||||
this.selectedPreset.PropertyChanged -= this.SelectedPresetPropertyChanged;
|
||||
}
|
||||
|
||||
this.selectedPreset = value;
|
||||
|
||||
if (this.selectedPreset != null)
|
||||
{
|
||||
this.selectedPreset.PropertyChanged += this.SelectedPresetPropertyChanged;
|
||||
}
|
||||
|
||||
this.OnPropertyChanged();
|
||||
this.OnPropertyChanged("InputCategories");
|
||||
}
|
||||
}
|
||||
|
||||
private void SelectedPresetPropertyChanged(object sender, PropertyChangedEventArgs e)
|
||||
{
|
||||
if (e.PropertyName == "OutputType")
|
||||
{
|
||||
this.OnPropertyChanged("InputCategories");
|
||||
}
|
||||
}
|
||||
|
||||
public Settings ApplicationSettings
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.settings;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.settings = value;
|
||||
this.OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<InputExtensionCategory> InputCategories
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.inputCategories == null)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
|
||||
for (int index = 0; index < this.inputCategories.Length; index++)
|
||||
{
|
||||
InputExtensionCategory category = this.inputCategories[index];
|
||||
if (this.SelectedPreset == null || PathHelpers.IsOutputTypeCompatibleWithCategory(this.SelectedPreset.OutputType, category.Name))
|
||||
{
|
||||
yield return category;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[NotifyPropertyChangedInvocator]
|
||||
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
|
||||
{
|
||||
this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
|
||||
private void OnInputTypeChecked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (this.selectedPreset == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
CheckBox checkBox = sender as System.Windows.Controls.CheckBox;
|
||||
if (!checkBox.IsVisible)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
string inputFormat = (checkBox.Content as string).ToLowerInvariant();
|
||||
|
||||
this.selectedPreset.AddInputType(inputFormat);
|
||||
}
|
||||
|
||||
private void OnInputTypeUnchecked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (this.selectedPreset == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
CheckBox checkBox = sender as System.Windows.Controls.CheckBox;
|
||||
if (!checkBox.IsVisible)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
string inputFormat = (checkBox.Content as string).ToLowerInvariant();
|
||||
|
||||
this.selectedPreset.RemoveInputType(inputFormat);
|
||||
}
|
||||
|
||||
private void OnInputTypeCategoryChecked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (this.selectedPreset == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
CheckBox checkBox = sender as System.Windows.Controls.CheckBox;
|
||||
string categoryName = checkBox.Content as string;
|
||||
InputExtensionCategory category = System.Array.Find(this.inputCategories, match => match.Name == categoryName);
|
||||
if (category == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (string inputExtension in category.InputExtensionNames)
|
||||
{
|
||||
this.selectedPreset.AddInputType(inputExtension);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnInputTypeCategoryUnchecked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (this.selectedPreset == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
CheckBox checkBox = sender as System.Windows.Controls.CheckBox;
|
||||
string categoryName = checkBox.Content as string;
|
||||
InputExtensionCategory category = System.Array.Find(this.inputCategories, match => match.Name == categoryName);
|
||||
if (category == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (string inputExtension in category.InputExtensionNames)
|
||||
{
|
||||
this.selectedPreset.RemoveInputType(inputExtension);
|
||||
}
|
||||
}
|
||||
|
||||
private void CloseButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.HideSettingsWindow();
|
||||
}
|
||||
|
||||
private void SaveButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// Save changes.
|
||||
Application application = Application.Current as Application;
|
||||
application.Settings.Save();
|
||||
|
||||
this.Hide();
|
||||
|
||||
this.OnSettingsWindowHide?.Invoke(this, new EventArgs());
|
||||
}
|
||||
|
||||
private void AddPresetButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Application application = Application.Current as Application;
|
||||
string presetName = "New preset";
|
||||
int index = 1;
|
||||
while (application.Settings.ConversionPresets.Any(match => match.Name == presetName))
|
||||
{
|
||||
index++;
|
||||
presetName = string.Format("New preset ({0})", index);
|
||||
}
|
||||
|
||||
ConversionPreset newPreset = null;
|
||||
if (this.SelectedPreset != null)
|
||||
{
|
||||
newPreset = new ConversionPreset(presetName, this.SelectedPreset);
|
||||
}
|
||||
else
|
||||
{
|
||||
newPreset = new ConversionPreset(presetName, OutputType.Mkv, new string[0]);
|
||||
}
|
||||
|
||||
application.Settings.ConversionPresets.Add(newPreset);
|
||||
this.SelectedPreset = newPreset;
|
||||
this.PresetNameTextBox.Focus();
|
||||
this.PresetNameTextBox.SelectAll();
|
||||
}
|
||||
|
||||
private void RemovePresetButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Application application = Application.Current as Application;
|
||||
application.Settings.ConversionPresets.Remove(this.selectedPreset);
|
||||
}
|
||||
|
||||
private void CanSaveSettings(object sender, CanExecuteRoutedEventArgs e)
|
||||
{
|
||||
e.CanExecute = this.settings != null && string.IsNullOrEmpty(this.settings.Error);
|
||||
}
|
||||
|
||||
private void SettingsWindow_OnClosing(object sender, CancelEventArgs e)
|
||||
{
|
||||
e.Cancel = true;
|
||||
|
||||
this.HideSettingsWindow();
|
||||
}
|
||||
|
||||
private void HideSettingsWindow()
|
||||
{
|
||||
// Load previous preset in order to cancel changes.
|
||||
Application application = Application.Current as Application;
|
||||
application.Settings = Settings.Load();
|
||||
|
||||
this.Hide();
|
||||
|
||||
this.OnSettingsWindowHide?.Invoke(this, new EventArgs());
|
||||
}
|
||||
|
||||
private void MovePresetUpButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ConversionPreset presetToMove = this.SelectedPreset;
|
||||
if (presetToMove == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int indexOfSelectedPreset = this.settings.ConversionPresets.IndexOf(presetToMove);
|
||||
int newIndexOfSelectedPreset = System.Math.Max(0, indexOfSelectedPreset - 1);
|
||||
|
||||
this.settings.ConversionPresets.Move(indexOfSelectedPreset, newIndexOfSelectedPreset);
|
||||
}
|
||||
|
||||
private void MovePresetDownButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ConversionPreset presetToMove = this.SelectedPreset;
|
||||
if (presetToMove == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int indexOfSelectedPreset = this.settings.ConversionPresets.IndexOf(presetToMove);
|
||||
int newIndexOfSelectedPreset = System.Math.Min(this.settings.ConversionPresets.Count - 1, indexOfSelectedPreset + 1);
|
||||
|
||||
this.settings.ConversionPresets.Move(indexOfSelectedPreset, newIndexOfSelectedPreset);
|
||||
}
|
||||
|
||||
private void InitializeCompatibleInputExtensions()
|
||||
{
|
||||
RegistryKey registryKey = 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);
|
||||
return;
|
||||
}
|
||||
|
||||
string registryValue = registryKey.GetValue("CompatibleInputExtensions") as string;
|
||||
if (registryValue == null)
|
||||
{
|
||||
MessageBox.Show("Can't retrieve the list of compatible input extensions. (code 0x0A)", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
string[] compatibleInputExtensions = registryValue.Split(';');
|
||||
|
||||
List<InputExtensionCategory> categories = new List<InputExtensionCategory>();
|
||||
for (int index = 0; index < compatibleInputExtensions.Length; index++)
|
||||
{
|
||||
string compatibleInputExtension = compatibleInputExtensions[index];
|
||||
string extensionCategory = PathHelpers.GetExtensionCategory(compatibleInputExtension);
|
||||
InputExtensionCategory category = categories.Find(match => match.Name == extensionCategory);
|
||||
if (category == null)
|
||||
{
|
||||
category = new InputExtensionCategory(extensionCategory);
|
||||
categories.Add(category);
|
||||
}
|
||||
|
||||
category.AddExtension(compatibleInputExtension);
|
||||
}
|
||||
|
||||
this.inputCategories = categories.ToArray();
|
||||
this.OnPropertyChanged("InputCategories");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
// <copyright file="XmlHelpers.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;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
public class XmlHelpers
|
||||
{
|
||||
public static void LoadFromFile<T>(string root, string path, out T deserializedObject)
|
||||
{
|
||||
if (string.IsNullOrEmpty(path))
|
||||
{
|
||||
throw new ArgumentNullException("path");
|
||||
}
|
||||
|
||||
XmlRootAttribute xmlRoot = new XmlRootAttribute
|
||||
{
|
||||
ElementName = root
|
||||
};
|
||||
|
||||
XmlSerializer serializer = new XmlSerializer(typeof(T), xmlRoot);
|
||||
|
||||
try
|
||||
{
|
||||
using (StreamReader reader = new StreamReader(path))
|
||||
{
|
||||
XmlReaderSettings xmlReaderSettings = new XmlReaderSettings
|
||||
{
|
||||
IgnoreWhitespace = true,
|
||||
IgnoreComments = true
|
||||
};
|
||||
|
||||
using (XmlReader xmlReader = XmlReader.Create(reader, xmlReaderSettings))
|
||||
{
|
||||
deserializedObject = (T)serializer.Deserialize(xmlReader);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (System.Exception exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
|
||||
IXmlSerializable xmlSerializableObject = deserializedObject as IXmlSerializable;
|
||||
if (xmlSerializableObject != null)
|
||||
{
|
||||
xmlSerializableObject.OnDeserializationComplete();
|
||||
}
|
||||
}
|
||||
|
||||
public static void SaveToFile<T>(string root, string path, T objectToSerialize)
|
||||
{
|
||||
if (string.IsNullOrEmpty(path))
|
||||
{
|
||||
throw new ArgumentNullException("path");
|
||||
}
|
||||
|
||||
if (objectToSerialize == null)
|
||||
{
|
||||
throw new ArgumentNullException("objectToSerialize");
|
||||
}
|
||||
|
||||
XmlRootAttribute xmlRoot = new XmlRootAttribute
|
||||
{
|
||||
ElementName = root
|
||||
};
|
||||
|
||||
XmlSerializer serializer = new XmlSerializer(typeof(T), xmlRoot);
|
||||
|
||||
try
|
||||
{
|
||||
using (StreamWriter writer = new StreamWriter(path))
|
||||
{
|
||||
XmlWriterSettings xmlWriterSettings = new XmlWriterSettings
|
||||
{
|
||||
Indent = true,
|
||||
IndentChars = " "
|
||||
};
|
||||
|
||||
using (XmlWriter xmlWriter = XmlWriter.Create(writer, xmlWriterSettings))
|
||||
{
|
||||
serializer.Serialize(xmlWriter, objectToSerialize);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (System.Exception exception)
|
||||
{
|
||||
Diagnostics.Debug.LogError("Fail to save asset of type '" + typeof(T) + "'. The following exception was raised:\n " + exception.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,276 @@
|
||||
// <copyright file="FileConverterExtension.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverterExtension
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
using Microsoft.Win32;
|
||||
|
||||
using SharpShell.Attributes;
|
||||
using SharpShell.SharpContextMenu;
|
||||
|
||||
/// <summary>
|
||||
/// File converter context menu extension class.
|
||||
/// </summary>
|
||||
[ComVisible(true), Guid("AF9B72B5-F4E4-44B0-A3D9-B55B748EFE90")]
|
||||
[COMServerAssociation(AssociationType.AllFiles)]
|
||||
public class FileConverterExtension : SharpContextMenu
|
||||
{
|
||||
private string fileConverterPath;
|
||||
private RegistryKey fileConverterRegistryKey;
|
||||
private List<PresetDefinition> presetList = new List<PresetDefinition>();
|
||||
private List<string> compatibleInputExtensions = new List<string>();
|
||||
|
||||
private RegistryKey FileConverterRegistryKey
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.fileConverterRegistryKey == null)
|
||||
{
|
||||
this.fileConverterRegistryKey = Registry.CurrentUser.OpenSubKey(@"Software\FileConverter");
|
||||
if (this.fileConverterRegistryKey == null)
|
||||
{
|
||||
throw new Exception("Can't retrieve file converter registry entry.");
|
||||
}
|
||||
}
|
||||
|
||||
return this.fileConverterRegistryKey;
|
||||
}
|
||||
}
|
||||
|
||||
private string FileConverterPath
|
||||
{
|
||||
get
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.fileConverterPath))
|
||||
{
|
||||
this.fileConverterPath = this.FileConverterRegistryKey.GetValue("Path") as string;
|
||||
}
|
||||
|
||||
return this.fileConverterPath;
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerable<string> CompatibleInputExtensions
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.compatibleInputExtensions != null && this.compatibleInputExtensions.Count > 0)
|
||||
{
|
||||
return this.compatibleInputExtensions;
|
||||
}
|
||||
|
||||
this.compatibleInputExtensions.Clear();
|
||||
string registryValue = this.FileConverterRegistryKey.GetValue("CompatibleInputExtensions") as string;
|
||||
string[] extensions = registryValue.Split(';');
|
||||
for (int index = 0; index < extensions.Length; index++)
|
||||
{
|
||||
this.compatibleInputExtensions.Add(extensions[index]);
|
||||
}
|
||||
|
||||
return this.compatibleInputExtensions;
|
||||
}
|
||||
}
|
||||
|
||||
protected override bool CanShowMenu()
|
||||
{
|
||||
foreach (string filePath in this.SelectedItemPaths)
|
||||
{
|
||||
string extension = Path.GetExtension(filePath);
|
||||
if (string.IsNullOrEmpty(extension))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
extension = extension.Substring(1).ToLowerInvariant();
|
||||
if (this.CompatibleInputExtensions.Contains(extension))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
protected override ContextMenuStrip CreateMenu()
|
||||
{
|
||||
this.RefreshPresetList();
|
||||
|
||||
ContextMenuStrip menu = new ContextMenuStrip();
|
||||
|
||||
ToolStripMenuItem fileConverterItem = new ToolStripMenuItem
|
||||
{
|
||||
Text = "File Converter",
|
||||
Image = Properties.Resources.ApplicationIcon_16x16.ToBitmap(),
|
||||
};
|
||||
|
||||
for (int index = 0; index < this.presetList.Count; index++)
|
||||
{
|
||||
PresetDefinition preset = this.presetList[index];
|
||||
|
||||
ToolStripMenuItem subItem = new ToolStripMenuItem
|
||||
{
|
||||
Text = preset.Name,
|
||||
Enabled = preset.Enabled
|
||||
};
|
||||
|
||||
fileConverterItem.DropDownItems.Add(subItem);
|
||||
subItem.Click += (sender, args) => this.ConvertFiles(preset.Name);
|
||||
}
|
||||
|
||||
if (this.presetList.Count > 0)
|
||||
{
|
||||
fileConverterItem.DropDownItems.Add(new ToolStripSeparator());
|
||||
}
|
||||
|
||||
{
|
||||
ToolStripMenuItem subItem = new ToolStripMenuItem
|
||||
{
|
||||
Text = "Settings",
|
||||
};
|
||||
|
||||
fileConverterItem.DropDownItems.Add(subItem);
|
||||
subItem.Click += (sender, args) => this.OpenSettings();
|
||||
}
|
||||
|
||||
menu.Items.Add(fileConverterItem);
|
||||
|
||||
return menu;
|
||||
}
|
||||
|
||||
private void RefreshPresetList()
|
||||
{
|
||||
// Retrieve selected files extensions.
|
||||
List<string> extensions = new List<string>();
|
||||
foreach (string filePath in this.SelectedItemPaths)
|
||||
{
|
||||
string extension = Path.GetExtension(filePath);
|
||||
if (string.IsNullOrEmpty(extension))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
extension = extension.Substring(1).ToLowerInvariant();
|
||||
if (extensions.Contains(extension))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
extensions.Add(extension);
|
||||
}
|
||||
|
||||
// Compute preset list.
|
||||
this.presetList.Clear();
|
||||
RegistryKey fileConverterKey = this.FileConverterRegistryKey;
|
||||
for (int extensionIndex = 0; extensionIndex < extensions.Count; extensionIndex++)
|
||||
{
|
||||
string extension = extensions[extensionIndex];
|
||||
RegistryKey extensionKey = fileConverterKey.OpenSubKey(extension);
|
||||
if (extensionKey == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
string presetsString = extensionKey.GetValue("Presets") as string;
|
||||
if (presetsString == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
string[] presets = presetsString.Split(';');
|
||||
|
||||
for (int presetIndex = 0; presetIndex < presets.Length; presetIndex++)
|
||||
{
|
||||
string presetName = presets[presetIndex];
|
||||
PresetDefinition presetDefinition = this.presetList.FirstOrDefault(match => match.Name == presetName);
|
||||
if (presetDefinition == null)
|
||||
{
|
||||
presetDefinition = new PresetDefinition(presetName);
|
||||
this.presetList.Add(presetDefinition);
|
||||
}
|
||||
|
||||
presetDefinition.ExtensionRefCount++;
|
||||
}
|
||||
}
|
||||
|
||||
// Update enable states.
|
||||
for (int index = 0; index < this.presetList.Count; index++)
|
||||
{
|
||||
this.presetList[index].Enabled = this.presetList[index].ExtensionRefCount == extensions.Count;
|
||||
}
|
||||
}
|
||||
|
||||
private void OpenSettings()
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.FileConverterPath))
|
||||
{
|
||||
MessageBox.Show(string.Format("Can't retrieve the file converter executable path. You should try to reinstall the application."));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!File.Exists(this.FileConverterPath))
|
||||
{
|
||||
MessageBox.Show(string.Format("Can't find the file converter executable ({0}). You should try to reinstall the application.", this.FileConverterPath));
|
||||
return;
|
||||
}
|
||||
|
||||
ProcessStartInfo processStartInfo = new ProcessStartInfo(this.FileConverterPath);
|
||||
|
||||
processStartInfo.CreateNoWindow = false;
|
||||
processStartInfo.UseShellExecute = false;
|
||||
processStartInfo.RedirectStandardOutput = false;
|
||||
|
||||
// Build arguments string.
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
stringBuilder.Append("--settings");
|
||||
|
||||
processStartInfo.Arguments = stringBuilder.ToString();
|
||||
Process exeProcess = Process.Start(processStartInfo);
|
||||
}
|
||||
|
||||
private void ConvertFiles(string presetName)
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.FileConverterPath))
|
||||
{
|
||||
MessageBox.Show(string.Format("Can't retrieve the file converter executable path. You should try to reinstall the application."));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!File.Exists(this.FileConverterPath))
|
||||
{
|
||||
MessageBox.Show(string.Format("Can't find the file converter executable ({0}). You should try to reinstall the application.", this.FileConverterPath));
|
||||
return;
|
||||
}
|
||||
|
||||
ProcessStartInfo processStartInfo = new ProcessStartInfo(this.FileConverterPath);
|
||||
|
||||
processStartInfo.CreateNoWindow = false;
|
||||
processStartInfo.UseShellExecute = false;
|
||||
processStartInfo.RedirectStandardOutput = false;
|
||||
|
||||
// Build arguments string.
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
stringBuilder.Append("--conversion-preset ");
|
||||
stringBuilder.Append(" \"");
|
||||
stringBuilder.Append(presetName);
|
||||
stringBuilder.Append("\"");
|
||||
|
||||
foreach (var filePath in this.SelectedItemPaths)
|
||||
{
|
||||
stringBuilder.Append(" \"");
|
||||
stringBuilder.Append(filePath);
|
||||
stringBuilder.Append("\"");
|
||||
}
|
||||
|
||||
processStartInfo.Arguments = stringBuilder.ToString();
|
||||
Process exeProcess = Process.Start(processStartInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{0C44CA69-42D6-4357-BDFD-83069D1ABA2F}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>FileConverterExtension</RootNamespace>
|
||||
<AssemblyName>FileConverterExtension</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<AssemblyOriginatorKeyFile>FileConverterExtensionKey.snk</AssemblyOriginatorKeyFile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<OutputPath>bin\x64\Debug\</OutputPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<OutputPath>bin\x64\Release\</OutputPath>
|
||||
<DefineConstants>
|
||||
</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="SharpShell">
|
||||
<HintPath>..\..\Middleware\SharpShell\SharpShell.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="FileConverterExtension.cs" />
|
||||
<Compile Include="PresetDefinition.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs">
|
||||
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="FileConverterExtensionKey.snk" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\ApplicationIcon-16x16.ico" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -0,0 +1,30 @@
|
||||
// <copyright file="PresetDefinition.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverterExtension
|
||||
{
|
||||
public class PresetDefinition
|
||||
{
|
||||
public PresetDefinition(string name)
|
||||
{
|
||||
this.Name = name;
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public bool Enabled
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public int ExtensionRefCount
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("FileConverterExtension")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("FileConverterExtension")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2015")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("86f3928d-94ef-4d27-8235-1074894e9b5f")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -0,0 +1,73 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.0
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FileConverterExtension.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("FileConverterExtension.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
|
||||
/// </summary>
|
||||
internal static System.Drawing.Icon ApplicationIcon_16x16 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("ApplicationIcon_16x16", resourceCulture);
|
||||
return ((System.Drawing.Icon)(obj));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="ApplicationIcon_16x16" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\ApplicationIcon-16x16.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
</root>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1,24 @@
|
||||
<StyleCopSettings Version="105">
|
||||
<Analyzers>
|
||||
<Analyzer AnalyzerId="StyleCop.CSharp.DocumentationRules">
|
||||
<Rules>
|
||||
<Rule Name="ElementsMustBeDocumented">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="EnumerationItemsMustBeDocumented">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="PartialElementsMustBeDocumented">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
</Rules>
|
||||
<AnalyzerSettings />
|
||||
</Analyzer>
|
||||
</Analyzers>
|
||||
</StyleCopSettings>
|
||||
@@ -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
|
||||
@@ -0,0 +1,60 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.23107.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FileConverter", "Application\FileConverter\FileConverter.csproj", "{D27A76D2-43E4-43CC-9DA3-334B0B46F4E5}"
|
||||
EndProject
|
||||
Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "Installer", "Installer\Installer.wixproj", "{F14673DF-DF38-44B4-AB1D-99A59182C24C}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FileConverterExtension", "Application\FileConverterExtension\FileConverterExtension.csproj", "{0C44CA69-42D6-4357-BDFD-83069D1ABA2F}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{D27A76D2-43E4-43CC-9DA3-334B0B46F4E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D27A76D2-43E4-43CC-9DA3-334B0B46F4E5}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D27A76D2-43E4-43CC-9DA3-334B0B46F4E5}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{D27A76D2-43E4-43CC-9DA3-334B0B46F4E5}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{D27A76D2-43E4-43CC-9DA3-334B0B46F4E5}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{D27A76D2-43E4-43CC-9DA3-334B0B46F4E5}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{D27A76D2-43E4-43CC-9DA3-334B0B46F4E5}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D27A76D2-43E4-43CC-9DA3-334B0B46F4E5}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{D27A76D2-43E4-43CC-9DA3-334B0B46F4E5}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{D27A76D2-43E4-43CC-9DA3-334B0B46F4E5}.Release|x64.Build.0 = Release|Any CPU
|
||||
{D27A76D2-43E4-43CC-9DA3-334B0B46F4E5}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{D27A76D2-43E4-43CC-9DA3-334B0B46F4E5}.Release|x86.Build.0 = Release|Any CPU
|
||||
{F14673DF-DF38-44B4-AB1D-99A59182C24C}.Debug|Any CPU.ActiveCfg = Debug|x86
|
||||
{F14673DF-DF38-44B4-AB1D-99A59182C24C}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{F14673DF-DF38-44B4-AB1D-99A59182C24C}.Debug|x64.Build.0 = Debug|x64
|
||||
{F14673DF-DF38-44B4-AB1D-99A59182C24C}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{F14673DF-DF38-44B4-AB1D-99A59182C24C}.Debug|x86.Build.0 = Debug|x86
|
||||
{F14673DF-DF38-44B4-AB1D-99A59182C24C}.Release|Any CPU.ActiveCfg = Release|x86
|
||||
{F14673DF-DF38-44B4-AB1D-99A59182C24C}.Release|x64.ActiveCfg = Release|x64
|
||||
{F14673DF-DF38-44B4-AB1D-99A59182C24C}.Release|x64.Build.0 = Release|x64
|
||||
{F14673DF-DF38-44B4-AB1D-99A59182C24C}.Release|x86.ActiveCfg = Release|x86
|
||||
{F14673DF-DF38-44B4-AB1D-99A59182C24C}.Release|x86.Build.0 = Release|x86
|
||||
{0C44CA69-42D6-4357-BDFD-83069D1ABA2F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{0C44CA69-42D6-4357-BDFD-83069D1ABA2F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{0C44CA69-42D6-4357-BDFD-83069D1ABA2F}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{0C44CA69-42D6-4357-BDFD-83069D1ABA2F}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{0C44CA69-42D6-4357-BDFD-83069D1ABA2F}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{0C44CA69-42D6-4357-BDFD-83069D1ABA2F}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{0C44CA69-42D6-4357-BDFD-83069D1ABA2F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{0C44CA69-42D6-4357-BDFD-83069D1ABA2F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{0C44CA69-42D6-4357-BDFD-83069D1ABA2F}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{0C44CA69-42D6-4357-BDFD-83069D1ABA2F}.Release|x64.Build.0 = Release|Any CPU
|
||||
{0C44CA69-42D6-4357-BDFD-83069D1ABA2F}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{0C44CA69-42D6-4357-BDFD-83069D1ABA2F}.Release|x86.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,25 @@
|
||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<s:Boolean x:Key="/Default/CodeInspection/CodeAnnotations/NamespacesWithAnnotations/=FileConverter_002EAnnotations/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=StyleCop_002ESA1600/@EntryIndexedValue">HINT</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=StyleCop_002ESA1601/@EntryIndexedValue">DO_NOT_SHOW</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=StyleCop_002ESA1602/@EntryIndexedValue">DO_NOT_SHOW</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=SuggestUseVarKeywordEvident/@EntryIndexedValue">DO_NOT_SHOW</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UnusedMember_002ELocal/@EntryIndexedValue">HINT</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/Highlighting/ValueAnalysisMode/@EntryValue">PESSIMISTIC</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/ThisQualifier/INSTANCE_MEMBERS_QUALIFY_MEMBERS/@EntryValue">Field, Property, Event, Method</s:String>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_ABSTRACT_ACCESSORHOLDER_ON_SINGLE_LINE/@EntryValue">False</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_SIMPLE_ACCESSOR_ATTRIBUTE_ON_SAME_LINE/@EntryValue">False</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_SIMPLE_ACCESSOR_ON_SINGLE_LINE/@EntryValue">False</s:Boolean>
|
||||
<s:String x:Key="/Default/CodeStyle/CSharpVarKeywordUsage/ForBuiltInTypes/@EntryValue">UseExplicitType</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CSharpVarKeywordUsage/ForOtherTypes/@EntryValue">UseExplicitType</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CSharpVarKeywordUsage/ForSimpleTypes/@EntryValue">UseExplicitType</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/FileHeader/FileHeaderText/@EntryValue">// <copyright file="$FILENAME$" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=CBR/@EntryIndexedValue">CBR</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=OGGVBR/@EntryIndexedValue">OGGVBR</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=VBR/@EntryIndexedValue">VBR</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=MethodPropertyEvent/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb_AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateInstanceFields/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticFields/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateThisQualifierSettings/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/Environment/UpdatesManger/IsDownloadUpdateDataAllowed/@EntryValue">False</s:Boolean></wpf:ResourceDictionary>
|
||||
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<?if $(var.Platform) = x64 ?>
|
||||
<?define Win64 = "yes" ?>
|
||||
<?else ?>
|
||||
<?define Win64 = "no" ?>
|
||||
<?endif ?>
|
||||
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Fragment>
|
||||
<DirectoryRef Id="INSTALLFOLDER">
|
||||
<Component Id="FileConverterExtension.dll" Guid="{FEF385C4-C43F-44F9-92E2-06578A8BD96E}" Win64="$(var.Win64)">
|
||||
<Class Id="{AF9B72B5-F4E4-44B0-A3D9-B55B748EFE90}" Context="InprocServer32" Description="FileConverterExtension.FileConverterExtension" ThreadingModel="both" ForeignServer="mscoree.dll">
|
||||
<ProgId Id="FileConverterExtension.FileConverterExtension" Description="FileConverterExtension.FileConverterExtension" />
|
||||
</Class>
|
||||
<File Id="FileConverterExtension.dll" KeyPath="yes" Source="..\Application\FileConverterExtension\bin\$(var.Configuration)\FileConverterExtension.dll" />
|
||||
<RegistryValue Root="HKCR" Key="*\shellex\ContextMenuHandlers\FileConverterExtension" Value="{af9b72b5-f4e4-44b0-a3d9-b55b748efe90}" Type="string" Action="write" />
|
||||
<RegistryValue Root="HKCR" Key="CLSID\{AF9B72B5-F4E4-44B0-A3D9-B55B748EFE90}\Implemented Categories\{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}" Value="" Type="string" Action="write" />
|
||||
<RegistryValue Root="HKCR" Key="CLSID\{AF9B72B5-F4E4-44B0-A3D9-B55B748EFE90}\InprocServer32\1.0.0.0" Name="Class" Value="FileConverterExtension.FileConverterExtension" Type="string" Action="write" />
|
||||
<RegistryValue Root="HKCR" Key="CLSID\{AF9B72B5-F4E4-44B0-A3D9-B55B748EFE90}\InprocServer32\1.0.0.0" Name="Assembly" Value="FileConverterExtension, Version=1.0.0.0, Culture=neutral, PublicKeyToken=15400b1c4b948c8a" Type="string" Action="write" />
|
||||
<RegistryValue Root="HKCR" Key="CLSID\{AF9B72B5-F4E4-44B0-A3D9-B55B748EFE90}\InprocServer32\1.0.0.0" Name="RuntimeVersion" Value="v4.0.30319" Type="string" Action="write" />
|
||||
<RegistryValue Root="HKCR" Key="CLSID\{AF9B72B5-F4E4-44B0-A3D9-B55B748EFE90}\InprocServer32\1.0.0.0" Name="CodeBase" Value="file:///[#FileConverterExtension.dll]" Type="string" Action="write" />
|
||||
<RegistryValue Root="HKCR" Key="CLSID\{AF9B72B5-F4E4-44B0-A3D9-B55B748EFE90}\InprocServer32" Name="Class" Value="FileConverterExtension.FileConverterExtension" Type="string" Action="write" />
|
||||
<RegistryValue Root="HKCR" Key="CLSID\{AF9B72B5-F4E4-44B0-A3D9-B55B748EFE90}\InprocServer32" Name="Assembly" Value="FileConverterExtension, Version=1.0.0.0, Culture=neutral, PublicKeyToken=15400b1c4b948c8a" Type="string" Action="write" />
|
||||
<RegistryValue Root="HKCR" Key="CLSID\{AF9B72B5-F4E4-44B0-A3D9-B55B748EFE90}\InprocServer32" Name="RuntimeVersion" Value="v4.0.30319" Type="string" Action="write" />
|
||||
<RegistryValue Root="HKCR" Key="CLSID\{AF9B72B5-F4E4-44B0-A3D9-B55B748EFE90}\InprocServer32" Name="CodeBase" Value="file:///[#FileConverterExtension.dll]" Type="string" Action="write" />
|
||||
</Component>
|
||||
</DirectoryRef>
|
||||
</Fragment>
|
||||
</Wix>
|
||||
@@ -0,0 +1 @@
|
||||
"C:\Program Files (x86)\Wix Toolset v3.9\bin\Heat.exe" file "..\Application\FileConverterExtension\bin\Release\FileConverterExtension.dll" -dr INSTALLFOLDER -srd -gg -sfrag -suid -out "Extension.wxs" -b "..\Application\FileConverterExtension\bin\Release\"
|
||||
@@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||
<ProductVersion>3.9</ProductVersion>
|
||||
<ProjectGuid>f14673df-df38-44b4-ab1d-99a59182c24c</ProjectGuid>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<OutputName>Installer</OutputName>
|
||||
<OutputType>Package</OutputType>
|
||||
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' AND '$(MSBuildExtensionsPath32)' != '' ">$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
|
||||
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
|
||||
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
|
||||
<DefineConstants>Debug</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
|
||||
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
|
||||
<DefineConstants>Debug</DefineConstants>
|
||||
<OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
|
||||
<IntermediateOutputPath>obj\$(Platform)\$(Configuration)\</IntermediateOutputPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
|
||||
<OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
|
||||
<IntermediateOutputPath>obj\$(Platform)\$(Configuration)\</IntermediateOutputPath>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Extension.wxs" />
|
||||
<Compile Include="Product.wxs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<WixExtension Include="WixUIExtension">
|
||||
<HintPath>$(WixExtDir)\WixUIExtension.dll</HintPath>
|
||||
<Name>WixUIExtension</Name>
|
||||
</WixExtension>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Application\FileConverter\FileConverter.csproj">
|
||||
<Name>FileConverter</Name>
|
||||
<Project>{d27a76d2-43e4-43cc-9da3-334b0b46f4e5}</Project>
|
||||
<Private>True</Private>
|
||||
<DoNotHarvest>True</DoNotHarvest>
|
||||
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
|
||||
<RefTargetDir>INSTALLFOLDER</RefTargetDir>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(WixTargetsPath)" />
|
||||
<!--
|
||||
To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Wix.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -0,0 +1,260 @@
|
||||
{\rtf1\ansi\deff3\adeflang1025
|
||||
{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\froman\fprq2\fcharset0 Liberation Serif{\*\falt Times New Roman};}{\f4\fswiss\fprq2\fcharset0 Liberation Sans{\*\falt Arial};}{\f5\froman\fprq2\fcharset0 Calibri;}{\f6\fnil\fprq2\fcharset0 Microsoft YaHei;}{\f7\fnil\fprq2\fcharset0 Arial;}{\f8\fnil\fprq2\fcharset0 Mangal;}{\f9\fnil\fprq0\fcharset128 Mangal;}{\f10\fnil\fprq2\fcharset0 Liberation Serif{\*\falt Times New Roman};}}
|
||||
{\colortbl;\red0\green0\blue0;\red0\green0\blue128;\red0\green0\blue255;\red128\green128\blue128;}
|
||||
{\stylesheet{\s0\snext0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255 Normal;}
|
||||
{\s1\sbasedon16\snext1\ql\nowidctlpar\sb240\sa120\keepn\ltrpar\cf1\kerning1\dbch\af6\dbch\af8\afs28\loch\f4\fs28\lang255 Titre 1;}
|
||||
{\s2\sbasedon16\snext2\ql\nowidctlpar\sb240\sa120\keepn\ltrpar\cf1\kerning1\dbch\af6\dbch\af8\afs28\loch\f4\fs28\lang255 Titre 2;}
|
||||
{\s3\sbasedon16\snext3\ql\nowidctlpar\sb240\sa120\keepn\ltrpar\cf1\kerning1\dbch\af6\dbch\af8\afs28\loch\f4\fs28\lang255 Titre 3;}
|
||||
{\*\cs15\snext15\cf2\ul\ulc1\langfe255\alang255\lang255 Lien Internet;}
|
||||
{\s16\sbasedon0\snext17\ql\nowidctlpar\sb240\sa120\keepn\ltrpar\cf1\kerning1\dbch\af6\dbch\af8\afs28\loch\f4\fs28\lang255 Titre;}
|
||||
{\s17\sbasedon0\snext17\sl288\slmult1\ql\nowidctlpar\sb0\sa140\ltrpar\cf1\kerning1\dbch\af7\dbch\af10\afs24\loch\f0\fs24\lang255 Corps de texte;}
|
||||
{\s18\sbasedon17\snext18\sl288\slmult1\ql\nowidctlpar\sb0\sa140\ltrpar\cf1\kerning1\dbch\af7\dbch\af9\afs24\loch\f0\fs24\lang255 Liste;}
|
||||
{\s19\sbasedon0\snext19\ql\nowidctlpar\sb120\sa120\noline\ltrpar\cf1\i\kerning1\dbch\af7\dbch\af9\afs24\ai\loch\f0\fs24\lang255 L\u233\'e9gende;}
|
||||
{\s20\sbasedon0\snext20\ql\nowidctlpar\noline\ltrpar\cf1\kerning1\dbch\af7\dbch\af9\afs24\loch\f0\fs24\lang255 Index;}
|
||||
{\s21\sbasedon0\snext21\ql\nowidctlpar\ltrpar\cf1\kerning1\dbch\af7\dbch\af10\afs24\loch\f0\fs24\lang255 Quotations;}
|
||||
{\s22\sbasedon16\snext22\ql\nowidctlpar\sb240\sa120\keepn\ltrpar\cf1\kerning1\dbch\af6\dbch\af8\afs28\loch\f4\fs28\lang255 Titre principal;}
|
||||
{\s23\sbasedon16\snext23\ql\nowidctlpar\sb240\sa120\keepn\ltrpar\cf1\kerning1\dbch\af6\dbch\af8\afs28\loch\f4\fs28\lang255 Sous-titre;}
|
||||
}{\info{\author Adrien Allard}{\creatim\yr0\mo0\dy0\hr0\min0}{\author Adrien Allard}{\revtim\yr2015\mo4\dy6\hr16\min12}{\printim\yr0\mo0\dy0\hr0\min0}{\comment LibreOffice}{\vern67305476}}\deftab720
|
||||
\viewscale120
|
||||
{\*\pgdsctbl
|
||||
{\pgdsc0\pgdscuse451\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\pgdscnxt0 Style par d\u233\'e9faut;}}
|
||||
\formshade{\*\pgdscno0}\paperh15840\paperw12240\margl1800\margr1800\margt1440\margb1440\sectd\sbknone\sectunlocked1\pgndec\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc
|
||||
{\*\ftnsep}\pgndec\pard\plain \s22\ql\nowidctlpar\sb240\sa120\keepn\ltrpar\cf1\kerning1\dbch\af6\dbch\af8\afs28\loch\f4\fs28\lang255\sb240\sa120{\b\rtlch \ltrch\loch\fs32\loch\f5
|
||||
GNU GENERAL PUBLIC LICENSE}
|
||||
\par \pard\plain \s23\ql\nowidctlpar\sb240\sa120\keepn\ltrpar\cf1\kerning1\dbch\af6\dbch\af8\afs28\loch\f4\fs28\lang255{\b0\rtlch \ltrch\loch\fs24\loch\f5
|
||||
Version 3, 29 June 2007}
|
||||
\par \pard\plain \s23\ql\nowidctlpar\sb240\sa120\keepn\ltrpar\cf1\kerning1\dbch\af6\dbch\af8\afs28\loch\f4\fs28\lang255\rtlch \ltrch\loch
|
||||
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <}{{\field{\*\fldinst HYPERLINK "http://fsf.org/" }{\fldrslt {\cf2\ul\ulc1\langfe255\alang255\lang255\cf3\ul\ulc1\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
http://fsf.org/}{}}}\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
>}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.}
|
||||
\par \pard\plain \s1\ql\nowidctlpar\sb240\sa120\keepn\ltrpar\cf1\kerning1\dbch\af6\dbch\af8\afs28\loch\f4\fs28\lang255{\b\rtlch \ltrch\loch\loch\f5
|
||||
Preamble}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab The GNU General Public License is a free, copyleft license for software and other kinds of works.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. }
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab The precise terms and conditions for copying, distribution and modification follow.}
|
||||
\par \pard\plain \s1\ql\nowidctlpar\sb240\sa120\keepn\ltrpar\cf1\kerning1\dbch\af6\dbch\af8\afs28\loch\f4\fs28\lang255{\b\rtlch \ltrch\loch\loch\f5
|
||||
TERMS AND CONDITIONS}
|
||||
\par \pard\plain \s2\ql\nowidctlpar\sb240\sa120\keepn\ltrpar\cf1\kerning1\dbch\af6\dbch\af8\afs28\loch\f4\fs28\lang255{\b0\rtlch \ltrch\fs22\loch\f5
|
||||
}{\b0\rtlch \ltrch\loch\fs22\loch\f5
|
||||
0. Definitions.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab "This License" refers to version 3 of the GNU General Public License.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab A "covered work" means either the unmodified Program or a work based on the Program.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. }
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.}
|
||||
\par \pard\plain \s2\ql\nowidctlpar\sb240\sa120\keepn\ltrpar\cf1\kerning1\dbch\af6\dbch\af8\afs28\loch\f4\fs28\lang255{\b0\rtlch \ltrch\fs22\loch\f5
|
||||
}{\b0\rtlch \ltrch\loch\fs22\loch\f5
|
||||
1. Source Code.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab The Corresponding Source for a work in source code form is that same work.}
|
||||
\par \pard\plain \s2\ql\nowidctlpar\sb240\sa120\keepn\ltrpar\cf1\kerning1\dbch\af6\dbch\af8\afs28\loch\f4\fs28\lang255{\b0\rtlch \ltrch\fs22\loch\f5
|
||||
}{\b0\rtlch \ltrch\loch\fs22\loch\f5
|
||||
2. Basic Permissions.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.}
|
||||
\par \pard\plain \s2\ql\nowidctlpar\sb240\sa120\keepn\ltrpar\cf1\kerning1\dbch\af6\dbch\af8\afs28\loch\f4\fs28\lang255{\b0\rtlch \ltrch\loch\fs22\loch\f5
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.}
|
||||
\par \pard\plain \s2\ql\nowidctlpar\sb240\sa120\keepn\ltrpar\cf1\kerning1\dbch\af6\dbch\af8\afs28\loch\f4\fs28\lang255{\b0\rtlch \ltrch\loch\fs22\loch\f5
|
||||
4. Conveying Verbatim Copies.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. }
|
||||
\par \pard\plain \s2\ql\nowidctlpar\sb240\sa120\keepn\ltrpar\cf1\kerning1\dbch\af6\dbch\af8\afs28\loch\f4\fs28\lang255{\b0\rtlch \ltrch\loch\fs22\loch\f5
|
||||
5. Conveying Modified Source Versions.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: }
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
a) The work must carry prominent notices stating that you modified it, and giving a relevant date.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices".}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.}
|
||||
\par \pard\plain \s2\ql\nowidctlpar\sb240\sa120\keepn\ltrpar\cf1\kerning1\dbch\af6\dbch\af8\afs28\loch\f4\fs28\lang255{\b0\rtlch \ltrch\loch\fs22\loch\f5
|
||||
6. Conveying Non-Source Forms.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\fs22\loch\f5
|
||||
}{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\fs22\loch\f5
|
||||
}{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\fs22\loch\f5
|
||||
}{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\fs22\loch\f5
|
||||
}{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\fs22\loch\f5
|
||||
}{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.}
|
||||
\par \pard\plain \s2\ql\nowidctlpar\sb240\sa120\keepn\ltrpar\cf1\kerning1\dbch\af6\dbch\af8\afs28\loch\f4\fs28\lang255{\b0\rtlch \ltrch\loch\fs22\loch\f5
|
||||
7. Additional Terms.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\fs22\loch\f5
|
||||
}{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\fs22\loch\f5
|
||||
}{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\fs22\loch\f5
|
||||
}{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\fs22\loch\f5
|
||||
}{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
d) Limiting the use for publicity purposes of names of licensors or authors of the material; or}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\fs22\loch\f5
|
||||
}{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\fs22\loch\f5
|
||||
}{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.}
|
||||
\par \pard\plain \s2\ql\nowidctlpar\sb240\sa120\keepn\ltrpar\cf1\kerning1\dbch\af6\dbch\af8\afs28\loch\f4\fs28\lang255{\b0\rtlch \ltrch\loch\fs22\loch\f5
|
||||
8. Termination.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.}
|
||||
\par \pard\plain \s2\ql\nowidctlpar\sb240\sa120\keepn\ltrpar\cf1\kerning1\dbch\af6\dbch\af8\afs28\loch\f4\fs28\lang255{\b0\rtlch \ltrch\loch\fs22\loch\f5
|
||||
9. Acceptance Not Required for Having Copies.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.}
|
||||
\par \pard\plain \s2\ql\nowidctlpar\sb240\sa120\keepn\ltrpar\cf1\kerning1\dbch\af6\dbch\af8\afs28\loch\f4\fs28\lang255{\b0\rtlch \ltrch\loch\fs22\loch\f5
|
||||
10. Automatic Licensing of Downstream Recipients.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.}
|
||||
\par \pard\plain \s2\ql\nowidctlpar\sb240\sa120\keepn\ltrpar\cf1\kerning1\dbch\af6\dbch\af8\afs28\loch\f4\fs28\lang255{\b0\rtlch \ltrch\loch\fs22\loch\f5
|
||||
11. Patents.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version".}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. }
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.}
|
||||
\par \pard\plain \s2\ql\nowidctlpar\sb240\sa120\keepn\ltrpar\cf1\kerning1\dbch\af6\dbch\af8\afs28\loch\f4\fs28\lang255{\b0\rtlch \ltrch\loch\fs22\loch\f5
|
||||
12. No Surrender of Others' Freedom.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.}
|
||||
\par \pard\plain \s2\ql\nowidctlpar\sb240\sa120\keepn\ltrpar\cf1\kerning1\dbch\af6\dbch\af8\afs28\loch\f4\fs28\lang255{\b0\rtlch \ltrch\loch\fs22\loch\f5
|
||||
13. Use with the GNU Affero General Public License.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.}
|
||||
\par \pard\plain \s2\ql\nowidctlpar\sb240\sa120\keepn\ltrpar\cf1\kerning1\dbch\af6\dbch\af8\afs28\loch\f4\fs28\lang255{\b0\rtlch \ltrch\loch\fs22\loch\f5
|
||||
14. Revised Versions of this License.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.}
|
||||
\par \pard\plain \s2\ql\nowidctlpar\sb240\sa120\keepn\ltrpar\cf1\kerning1\dbch\af6\dbch\af8\afs28\loch\f4\fs28\lang255{\b0\rtlch \ltrch\loch\fs22\loch\f5
|
||||
15. Disclaimer of Warranty.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.}
|
||||
\par \pard\plain \s2\ql\nowidctlpar\sb240\sa120\keepn\ltrpar\cf1\kerning1\dbch\af6\dbch\af8\afs28\loch\f4\fs28\lang255{\b0\rtlch \ltrch\loch\fs22\loch\f5
|
||||
16. Limitation of Liability.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.}
|
||||
\par \pard\plain \s2\ql\nowidctlpar\sb240\sa120\keepn\ltrpar\cf1\kerning1\dbch\af6\dbch\af8\afs28\loch\f4\fs28\lang255{\b0\rtlch \ltrch\loch\fs22\loch\f5
|
||||
17. Interpretation of Sections 15 and 16.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\dbch\af10\afs24\langfe2052\alang1081\loch\f0\fs24\lang255\sl276\slmult1\sb0\sa200{\b0\langfe255\rtlch \ltrch\loch\fs22\loch\f5
|
||||
\tab If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates 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.}
|
||||
\par }
|
||||
@@ -0,0 +1,160 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?if $(var.Platform) = x64 ?>
|
||||
<?define ProductName = "File Converter (64 bit)" ?>
|
||||
<?define Win64 = "yes" ?>
|
||||
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
|
||||
<?else ?>
|
||||
<?define ProductName = "File Converter" ?>
|
||||
<?define Win64 = "no" ?>
|
||||
<?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?>
|
||||
<?endif ?>
|
||||
|
||||
<!-- 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">
|
||||
<Package Id="*" InstallerVersion="200" Compressed="yes" InstallScope="perMachine" Platform="x64" />
|
||||
|
||||
<Icon Id="icon.ico" SourceFile="..\Resources\ApplicationIcon.ico"/>
|
||||
<Property Id="ARPPRODUCTICON" Value="icon.ico" />
|
||||
|
||||
<MajorUpgrade Schedule="afterInstallInitialize" DowngradeErrorMessage="A later version of [ProductName] is already installed. Setup will now exit." />
|
||||
|
||||
<Media Id="1" Cabinet="CabFile.cab" EmbedCab="yes" />
|
||||
|
||||
<Feature Id="ProductFeature" Title="Installer" Level="1">
|
||||
<ComponentGroupRef Id="ProductComponents" />
|
||||
</Feature>
|
||||
|
||||
<Feature Id="ShellExtensionFeature" Title="ShellExtension" Level="1" AllowAdvertise="no">
|
||||
<ComponentRef Id="FileConverterExtension.dll" />
|
||||
</Feature>
|
||||
|
||||
<UIRef Id="WixUI_InstallDir" />
|
||||
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
|
||||
|
||||
<WixVariable Id="WixUILicenseRtf" Value="License.rtf" />
|
||||
<WixVariable Id="WixUIBannerBmp" Value="..\Resources\Installer\Banner.bmp" />
|
||||
<WixVariable Id="WixUIDialogBmp" Value="..\Resources\Installer\UI.bmp" />
|
||||
<WixVariable Id="WixUIExclamationIco" Value="..\Resources\Installer\ErrorIcon.ico" />
|
||||
<WixVariable Id="WixUIInfoIco" Value="..\Resources\Installer\WarningIcon.ico" />
|
||||
<!--<WixVariable Id="WixUINewIco" Value="Icon16x16.ico" />
|
||||
<WixVariable Id="WixUIUpIco" Value="Icon16x16.ico" />-->
|
||||
</Product>
|
||||
|
||||
<Fragment>
|
||||
<Directory Id="TARGETDIR" Name="SourceDir">
|
||||
<Directory Id="$(var.PlatformProgramFilesFolder)">
|
||||
<Directory Id="INSTALLFOLDER" Name="File Converter" />
|
||||
</Directory>
|
||||
</Directory>
|
||||
</Fragment>
|
||||
|
||||
<Fragment>
|
||||
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
|
||||
<!-- Resources -->
|
||||
<Component Guid="{9BF0AC45-A586-41C9-BA93-6048B46DA65F}" Win64="$(var.Win64)">
|
||||
<File Id="SharpShell.dll" KeyPath="yes" Source="..\Middleware\SharpShell\SharpShell.dll" />
|
||||
</Component>
|
||||
<Component Guid="{AA5EA6F7-C443-488B-8E48-7CF000B9AD2A}" Win64="$(var.Win64)">
|
||||
<File Source="$(var.FileConverter.TargetPath)" KeyPath="yes" />
|
||||
</Component>
|
||||
<Component Guid="{1790B82E-86BC-4B95-AA1D-9859FF3B6CA4}" Win64="$(var.Win64)">
|
||||
<File Source="..\Middleware\ffmpeg.exe" KeyPath="yes" />
|
||||
</Component>
|
||||
<Component Guid="{86AEF5B3-C25B-4662-BAEF-20969D1821A5}" Win64="$(var.Win64)">
|
||||
<File Source="..\Application\FileConverter\Settings.xml" KeyPath="yes" />
|
||||
</Component>
|
||||
<Component Guid="{A5158756-A107-4010-9E2F-3C0333F5A5F6}" Win64="$(var.Win64)">
|
||||
<File Source="..\README.md" KeyPath="yes" />
|
||||
</Component>
|
||||
<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>
|
||||
<Component Guid="{3CE6CF1B-431C-41FD-8381-3F73EDAF7B8A}" Win64="$(var.Win64)">
|
||||
<File Id="yeti.mmedia.dll" KeyPath="yes" Source="..\Middleware\yeti.mmedia.dll" />
|
||||
</Component>
|
||||
|
||||
<!-- Registry entries -->
|
||||
<Component Id="RegistryEntries" Guid="{C3EF3D67-0206-4DBD-B2EA-78FF2E290093}">
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter">
|
||||
<RegistryValue Name="Path" Type="string" Value="[INSTALLFOLDER]FileConverter.exe"/>
|
||||
<RegistryValue Name="CompatibleInputExtensions" Type="string" Value="aac;aiff;ape;avi;bik;bmp;cda;flac;flv;ico;jpg;jpeg;m4a;mkv;mov;mp3;mp4;ogg;png;tiff;wav;wma"/>
|
||||
</RegistryKey>
|
||||
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\aac">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Ogg;To Wav;To Mp3"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\aiff">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Ogg;To Wav;To Mp3;To Aac"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\ape">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Ogg;To Flac;To Wav;To Mp3;To Aac"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\avi">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Mkv;To Ogg;To Flac;To Wav;To Mp3;To Aac;To Mkv (low quality)"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\bik">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Mkv;To Ogg;To Flac;To Wav;To Mp3;To Aac;To Mkv (low quality)"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\bmp">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Png;To Jpg;To Ico (max 256x256)"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\cda">
|
||||
<RegistryValue Name="Presets" Type="string" Value="Extract CDA to Flac;Extract CDA to Ogg;Extract CDA to Mp3"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\flac">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Ogg;To Wav;To Mp3;To Aac"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\flv">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Mkv;To Mkv (low quality);To Ogg;To Flac;To Wav;To Mp3;To Aac"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\ico">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Png;To Jpg"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\jpeg">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Png;To Ico (max 256x256)"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\jpg">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Png;To Ico (max 256x256)"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\m4a">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Ogg;To Wav;To Mp3;To Aac"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\mkv">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Mkv;To Mkv (low quality);To Ogg;To Flac;To Wav;To Mp3;To Aac"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\mov">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Mkv;To Mkv (low quality);To Ogg;To Flac;To Wav;To Mp3;To Aac"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\mp3">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Ogg;To Wav;To Aac"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\mp4">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Mkv;To Mkv (low quality);To Ogg;To Flac;To Wav;To Mp3;To Aac"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\ogg">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Wav;To Mp3;To Aac"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\png">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Jpg;To Ico (max 256x256)"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\tiff">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Png;To Jpg;To Ico (max 256x256)"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\wav">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Ogg;To Flac;To Mp3;To Aac"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCU" Key="Software\FileConverter\wma">
|
||||
<RegistryValue Name="Presets" Type="string" Value="To Ogg;To Wav;To Mp3;To Aac"/>
|
||||
</RegistryKey>
|
||||
</Component>
|
||||
</ComponentGroup>
|
||||
</Fragment>
|
||||
</Wix>
|
||||
@@ -0,0 +1,675 @@
|
||||
# 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
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
## TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
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
|
||||
|
||||
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
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
{one line to give the program's name and a brief idea of what it does.}
|
||||
Copyright (C) {year} {name of author}
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
{project} Copyright (C) {year} {fullname}
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
# 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.
|
||||
|
||||
You can download it here: [www.file-converter.org](http://file-converter.org).
|
||||
|
||||
## 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
|
||||
Image | png, jpg, ico | bmp, ico, jpg, jpeg, png, tiff
|
||||
|
||||
*Note: If your source file is a video, the conversion to an audio format will extract the audio part of the video.*
|
||||
|
||||
*Note 2: The mkv output file format encodes video using H.264 encoder for video and AAC encoder for audio.*
|
||||
|
||||
## Thanks
|
||||
|
||||
File converter uses the following middlewares:
|
||||
|
||||
**ffmpeg** as file conversion software.
|
||||
Thanks to ffmpeg devs for this awesome open source file conversion tool. [Web site link](https://www.ffmpeg.org/)
|
||||
|
||||
**SharpShell** to easily create windows context menu extensions.
|
||||
Thanks to Dave Kerr for his work on SharpShell. [CodePlex link](https://sharpshell.codeplex.com/)
|
||||
|
||||
**Ripper** and **yeti.mmedia** for CD Audio extraction.
|
||||
Thanks to Idael Cardoso for his work on CD Audio ripper. [Code project link](http://www.codeproject.com/Articles/5458/C-Sharp-Ripper)
|
||||
|
||||
## License
|
||||
|
||||
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).
|
||||
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 294 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
@@ -0,0 +1,159 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
version="1.1"
|
||||
id="Capa_1"
|
||||
x="0px"
|
||||
y="0px"
|
||||
width="792px"
|
||||
height="792px"
|
||||
viewBox="0 0 792 792"
|
||||
style="enable-background:new 0 0 792 792;"
|
||||
xml:space="preserve"
|
||||
inkscape:version="0.91 r13725"
|
||||
sodipodi:docname="ApplicationIcon.svg"
|
||||
inkscape:export-filename="D:\Users\Adrien.Adrien-PC\Documents\GitHub\FileConverter\Resources\ApplicationIcon.png"
|
||||
inkscape:export-xdpi="8.6400003"
|
||||
inkscape:export-ydpi="8.6400003"><metadata
|
||||
id="metadata3385"><rdf:RDF><cc:Work
|
||||
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title /></cc:Work></rdf:RDF></metadata><defs
|
||||
id="defs3383" /><sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1018"
|
||||
id="namedview3381"
|
||||
showgrid="false"
|
||||
showguides="true"
|
||||
inkscape:guide-bbox="true"
|
||||
inkscape:zoom="0.3535534"
|
||||
inkscape:cx="-538.5249"
|
||||
inkscape:cy="-40.831874"
|
||||
inkscape:window-x="-8"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="layer4"><sodipodi:guide
|
||||
position="21.058654,403.40483"
|
||||
orientation="0,1"
|
||||
id="guide4315" /></sodipodi:namedview><g
|
||||
inkscape:groupmode="layer"
|
||||
id="layer3"
|
||||
inkscape:label="Background"><circle
|
||||
style="opacity:1;fill:#0171bb;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path4286"
|
||||
cx="389.60046"
|
||||
cy="396.81552"
|
||||
r="250" /></g><g
|
||||
inkscape:groupmode="layer"
|
||||
id="layer4"
|
||||
inkscape:label="Pattern"
|
||||
style="display:inline"><circle
|
||||
style="opacity:1;fill:#004b82;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path4393"
|
||||
cx="388.34808"
|
||||
cy="393.1311"
|
||||
r="185.13635" /><path
|
||||
style="fill:#004b82;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 220.61731,309.04607 333.0473,168.99852 -96.87364,160.51324 C 224.69865,684.45629 144.72119,490.77251 144.24978,434.20397 Z"
|
||||
id="path4397"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccccc" /></g><g
|
||||
inkscape:groupmode="layer"
|
||||
id="layer2"
|
||||
inkscape:label="Arrow"
|
||||
style="display:inline"><path
|
||||
style="opacity:1;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:45;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path4307"
|
||||
sodipodi:type="arc"
|
||||
sodipodi:cx="388.49072"
|
||||
sodipodi:cy="391.00571"
|
||||
sodipodi:rx="164.15593"
|
||||
sodipodi:ry="164.15593"
|
||||
sodipodi:start="0.5814947"
|
||||
sodipodi:end="6.2723665"
|
||||
d="M 525.66641,481.17222 A 164.15593,164.15593 0 0 1 319.54955,539.98317 164.15593,164.15593 0 0 1 230.97218,344.79881 164.15593,164.15593 0 0 1 410.95201,228.39372 164.15593,164.15593 0 0 1 552.63705,389.22977"
|
||||
sodipodi:open="true" /><path
|
||||
style="fill:#ffffff;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 502.05274,388.6363 52.26457,89.16055 48.0834,-89.16055 z"
|
||||
id="path4317"
|
||||
inkscape:connector-curvature="0" /><path
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 544.46303,493.53621 -28.0754,-44.18448 -9.52444,19.46287 z"
|
||||
id="path4348"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cccc" /></g><g
|
||||
id="g3337"
|
||||
transform="matrix(0.55346595,0,0,0.55346595,167.0343,189.85664)" /><g
|
||||
id="g3351" /><g
|
||||
id="g3353" /><g
|
||||
id="g3355" /><g
|
||||
id="g3357" /><g
|
||||
id="g3359" /><g
|
||||
id="g3361" /><g
|
||||
id="g3363" /><g
|
||||
id="g3365" /><g
|
||||
id="g3367" /><g
|
||||
id="g3369" /><g
|
||||
id="g3371" /><g
|
||||
id="g3373" /><g
|
||||
id="g3375" /><g
|
||||
id="g3377" /><g
|
||||
id="g3379" /><g
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
inkscape:label="Files"
|
||||
style="display:inline"><g
|
||||
transform="translate(491.76135,105.01435)"
|
||||
id="g3"
|
||||
style="stroke:#ffffff;stroke-opacity:1;fill:#ffffff;fill-opacity:0.94117647;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none"><g
|
||||
id="g5"
|
||||
style="stroke:#ffffff;stroke-opacity:1;fill:#ffffff;fill-opacity:0.94117647;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none"><path
|
||||
inkscape:connector-curvature="0"
|
||||
d="m -174.15384,386.14314 149.574394,0 c 4.183017,0 7.605485,-3.42247 7.605485,-7.60549 l 0,-129.16619 c 0,-2.15503 -0.887157,-4.18301 -2.408254,-5.57751 l -58.815902,-54.63288 c -1.39404,-1.26743 -3.295411,-2.02798 -5.196783,-2.02798 l -90.75894,0 c -4.18302,0 -7.60548,3.42247 -7.60548,7.60549 l 0,183.79907 c 0,4.18302 3.42246,7.60549 7.60548,7.60549 z m 141.968909,-133.47627 0,0.38028 -51.970517,0 0,-48.67511 51.970517,48.29483 z m -134.363419,-50.32281 67.181935,0 0,58.30857 c 0,4.18302 3.422465,7.60549 7.605481,7.60549 l 59.57645,0 0,102.67405 -134.363866,0 0,-168.58811 z"
|
||||
id="path7"
|
||||
style="stroke:#ffffff;stroke-opacity:1;fill:#ffffff;fill-opacity:0.94117647;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none" /></g></g><g
|
||||
transform="translate(491.76135,105.01435)"
|
||||
id="g9" /><g
|
||||
transform="translate(491.76135,105.01435)"
|
||||
id="g11" /><g
|
||||
transform="translate(491.76135,105.01435)"
|
||||
id="g13" /><g
|
||||
transform="translate(491.76135,105.01435)"
|
||||
id="g15" /><g
|
||||
transform="translate(491.76135,105.01435)"
|
||||
id="g17" /><g
|
||||
transform="translate(491.76135,105.01435)"
|
||||
id="g19" /><g
|
||||
transform="translate(491.76135,105.01435)"
|
||||
id="g21" /><g
|
||||
transform="translate(491.76135,105.01435)"
|
||||
id="g23" /><g
|
||||
transform="translate(491.76135,105.01435)"
|
||||
id="g25" /><g
|
||||
transform="translate(491.76135,105.01435)"
|
||||
id="g27" /><g
|
||||
transform="translate(491.76135,105.01435)"
|
||||
id="g29" /><g
|
||||
transform="translate(491.76135,105.01435)"
|
||||
id="g31" /><g
|
||||
transform="translate(491.76135,105.01435)"
|
||||
id="g33" /><g
|
||||
transform="translate(491.76135,105.01435)"
|
||||
id="g35" /><g
|
||||
transform="translate(491.76135,105.01435)"
|
||||
id="g37" /></g></svg>
|
||||
|
After Width: | Height: | Size: 7.0 KiB |