diff options
Diffstat (limited to 'win/C#')
-rw-r--r-- | win/C#/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj | 17 | ||||
-rw-r--r-- | win/C#/HandBrake.ApplicationServices/Parsing/AudioTrack.cs | 42 | ||||
-rw-r--r-- | win/C#/HandBrake.ApplicationServices/Parsing/Chapter.cs | 26 | ||||
-rw-r--r-- | win/C#/HandBrake.ApplicationServices/Parsing/DVD.cs | 4 | ||||
-rw-r--r-- | win/C#/HandBrake.ApplicationServices/Parsing/Subtitle.cs | 31 | ||||
-rw-r--r-- | win/C#/HandBrake.ApplicationServices/Services/LibScan.cs | 328 | ||||
-rw-r--r-- | win/C#/HandBrake.ApplicationServices/app.config | 2 | ||||
-rw-r--r-- | win/C#/HandBrake.Framework/HandBrake.Framework.csproj | 3 | ||||
-rw-r--r-- | win/C#/HandBrake10.sln | 44 | ||||
-rw-r--r-- | win/C#/HandBrakeCS.csproj | 3 | ||||
-rw-r--r-- | win/C#/Installer/Installer.nsi | 2 | ||||
-rw-r--r-- | win/C#/Installer/MakeNightly.nsi.tmpl | 2 | ||||
-rw-r--r-- | win/C#/app.config | 21 | ||||
-rw-r--r-- | win/C#/frmMain.cs | 6 | ||||
-rw-r--r-- | win/C#/libraries/HandBrakeInterop.dll | bin | 0 -> 69120 bytes | |||
-rw-r--r-- | win/C#/libraries/Source/HandBrakeInteropSource.zip | bin | 0 -> 42736 bytes |
16 files changed, 507 insertions, 24 deletions
diff --git a/win/C#/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj b/win/C#/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj index 8809cc133..12b5bc624 100644 --- a/win/C#/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj +++ b/win/C#/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj @@ -10,14 +10,13 @@ <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>HandBrake.ApplicationServices</RootNamespace>
<AssemblyName>HandBrake.ApplicationServices</AssemblyName>
- <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation />
- <TargetFrameworkProfile>
- </TargetFrameworkProfile>
+ <TargetFrameworkProfile>Client</TargetFrameworkProfile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -54,6 +53,9 @@ <SpecificVersion>False</SpecificVersion>
<HintPath>..\libraries\Growl.CoreLibrary.dll</HintPath>
</Reference>
+ <Reference Include="HandBrakeInterop">
+ <HintPath>..\libraries\HandBrakeInterop.dll</HintPath>
+ </Reference>
<Reference Include="Microsoft.WindowsAPICodePack, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\libraries\Microsoft.WindowsAPICodePack.dll</HintPath>
@@ -62,6 +64,7 @@ <SpecificVersion>False</SpecificVersion>
<HintPath>..\libraries\Microsoft.WindowsAPICodePack.Shell.dll</HintPath>
</Reference>
+ <Reference Include="PresentationCore" />
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
@@ -76,6 +79,7 @@ </Reference>
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
+ <Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="EventArgs\EncodeCompletedEventArgs.cs" />
@@ -92,9 +96,9 @@ <Compile Include="Functions\Win32.cs" />
<Compile Include="Functions\Win7.cs" />
<Compile Include="Init.cs" />
+ <Compile Include="Model\Encoding\AudioTrack.cs" />
<Compile Include="Model\Encoding\Anamorphic.cs" />
<Compile Include="Model\Encoding\AudioEncoder.cs" />
- <Compile Include="Model\Encoding\AudioTrack.cs" />
<Compile Include="Model\Encoding\Mixdown.cs" />
<Compile Include="Model\Encoding\PointToPointMode.cs" />
<Compile Include="Model\Encoding\Cropping.cs" />
@@ -126,6 +130,7 @@ <Compile Include="Services\Interfaces\IQueueManager.cs" />
<Compile Include="Services\Interfaces\IQueueProcessor.cs" />
<Compile Include="Services\Interfaces\IScan.cs" />
+ <Compile Include="Services\LibScan.cs" />
<Compile Include="Services\QueueManager.cs" />
<Compile Include="Services\QueueProcessor.cs" />
<Compile Include="Services\Scan.cs" />
@@ -151,9 +156,7 @@ <Name>HandBrake.Framework</Name>
</ProjectReference>
</ItemGroup>
- <ItemGroup>
- <Folder Include="Model\Interfaces\" />
- </ItemGroup>
+ <ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(ProgramFiles)\MSBuild\Microsoft\StyleCop\v4.4\Microsoft.StyleCop.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
diff --git a/win/C#/HandBrake.ApplicationServices/Parsing/AudioTrack.cs b/win/C#/HandBrake.ApplicationServices/Parsing/AudioTrack.cs index 55cf524a5..0597f4d1b 100644 --- a/win/C#/HandBrake.ApplicationServices/Parsing/AudioTrack.cs +++ b/win/C#/HandBrake.ApplicationServices/Parsing/AudioTrack.cs @@ -15,6 +15,48 @@ namespace HandBrake.ApplicationServices.Parsing public class AudioTrack
{
/// <summary>
+ /// Initializes a new instance of the <see cref="AudioTrack"/> class.
+ /// </summary>
+ public AudioTrack()
+ {
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="AudioTrack"/> class.
+ /// </summary>
+ /// <param name="trackNumber">
+ /// The track number.
+ /// </param>
+ /// <param name="language">
+ /// The language.
+ /// </param>
+ /// <param name="languageCode">
+ /// The language code.
+ /// </param>
+ /// <param name="description">
+ /// The description.
+ /// </param>
+ /// <param name="format">
+ /// The format.
+ /// </param>
+ /// <param name="sampleRate">
+ /// The sample rate.
+ /// </param>
+ /// <param name="bitrate">
+ /// The bitrate.
+ /// </param>
+ public AudioTrack(int trackNumber, string language, string languageCode, string description, string format, int sampleRate, int bitrate)
+ {
+ this.TrackNumber = trackNumber;
+ this.Language = language;
+ this.LanguageCode = languageCode;
+ this.Description = description;
+ this.Format = format;
+ this.SampleRate = sampleRate;
+ this.Bitrate = bitrate;
+ }
+
+ /// <summary>
/// Gets or sets The track number of this Audio Track
/// </summary>
public int TrackNumber { get; set; }
diff --git a/win/C#/HandBrake.ApplicationServices/Parsing/Chapter.cs b/win/C#/HandBrake.ApplicationServices/Parsing/Chapter.cs index 949b73f97..4ec76fa1c 100644 --- a/win/C#/HandBrake.ApplicationServices/Parsing/Chapter.cs +++ b/win/C#/HandBrake.ApplicationServices/Parsing/Chapter.cs @@ -16,6 +16,32 @@ namespace HandBrake.ApplicationServices.Parsing public class Chapter
{
/// <summary>
+ /// Initializes a new instance of the <see cref="Chapter"/> class.
+ /// </summary>
+ public Chapter()
+ {
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="Chapter"/> class.
+ /// </summary>
+ /// <param name="number">
+ /// The number.
+ /// </param>
+ /// <param name="Name">
+ /// The name.
+ /// </param>
+ /// <param name="duration">
+ /// The duration.
+ /// </param>
+ public Chapter(int number, string Name, TimeSpan duration)
+ {
+ this.ChapterName = Name;
+ this.ChapterNumber = number;
+ this.Duration = duration;
+ }
+
+ /// <summary>
/// Gets or sets The number of this Chapter, in regards to it's parent Title
/// </summary>
public int ChapterNumber { get; set; }
diff --git a/win/C#/HandBrake.ApplicationServices/Parsing/DVD.cs b/win/C#/HandBrake.ApplicationServices/Parsing/DVD.cs index c7e5a27bb..40b1c4e5f 100644 --- a/win/C#/HandBrake.ApplicationServices/Parsing/DVD.cs +++ b/win/C#/HandBrake.ApplicationServices/Parsing/DVD.cs @@ -22,9 +22,9 @@ namespace HandBrake.ApplicationServices.Parsing }
/// <summary>
- /// Gets Titles. A list of titles from the source
+ /// Gets or sets Titles. A list of titles from the source
/// </summary>
- public List<Title> Titles { get; private set; }
+ public List<Title> Titles { get; set; }
/// <summary>
/// Parse the StreamReader output into a List of Titles
diff --git a/win/C#/HandBrake.ApplicationServices/Parsing/Subtitle.cs b/win/C#/HandBrake.ApplicationServices/Parsing/Subtitle.cs index af261b0ef..1ac827037 100644 --- a/win/C#/HandBrake.ApplicationServices/Parsing/Subtitle.cs +++ b/win/C#/HandBrake.ApplicationServices/Parsing/Subtitle.cs @@ -18,6 +18,37 @@ namespace HandBrake.ApplicationServices.Parsing public class Subtitle
{
/// <summary>
+ /// Initializes a new instance of the <see cref="Subtitle"/> class.
+ /// </summary>
+ public Subtitle()
+ {
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="Subtitle"/> class.
+ /// </summary>
+ /// <param name="trackNumber">
+ /// The track number.
+ /// </param>
+ /// <param name="language">
+ /// The language.
+ /// </param>
+ /// <param name="languageCode">
+ /// The language code.
+ /// </param>
+ /// <param name="subtitleType">
+ /// The subtitle type.
+ /// </param>
+ public Subtitle(int trackNumber, string language, string languageCode, SubtitleType subtitleType)
+ {
+ this.TrackNumber = trackNumber;
+ this.Language = language;
+ this.LanguageCode = languageCode;
+ this.SubtitleType = subtitleType;
+ }
+
+
+ /// <summary>
/// Gets or sets the track number of this Subtitle
/// </summary>
public int TrackNumber { get; set; }
diff --git a/win/C#/HandBrake.ApplicationServices/Services/LibScan.cs b/win/C#/HandBrake.ApplicationServices/Services/LibScan.cs new file mode 100644 index 000000000..50be6aa07 --- /dev/null +++ b/win/C#/HandBrake.ApplicationServices/Services/LibScan.cs @@ -0,0 +1,328 @@ +/* LibScan.cs $
+ This file is part of the HandBrake source code.
+ Homepage: <http://handbrake.fr>.
+ It may be used under the terms of the GNU General Public License. */
+
+namespace HandBrake.ApplicationServices.Services
+{
+ using System;
+ using System.Collections.Generic;
+ using System.Text;
+ using System.Threading;
+
+ using HandBrake.ApplicationServices.EventArgs;
+ using HandBrake.ApplicationServices.Model.Encoding;
+ using HandBrake.ApplicationServices.Parsing;
+ using HandBrake.ApplicationServices.Services.Interfaces;
+ using HandBrake.Interop;
+
+ using AudioTrack = HandBrake.ApplicationServices.Parsing.AudioTrack;
+ using Cropping = HandBrake.ApplicationServices.Model.Encoding.Cropping;
+ using ScanProgressEventArgs = HandBrake.Interop.ScanProgressEventArgs;
+ using Size = System.Drawing.Size;
+
+ /// <summary>
+ /// Scan a Source
+ /// </summary>
+ public class LibScan : IScan
+ {
+ /*
+ * TODO
+ * 1. Expose the Previews code.
+ * 2. Expose the Logging.
+ *
+ */
+
+ #region Private Variables
+
+ /// <summary>
+ /// Lock for the log file
+ /// </summary>
+ static readonly object LogLock = new object();
+
+ /// <summary>
+ /// LibHB Instance
+ /// </summary>
+ private readonly HandBrakeInstance instance;
+
+ /// <summary>
+ /// Log data from HandBrakeInstance
+ /// </summary>
+ private readonly StringBuilder logging;
+
+ #endregion
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="LibScan"/> class.
+ /// </summary>
+ public LibScan()
+ {
+ logging = new StringBuilder();
+
+ instance = new HandBrakeInstance();
+ instance.Initialize(1);
+ instance.ScanProgress += this.InstanceScanProgress;
+ instance.ScanCompleted += this.InstanceScanCompleted;
+
+ HandBrakeUtils.MessageLogged += this.HandBrakeInstanceMessageLogged;
+ HandBrakeUtils.ErrorLogged += this.HandBrakeInstanceErrorLogged;
+ }
+
+ #region Events
+
+ /// <summary>
+ /// Scan has Started
+ /// </summary>
+ public event EventHandler ScanStared;
+
+ /// <summary>
+ /// Scan has completed
+ /// </summary>
+ public event ScanCompletedStatus ScanCompleted;
+
+ /// <summary>
+ /// Encode process has progressed
+ /// </summary>
+ public event ScanProgessStatus ScanStatusChanged;
+
+ #endregion
+
+ #region Properties
+
+ /// <summary>
+ /// Gets a value indicating whether IsScanning.
+ /// </summary>
+ public bool IsScanning { get; private set; }
+
+ /// <summary>
+ /// Gets the Souce Data.
+ /// </summary>
+ public DVD SouceData { get; private set; }
+
+ /// <summary>
+ /// Gets ActivityLog.
+ /// </summary>
+ public string ActivityLog
+ {
+ get
+ {
+ return logging.ToString();
+ }
+ }
+
+ #endregion
+
+ #region Public Methods
+
+ /// <summary>
+ /// Scan a Source Path.
+ /// Title 0: scan all
+ /// </summary>
+ /// <param name="sourcePath">Path to the file to scan</param>
+ /// <param name="title">int title number. 0 for scan all</param>
+ public void Scan(string sourcePath, int title)
+ {
+ Thread t = new Thread(unused => this.ScanSource(sourcePath, title));
+ t.Start();
+ }
+
+ /// <summary>
+ /// Kill the scan
+ /// </summary>
+ public void Stop()
+ {
+ instance.StopScan();
+ }
+
+ #endregion
+
+ #region Private Methods
+
+ /// <summary>
+ /// Start a scan for a given source path and title
+ /// </summary>
+ /// <param name="sourcePath">Path to the source file</param>
+ /// <param name="title">the title number to look at</param>
+ private void ScanSource(object sourcePath, int title)
+ {
+ try
+ {
+ IsScanning = true;
+ if (this.ScanStared != null)
+ this.ScanStared(this, new EventArgs());
+
+ if (title != 0)
+ instance.StartScan(sourcePath.ToString(), 10, title);
+ else
+ instance.StartScan(sourcePath.ToString(), 10);
+ }
+ catch (Exception exc)
+ {
+ this.Stop();
+
+ if (this.ScanCompleted != null)
+ this.ScanCompleted(this, new ScanCompletedEventArgs(false, exc, "An Error has occured in ScanService.ScanSource()"));
+ }
+ }
+
+ #endregion
+
+ #region HandBrakeInstance Event Handlers
+ /// <summary>
+ /// Scan Completed Event Handler
+ /// </summary>
+ /// <param name="sender">
+ /// The sender.
+ /// </param>
+ /// <param name="e">
+ /// The EventArgs.
+ /// </param>
+ private void InstanceScanCompleted(object sender, EventArgs e)
+ {
+ this.SouceData = new DVD { Titles = ConvertTitles(this.instance.Titles) };
+
+ IsScanning = false;
+
+ if (this.ScanCompleted != null)
+ this.ScanCompleted(this, new ScanCompletedEventArgs(true, null, string.Empty));
+ }
+
+ /// <summary>
+ /// Scan Progress Event Handler
+ /// </summary>
+ /// <param name="sender">
+ /// The sender.
+ /// </param>
+ /// <param name="e">
+ /// The EventArgs.
+ /// </param>
+ private void InstanceScanProgress(object sender, ScanProgressEventArgs e)
+ {
+ if (this.ScanStatusChanged != null)
+ {
+ ApplicationServices.EventArgs.ScanProgressEventArgs eventArgs =
+ new ApplicationServices.EventArgs.ScanProgressEventArgs
+ {
+ CurrentTitle = e.CurrentTitle,
+ Titles = e.Titles
+ };
+
+ this.ScanStatusChanged(this, eventArgs);
+ }
+ }
+
+ /// <summary>
+ /// Log a message
+ /// </summary>
+ /// <param name="sender">
+ /// The sender.
+ /// </param>
+ /// <param name="e">
+ /// The MessageLoggedEventArgs.
+ /// </param>
+ private void HandBrakeInstanceErrorLogged(object sender, MessageLoggedEventArgs e)
+ {
+ lock (LogLock)
+ {
+ this.logging.AppendLine(e.Message);
+ }
+ }
+
+ /// <summary>
+ /// Log a message
+ /// </summary>
+ /// <param name="sender">
+ /// The sender.
+ /// </param>
+ /// <param name="e">
+ /// The MessageLoggedEventArgs.
+ /// </param>
+ private void HandBrakeInstanceMessageLogged(object sender, MessageLoggedEventArgs e)
+ {
+ lock (LogLock)
+ {
+ this.logging.AppendLine(e.Message);
+ }
+ }
+
+ /// <summary>
+ /// Convert Interop Title objects to App Services Title object
+ /// </summary>
+ /// <param name="titles">
+ /// The titles.
+ /// </param>
+ /// <returns>
+ /// The convert titles.
+ /// </returns>
+ private static List<Title> ConvertTitles(IEnumerable<SourceData.Title> titles)
+ {
+ List<Title> titleList = new List<Title>();
+ foreach (SourceData.Title title in titles)
+ {
+ Title converted = new Title
+ {
+ TitleNumber = title.TitleNumber,
+ Duration = title.Duration,
+ Resolution = new Size(title.Resolution.Width, title.Resolution.Height),
+ AspectRatio = title.AspectRatio,
+ AngleCount = title.AngleCount,
+ ParVal = new Size(title.ParVal.Width, title.ParVal.Height),
+ AutoCropDimensions =
+ Cropping.CreateCroppingObject(
+ title.AutoCropDimensions.Top,
+ title.AutoCropDimensions.Bottom,
+ title.AutoCropDimensions.Left,
+ title.AutoCropDimensions.Right),
+ Fps = title.Framerate
+ };
+
+ foreach (SourceData.Chapter chapter in title.Chapters)
+ {
+ converted.Chapters.Add(new Chapter(chapter.ChapterNumber, string.Empty, chapter.Duration));
+ }
+
+ foreach (SourceData.AudioTrack track in title.AudioTracks)
+ {
+ converted.AudioTracks.Add(new AudioTrack(track.TrackNumber, track.Language, track.LanguageCode, track.Description, string.Empty, track.SampleRate, track.Bitrate));
+ }
+
+ foreach (SourceData.Subtitle track in title.Subtitles)
+ {
+ SubtitleType convertedType = new SubtitleType();
+
+ switch (track.SubtitleSource)
+ {
+ case SourceData.SubtitleSource.VobSub:
+ convertedType = SubtitleType.VobSub;
+ break;
+ case SourceData.SubtitleSource.UTF8:
+ convertedType = SubtitleType.UTF8Sub;
+ break;
+ case SourceData.SubtitleSource.TX3G:
+ convertedType = SubtitleType.TX3G;
+ break;
+ case SourceData.SubtitleSource.SSA:
+ convertedType = SubtitleType.SSA;
+ break;
+ case SourceData.SubtitleSource.SRT:
+ convertedType = SubtitleType.SRT;
+ break;
+ case SourceData.SubtitleSource.CC608:
+ convertedType = SubtitleType.CC;
+ break;
+ case SourceData.SubtitleSource.CC708:
+ convertedType = SubtitleType.CC;
+ break;
+ }
+
+ converted.Subtitles.Add(new Subtitle(track.TrackNumber, track.Language, track.LanguageCode, convertedType));
+ }
+
+ titleList.Add(converted);
+ }
+
+ return titleList;
+ }
+ #endregion
+ }
+}
\ No newline at end of file diff --git a/win/C#/HandBrake.ApplicationServices/app.config b/win/C#/HandBrake.ApplicationServices/app.config index 7077d5d6c..2665bc96e 100644 --- a/win/C#/HandBrake.ApplicationServices/app.config +++ b/win/C#/HandBrake.ApplicationServices/app.config @@ -39,4 +39,4 @@ </setting>
</HandBrake.ApplicationServices.Properties.Settings>
</userSettings>
-<startup><supportedRuntime version="v2.0.50727"/></startup></configuration>
+<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client"/></startup></configuration>
diff --git a/win/C#/HandBrake.Framework/HandBrake.Framework.csproj b/win/C#/HandBrake.Framework/HandBrake.Framework.csproj index 8d806e5b8..e7a7664b6 100644 --- a/win/C#/HandBrake.Framework/HandBrake.Framework.csproj +++ b/win/C#/HandBrake.Framework/HandBrake.Framework.csproj @@ -10,12 +10,13 @@ <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>HandBrake.Framework</RootNamespace>
<AssemblyName>HandBrake.Framework</AssemblyName>
- <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation />
+ <TargetFrameworkProfile>Client</TargetFrameworkProfile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
diff --git a/win/C#/HandBrake10.sln b/win/C#/HandBrake10.sln index 84de6f542..e5fda7222 100644 --- a/win/C#/HandBrake10.sln +++ b/win/C#/HandBrake10.sln @@ -10,54 +10,98 @@ EndProject Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
+ Debug|Mixed Platforms = Debug|Mixed Platforms
+ Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Install|Any CPU = Install|Any CPU
+ Install|Mixed Platforms = Install|Mixed Platforms
+ Install|x64 = Install|x64
Install|x86 = Install|x86
NightlyBuild|Any CPU = NightlyBuild|Any CPU
+ NightlyBuild|Mixed Platforms = NightlyBuild|Mixed Platforms
+ NightlyBuild|x64 = NightlyBuild|x64
NightlyBuild|x86 = NightlyBuild|x86
Release|Any CPU = Release|Any CPU
+ Release|Mixed Platforms = Release|Mixed Platforms
+ Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
+ {A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.Debug|Mixed Platforms.Build.0 = Debug|x86
+ {A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.Debug|x64.ActiveCfg = Debug|x86
{A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.Debug|x86.ActiveCfg = Debug|x86
{A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.Debug|x86.Build.0 = Debug|x86
{A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.Install|Any CPU.ActiveCfg = Install|Any CPU
{A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.Install|Any CPU.Build.0 = Install|Any CPU
+ {A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.Install|Mixed Platforms.ActiveCfg = Install|x86
+ {A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.Install|Mixed Platforms.Build.0 = Install|x86
+ {A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.Install|x64.ActiveCfg = Install|x86
{A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.Install|x86.ActiveCfg = Install|x86
{A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.Install|x86.Build.0 = Install|x86
{A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.NightlyBuild|Any CPU.ActiveCfg = NightlyBuild|Any CPU
{A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.NightlyBuild|Any CPU.Build.0 = NightlyBuild|Any CPU
+ {A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.NightlyBuild|Mixed Platforms.ActiveCfg = NightlyBuild|x86
+ {A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.NightlyBuild|Mixed Platforms.Build.0 = NightlyBuild|x86
+ {A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.NightlyBuild|x64.ActiveCfg = NightlyBuild|x86
{A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.NightlyBuild|x86.ActiveCfg = NightlyBuild|x86
{A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.NightlyBuild|x86.Build.0 = NightlyBuild|x86
{A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.Release|Any CPU.Build.0 = Release|Any CPU
+ {A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.Release|Mixed Platforms.ActiveCfg = Release|x86
+ {A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.Release|Mixed Platforms.Build.0 = Release|x86
+ {A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.Release|x64.ActiveCfg = Release|x86
{A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.Release|x86.ActiveCfg = Release|x86
{A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.Release|x86.Build.0 = Release|x86
{087A2BA8-BAC2-4577-A46F-07FF9D420016}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{087A2BA8-BAC2-4577-A46F-07FF9D420016}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {087A2BA8-BAC2-4577-A46F-07FF9D420016}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {087A2BA8-BAC2-4577-A46F-07FF9D420016}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {087A2BA8-BAC2-4577-A46F-07FF9D420016}.Debug|x64.ActiveCfg = Debug|Any CPU
{087A2BA8-BAC2-4577-A46F-07FF9D420016}.Debug|x86.ActiveCfg = Debug|Any CPU
{087A2BA8-BAC2-4577-A46F-07FF9D420016}.Install|Any CPU.ActiveCfg = Release|Any CPU
{087A2BA8-BAC2-4577-A46F-07FF9D420016}.Install|Any CPU.Build.0 = Release|Any CPU
+ {087A2BA8-BAC2-4577-A46F-07FF9D420016}.Install|Mixed Platforms.ActiveCfg = NightlyBuild|Any CPU
+ {087A2BA8-BAC2-4577-A46F-07FF9D420016}.Install|Mixed Platforms.Build.0 = NightlyBuild|Any CPU
+ {087A2BA8-BAC2-4577-A46F-07FF9D420016}.Install|x64.ActiveCfg = NightlyBuild|Any CPU
{087A2BA8-BAC2-4577-A46F-07FF9D420016}.Install|x86.ActiveCfg = Release|Any CPU
{087A2BA8-BAC2-4577-A46F-07FF9D420016}.NightlyBuild|Any CPU.ActiveCfg = NightlyBuild|Any CPU
{087A2BA8-BAC2-4577-A46F-07FF9D420016}.NightlyBuild|Any CPU.Build.0 = NightlyBuild|Any CPU
+ {087A2BA8-BAC2-4577-A46F-07FF9D420016}.NightlyBuild|Mixed Platforms.ActiveCfg = NightlyBuild|Any CPU
+ {087A2BA8-BAC2-4577-A46F-07FF9D420016}.NightlyBuild|Mixed Platforms.Build.0 = NightlyBuild|Any CPU
+ {087A2BA8-BAC2-4577-A46F-07FF9D420016}.NightlyBuild|x64.ActiveCfg = NightlyBuild|Any CPU
{087A2BA8-BAC2-4577-A46F-07FF9D420016}.NightlyBuild|x86.ActiveCfg = Release|Any CPU
{087A2BA8-BAC2-4577-A46F-07FF9D420016}.Release|Any CPU.ActiveCfg = Release|Any CPU
{087A2BA8-BAC2-4577-A46F-07FF9D420016}.Release|Any CPU.Build.0 = Release|Any CPU
+ {087A2BA8-BAC2-4577-A46F-07FF9D420016}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {087A2BA8-BAC2-4577-A46F-07FF9D420016}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {087A2BA8-BAC2-4577-A46F-07FF9D420016}.Release|x64.ActiveCfg = Release|Any CPU
{087A2BA8-BAC2-4577-A46F-07FF9D420016}.Release|x86.ActiveCfg = Release|Any CPU
{49AD42C1-BF9B-4D78-A644-020878FAADE6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{49AD42C1-BF9B-4D78-A644-020878FAADE6}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {49AD42C1-BF9B-4D78-A644-020878FAADE6}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {49AD42C1-BF9B-4D78-A644-020878FAADE6}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {49AD42C1-BF9B-4D78-A644-020878FAADE6}.Debug|x64.ActiveCfg = Debug|Any CPU
{49AD42C1-BF9B-4D78-A644-020878FAADE6}.Debug|x86.ActiveCfg = Debug|Any CPU
{49AD42C1-BF9B-4D78-A644-020878FAADE6}.Install|Any CPU.ActiveCfg = Release|Any CPU
{49AD42C1-BF9B-4D78-A644-020878FAADE6}.Install|Any CPU.Build.0 = Release|Any CPU
+ {49AD42C1-BF9B-4D78-A644-020878FAADE6}.Install|Mixed Platforms.ActiveCfg = NightlyBuild|Any CPU
+ {49AD42C1-BF9B-4D78-A644-020878FAADE6}.Install|Mixed Platforms.Build.0 = NightlyBuild|Any CPU
+ {49AD42C1-BF9B-4D78-A644-020878FAADE6}.Install|x64.ActiveCfg = NightlyBuild|Any CPU
{49AD42C1-BF9B-4D78-A644-020878FAADE6}.Install|x86.ActiveCfg = Release|Any CPU
{49AD42C1-BF9B-4D78-A644-020878FAADE6}.NightlyBuild|Any CPU.ActiveCfg = Release|Any CPU
{49AD42C1-BF9B-4D78-A644-020878FAADE6}.NightlyBuild|Any CPU.Build.0 = Release|Any CPU
+ {49AD42C1-BF9B-4D78-A644-020878FAADE6}.NightlyBuild|Mixed Platforms.ActiveCfg = NightlyBuild|Any CPU
+ {49AD42C1-BF9B-4D78-A644-020878FAADE6}.NightlyBuild|Mixed Platforms.Build.0 = NightlyBuild|Any CPU
+ {49AD42C1-BF9B-4D78-A644-020878FAADE6}.NightlyBuild|x64.ActiveCfg = NightlyBuild|Any CPU
{49AD42C1-BF9B-4D78-A644-020878FAADE6}.NightlyBuild|x86.ActiveCfg = Release|Any CPU
{49AD42C1-BF9B-4D78-A644-020878FAADE6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{49AD42C1-BF9B-4D78-A644-020878FAADE6}.Release|Any CPU.Build.0 = Release|Any CPU
+ {49AD42C1-BF9B-4D78-A644-020878FAADE6}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {49AD42C1-BF9B-4D78-A644-020878FAADE6}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {49AD42C1-BF9B-4D78-A644-020878FAADE6}.Release|x64.ActiveCfg = Release|Any CPU
{49AD42C1-BF9B-4D78-A644-020878FAADE6}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
diff --git a/win/C#/HandBrakeCS.csproj b/win/C#/HandBrakeCS.csproj index 158b96bf1..55e94b62e 100644 --- a/win/C#/HandBrakeCS.csproj +++ b/win/C#/HandBrakeCS.csproj @@ -19,7 +19,7 @@ <UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>3.5</OldToolsVersion>
- <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<SignManifests>false</SignManifests>
<PublishUrl>publish\</PublishUrl>
@@ -36,6 +36,7 @@ <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
+ <TargetFrameworkProfile>Client</TargetFrameworkProfile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
diff --git a/win/C#/Installer/Installer.nsi b/win/C#/Installer/Installer.nsi index 2951bcaad..9283fdd01 100644 --- a/win/C#/Installer/Installer.nsi +++ b/win/C#/Installer/Installer.nsi @@ -136,6 +136,7 @@ Section "Handbrake" SEC01 File "HandBrake.Framework.dll"
File "Microsoft.WindowsAPICodePack.Shell.dll"
File "Microsoft.WindowsAPICodePack.dll"
+ File "HandBrakeInterop.dll"
;File "Caliburn.Castle.dll"
;File "Caliburn.Core.dll"
@@ -197,6 +198,7 @@ Section Uninstall Delete "$INSTDIR\HandBrake.Framework.dll"
Delete "$INSTDIR\Microsoft.WindowsAPICodePack.Shell.dll"
Delete "$INSTDIR\Microsoft.WindowsAPICodePack.dll"
+ Delete "$INSTDIR\HandBrakeInterop.dll"
Delete "$INSTDIR\Caliburn.Castle.dll"
Delete "$INSTDIR\Caliburn.Core.dll"
diff --git a/win/C#/Installer/MakeNightly.nsi.tmpl b/win/C#/Installer/MakeNightly.nsi.tmpl index 55db341f5..b7b6a2ed5 100644 --- a/win/C#/Installer/MakeNightly.nsi.tmpl +++ b/win/C#/Installer/MakeNightly.nsi.tmpl @@ -136,6 +136,7 @@ Section "Handbrake" SEC01 File "HandBrake.Framework.dll"
File "Microsoft.WindowsAPICodePack.Shell.dll"
File "Microsoft.WindowsAPICodePack.dll"
+ File "HandBrakeInterop.dll"
;File "Caliburn.Castle.dll"
;File "Caliburn.Core.dll"
@@ -197,6 +198,7 @@ Section Uninstall Delete "$INSTDIR\HandBrake.Framework.dll"
Delete "$INSTDIR\Microsoft.WindowsAPICodePack.Shell.dll"
Delete "$INSTDIR\Microsoft.WindowsAPICodePack.dll"
+ Delete "$INSTDIR\HandBrakeInterop.dll"
Delete "$INSTDIR\Caliburn.Castle.dll"
Delete "$INSTDIR\Caliburn.Core.dll"
diff --git a/win/C#/app.config b/win/C#/app.config index cea155aab..d2164ddf6 100644 --- a/win/C#/app.config +++ b/win/C#/app.config @@ -1,11 +1,10 @@ <?xml version="1.0"?>
-
<configuration>
<configSections>
- <section name="castle" type="Castle.Windsor.Configuration.AppDomain.CastleSectionHandler, Castle.Windsor" />
+ <section name="castle" type="Castle.Windsor.Configuration.AppDomain.CastleSectionHandler, Castle.Windsor"/>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
- <section name="Handbrake.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
+ <section name="Handbrake.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
</sectionGroup>
</configSections>
@@ -27,7 +26,7 @@ <value>Do Nothing</value>
</setting>
<setting name="defaultPreset" serializeAs="String">
- <value />
+ <value/>
</setting>
<setting name="hb_build" serializeAs="String">
<value>0</value>
@@ -39,7 +38,7 @@ <value>True</value>
</setting>
<setting name="autoNamePath" serializeAs="String">
- <value />
+ <value/>
</setting>
<setting name="appcast" serializeAs="String">
<value>http://handbrake.fr/appcast.xml</value>
@@ -54,7 +53,7 @@ <value>False</value>
</setting>
<setting name="saveLogPath" serializeAs="String">
- <value />
+ <value/>
</setting>
<setting name="saveLogWithVideo" serializeAs="String">
<value>False</value>
@@ -84,7 +83,7 @@ <value>True</value>
</setting>
<setting name="lastUpdateCheckDate" serializeAs="String">
- <value />
+ <value/>
</setting>
<setting name="daysBetweenUpdateCheck" serializeAs="String">
<value>7</value>
@@ -102,7 +101,7 @@ <value>0</value>
</setting>
<setting name="hb_platform" serializeAs="String">
- <value />
+ <value/>
</setting>
<setting name="growlQueue" serializeAs="String">
<value>False</value>
@@ -111,7 +110,7 @@ <value>False</value>
</setting>
<setting name="CliExeHash" serializeAs="String">
- <value />
+ <value/>
</setting>
<setting name="previewScanCount" serializeAs="String">
<value>10</value>
@@ -149,7 +148,7 @@ </Handbrake.Properties.Settings>
</userSettings>
- <startup />
+ <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client"/></startup>
<!--<castle>
<components>
@@ -159,4 +158,4 @@ </components>
</castle>-->
-</configuration>
\ No newline at end of file +</configuration>
diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs index 1c4ccb229..fa85b4763 100644 --- a/win/C#/frmMain.cs +++ b/win/C#/frmMain.cs @@ -56,7 +56,8 @@ namespace Handbrake private string dvdDriveLabel;
private Preset currentlySelectedPreset;
private DVD currentSource;
- private IScan SourceScan = new ScanService();
+
+ private IScan SourceScan;
private List<DriveInformation> drives;
private QueueTask queueEdit;
@@ -118,6 +119,9 @@ namespace Handbrake {
InitializeComponent();
+ // We can use LibHB, if the library hb.dll exists.
+ this.SourceScan = File.Exists("hb.dll") ? (IScan)new LibScan() : new ScanService();
+
// Update the users config file with the CLI version data.
Main.SetCliVersionData();
diff --git a/win/C#/libraries/HandBrakeInterop.dll b/win/C#/libraries/HandBrakeInterop.dll Binary files differnew file mode 100644 index 000000000..a2bb55eb0 --- /dev/null +++ b/win/C#/libraries/HandBrakeInterop.dll diff --git a/win/C#/libraries/Source/HandBrakeInteropSource.zip b/win/C#/libraries/Source/HandBrakeInteropSource.zip Binary files differnew file mode 100644 index 000000000..b6340098b --- /dev/null +++ b/win/C#/libraries/Source/HandBrakeInteropSource.zip |