OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sun, 29 Aug 2010 15:09:32 +0000 (15:09 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sun, 29 Aug 2010 15:09:32 +0000 (15:09 +0000)
- Update the Interop Code.
- Update Growl Libary to 2.0.4.1

git-svn-id: svn://localhost/HandBrake/trunk@3500 b64f7644-9d1e-0410-96f1-a4d463321fa5

41 files changed:
win/C#/interop/Converters.cs [new file with mode: 0644]
win/C#/interop/DisplayStringAttribute.cs
win/C#/interop/EncodeCompletedEventArgs.cs [new file with mode: 0644]
win/C#/interop/EncodeProgressEventArgs.cs
win/C#/interop/HandBrakeInstance.cs
win/C#/interop/HandBrakeInterop.csproj
win/C#/interop/HbLib.cs
win/C#/interop/InteropUtilities.cs
win/C#/interop/Language.cs
win/C#/interop/LanguageCodes.cs
win/C#/interop/MessageLoggedEventArgs.cs
win/C#/interop/Model/Cropping.cs
win/C#/interop/Model/EncodeJob.cs
win/C#/interop/Model/Encoding/Anamorphic.cs
win/C#/interop/Model/Encoding/AudioEncoder.cs
win/C#/interop/Model/Encoding/AudioEncoding.cs
win/C#/interop/Model/Encoding/Decomb.cs
win/C#/interop/Model/Encoding/Deinterlace.cs
win/C#/interop/Model/Encoding/Denoise.cs
win/C#/interop/Model/Encoding/Detelecine.cs
win/C#/interop/Model/Encoding/EncodingProfile.cs
win/C#/interop/Model/Encoding/Mixdown.cs
win/C#/interop/Model/Encoding/OutputExtension.cs
win/C#/interop/Model/Encoding/OutputFormat.cs
win/C#/interop/Model/Encoding/VideoEncodeRateType.cs
win/C#/interop/Model/Encoding/VideoEncoder.cs
win/C#/interop/Model/Size.cs [new file with mode: 0644]
win/C#/interop/Model/SourceSubtitle.cs
win/C#/interop/Model/SourceType.cs
win/C#/interop/Model/SrtSubtitle.cs
win/C#/interop/Model/Subtitles.cs
win/C#/interop/NativeList.cs
win/C#/interop/Properties/AssemblyInfo.cs
win/C#/interop/ScanProgressEventArgs.cs
win/C#/interop/SourceData/AudioTrack.cs
win/C#/interop/SourceData/Chapter.cs
win/C#/interop/SourceData/Subtitle.cs
win/C#/interop/SourceData/SubtitleType.cs
win/C#/interop/SourceData/Title.cs
win/C#/libraries/Growl.Connector.dll
win/C#/libraries/Growl.CoreLibrary.dll

diff --git a/win/C#/interop/Converters.cs b/win/C#/interop/Converters.cs
new file mode 100644 (file)
index 0000000..e549199
--- /dev/null
@@ -0,0 +1,32 @@
+using System;\r
+using System.Collections.Generic;\r
+using System.Linq;\r
+using System.Text;\r
+\r
+namespace HandBrake.Interop\r
+{\r
+    public static class Converters\r
+    {\r
+        private static Dictionary<double, int> vrates = new Dictionary<double, int>\r
+        {\r
+            {5, 5400000},\r
+            {10, 2700000},\r
+            {12, 2250000},\r
+            {15, 1800000},\r
+            {23.976, 1126125},\r
+            {24, 1125000},\r
+            {25, 1080000},\r
+            {29.97, 900900}\r
+        };\r
+\r
+        public static int FramerateToVrate(double framerate)\r
+        {\r
+            if (!vrates.ContainsKey(framerate))\r
+            {\r
+                throw new ArgumentException("Framerate not recognized.", "framerate");\r
+            }\r
+\r
+            return vrates[framerate];\r
+        }\r
+    }\r
+}\r
index 1d1c7e4..3f7e62d 100644 (file)
@@ -1,16 +1,10 @@
-// --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="DisplayStringAttribute.cs" company="HandBrake Project (http://handbrake.fr)">\r
-//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
-// </copyright>\r
-// <summary>\r
-//   Defines the DisplayStringAttribute type.\r
-// </summary>\r
-// --------------------------------------------------------------------------------------------------------------------\r
+using System;\r
+using System.Collections.Generic;\r
+using System.Linq;\r
+using System.Text;\r
 \r
 namespace HandBrake.Interop\r
 {\r
-    using System;\r
-\r
     [AttributeUsage(AttributeTargets.Field)]\r
     public sealed class DisplayStringAttribute : Attribute\r
     {\r
diff --git a/win/C#/interop/EncodeCompletedEventArgs.cs b/win/C#/interop/EncodeCompletedEventArgs.cs
new file mode 100644 (file)
index 0000000..a96afa2
--- /dev/null
@@ -0,0 +1,12 @@
+using System;\r
+using System.Collections.Generic;\r
+using System.Linq;\r
+using System.Text;\r
+\r
+namespace HandBrake.Interop\r
+{\r
+    public class EncodeCompletedEventArgs : EventArgs\r
+    {\r
+        public bool Error { get; set; }\r
+    }\r
+}\r
index 7241104..7f08595 100644 (file)
@@ -1,44 +1,16 @@
-// --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="EncodeProgressEventArgs.cs" company="HandBrake Project (http://handbrake.fr)">\r
-//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
-// </copyright>\r
-// <summary>\r
-//   Defines the EncodeProgressEventArgs type.\r
-// </summary>\r
-// --------------------------------------------------------------------------------------------------------------------\r
+using System;\r
+using System.Collections.Generic;\r
+using System.Linq;\r
+using System.Text;\r
 \r
 namespace HandBrake.Interop\r
 {\r
-    using System;\r
-\r
-    /// <summary>\r
-    /// Encode Progress Event Arguments\r
-    /// </summary>\r
     public class EncodeProgressEventArgs : EventArgs\r
     {\r
-        /// <summary>\r
-        /// Gets or sets FractionComplete.\r
-        /// </summary>\r
         public float FractionComplete { get; set; }\r
-\r
-        /// <summary>\r
-        /// Gets or sets CurrentFrameRate.\r
-        /// </summary>\r
         public float CurrentFrameRate { get; set; }\r
-\r
-        /// <summary>\r
-        /// Gets or sets AverageFrameRate.\r
-        /// </summary>\r
         public float AverageFrameRate { get; set; }\r
-\r
-        /// <summary>\r
-        /// Gets or sets EstimatedTimeLeft.\r
-        /// </summary>\r
         public TimeSpan EstimatedTimeLeft { get; set; }\r
-\r
-        /// <summary>\r
-        /// Gets or sets Pass.\r
-        /// </summary>\r
         public int Pass { get; set; }\r
     }\r
 }\r
index 26ab994..38c4c92 100644 (file)
@@ -1,25 +1,16 @@
-// --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="HandBrakeInstance.cs" company="HandBrake Project (http://handbrake.fr)">\r
-//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
-// </copyright>\r
-// <summary>\r
-//   A wrapper for a HandBrake instance.\r
-// </summary>\r
-// --------------------------------------------------------------------------------------------------------------------\r
-\r
-using System.Drawing;\r
-\r
-namespace HandBrake.Interop\r
+namespace HandBrake.Interop\r
 {\r
     using System;\r
     using System.Collections.Generic;\r
     using System.IO;\r
     using System.Linq;\r
     using System.Runtime.InteropServices;\r
+    using System.Text;\r
+    using System.Timers;\r
+    using System.Threading;\r
     using System.Windows.Media.Imaging;\r
-    using Model;\r
-    using Model.Encoding;\r
-    using SourceData;\r
+    using HandBrake.SourceData;\r
+    using HandBrake.Interop;\r
 \r
     /// <summary>\r
     /// A wrapper for a HandBrake instance.\r
@@ -67,6 +58,11 @@ namespace HandBrake.Interop
         private List<Title> titles;\r
 \r
         /// <summary>\r
+        /// The index of the default title.\r
+        /// </summary>\r
+        private int featureTitle;\r
+\r
+        /// <summary>\r
         /// A list of native memory locations allocated by this instance.\r
         /// </summary>\r
         private List<IntPtr> encodeAllocatedMemory;\r
@@ -99,7 +95,7 @@ namespace HandBrake.Interop
         /// <summary>\r
         /// Fires when an encode has completed.\r
         /// </summary>\r
-        public event EventHandler<EventArgs> EncodeCompleted;\r
+        public event EventHandler<EncodeCompletedEventArgs> EncodeCompleted;\r
 \r
         /// <summary>\r
         /// Fires when HandBrake has logged a message.\r
@@ -131,6 +127,17 @@ namespace HandBrake.Interop
         }\r
 \r
         /// <summary>\r
+        /// Gets the index of the default title.\r
+        /// </summary>\r
+        public int FeatureTitle\r
+        {\r
+            get\r
+            {\r
+                return this.featureTitle;\r
+            }\r
+        }\r
+\r
+        /// <summary>\r
         /// Initializes this instance.\r
         /// </summary>\r
         /// <param name="verbosity"></param>\r
@@ -146,7 +153,7 @@ namespace HandBrake.Interop
                 HbLib.hb_register_error_handler(errorCallback);\r
             }\r
 \r
-            this.hbHandle = HbLib.hb_init(verbosity, 0);\r
+            this.hbHandle = HbLib.hb_init(verbosity, update_check: 0);\r
         }\r
 \r
         /// <summary>\r
@@ -261,7 +268,7 @@ namespace HandBrake.Interop
             for (int i = 0; i < nativeJob.height; i++)\r
             {\r
                 Marshal.Copy(managedBuffer, i * nativeJob.width * 4, ptr, nativeJob.width * 4);\r
-                ptr = AddOffset(ptr, bitmapData.Stride);\r
+                ptr = IntPtr.Add(ptr, bitmapData.Stride);\r
             }\r
 \r
             bitmap.UnlockBits(bitmapData);\r
@@ -282,11 +289,6 @@ namespace HandBrake.Interop
             }\r
         }\r
 \r
-        public static IntPtr AddOffset(IntPtr src, int offset)\r
-        {\r
-            return new IntPtr(src.ToInt64() + offset);\r
-        }\r
-\r
         /// <summary>\r
         /// Starts an encode with the given job.\r
         /// </summary>\r
@@ -485,6 +487,16 @@ namespace HandBrake.Interop
                     this.titles.Add(newTitle);\r
                 }\r
 \r
+                if (this.originalTitles.Count > 0)\r
+                {\r
+                    hb_job_s nativeJob = InteropUtilities.ReadStructure<hb_job_s>(this.originalTitles[0].job);\r
+                    this.featureTitle = nativeJob.feature;\r
+                }\r
+                else\r
+                {\r
+                    this.featureTitle = 0;\r
+                }\r
+\r
                 this.scanPollTimer.Stop();\r
 \r
                 if (this.ScanCompleted != null)\r
@@ -529,7 +541,7 @@ namespace HandBrake.Interop
 \r
                 if (this.EncodeCompleted != null)\r
                 {\r
-                    this.EncodeCompleted(this, new EventArgs());\r
+                    this.EncodeCompleted(this, new EncodeCompletedEventArgs { Error = state.param.workdone.error > 0 });\r
                 }\r
             }\r
         }\r
@@ -614,7 +626,6 @@ namespace HandBrake.Interop
                 }\r
 \r
                 this.AddFilter(filterList, NativeConstants.HB_FILTER_DEINTERLACE, settings, allocatedMemory);\r
-                //filterList.Add(HbLib.hb_get_filter_object(NativeConstants.HB_FILTER_DEINTERLACE, settings));\r
             }\r
             else\r
             {\r
@@ -630,7 +641,6 @@ namespace HandBrake.Interop
                 }\r
 \r
                 this.AddFilter(filterList, NativeConstants.HB_FILTER_DETELECINE, settings, allocatedMemory);\r
-                //filterList.Add(HbLib.hb_get_filter_object(NativeConstants.HB_FILTER_DETELECINE, settings));\r
             }\r
 \r
             if (profile.Decomb != Decomb.Off)\r
@@ -642,13 +652,11 @@ namespace HandBrake.Interop
                 }\r
 \r
                 this.AddFilter(filterList, NativeConstants.HB_FILTER_DECOMB, settings, allocatedMemory);\r
-                //filterList.Add(HbLib.hb_get_filter_object(NativeConstants.HB_FILTER_DECOMB, settings));\r
             }\r
 \r
             if (profile.Deblock > 0)\r
             {\r
                 this.AddFilter(filterList, NativeConstants.HB_FILTER_DEBLOCK, profile.Deblock.ToString(), allocatedMemory);\r
-                //filterList.Add(HbLib.hb_get_filter_object(NativeConstants.HB_FILTER_DEBLOCK, profile.Deblock.ToString()));\r
             }\r
 \r
             if (profile.Denoise != Denoise.Off)\r
@@ -673,7 +681,6 @@ namespace HandBrake.Interop
                 }\r
 \r
                 this.AddFilter(filterList, NativeConstants.HB_FILTER_DENOISE, settings, allocatedMemory);\r
-                //filterList.Add(HbLib.hb_get_filter_object(NativeConstants.HB_FILTER_DENOISE, settings));\r
             }\r
 \r
             NativeList filterListNative = InteropUtilities.CreateIntPtrList(filterList);\r
@@ -778,21 +785,26 @@ namespace HandBrake.Interop
                     break;\r
             }\r
 \r
-            if (profile.VideoEncodeRateType == VideoEncodeRateType.ConstantQuality)\r
+            if (profile.Framerate == 0)\r
             {\r
-                nativeJob.vquality = (float)profile.Quality;\r
-                nativeJob.vbitrate = 0;\r
+                nativeJob.cfr = 0;\r
             }\r
-            else if (profile.VideoEncodeRateType == VideoEncodeRateType.AverageBitrate)\r
+            else\r
             {\r
-                nativeJob.vquality = -1;\r
-                nativeJob.vbitrate = profile.VideoBitrate;\r
+                if (profile.PeakFramerate)\r
+                {\r
+                    nativeJob.cfr = 2;\r
+                }\r
+                else\r
+                {\r
+                    nativeJob.cfr = 1;\r
+                }\r
+\r
+                nativeJob.vrate = 27000000;\r
+                nativeJob.vrate_base = Converters.FramerateToVrate(profile.Framerate);\r
             }\r
 \r
-            // vrate\r
-            // vrate_base\r
             // vfr\r
-            // cfr\r
             // areBframes\r
             // color_matrix\r
             List<hb_audio_s> titleAudio = InteropUtilities.ConvertList<hb_audio_s>(originalTitle.list_audio);\r
@@ -933,6 +945,24 @@ namespace HandBrake.Interop
                 nativeJob.angle = job.Angle;\r
             }\r
 \r
+            switch (profile.VideoEncodeRateType)\r
+            {\r
+                case VideoEncodeRateType.ConstantQuality:\r
+                    nativeJob.vquality = (float)profile.Quality;\r
+                    nativeJob.vbitrate = 0;\r
+                    break;\r
+                case VideoEncodeRateType.AverageBitrate:\r
+                    nativeJob.vquality = -1;\r
+                    nativeJob.vbitrate = profile.VideoBitrate;\r
+                    break;\r
+                case VideoEncodeRateType.TargetSize:\r
+                    nativeJob.vquality = -1;\r
+                    nativeJob.vbitrate = HbLib.hb_calc_bitrate(ref nativeJob, profile.TargetSize);\r
+                    break;\r
+                default:\r
+                    break;\r
+            }\r
+\r
             // frames_to_skip\r
 \r
             return allocatedMemory;\r
index 1379139..fd35b97 100644 (file)
@@ -3,14 +3,14 @@
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
-    <ProductVersion>9.0.21022</ProductVersion>\r
+    <ProductVersion>9.0.30729</ProductVersion>\r
     <SchemaVersion>2.0</SchemaVersion>\r
     <ProjectGuid>{F0A61F62-2C3B-4A87-AFF4-0C4256253DA1}</ProjectGuid>\r
     <OutputType>Library</OutputType>\r
     <AppDesignerFolder>Properties</AppDesignerFolder>\r
     <RootNamespace>HandBrake.Interop</RootNamespace>\r
     <AssemblyName>HandBrakeInterop</AssemblyName>\r
-    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>\r
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
     <FileUpgradeFlags>\r
     </FileUpgradeFlags>\r
@@ -64,6 +64,7 @@
       <RequiredTargetFramework>3.5</RequiredTargetFramework>\r
     </Reference>\r
     <Reference Include="System.Drawing" />\r
+    <Reference Include="System.Xaml" />\r
     <Reference Include="System.Xml.Linq">\r
       <RequiredTargetFramework>3.5</RequiredTargetFramework>\r
     </Reference>\r
@@ -77,7 +78,9 @@
     </Reference>\r
   </ItemGroup>\r
   <ItemGroup>\r
+    <Compile Include="Converters.cs" />\r
     <Compile Include="DisplayStringAttribute.cs" />\r
+    <Compile Include="EncodeCompletedEventArgs.cs" />\r
     <Compile Include="EncodeProgressEventArgs.cs" />\r
     <Compile Include="HandBrakeInstance.cs" />\r
     <Compile Include="HbLib.cs" />\r
     <Compile Include="Model\Encoding\OutputFormat.cs" />\r
     <Compile Include="Model\Encoding\VideoEncoder.cs" />\r
     <Compile Include="Model\Encoding\VideoEncodeRateType.cs" />\r
+    <Compile Include="Model\Size.cs" />\r
     <Compile Include="Model\SourceSubtitle.cs" />\r
     <Compile Include="Model\SourceType.cs" />\r
     <Compile Include="Model\SrtSubtitle.cs" />\r
     </BootstrapperPackage>\r
   </ItemGroup>\r
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
-  <Import Project="$(ProgramFiles)\MSBuild\Microsoft\StyleCop\v4.3\Microsoft.StyleCop.targets" />\r
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
        Other similar extension points exist, see Microsoft.Common.targets.\r
   <Target Name="BeforeBuild">\r
index 80a52ef..9d22207 100644 (file)
@@ -1,51 +1,46 @@
-// --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="HbLib.cs" company="HandBrake Project (http://handbrake.fr)">\r
-//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
-// </copyright>\r
-// <summary>\r
-//   Defines the NativeConstants type.\r
-// </summary>\r
-// --------------------------------------------------------------------------------------------------------------------\r
+using System;\r
+using System.Collections.Generic;\r
+using System.Linq;\r
+using System.Text;\r
+using System.Runtime.InteropServices;\r
 \r
 namespace HandBrake.Interop\r
 {\r
-    using System;\r
-    using System.Runtime.InteropServices;\r
 \r
-    internal partial class NativeConstants\r
+    public partial class NativeConstants\r
     {\r
-        public const int HB_ACODEC_MASK = 0x00FF00;\r
-        public const int HB_ACODEC_FAAC = 0x000100;\r
-        public const int HB_ACODEC_LAME = 0x000200;\r
+        public const int HB_ACODEC_MASK =   0x00FF00;\r
+        public const int HB_ACODEC_FAAC =   0x000100;\r
+        public const int HB_ACODEC_LAME =   0x000200;\r
         public const int HB_ACODEC_VORBIS = 0x000400;\r
-        public const int HB_ACODEC_AC3 = 0x000800;\r
-        public const int HB_ACODEC_MPGA = 0x001000;\r
-        public const int HB_ACODEC_LPCM = 0x002000;\r
-        public const int HB_ACODEC_DCA = 0x004000;\r
+        public const int HB_ACODEC_AC3 =    0x000800;\r
+        public const int HB_ACODEC_MPGA =   0x001000;\r
+        public const int HB_ACODEC_LPCM =   0x002000;\r
+        public const int HB_ACODEC_DCA =    0x004000;\r
         public const int HB_ACODEC_FFMPEG = 0x008000;\r
         public const int HB_ACODEC_CA_AAC = 0x010000;\r
 \r
-        public const int HB_AMIXDOWN_DCA_FORMAT_MASK = 0x00FFF000;\r
-        public const int HB_AMIXDOWN_A52_FORMAT_MASK = 0x00000FF0;\r
-        public const int HB_AMIXDOWN_DISCRETE_CHANNEL_COUNT_MASK = 0x0000000F;\r
-        public const int HB_AMIXDOWN_MONO = 0x01000001;\r
-        public const int HB_AMIXDOWN_STEREO = 0x02002022;\r
-        public const int HB_AMIXDOWN_DOLBY = 0x042070A2;\r
-        public const int HB_AMIXDOWN_DOLBYPLII = 0x084094A2;\r
-        public const int HB_AMIXDOWN_6CH = 0x10089176;\r
+        public const int HB_AMIXDOWN_DCA_FORMAT_MASK =              0x00FFF000;\r
+        public const int HB_AMIXDOWN_A52_FORMAT_MASK =              0x00000FF0;\r
+        public const int HB_AMIXDOWN_DISCRETE_CHANNEL_COUNT_MASK =  0x0000000F;\r
+        public const int HB_AMIXDOWN_MONO =                         0x01000001;\r
+        public const int HB_AMIXDOWN_STEREO =                       0x02002022;\r
+        public const int HB_AMIXDOWN_DOLBY =                        0x042070A2;\r
+        public const int HB_AMIXDOWN_DOLBYPLII =                    0x084094A2;\r
+        public const int HB_AMIXDOWN_6CH =                          0x10089176;\r
 \r
-        public const int HB_VCODEC_MASK = 0x0000FF;\r
+        public const int HB_VCODEC_MASK =   0x0000FF;\r
         public const int HB_VCODEC_FFMPEG = 0x000001;\r
-        public const int HB_VCODEC_X264 = 0x000002;\r
+        public const int HB_VCODEC_X264 =   0x000002;\r
         public const int HB_VCODEC_THEORA = 0x000004;\r
 \r
-        public const int HB_MUX_MASK = 0xFF0000;\r
-        public const int HB_MUX_MP4 = 0x010000;\r
-        public const int HB_MUX_PSP = 0x020000;\r
-        public const int HB_MUX_AVI = 0x040000;\r
-        public const int HB_MUX_OGM = 0x080000;\r
-        public const int HB_MUX_IPOD = 0x100000;\r
-        public const int HB_MUX_MKV = 0x200000;\r
+        public const int HB_MUX_MASK =  0xFF0000;\r
+        public const int HB_MUX_MP4 =   0x010000;\r
+        public const int HB_MUX_PSP =   0x020000;\r
+        public const int HB_MUX_AVI =   0x040000;\r
+        public const int HB_MUX_OGM =   0x080000;\r
+        public const int HB_MUX_IPOD =  0x100000;\r
+        public const int HB_MUX_MKV =   0x200000;\r
 \r
         public const int HBTF_NO_IDR = 1 << 0;\r
 \r
@@ -63,14 +58,14 @@ namespace HandBrake.Interop
 \r
         public const int AUDIO_F_DOLBY = 1 << 31;\r
 \r
-        public const int HB_FRAME_IDR = 0x01;\r
-        public const int HB_FRAME_I = 0x02;\r
-        public const int HB_FRAME_AUDIO = 0x04;\r
-        public const int HB_FRAME_P = 0x10;\r
-        public const int HB_FRAME_B = 0x20;\r
-        public const int HB_FRAME_BREF = 0x40;\r
-        public const int HB_FRAME_KEY = 0x0F;\r
-        public const int HB_FRAME_REF = 0xF0;\r
+        public const int HB_FRAME_IDR =     0x01;\r
+        public const int HB_FRAME_I =       0x02;\r
+        public const int HB_FRAME_AUDIO =   0x04;\r
+        public const int HB_FRAME_P =       0x10;\r
+        public const int HB_FRAME_B =       0x20;\r
+        public const int HB_FRAME_BREF =    0x40;\r
+        public const int HB_FRAME_KEY =     0x0F;\r
+        public const int HB_FRAME_REF =     0xF0;\r
 \r
         public const int HB_CONFIG_MAX_SIZE = 8192;\r
 \r
@@ -83,7 +78,7 @@ namespace HandBrake.Interop
     }\r
 \r
     [StructLayout(LayoutKind.Sequential)]\r
-    internal struct hb_anamorphic_substruct\r
+    public struct hb_anamorphic_substruct\r
     {\r
         /// int\r
         public int mode;\r
@@ -108,7 +103,7 @@ namespace HandBrake.Interop
     }\r
 \r
     [StructLayout(LayoutKind.Sequential)]\r
-    internal struct hb_job_s\r
+    public struct hb_job_s\r
     {\r
         /// int\r
         public int sequence_id;\r
@@ -128,7 +123,8 @@ namespace HandBrake.Interop
         public int chapter_markers;\r
 \r
         /// int[4]\r
-        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4, ArraySubType = UnmanagedType.I4)] public int[] crop;\r
+        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4, ArraySubType = UnmanagedType.I4)]\r
+        public int[] crop;\r
 \r
         /// int\r
         public int deinterlace;\r
@@ -191,6 +187,7 @@ namespace HandBrake.Interop
         /// char*\r
         //[MarshalAs(UnmanagedType.LPStr)]\r
         //public string x264opts;\r
+\r
         public IntPtr x264opts;\r
 \r
         /// int\r
@@ -209,7 +206,8 @@ namespace HandBrake.Interop
         public int mux;\r
 \r
         /// char*\r
-        [MarshalAs(UnmanagedType.LPStr)] public string file;\r
+        [MarshalAs(UnmanagedType.LPStr)]\r
+        public string file;\r
 \r
         /// int\r
         public int largeFileSize;\r
@@ -249,11 +247,12 @@ namespace HandBrake.Interop
         public uint frames_to_skip;\r
 \r
         // Padding for the part of the struct we don't care about marshaling.\r
-        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 24644, ArraySubType = UnmanagedType.U1)] public byte[] padding;\r
+        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 24644, ArraySubType = UnmanagedType.U1)]\r
+        public byte[] padding;\r
     }\r
 \r
     [StructLayout(LayoutKind.Sequential)]\r
-    internal struct hb_list_s\r
+    public struct hb_list_s\r
     {\r
         /// void**\r
         public IntPtr items;\r
@@ -266,17 +265,18 @@ namespace HandBrake.Interop
     }\r
 \r
     [StructLayout(LayoutKind.Sequential)]\r
-    internal struct hb_rate_s\r
+    public struct hb_rate_s\r
     {\r
         /// char*\r
-        [MarshalAs(UnmanagedType.LPStr)] public string @string;\r
+        [MarshalAs(UnmanagedType.LPStr)]\r
+        public string @string;\r
 \r
         /// int\r
         public int rate;\r
     }\r
 \r
     [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]\r
-    internal struct hb_handle_s\r
+    public struct hb_handle_s\r
     {\r
         public int id;\r
 \r
@@ -284,7 +284,8 @@ namespace HandBrake.Interop
         public int build;\r
 \r
         /// char[32]\r
-        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] public string version;\r
+        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]\r
+        public string version;\r
 \r
         /// hb_thread_t*\r
         public IntPtr update_thread;\r
@@ -348,7 +349,7 @@ namespace HandBrake.Interop
     }\r
 \r
     [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]\r
-    internal struct hb_chapter_s\r
+    public struct hb_chapter_s\r
     {\r
         /// int\r
         public int index;\r
@@ -387,17 +388,18 @@ namespace HandBrake.Interop
         public ulong duration;\r
 \r
         /// char[1024]\r
-        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)] public string title;\r
+        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)]\r
+        public string title;\r
     }\r
 \r
-    internal enum hb_subtitle_s_subtype\r
+    public enum hb_subtitle_s_subtype\r
     {\r
         PICTURESUB,\r
 \r
         TEXTSUB,\r
     }\r
 \r
-    internal enum hb_subtitle_s_subsource\r
+    public enum hb_subtitle_s_subsource\r
     {\r
         VOBSUB,\r
 \r
@@ -409,11 +411,13 @@ namespace HandBrake.Interop
 \r
         UTF8SUB,\r
 \r
-        TX3GSUB\r
+        TX3GSUB,\r
+\r
+        SSASUB\r
     }\r
 \r
     [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]\r
-    internal struct hb_subtitle_s\r
+    public struct hb_subtitle_s\r
     {\r
         /// int\r
         public int id;\r
@@ -431,15 +435,18 @@ namespace HandBrake.Interop
         public hb_subtitle_s_subsource source;\r
 \r
         /// char[1024]\r
-        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)] public string lang;\r
+        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)]\r
+        public string lang;\r
 \r
         /// char[4]\r
-        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] public string iso639_2;\r
+        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)]\r
+        public string iso639_2;\r
 \r
         /// uint8_t->unsigned char\r
         public byte type;\r
 \r
-        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16, ArraySubType = UnmanagedType.U4)] public uint[] palette;\r
+        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16, ArraySubType = UnmanagedType.U4)]\r
+        public uint[] palette;\r
 \r
         public int width;\r
 \r
@@ -468,28 +475,35 @@ namespace HandBrake.Interop
     }\r
 \r
     [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]\r
-    internal struct hb_metadata_s\r
+    public struct hb_metadata_s\r
     {\r
         /// char[255]\r
-        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)] public string name;\r
+        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)]\r
+        public string name;\r
 \r
         /// char[255]\r
-        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)] public string artist;\r
+        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)]\r
+        public string artist;\r
 \r
         /// char[255]\r
-        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)] public string composer;\r
+        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)]\r
+        public string composer;\r
 \r
         /// char[255]\r
-        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)] public string release_date;\r
+        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)]\r
+        public string release_date;\r
 \r
         /// char[1024]\r
-        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)] public string comment;\r
+        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)]\r
+        public string comment;\r
 \r
         /// char[255]\r
-        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)] public string album;\r
+        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)]\r
+        public string album;\r
 \r
         /// char[255]\r
-        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)] public string genre;\r
+        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)]\r
+        public string genre;\r
 \r
         /// uint32_t->unsigned int\r
         public uint coverart_size;\r
@@ -498,14 +512,14 @@ namespace HandBrake.Interop
         public IntPtr coverart;\r
     }\r
 \r
-    internal enum Anonymous_990d28ea_6cf3_4fbc_8143_4df9513e9550\r
+    public enum Anonymous_990d28ea_6cf3_4fbc_8143_4df9513e9550\r
     {\r
         HB_DVD_TYPE,\r
 \r
         HB_STREAM_TYPE,\r
     }\r
 \r
-    internal enum Anonymous_618ebeca_0ad9_4a71_9a49_18e50ac2e9db\r
+    public enum Anonymous_618ebeca_0ad9_4a71_9a49_18e50ac2e9db\r
     {\r
         /// HB_MPEG2_PS_DEMUXER -> 0\r
         HB_MPEG2_PS_DEMUXER = 0,\r
@@ -516,16 +530,18 @@ namespace HandBrake.Interop
     }\r
 \r
     [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]\r
-    internal struct hb_title_s\r
+    public struct hb_title_s\r
     {\r
         /// Anonymous_990d28ea_6cf3_4fbc_8143_4df9513e9550\r
         public Anonymous_990d28ea_6cf3_4fbc_8143_4df9513e9550 type;\r
 \r
         /// char[1024]\r
-        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)] public string dvd;\r
+        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)]\r
+        public string dvd;\r
 \r
         /// char[1024]\r
-        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)] public string name;\r
+        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)]\r
+        public string name;\r
 \r
         //public fixed byte dvd[1024];\r
 \r
@@ -595,7 +611,8 @@ namespace HandBrake.Interop
         public int rate_base;\r
 \r
         /// int[4]\r
-        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4, ArraySubType = UnmanagedType.I4)] public int[] crop;\r
+        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4, ArraySubType = UnmanagedType.I4)]\r
+        public int[] crop;\r
 \r
         //public fixed int crop[4];\r
 \r
@@ -646,7 +663,7 @@ namespace HandBrake.Interop
     }\r
 \r
     [StructLayout(LayoutKind.Sequential)]\r
-    internal struct hb_state_scanning_s\r
+    public struct hb_state_scanning_s\r
     {\r
         /// int\r
         public int title_cur;\r
@@ -656,7 +673,7 @@ namespace HandBrake.Interop
     }\r
 \r
     [StructLayout(LayoutKind.Sequential)]\r
-    internal struct hb_state_working_s\r
+    public struct hb_state_working_s\r
     {\r
         /// float\r
         public float progress;\r
@@ -687,42 +704,46 @@ namespace HandBrake.Interop
     }\r
 \r
     [StructLayout(LayoutKind.Sequential)]\r
-    internal struct hb_state_workdone_s\r
+    public struct hb_state_workdone_s\r
     {\r
         /// int\r
         public int error;\r
     }\r
 \r
     [StructLayout(LayoutKind.Sequential)]\r
-    internal struct hb_state_muxing_s\r
+    public struct hb_state_muxing_s\r
     {\r
         /// float\r
         public float progress;\r
     }\r
 \r
     [StructLayout(LayoutKind.Explicit)]\r
-    internal struct hb_state_param_u\r
+    public struct hb_state_param_u\r
     {\r
-        [FieldOffset(0)] public hb_state_scanning_s scanning;\r
+        [FieldOffset(0)]\r
+        public hb_state_scanning_s scanning;\r
 \r
-        [FieldOffset(0)] public hb_state_working_s working;\r
+        [FieldOffset(0)]\r
+        public hb_state_working_s working;\r
 \r
-        [FieldOffset(0)] public hb_state_workdone_s workdone;\r
+        [FieldOffset(0)]\r
+        public hb_state_workdone_s workdone;\r
 \r
-        [FieldOffset(0)] public hb_state_muxing_s muxing;\r
+        [FieldOffset(0)]\r
+        public hb_state_muxing_s muxing;\r
     }\r
 \r
     [StructLayout(LayoutKind.Sequential)]\r
-    internal struct hb_state_s\r
+    public struct hb_state_s\r
     {\r
+\r
         /// int\r
         public int state;\r
-\r
         public hb_state_param_u param;\r
     }\r
 \r
     [StructLayout(LayoutKind.Sequential)]\r
-    internal struct hb_audio_s\r
+    public struct hb_audio_s\r
     {\r
         /// int\r
         public int id;\r
@@ -731,14 +752,15 @@ namespace HandBrake.Interop
         public hb_audio_config_s config;\r
 \r
         // Padding for the part of the struct we don't care about marshaling.\r
-        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 24600, ArraySubType = UnmanagedType.U1)] public byte[] padding;\r
+        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 24600, ArraySubType = UnmanagedType.U1)]\r
+        public byte[] padding;\r
 \r
         /// Anonymous_e6c7b779_b5a3_4e80_9fa8_13619d14f545\r
         //public Anonymous_e6c7b779_b5a3_4e80_9fa8_13619d14f545 priv;\r
     }\r
 \r
     [StructLayout(LayoutKind.Sequential)]\r
-    internal struct hb_audio_config_s\r
+    public struct hb_audio_config_s\r
     {\r
         public hb_audio_config_output_s output;\r
         public hb_audio_config_input_s input;\r
@@ -750,7 +772,7 @@ namespace HandBrake.Interop
     }\r
 \r
     [StructLayout(LayoutKind.Sequential)]\r
-    internal struct hb_audio_config_output_s\r
+    public struct hb_audio_config_output_s\r
     {\r
         /// int\r
         public int track;\r
@@ -771,11 +793,12 @@ namespace HandBrake.Interop
         public double dynamic_range_compression;\r
 \r
         /// char*\r
-        [MarshalAs(UnmanagedType.LPStr)] public string name;\r
+        [MarshalAs(UnmanagedType.LPStr)]\r
+        public string name;\r
     }\r
 \r
     [StructLayout(LayoutKind.Sequential)]\r
-    internal struct hb_audio_config_input_s\r
+    public struct hb_audio_config_input_s\r
     {\r
         /// int\r
         public int track;\r
@@ -803,48 +826,56 @@ namespace HandBrake.Interop
     }\r
 \r
     [StructLayout(LayoutKind.Explicit)]\r
-    internal struct Anonymous_a0a59d69_d9a4_4003_a198_f7c51511e31d\r
+    public struct Anonymous_a0a59d69_d9a4_4003_a198_f7c51511e31d\r
     {\r
         /// int\r
-        [FieldOffset(0)] public int ac3;\r
+        [FieldOffset(0)]\r
+        public int ac3;\r
 \r
         /// int\r
-        [FieldOffset(0)] public int dca;\r
+        [FieldOffset(0)]\r
+        public int dca;\r
     }\r
 \r
     [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]\r
-    internal struct hb_audio_config_lang_s\r
+    public struct hb_audio_config_lang_s\r
     {\r
         /// char[1024]\r
-        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)] public string description;\r
+        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)]\r
+        public string description;\r
 \r
         /// char[1024]\r
-        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)] public string simple;\r
+        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)]\r
+        public string simple;\r
 \r
         /// char[4]\r
-        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] public string iso639_2;\r
+        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)]\r
+        public string iso639_2;\r
 \r
         /// uint8_t->unsigned char\r
         public byte type;\r
     }\r
 \r
     [StructLayout(LayoutKind.Sequential)]\r
-    internal struct hb_mixdown_s\r
+    public struct hb_mixdown_s\r
     {\r
         /// char*\r
-        [MarshalAs(UnmanagedType.LPStr)] public string human_readable_name;\r
+        [MarshalAs(UnmanagedType.LPStr)]\r
+        public string human_readable_name;\r
 \r
         /// char*\r
-        [MarshalAs(UnmanagedType.LPStr)] public string internal_name;\r
+        [MarshalAs(UnmanagedType.LPStr)]\r
+        public string internal_name;\r
 \r
         /// char*\r
-        [MarshalAs(UnmanagedType.LPStr)] public string short_name;\r
+        [MarshalAs(UnmanagedType.LPStr)]\r
+        public string short_name;\r
 \r
         /// int\r
         public int amixdown;\r
     }\r
 \r
-    internal enum hb_subtitle_config_s_subdest\r
+    public enum hb_subtitle_config_s_subdest\r
     {\r
         RENDERSUB,\r
 \r
@@ -852,7 +883,7 @@ namespace HandBrake.Interop
     }\r
 \r
     [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]\r
-    internal struct hb_subtitle_config_s\r
+    public struct hb_subtitle_config_s\r
     {\r
         /// hb_subtitle_config_s_subdest\r
         public hb_subtitle_config_s_subdest dest;\r
@@ -864,17 +895,19 @@ namespace HandBrake.Interop
         public int default_track;\r
 \r
         /// char[128]\r
-        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] public string src_filename;\r
+        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]\r
+        public string src_filename;\r
 \r
         /// char[40]\r
-        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 40)] public string src_codeset;\r
+        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 40)]\r
+        public string src_codeset;\r
 \r
         /// int64_t->int\r
         public long offset;\r
     }\r
 \r
     [StructLayout(LayoutKind.Sequential)]\r
-    internal struct hb_fifo_s\r
+    public struct hb_fifo_s\r
     {\r
         /// hb_lock_t*\r
         public IntPtr @lock;\r
@@ -896,12 +929,12 @@ namespace HandBrake.Interop
     }\r
 \r
     [StructLayout(LayoutKind.Sequential)]\r
-    internal struct hb_lock_s\r
+    public struct hb_lock_s\r
     {\r
     }\r
 \r
     [StructLayout(LayoutKind.Sequential)]\r
-    internal struct hb_buffer_s\r
+    public struct hb_buffer_s\r
     {\r
         /// int\r
         public int size;\r
@@ -910,7 +943,8 @@ namespace HandBrake.Interop
         public int alloc;\r
 \r
         /// uint8_t*\r
-        [MarshalAs(UnmanagedType.LPStr)] public string data;\r
+        [MarshalAs(UnmanagedType.LPStr)]\r
+        public string data;\r
 \r
         /// int\r
         public int cur;\r
@@ -959,7 +993,7 @@ namespace HandBrake.Interop
     }\r
 \r
     [StructLayout(LayoutKind.Sequential)]\r
-    internal struct hb_mux_data_s\r
+    public struct hb_mux_data_s\r
     {\r
         /// MP4TrackId->uint32_t->unsigned int\r
         public uint track;\r
@@ -975,7 +1009,7 @@ namespace HandBrake.Interop
     }\r
 \r
     [StructLayout(LayoutKind.Sequential)]\r
-    internal struct hb_interjob_s\r
+    public struct hb_interjob_s\r
     {\r
         /// int\r
         public int last_job;\r
@@ -1001,13 +1035,14 @@ namespace HandBrake.Interop
 \r
     /// Return Type: void\r
     ///param0: void*\r
-    internal delegate void hb_thread_s_function(IntPtr param0);\r
+    public delegate void hb_thread_s_function(IntPtr param0);\r
 \r
     [StructLayout(LayoutKind.Sequential)]\r
-    internal struct hb_thread_s\r
+    public struct hb_thread_s\r
     {\r
         /// char*\r
-        [MarshalAs(UnmanagedType.LPStr)] public string name;\r
+        [MarshalAs(UnmanagedType.LPStr)]\r
+        public string name;\r
 \r
         /// int\r
         public int priority;\r
@@ -1029,7 +1064,7 @@ namespace HandBrake.Interop
     }\r
 \r
     [StructLayout(LayoutKind.Sequential)]\r
-    internal struct ptw32_handle_t\r
+    public struct ptw32_handle_t\r
     {\r
         /// void*\r
         public IntPtr p;\r
@@ -1039,10 +1074,13 @@ namespace HandBrake.Interop
     }\r
 \r
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]\r
-    internal delegate void LoggingCallback(string message);\r
+    public delegate void LoggingCallback(string message);\r
 \r
-    internal partial class HbLib\r
+    public partial class HbLib\r
     {\r
+        [DllImport("hb.dll", EntryPoint = "hb_calc_bitrate", CallingConvention = CallingConvention.Cdecl)]\r
+        public static extern int hb_calc_bitrate(ref hb_job_s job, int size);\r
+\r
         [DllImport("hb.dll", EntryPoint = "hb_register_logger", CallingConvention = CallingConvention.Cdecl)]\r
         public static extern void hb_register_logger(LoggingCallback callback);\r
 \r
@@ -1108,8 +1146,7 @@ namespace HandBrake.Interop
         ///preview_count: int\r
         ///store_previews: int\r
         [DllImport("hb.dll", EntryPoint = "hb_scan", CallingConvention = CallingConvention.Cdecl)]\r
-        public static extern void hb_scan(IntPtr hbHandle, [In] [MarshalAs(UnmanagedType.LPStr)] string path,\r
-                                          int title_index, int preview_count, int store_previews);\r
+        public static extern void hb_scan(IntPtr hbHandle, [In] [MarshalAs(UnmanagedType.LPStr)] string path, int title_index, int preview_count, int store_previews);\r
 \r
 \r
         /// Return Type: hb_list_t*\r
@@ -1129,9 +1166,7 @@ namespace HandBrake.Interop
         ///prog_diff: int\r
         ///prog_threshold: int\r
         [DllImport("hb.dll", EntryPoint = "hb_detect_comb", CallingConvention = CallingConvention.Cdecl)]\r
-        public static extern int hb_detect_comb(ref hb_buffer_s buf, int width, int height, int color_equal,\r
-                                                int color_diff, int threshold, int prog_equal, int prog_diff,\r
-                                                int prog_threshold);\r
+        public static extern int hb_detect_comb(ref hb_buffer_s buf, int width, int height, int color_equal, int color_diff, int threshold, int prog_equal, int prog_diff, int prog_threshold);\r
 \r
         [DllImport("hb.dll", EntryPoint = "hb_get_preview_by_index", CallingConvention = CallingConvention.Cdecl)]\r
         public static extern void hb_get_preview_by_index(IntPtr hbHandle, int title_index, int picture, IntPtr buffer);\r
@@ -1152,11 +1187,8 @@ namespace HandBrake.Interop
         [DllImport("hb.dll", EntryPoint = "hb_set_size", CallingConvention = CallingConvention.Cdecl)]\r
         public static extern void hb_set_size(ref hb_job_s param0, double ratio, int pixels);\r
 \r
-        [DllImport("hb.dll", EntryPoint = "hb_set_anamorphic_size_by_index", CallingConvention = CallingConvention.Cdecl\r
-            )]\r
-        public static extern void hb_set_anamorphic_size_by_index(IntPtr hbHandle, int title_index, ref int output_width,\r
-                                                                  ref int output_height, ref int output_par_width,\r
-                                                                  ref int output_par_height);\r
+        [DllImport("hb.dll", EntryPoint = "hb_set_anamorphic_size_by_index", CallingConvention = CallingConvention.Cdecl)]\r
+        public static extern void hb_set_anamorphic_size_by_index(IntPtr hbHandle, int title_index, ref int output_width, ref int output_height, ref int output_par_width, ref int output_par_height);\r
 \r
         /// Return Type: void\r
         ///param0: hb_job_t*\r
@@ -1165,8 +1197,7 @@ namespace HandBrake.Interop
         ///output_par_width: int*\r
         ///output_par_height: int*\r
         [DllImport("hb.dll", EntryPoint = "hb_set_anamorphic_size", CallingConvention = CallingConvention.Cdecl)]\r
-        public static extern void hb_set_anamorphic_size(ref hb_job_s job, ref int output_width, ref int output_height,\r
-                                                         ref int output_par_width, ref int output_par_height);\r
+        public static extern void hb_set_anamorphic_size(ref hb_job_s job, ref int output_width, ref int output_height, ref int output_par_width, ref int output_par_height);\r
 \r
 \r
         /// Return Type: int\r
@@ -1182,8 +1213,7 @@ namespace HandBrake.Interop
         public static extern IntPtr hb_job(IntPtr hbHandle, int jobIndex);\r
 \r
         [DllImport("hb.dll", EntryPoint = "hb_set_chapter_name", CallingConvention = CallingConvention.Cdecl)]\r
-        public static extern void hb_set_chapter_name(IntPtr hbHandle, int title_index, int chapter_index,\r
-                                                      [In] [MarshalAs(UnmanagedType.LPStr)] string chapter_name);\r
+        public static extern void hb_set_chapter_name(IntPtr hbHandle, int title_index, int chapter_index, [In] [MarshalAs(UnmanagedType.LPStr)] string chapter_name);\r
 \r
         [DllImport("hb.dll", EntryPoint = "hb_set_job", CallingConvention = CallingConvention.Cdecl)]\r
         public static extern void hb_set_job(IntPtr hbHandle, int title_index, ref hb_job_s job);\r
@@ -1257,4 +1287,4 @@ namespace HandBrake.Interop
         [DllImport("hb.dll", EntryPoint = "hb_global_close", CallingConvention = CallingConvention.Cdecl)]\r
         public static extern void hb_global_close();\r
     }\r
-}
\ No newline at end of file
+}\r
index c845933..d53c688 100644 (file)
@@ -1,16 +1,9 @@
-// --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="InteropUtilities.cs" company="HandBrake Project (http://handbrake.fr)">\r
-//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
-// </copyright>\r
-// <summary>\r
-//   Helper utilities for native interop.\r
-// </summary>\r
-// --------------------------------------------------------------------------------------------------------------------\r
-\r
-namespace HandBrake.Interop\r
+namespace HandBrake.Interop\r
 {\r
     using System;\r
     using System.Collections.Generic;\r
+    using System.Linq;\r
+    using System.Text;\r
     using System.Runtime.InteropServices;\r
 \r
     /// <summary>\r
index f16f80c..609a4ec 100644 (file)
@@ -1,14 +1,10 @@
-// --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="Language.cs" company="HandBrake Project (http://handbrake.fr)">\r
-//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
-// </copyright>\r
-// <summary>\r
-//   Represents a language.\r
-// </summary>\r
-// --------------------------------------------------------------------------------------------------------------------\r
-\r
-namespace HandBrake.Interop\r
+namespace HandBrake.Interop\r
 {\r
+    using System;\r
+    using System.Collections.Generic;\r
+    using System.Linq;\r
+    using System.Text;\r
+\r
     /// <summary>\r
     /// Represents a language.\r
     /// </summary>\r
index 11e935e..0d45cc1 100644 (file)
@@ -1,15 +1,9 @@
-// --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="LanguageCodes.cs" company="HandBrake Project (http://handbrake.fr)">\r
-//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
-// </copyright>\r
-// <summary>\r
-//   Contains utilities for converting language codes.\r
-// </summary>\r
-// --------------------------------------------------------------------------------------------------------------------\r
-\r
-namespace HandBrake.Interop\r
+namespace HandBrake.Interop\r
 {\r
+    using System;\r
     using System.Collections.Generic;\r
+    using System.Linq;\r
+    using System.Text;\r
 \r
     /// <summary>\r
     /// Contains utilities for converting language codes.\r
index 81b77ed..a73b5ca 100644 (file)
@@ -1,16 +1,10 @@
-// --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="MessageLoggedEventArgs.cs" company="HandBrake Project (http://handbrake.fr)">\r
-//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
-// </copyright>\r
-// <summary>\r
-//   Defines the MessageLoggedEventArgs type.\r
-// </summary>\r
-// --------------------------------------------------------------------------------------------------------------------\r
+using System;\r
+using System.Collections.Generic;\r
+using System.Linq;\r
+using System.Text;\r
 \r
 namespace HandBrake.Interop\r
 {\r
-    using System;\r
-\r
     public class MessageLoggedEventArgs : EventArgs\r
     {\r
         public string Message { get; set; }\r
index e0a0806..1ba0e8e 100644 (file)
@@ -1,37 +1,15 @@
-// --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="Cropping.cs" company="HandBrake Project (http://handbrake.fr)">\r
-//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
-// </copyright>\r
-// <summary>\r
-//   Defines the Cropping type.\r
-// </summary>\r
-// --------------------------------------------------------------------------------------------------------------------\r
+using System;\r
+using System.Collections.Generic;\r
+using System.Linq;\r
+using System.Text;\r
 \r
-namespace HandBrake.Interop.Model\r
+namespace HandBrake.Interop\r
 {\r
-    /// <summary>\r
-    /// Cropping T B L R\r
-    /// </summary>\r
     public class Cropping\r
     {\r
-        /// <summary>\r
-        /// Gets or sets Top.\r
-        /// </summary>\r
         public int Top { get; set; }\r
-\r
-        /// <summary>\r
-        /// Gets or sets Bottom.\r
-        /// </summary>\r
         public int Bottom { get; set; }\r
-\r
-        /// <summary>\r
-        /// Gets or sets Left.\r
-        /// </summary>\r
         public int Left { get; set; }\r
-\r
-        /// <summary>\r
-        /// Gets or sets Right.\r
-        /// </summary>\r
         public int Right { get; set; }\r
     }\r
 }\r
index d454c6b..53058a9 100644 (file)
@@ -1,32 +1,14 @@
-// --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="EncodeJob.cs" company="HandBrake Project (http://handbrake.fr)">\r
-//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
-// </copyright>\r
-// <summary>\r
-//   Defines the EncodeJob type.\r
-// </summary>\r
-// --------------------------------------------------------------------------------------------------------------------\r
+using System;\r
+using System.Collections.Generic;\r
+using System.Linq;\r
+using System.Text;\r
+using System.Xml.Serialization;\r
 \r
-namespace HandBrake.Interop.Model\r
+namespace HandBrake.Interop\r
 {\r
-    using System;\r
-    using System.Collections.Generic;\r
-    using System.Xml.Serialization;\r
-    using Encoding;\r
-\r
-    /// <summary>\r
-    /// An Encode Job\r
-    /// </summary>\r
     public class EncodeJob\r
     {\r
-        /// <summary>\r
-        /// Gets or sets SourceType.\r
-        /// </summary>\r
         public SourceType SourceType { get; set; }\r
-\r
-        /// <summary>\r
-        /// Gets or sets SourcePath.\r
-        /// </summary>\r
         public string SourcePath { get; set; }\r
 \r
         /// <summary>\r
@@ -38,56 +20,25 @@ namespace HandBrake.Interop.Model
         /// Gets or sets the angle to encode. 0 for default, 1+ for specified angle.\r
         /// </summary>\r
         public int Angle { get; set; }\r
-\r
-        /// <summary>\r
-        /// Gets or sets ChapterStart.\r
-        /// </summary>\r
         public int ChapterStart { get; set; }\r
-\r
-        /// <summary>\r
-        /// Gets or sets ChapterEnd.\r
-        /// </summary>\r
         public int ChapterEnd { get; set; }\r
 \r
         /// <summary>\r
         /// Gets or sets the list of chosen audio tracks (1-based)\r
         /// </summary>\r
         public List<int> ChosenAudioTracks { get; set; }\r
-\r
-        /// <summary>\r
-        /// Gets or sets Subtitles.\r
-        /// </summary>\r
         public Subtitles Subtitles { get; set; }\r
-\r
-        /// <summary>\r
-        /// Gets or sets a value indicating whether UseDefaultChapterNames.\r
-        /// </summary>\r
         public bool UseDefaultChapterNames { get; set; }\r
-\r
-        /// <summary>\r
-        /// Gets or sets CustomChapterNames.\r
-        /// </summary>\r
         public List<string> CustomChapterNames { get; set; }\r
 \r
-        /// <summary>\r
-        /// Gets or sets OutputPath.\r
-        /// </summary>\r
         public string OutputPath { get; set; }\r
 \r
-        /// <summary>\r
-        /// Gets or sets EncodingProfile.\r
-        /// </summary>\r
         public EncodingProfile EncodingProfile { get; set; }\r
 \r
-        /// <summary>\r
-        /// The length of video to encode.\r
-        /// </summary>\r
+        // The length of video to encode.\r
         [XmlIgnore]\r
         public TimeSpan Length { get; set; }\r
 \r
-        /// <summary>\r
-        /// Gets or sets XmlLength.\r
-        /// </summary>\r
         [XmlElement("Length")]\r
         public string XmlLength\r
         {\r
@@ -95,12 +46,6 @@ namespace HandBrake.Interop.Model
             set { this.Length = TimeSpan.Parse(value); }\r
         }\r
 \r
-        /// <summary>\r
-        /// Clone the Encode Job\r
-        /// </summary>\r
-        /// <returns>\r
-        /// An EncodeJob Ojbect\r
-        /// </returns>\r
         public EncodeJob Clone()\r
         {\r
             EncodeJob clone = new EncodeJob\r
index 1a7302d..65a7f23 100644 (file)
@@ -1,17 +1,10 @@
-// --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="Anamorphic.cs" company="HandBrake Project (http://handbrake.fr)">\r
-//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
-// </copyright>\r
-// <summary>\r
-//   Defines the Anamorphic type.\r
-// </summary>\r
-// --------------------------------------------------------------------------------------------------------------------\r
+using System;\r
+using System.Collections.Generic;\r
+using System.Linq;\r
+using System.Text;\r
 \r
-namespace HandBrake.Interop.Model.Encoding\r
+namespace HandBrake.Interop\r
 {\r
-    /// <summary>\r
-    /// Anamorphic Modes\r
-    /// </summary>\r
     public enum Anamorphic\r
     {\r
         [DisplayString("None")]\r
index a9efed8..b4eee52 100644 (file)
@@ -1,16 +1,10 @@
-// --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="AudioEncoder.cs" company="HandBrake Project (http://handbrake.fr)">\r
-//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
-// </copyright>\r
-// <summary>\r
-//   Defines the AudioEncoder type.\r
-// </summary>\r
-// --------------------------------------------------------------------------------------------------------------------\r
-namespace HandBrake.Interop.Model.Encoding\r
+using System;\r
+using System.Collections.Generic;\r
+using System.Linq;\r
+using System.Text;\r
+\r
+namespace HandBrake.Interop\r
 {\r
-    /// <summary>\r
-    /// Audio Encoder\r
-    /// </summary>\r
     public enum AudioEncoder\r
     {\r
         [DisplayString("AAC (faac)")]\r
index a957e23..8ff112c 100644 (file)
@@ -1,47 +1,17 @@
-// --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="AudioEncoding.cs" company="HandBrake Project (http://handbrake.fr)">\r
-//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
-// </copyright>\r
-// <summary>\r
-//   Defines the AudioEncoding type.\r
-// </summary>\r
-// --------------------------------------------------------------------------------------------------------------------\r
+using System;\r
+using System.Collections.Generic;\r
+using System.Linq;\r
+using System.Text;\r
 \r
-namespace HandBrake.Interop.Model.Encoding\r
+namespace HandBrake.Interop\r
 {\r
-    /// <summary>\r
-    /// Audio Encoding\r
-    /// </summary>\r
     public class AudioEncoding\r
     {\r
-        /// <summary>\r
-        /// Gets or sets InputNumber.\r
-        /// </summary>\r
         public int InputNumber { get; set; }\r
-\r
-        /// <summary>\r
-        /// Gets or sets Encoder.\r
-        /// </summary>\r
         public AudioEncoder Encoder { get; set; }\r
-\r
-        /// <summary>\r
-        /// Gets or sets Bitrate.\r
-        /// </summary>\r
         public int Bitrate { get; set; }\r
-\r
-        /// <summary>\r
-        /// Gets or sets Mixdown.\r
-        /// </summary>\r
         public Mixdown Mixdown { get; set; }\r
-\r
-        /// <summary>\r
-        /// Gets or sets SampleRate.\r
-        /// </summary>\r
         public string SampleRate { get; set; }\r
-\r
-        /// <summary>\r
-        /// Gets or sets Drc.\r
-        /// </summary>\r
         public double Drc { get; set; }\r
     }\r
 }\r
index 966a2c1..9060b01 100644 (file)
@@ -1,17 +1,10 @@
-// --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="Decomb.cs" company="HandBrake Project (http://handbrake.fr)">\r
-//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
-// </copyright>\r
-// <summary>\r
-//   Defines the Decomb type.\r
-// </summary>\r
-// --------------------------------------------------------------------------------------------------------------------\r
+using System;\r
+using System.Collections.Generic;\r
+using System.Linq;\r
+using System.Text;\r
 \r
-namespace HandBrake.Interop.Model.Encoding\r
+namespace HandBrake.Interop\r
 {\r
-    /// <summary>\r
-    /// Decomb Mode. Off, Default or Custom\r
-    /// </summary>\r
     public enum Decomb\r
     {\r
         Off = 0,\r
index 1ef4acb..365f600 100644 (file)
@@ -1,17 +1,10 @@
-// --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="Deinterlace.cs" company="HandBrake Project (http://handbrake.fr)">\r
-//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
-// </copyright>\r
-// <summary>\r
-//   Defines the Deinterlace type.\r
-// </summary>\r
-// --------------------------------------------------------------------------------------------------------------------\r
+using System;\r
+using System.Collections.Generic;\r
+using System.Linq;\r
+using System.Text;\r
 \r
-namespace HandBrake.Interop.Model.Encoding\r
+namespace HandBrake.Interop\r
 {\r
-    /// <summary>\r
-    /// Delinterlace Mode\r
-    /// </summary>\r
     public enum Deinterlace\r
     {\r
         Off = 0,\r
index 526d37d..146cbfd 100644 (file)
@@ -1,17 +1,10 @@
-// --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="Denoise.cs" company="HandBrake Project (http://handbrake.fr)">\r
-//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
-// </copyright>\r
-// <summary>\r
-//   Defines the Denoise type.\r
-// </summary>\r
-// --------------------------------------------------------------------------------------------------------------------\r
+using System;\r
+using System.Collections.Generic;\r
+using System.Linq;\r
+using System.Text;\r
 \r
-namespace HandBrake.Interop.Model.Encoding\r
+namespace HandBrake.Interop\r
 {\r
-    /// <summary>\r
-    /// Denose Mode\r
-    /// </summary>\r
     public enum Denoise\r
     {\r
         Off = 0,\r
index 7380a94..028abf4 100644 (file)
@@ -1,17 +1,10 @@
-// --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="Detelecine.cs" company="HandBrake Project (http://handbrake.fr)">\r
-//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
-// </copyright>\r
-// <summary>\r
-//   Defines the Detelecine type.\r
-// </summary>\r
-// --------------------------------------------------------------------------------------------------------------------\r
+using System;\r
+using System.Collections.Generic;\r
+using System.Linq;\r
+using System.Text;\r
 \r
-namespace HandBrake.Interop.Model.Encoding\r
+namespace HandBrake.Interop\r
 {\r
-    /// <summary>\r
-    /// Detelecine Modes\r
-    /// </summary>\r
     public enum Detelecine\r
     {\r
         Off = 0,\r
index e7d4e81..af287a7 100644 (file)
@@ -1,18 +1,10 @@
-// --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="EncodingProfile.cs" company="HandBrake Project (http://handbrake.fr)">\r
-//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
-// </copyright>\r
-// <summary>\r
-//   Defines the EncodingProfile type.\r
-// </summary>\r
+using System;\r
+using System.Collections.Generic;\r
+using System.Linq;\r
+using System.Text;\r
 \r
-namespace HandBrake.Interop.Model.Encoding\r
+namespace HandBrake.Interop\r
 {\r
-    using System.Collections.Generic;\r
-\r
-    /// <summary>\r
-    /// Encode Profiles\r
-    /// </summary>\r
     public class EncodingProfile\r
     {\r
         public EncodingProfile()\r
@@ -61,15 +53,10 @@ namespace HandBrake.Interop.Model.Encoding
         public bool TwoPass { get; set; }\r
         public bool TurboFirstPass { get; set; }\r
         public double Framerate { get; set; }\r
+        public bool PeakFramerate { get; set; }\r
 \r
         public List<AudioEncoding> AudioEncodings { get; set; }\r
 \r
-        /// <summary>\r
-        /// Clone this encode profile\r
-        /// </summary>\r
-        /// <returns>\r
-        /// An Encode Profile Object\r
-        /// </returns>\r
         public EncodingProfile Clone()\r
         {\r
             EncodingProfile profile = new EncodingProfile\r
@@ -115,6 +102,7 @@ namespace HandBrake.Interop.Model.Encoding
                 TwoPass = this.TwoPass,\r
                 TurboFirstPass = this.TurboFirstPass,\r
                 Framerate = this.Framerate,\r
+                PeakFramerate = this.PeakFramerate,\r
 \r
                 AudioEncodings = new List<AudioEncoding>(this.AudioEncodings)\r
             };\r
index a4df6a1..2049d09 100644 (file)
@@ -1,17 +1,10 @@
-// --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="Mixdown.cs" company="HandBrake Project (http://handbrake.fr)">\r
-//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
-// </copyright>\r
-// <summary>\r
-//   Defines the Mixdown type.\r
-// </summary>\r
-// --------------------------------------------------------------------------------------------------------------------\r
+using System;\r
+using System.Collections.Generic;\r
+using System.Linq;\r
+using System.Text;\r
 \r
-namespace HandBrake.Interop.Model.Encoding\r
+namespace HandBrake.Interop\r
 {\r
-    /// <summary>\r
-    /// The Mixdown mode\r
-    /// </summary>\r
     public enum Mixdown\r
     {\r
         [DisplayString("Dolby Pro Logic II")]\r
index c3e3524..bcf7095 100644 (file)
@@ -1,17 +1,10 @@
-// --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="OutputExtension.cs" company="HandBrake Project (http://handbrake.fr)">\r
-//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
-// </copyright>\r
-// <summary>\r
-//   Defines the OutputExtension type.\r
-// </summary>\r
-// --------------------------------------------------------------------------------------------------------------------\r
+using System;\r
+using System.Collections.Generic;\r
+using System.Linq;\r
+using System.Text;\r
 \r
-namespace HandBrake.Interop.Model.Encoding\r
+namespace HandBrake.Interop\r
 {\r
-    /// <summary>\r
-    /// Output File Extension\r
-    /// </summary>\r
     public enum OutputExtension\r
     {\r
         Mp4,\r
index e0b0e8d..52549e7 100644 (file)
@@ -1,17 +1,11 @@
-// --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="OutputFormat.cs" company="HandBrake Project (http://handbrake.fr)">\r
-//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
-// </copyright>\r
-// <summary>\r
-//   Defines the OutputFormat type.\r
-// </summary>\r
-// --------------------------------------------------------------------------------------------------------------------\r
+using System;\r
+using System.Collections.Generic;\r
+using System.Linq;\r
+using System.Text;\r
+using System.ComponentModel;\r
 \r
-namespace HandBrake.Interop.Model.Encoding\r
+namespace HandBrake.Interop\r
 {\r
-    /// <summary>\r
-    /// Output File Format\r
-    /// </summary>\r
     public enum OutputFormat\r
     {\r
         [DisplayString("MP4")]\r
index b111da8..6c39e54 100644 (file)
@@ -1,17 +1,10 @@
-// --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="VideoEncodeRateType.cs" company="HandBrake Project (http://handbrake.fr)">\r
-//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
-// </copyright>\r
-// <summary>\r
-//   Defines the VideoEncodeRateType type.\r
-// </summary>\r
-// --------------------------------------------------------------------------------------------------------------------\r
+using System;\r
+using System.Collections.Generic;\r
+using System.Linq;\r
+using System.Text;\r
 \r
-namespace HandBrake.Interop.Model.Encoding\r
+namespace HandBrake.Interop\r
 {\r
-    /// <summary>\r
-    /// Video Encoder Encode Mode\r
-    /// </summary>\r
     public enum VideoEncodeRateType\r
     {\r
         TargetSize = 0,\r
index b5c2304..912117b 100644 (file)
@@ -1,17 +1,10 @@
-// --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="VideoEncoder.cs" company="HandBrake Project (http://handbrake.fr)">\r
-//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
-// </copyright>\r
-// <summary>\r
-//   Defines the VideoEncoder type.\r
-// </summary>\r
-// --------------------------------------------------------------------------------------------------------------------\r
+using System;\r
+using System.Collections.Generic;\r
+using System.Linq;\r
+using System.Text;\r
 \r
-namespace HandBrake.Interop.Model.Encoding\r
+namespace HandBrake.Interop\r
 {\r
-    /// <summary>\r
-    /// Video Encoder\r
-    /// </summary>\r
     public enum VideoEncoder\r
     {\r
         [DisplayString("H.264 (x264)")]\r
diff --git a/win/C#/interop/Model/Size.cs b/win/C#/interop/Model/Size.cs
new file mode 100644 (file)
index 0000000..f94cbd2
--- /dev/null
@@ -0,0 +1,19 @@
+using System;\r
+using System.Collections.Generic;\r
+using System.Linq;\r
+using System.Text;\r
+\r
+namespace HandBrake.Interop\r
+{\r
+    public class Size\r
+    {\r
+        public Size(int width, int height)\r
+        {\r
+            this.Width = width;\r
+            this.Height = height;\r
+        }\r
+\r
+        public int Width { get; set; }\r
+        public int Height { get; set; }\r
+    }\r
+}\r
index b902120..edfb68b 100644 (file)
@@ -1,45 +1,20 @@
-// --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="SourceSubtitle.cs" company="HandBrake Project (http://handbrake.fr)">\r
-//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
-// </copyright>\r
-// <summary>\r
-//   Defines the SourceSubtitle type.\r
-// </summary>\r
-// --------------------------------------------------------------------------------------------------------------------\r
+using System;\r
+using System.Collections.Generic;\r
+using System.Linq;\r
+using System.Text;\r
 \r
-namespace HandBrake.Interop.Model\r
+namespace HandBrake.Interop\r
 {\r
-    /// <summary>\r
-    /// A Source Subtitle\r
-    /// </summary>\r
     public class SourceSubtitle\r
     {\r
         /// <summary>\r
         /// Gets or sets the 1-based subtitle track number. 0 means foriegn audio search.\r
         /// </summary>\r
         public int TrackNumber { get; set; }\r
-\r
-        /// <summary>\r
-        /// Gets or sets a value indicating whether the subtitle is Default.\r
-        /// </summary>\r
         public bool Default { get; set; }\r
-\r
-        /// <summary>\r
-        /// Gets or sets a value indicating whether the subtitle is Forced.\r
-        /// </summary>\r
         public bool Forced { get; set; }\r
-\r
-        /// <summary>\r
-        /// Gets or sets a value indicating whether the subtitle is BurnedIn.\r
-        /// </summary>\r
         public bool BurnedIn { get; set; }\r
 \r
-        /// <summary>\r
-        /// Clone the Source Subtitle\r
-        /// </summary>\r
-        /// <returns>\r
-        /// A Source Subtitle\r
-        /// </returns>\r
         public SourceSubtitle Clone()\r
         {\r
             return new SourceSubtitle\r
index f15639c..1a53aab 100644 (file)
@@ -1,37 +1,10 @@
-// --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="SourceType.cs" company="HandBrake Project (http://handbrake.fr)">\r
-//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
-// </copyright>\r
-// <summary>\r
-//   Defines the SourceType type.\r
-// </summary>\r
-// --------------------------------------------------------------------------------------------------------------------\r
-\r
-namespace HandBrake.Interop.Model\r
+namespace HandBrake.Interop\r
 {\r
-    /// <summary>\r
-    /// The Source Type. (File, Folder, DVD)\r
-    /// </summary>\r
     public enum SourceType\r
     {\r
-        /// <summary>\r
-        /// None\r
-        /// </summary>\r
         None = 0,\r
-\r
-        /// <summary>\r
-        /// File\r
-        /// </summary>\r
         File,\r
-\r
-        /// <summary>\r
-        /// Video Folder\r
-        /// </summary>\r
         VideoFolder,\r
-\r
-        /// <summary>\r
-        /// DVD\r
-        /// </summary>\r
         Dvd\r
     }\r
 }
\ No newline at end of file
index e6cb2f1..199fe6a 100644 (file)
@@ -1,50 +1,18 @@
-// --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="SrtSubtitle.cs" company="HandBrake Project (http://handbrake.fr)">\r
-//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
-// </copyright>\r
-// <summary>\r
-//   Defines the SrtSubtitle type.\r
-// </summary>\r
-// --------------------------------------------------------------------------------------------------------------------\r
+using System;\r
+using System.Collections.Generic;\r
+using System.Linq;\r
+using System.Text;\r
 \r
-namespace HandBrake.Interop.Model\r
+namespace HandBrake.Interop\r
 {\r
-    /// <summary>\r
-    /// A Srt Subtitle\r
-    /// </summary>\r
     public class SrtSubtitle\r
     {\r
-        /// <summary>\r
-        /// Gets or sets a value indicating whether Default.\r
-        /// </summary>\r
         public bool Default { get; set; }\r
-\r
-        /// <summary>\r
-        /// Gets or sets FileName.\r
-        /// </summary>\r
         public string FileName { get; set; }\r
-\r
-        /// <summary>\r
-        /// Gets or sets LanguageCode.\r
-        /// </summary>\r
         public string LanguageCode { get; set; }\r
-\r
-        /// <summary>\r
-        /// Gets or sets CharacterCode.\r
-        /// </summary>\r
         public string CharacterCode { get; set; }\r
-\r
-        /// <summary>\r
-        /// Gets or sets Offset.\r
-        /// </summary>\r
         public int Offset { get; set; }\r
 \r
-        /// <summary>\r
-        /// Close the SRT Subtitle object\r
-        /// </summary>\r
-        /// <returns>\r
-        /// a SrtSubtitle\r
-        /// </returns>\r
         public SrtSubtitle Clone()\r
         {\r
             return new SrtSubtitle\r
index ace4702..1fab735 100644 (file)
@@ -1,29 +1,13 @@
-// --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="Subtitles.cs" company="HandBrake Project (http://handbrake.fr)">\r
-//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
-// </copyright>\r
-// <summary>\r
-//   Defines the Subtitles type.\r
-// </summary>\r
-// --------------------------------------------------------------------------------------------------------------------\r
+using System;\r
+using System.Collections.Generic;\r
+using System.Linq;\r
+using System.Text;\r
 \r
-namespace HandBrake.Interop.Model\r
+namespace HandBrake.Interop\r
 {\r
-    using System.Collections.Generic;\r
-\r
-    /// <summary>\r
-    /// Subtitles\r
-    /// </summary>\r
     public class Subtitles\r
     {\r
-        /// <summary>\r
-        /// Gets or sets SrtSubtitles.\r
-        /// </summary>\r
         public List<SrtSubtitle> SrtSubtitles { get; set; }\r
-\r
-        /// <summary>\r
-        /// Gets or sets SourceSubtitles.\r
-        /// </summary>\r
         public List<SourceSubtitle> SourceSubtitles { get; set; }\r
     }\r
 }\r
index 934803b..c16c099 100644 (file)
@@ -1,16 +1,9 @@
-// --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="NativeList.cs" company="HandBrake Project (http://handbrake.fr)">\r
-//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
-// </copyright>\r
-// <summary>\r
-//   Represents a HandBrake style native list.\r
-// </summary>\r
-// --------------------------------------------------------------------------------------------------------------------\r
-\r
-namespace HandBrake.Interop\r
+namespace HandBrake.Interop\r
 {\r
     using System;\r
     using System.Collections.Generic;\r
+    using System.Linq;\r
+    using System.Text;\r
 \r
     /// <summary>\r
     /// Represents a HandBrake style native list.\r
index 7e4107e..228f27c 100644 (file)
@@ -8,9 +8,9 @@ using System.Runtime.InteropServices;
 [assembly: AssemblyTitle("HandBrakeInterop")]\r
 [assembly: AssemblyDescription("")]\r
 [assembly: AssemblyConfiguration("")]\r
-[assembly: AssemblyCompany("HandBrake Team")]\r
+[assembly: AssemblyCompany("Microsoft")]\r
 [assembly: AssemblyProduct("HandBrakeInterop")]\r
-[assembly: AssemblyCopyright("Copyright © HandBrake Team")]\r
+[assembly: AssemblyCopyright("Copyright © Microsoft 2010")]\r
 [assembly: AssemblyTrademark("")]\r
 [assembly: AssemblyCulture("")]\r
 \r
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
 // You can specify all the values or you can default the Build and Revision Numbers \r
 // by using the '*' as shown below:\r
 // [assembly: AssemblyVersion("1.0.*")]\r
-[assembly: AssemblyVersion("1.3.0.0")]\r
-[assembly: AssemblyFileVersion("1.3.0.0")]\r
+[assembly: AssemblyVersion("1.5.0.0")]\r
+[assembly: AssemblyFileVersion("1.5.0.0")]\r
index 2087e1d..f7e3a0f 100644 (file)
@@ -1,29 +1,13 @@
-// --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="ScanProgressEventArgs.cs" company="HandBrake Project (http://handbrake.fr)">\r
-//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
-// </copyright>\r
-// <summary>\r
-//   Defines the ScanProgressEventArgs type.\r
-// </summary>\r
-// --------------------------------------------------------------------------------------------------------------------\r
+using System;\r
+using System.Collections.Generic;\r
+using System.Linq;\r
+using System.Text;\r
 \r
 namespace HandBrake.Interop\r
 {\r
-    using System;\r
-\r
-    /// <summary>\r
-    /// Scan Progress Event Arugments\r
-    /// </summary>\r
     public class ScanProgressEventArgs : EventArgs\r
     {\r
-        /// <summary>\r
-        /// Gets or sets CurrentTitle.\r
-        /// </summary>\r
         public int CurrentTitle { get; set; }\r
-\r
-        /// <summary>\r
-        /// Gets or sets Titles.\r
-        /// </summary>\r
         public int Titles { get; set; }\r
     }\r
 }\r
index 76de1b6..735ddd9 100644 (file)
@@ -1,13 +1,15 @@
-// --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="AudioTrack.cs" company="HandBrake Project (http://handbrake.fr)">\r
-//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
-// </copyright>\r
-// <summary>\r
-//   An object represending an AudioTrack associated with a Title, in a DVD\r
-// </summary>\r
-// --------------------------------------------------------------------------------------------------------------------\r
+/*  AudioTrack.cs $\r
+       \r
+          This file is part of the HandBrake source code.\r
+          Homepage: <http://handbrake.fr>.\r
+          It may be used under the terms of the GNU General Public License. */\r
 \r
-namespace HandBrake.Interop.SourceData\r
+using System;\r
+using System.Collections.Generic;\r
+using System.IO;\r
+using System.Text.RegularExpressions;\r
+\r
+namespace HandBrake.SourceData\r
 {\r
     /// <summary>\r
     /// An object represending an AudioTrack associated with a Title, in a DVD\r
@@ -15,38 +17,29 @@ namespace HandBrake.Interop.SourceData
     public class AudioTrack\r
     {\r
         /// <summary>\r
-        /// Gets or sets the track number of this Audio Track\r
+        /// The track number of this Audio Track\r
         /// </summary>\r
         public int TrackNumber { get; set; }\r
 \r
         /// <summary>\r
-        /// Gets or sets the language (if detected) of this Audio Track\r
+        /// The language (if detected) of this Audio Track\r
         /// </summary>\r
         public string Language { get; set; }\r
 \r
-        /// <summary>\r
-        /// Gets or sets LanguageCode.\r
-        /// </summary>\r
         public string LanguageCode { get; set; }\r
 \r
-        /// <summary>\r
-        /// Gets or sets Description.\r
-        /// </summary>\r
         public string Description { get; set; }\r
 \r
         /// <summary>\r
-        /// Gets or sets the frequency (in MHz) of this Audio Track\r
+        /// The frequency (in MHz) of this Audio Track\r
         /// </summary>\r
         public int SampleRate { get; set; }\r
 \r
         /// <summary>\r
-        /// Gets or sets the bitrate (in kbps) of this Audio Track\r
+        /// The bitrate (in kbps) of this Audio Track\r
         /// </summary>\r
         public int Bitrate { get; set; }\r
 \r
-        /// <summary>\r
-        /// Gets Display.\r
-        /// </summary>\r
         public string Display\r
         {\r
             get\r
@@ -55,9 +48,6 @@ namespace HandBrake.Interop.SourceData
             }\r
         }\r
 \r
-        /// <summary>\r
-        /// Gets NoTrackDisplay.\r
-        /// </summary>\r
         public string NoTrackDisplay\r
         {\r
             get\r
@@ -75,18 +65,16 @@ namespace HandBrake.Interop.SourceData
             return this.GetDisplayString(true);\r
         }\r
 \r
-        /// <summary>\r
-        /// Get the Display String\r
-        /// </summary>\r
-        /// <param name="includeTrackNumber">\r
-        /// The include track number.\r
-        /// </param>\r
-        /// <returns>\r
-        /// A String\r
-        /// </returns>\r
         private string GetDisplayString(bool includeTrackNumber)\r
         {\r
-            return includeTrackNumber ? (this.TrackNumber + " " + this.Description) : this.Description;\r
+            if (includeTrackNumber)\r
+            {\r
+                return this.TrackNumber + " " + this.Description;\r
+            }\r
+            else\r
+            {\r
+                return this.Description;\r
+            }\r
         }\r
     }\r
 }
\ No newline at end of file
index 0c3077f..8e41282 100644 (file)
@@ -1,28 +1,28 @@
-// --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="Chapter.cs" company="HandBrake Project (http://handbrake.fr)">\r
-//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
-// </copyright>\r
-// <summary>\r
-//   An object representing a Chapter aosciated with a Title, in a DVD\r
-// </summary>\r
-// --------------------------------------------------------------------------------------------------------------------\r
+/*  Chapter.cs $\r
+       \r
+          This file is part of the HandBrake source code.\r
+          Homepage: <http://handbrake.fr>.\r
+          It may be used under the terms of the GNU General Public License. */\r
 \r
-namespace HandBrake.Interop.SourceData\r
-{\r
-    using System;\r
+using System;\r
+using System.Collections.Generic;\r
+using System.IO;\r
+using System.Text.RegularExpressions;\r
 \r
+namespace HandBrake.SourceData\r
+{\r
     /// <summary>\r
     /// An object representing a Chapter aosciated with a Title, in a DVD\r
     /// </summary>\r
     public class Chapter\r
     {\r
         /// <summary>\r
-        /// Gets or sets the number of this Chapter, in regards to its parent Title\r
+        /// The number of this Chapter, in regards to its parent Title\r
         /// </summary>\r
         public int ChapterNumber { get; set; }\r
 \r
         /// <summary>\r
-        /// Gets or sets the length in time this Chapter spans\r
+        /// The length in time this Chapter spans\r
         /// </summary>\r
         public TimeSpan Duration { get; set; }\r
 \r
index f460b16..bf5d4e5 100644 (file)
@@ -1,13 +1,14 @@
-// --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="Subtitle.cs" company="HandBrake Project (http://handbrake.fr)">\r
-//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
-// </copyright>\r
-// <summary>\r
-//   An object that represents a subtitle associated with a Title, in a DVD\r
-// </summary>\r
-// --------------------------------------------------------------------------------------------------------------------\r
-\r
-namespace HandBrake.Interop.SourceData\r
+/*  Subtitle.cs $\r
+       \r
+          This file is part of the HandBrake source code.\r
+          Homepage: <http://handbrake.fr>.\r
+          It may be used under the terms of the GNU General Public License. */\r
+\r
+using System.Collections.Generic;\r
+using System.IO;\r
+using System.Text.RegularExpressions;\r
+\r
+namespace HandBrake.SourceData\r
 {\r
     /// <summary>\r
     /// An object that represents a subtitle associated with a Title, in a DVD\r
@@ -15,33 +16,37 @@ namespace HandBrake.Interop.SourceData
     public class Subtitle\r
     {\r
         /// <summary>\r
-        /// Gets or sets the track number of this Subtitle\r
+        /// The track number of this Subtitle\r
         /// </summary>\r
         public int TrackNumber { get; set; }\r
 \r
         /// <summary>\r
-        /// Gets or sets the language (if detected) of this Subtitle\r
+        /// The language (if detected) of this Subtitle\r
         /// </summary>\r
         public string Language { get; set; }\r
 \r
         /// <summary>\r
-        /// Gets or sets Langauage Code\r
+        /// Langauage Code\r
         /// </summary>\r
         public string LanguageCode { get; set; }\r
 \r
-        /// <summary>\r
-        /// Gets or sets SubtitleType.\r
-        /// </summary>\r
         public SubtitleType SubtitleType { get; set; }\r
 \r
         /// <summary>\r
-        /// Gets Subtitle Type\r
+        /// Subtitle Type\r
         /// </summary>\r
         public string TypeString\r
         {\r
             get\r
             {\r
-                return this.SubtitleType == SubtitleType.Picture ? "Bitmap" : "Text";\r
+                if (this.SubtitleType == SubtitleType.Picture)\r
+                {\r
+                    return "Bitmap";\r
+                }\r
+                else\r
+                {\r
+                    return "Text";\r
+                }\r
             }\r
         }\r
 \r
@@ -53,5 +58,13 @@ namespace HandBrake.Interop.SourceData
         {\r
             return string.Format("{0} {1} ({2})", this.TrackNumber, this.Language, this.TypeString);\r
         }\r
+\r
+        public string Display\r
+        {\r
+            get\r
+            {\r
+                return this.ToString();\r
+            }\r
+        }\r
     }\r
 }
\ No newline at end of file
index 5bbe5ab..68904fe 100644 (file)
@@ -1,29 +1,13 @@
-// --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="SubtitleType.cs" company="HandBrake Project (http://handbrake.fr)">\r
-//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
-// </copyright>\r
-// <summary>\r
-//   Defines the SubtitleType type.\r
-// </summary>\r
-// --------------------------------------------------------------------------------------------------------------------\r
+using System;\r
+using System.Collections.Generic;\r
+using System.Linq;\r
+using System.Text;\r
 \r
-namespace HandBrake.Interop.SourceData\r
+namespace HandBrake.SourceData\r
 {\r
-    /// <summary>\r
-    /// Subtitle Type. \r
-    /// 0: Picture\r
-    /// 1: Text\r
-    /// </summary>\r
     public enum SubtitleType\r
     {\r
-        /// <summary>\r
-        /// Picture Subtitle\r
-        /// </summary>\r
         Picture,\r
-\r
-        /// <summary>\r
-        /// Text Subtitle\r
-        /// </summary>\r
         Text\r
     }\r
 }\r
index 0499779..8d69494 100644 (file)
@@ -1,82 +1,91 @@
-// --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="Title.cs" company="HandBrake Project (http://handbrake.fr)">\r
-//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
-// </copyright>\r
-// <summary>\r
-//   An object that represents a single Title of a DVD\r
-// </summary>\r
-// --------------------------------------------------------------------------------------------------------------------\r
+/*  Title.cs $\r
+       \r
+          This file is part of the HandBrake source code.\r
+          Homepage: <http://handbrake.fr>.\r
+          It may be used under the terms of the GNU General Public License. */\r
 \r
-using System.Drawing;\r
+using System;\r
+using System.Collections.Generic;\r
+using System.Globalization;\r
+using System.IO;\r
+using System.Text.RegularExpressions;\r
+using HandBrake.Interop;\r
 \r
-namespace HandBrake.Interop.SourceData\r
+namespace HandBrake.SourceData\r
 {\r
-    using System;\r
-    using System.Collections.Generic;\r
-    using Model;\r
-\r
     /// <summary>\r
     /// An object that represents a single Title of a DVD\r
     /// </summary>\r
     public class Title\r
     {\r
+        private static readonly CultureInfo Culture = new CultureInfo("en-US", false);\r
+        private readonly List<AudioTrack> audioTracks;\r
+        private readonly List<Chapter> chapters;\r
+        private readonly List<Subtitle> subtitles;\r
+        \r
         /// <summary>\r
-        /// Initializes a new instance of the <see cref="Title"/> class. \r
+        /// The constructor for this object\r
         /// </summary>\r
         public Title()\r
         {\r
-            this.AudioTracks = new List<AudioTrack>();\r
-            this.Chapters = new List<Chapter>();\r
-            this.Subtitles = new List<Subtitle>();\r
+            this.audioTracks = new List<AudioTrack>();\r
+            this.chapters = new List<Chapter>();\r
+            this.subtitles = new List<Subtitle>();\r
         }\r
 \r
         /// <summary>\r
-        /// Gets Collection of chapters in this Title\r
+        /// Collection of chapters in this Title\r
         /// </summary>\r
-        public List<Chapter> Chapters { get; private set; }\r
+        public List<Chapter> Chapters\r
+        {\r
+            get { return this.chapters; }\r
+        }\r
 \r
         /// <summary>\r
-        /// Gets Collection of audio tracks associated with this Title\r
+        /// Collection of audio tracks associated with this Title\r
         /// </summary>\r
-        public List<AudioTrack> AudioTracks { get; private set; }\r
+        public List<AudioTrack> AudioTracks\r
+        {\r
+            get { return this.audioTracks; }\r
+        }\r
 \r
         /// <summary>\r
-        /// Gets Collection of subtitles associated with this Title\r
+        /// Collection of subtitles associated with this Title\r
         /// </summary>\r
-        public List<Subtitle> Subtitles { get; private set; }\r
+        public List<Subtitle> Subtitles\r
+        {\r
+            get { return this.subtitles; }\r
+        }\r
 \r
         /// <summary>\r
-        /// Gets or sets The track number of this Title (1-based).\r
+        /// The track number of this Title (1-based).\r
         /// </summary>\r
         public int TitleNumber { get; set; }\r
 \r
         /// <summary>\r
-        /// Gets or sets The length in time of this Title\r
+        /// The length in time of this Title\r
         /// </summary>\r
         public TimeSpan Duration { get; set; }\r
 \r
         /// <summary>\r
-        /// Gets or sets The resolution (width/height) of this Title\r
+        /// The resolution (width/height) of this Title\r
         /// </summary>\r
         public Size Resolution { get; set; }\r
 \r
         /// <summary>\r
-        /// Gets or sets The aspect ratio of this Title\r
+        /// The aspect ratio of this Title\r
         /// </summary>\r
         public double AspectRatio { get; set; }\r
 \r
-        /// <summary>\r
-        /// Gets or sets AngleCount.\r
-        /// </summary>\r
         public int AngleCount { get; set; }\r
 \r
         /// <summary>\r
-        /// Gets or sets Par Value\r
+        /// Par Value\r
         /// </summary>\r
         public Size ParVal { get; set; }\r
 \r
         /// <summary>\r
-        /// Gets or sets the automatically detected crop region for this Title.\r
+        /// The automatically detected crop region for this Title.\r
         /// This is an int array with 4 items in it as so:\r
         /// 0: \r
         /// 1: \r
@@ -84,17 +93,6 @@ namespace HandBrake.Interop.SourceData
         /// 3: \r
         /// </summary>\r
         public Cropping AutoCropDimensions { get; set; }\r
-\r
-        /// <summary>\r
-        /// Gets Display.\r
-        /// </summary>\r
-        public string Display\r
-        {\r
-            get\r
-            {\r
-                return this.ToString();\r
-            }\r
-        }\r
   \r
         /// <summary>\r
         /// Override of the ToString method to provide an easy way to use this object in the UI\r
@@ -105,5 +103,13 @@ namespace HandBrake.Interop.SourceData
             return string.Format("{0} ({1:00}:{2:00}:{3:00})", this.TitleNumber, this.Duration.Hours,\r
                                  this.Duration.Minutes, this.Duration.Seconds);\r
         }\r
+\r
+        public string Display\r
+        {\r
+            get\r
+            {\r
+                return this.ToString();\r
+            }\r
+        }\r
     }\r
 }
\ No newline at end of file
index 62958a8..01c0c59 100644 (file)
Binary files a/win/C#/libraries/Growl.Connector.dll and b/win/C#/libraries/Growl.Connector.dll differ
index 06429c0..ca1545c 100644 (file)
Binary files a/win/C#/libraries/Growl.CoreLibrary.dll and b/win/C#/libraries/Growl.CoreLibrary.dll differ