OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sun, 6 Jun 2010 14:14:19 +0000 (14:14 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sun, 6 Jun 2010 14:14:19 +0000 (14:14 +0000)
- Some changes / improvements to the current models / parsing models.

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

win/C#/Controls/PictureSettings.cs
win/C#/HandBrakeCS.csproj
win/C#/Model/Cropping.cs [new file with mode: 0644]
win/C#/Model/SubtitleType.cs [new file with mode: 0644]
win/C#/Parsing/AudioTrack.cs
win/C#/Parsing/Chapter.cs
win/C#/Parsing/Subtitle.cs
win/C#/Parsing/Title.cs
win/C#/Settings.StyleCop
win/C#/frmMain.cs

index b9a0bf0..333bec3 100644 (file)
@@ -97,10 +97,10 @@ namespace Handbrake.Controls
             // Set the Recommended Cropping values, but only if a preset doesn't have hard set picture settings.\r
             if ((CurrentlySelectedPreset != null && CurrentlySelectedPreset.PictureSettings == false) || CurrentlySelectedPreset == null)\r
             {\r
-                crop_top.Value = GetCropMod2Clean(sourceTitle.AutoCropDimensions[0]);\r
-                crop_bottom.Value = GetCropMod2Clean(sourceTitle.AutoCropDimensions[1]);\r
-                crop_left.Value = GetCropMod2Clean(sourceTitle.AutoCropDimensions[2]);\r
-                crop_right.Value = GetCropMod2Clean(sourceTitle.AutoCropDimensions[3]);\r
+                crop_top.Value = GetCropMod2Clean(sourceTitle.AutoCropDimensions.Top);\r
+                crop_bottom.Value = GetCropMod2Clean(sourceTitle.AutoCropDimensions.Bottom);\r
+                crop_left.Value = GetCropMod2Clean(sourceTitle.AutoCropDimensions.Left);\r
+                crop_right.Value = GetCropMod2Clean(sourceTitle.AutoCropDimensions.Right);\r
             }\r
 \r
             SetPresetCropWarningLabel(CurrentlySelectedPreset);\r
@@ -424,10 +424,10 @@ namespace Handbrake.Controls
 \r
             if (Source != null)\r
             {\r
-                crop_top.Value = Source.AutoCropDimensions[0];\r
-                crop_bottom.Value = Source.AutoCropDimensions[1];\r
-                crop_left.Value = Source.AutoCropDimensions[2];\r
-                crop_right.Value = Source.AutoCropDimensions[3];\r
+                crop_top.Value = Source.AutoCropDimensions.Top;\r
+                crop_bottom.Value = Source.AutoCropDimensions.Bottom;\r
+                crop_left.Value = Source.AutoCropDimensions.Left;\r
+                crop_right.Value = Source.AutoCropDimensions.Right;\r
             }\r
         }\r
 \r
index 98c9d23..6ba8d14 100644 (file)
       <HintPath>libraries\Growl.CoreLibrary.dll</HintPath>\r
       <Private>True</Private>\r
     </Reference>\r
+    <Reference Include="HandBrakeInterop, Version=1.3.0.0, Culture=neutral, processorArchitecture=x86">\r
+      <SpecificVersion>False</SpecificVersion>\r
+      <HintPath>libraries\HandBrakeInterop.dll</HintPath>\r
+    </Reference>\r
     <Reference Include="PresentationCore">\r
       <RequiredTargetFramework>3.0</RequiredTargetFramework>\r
     </Reference>\r
       <DependentUpon>frmExceptionWindow.cs</DependentUpon>\r
     </Compile>\r
     <Compile Include="Model\ActivityLogMode.cs" />\r
+    <Compile Include="Model\Cropping.cs" />\r
+    <Compile Include="Model\SubtitleType.cs" />\r
     <Compile Include="Properties\AssemblyInfo.cs" />\r
     <Compile Include="Services\Encode.cs" />\r
     <Compile Include="frmPreview.cs">\r
diff --git a/win/C#/Model/Cropping.cs b/win/C#/Model/Cropping.cs
new file mode 100644 (file)
index 0000000..63a84af
--- /dev/null
@@ -0,0 +1,56 @@
+/*  Cropping.cs $\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.Model\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
+        /// <summary>\r
+        /// Create a cropping object\r
+        /// </summary>\r
+        /// <param name="top">\r
+        /// The top.\r
+        /// </param>\r
+        /// <param name="bottom">\r
+        /// The bottom.\r
+        /// </param>\r
+        /// <param name="left">\r
+        /// The left.\r
+        /// </param>\r
+        /// <param name="right">\r
+        /// The right.\r
+        /// </param>\r
+        /// <returns>\r
+        /// A Cropping object\r
+        /// </returns>\r
+        public static Cropping CreateCroppingObject(int top, int bottom, int left, int right)\r
+        {\r
+            return new Cropping { Top = top, Bottom = bottom, Left = left, Right = right };\r
+        }\r
+    }\r
+}\r
diff --git a/win/C#/Model/SubtitleType.cs b/win/C#/Model/SubtitleType.cs
new file mode 100644 (file)
index 0000000..a9c8609
--- /dev/null
@@ -0,0 +1,18 @@
+/*  SubtitleType.cs $\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.Model\r
+{\r
+    /// <summary>\r
+    /// Subtitle Type. \r
+    /// 0: Picture\r
+    /// 1: Text\r
+    /// </summary>\r
+    public enum SubtitleType\r
+    {\r
+        Picture,\r
+        Text\r
+    }\r
+}\r
index 489f360..fb00bcf 100644 (file)
@@ -25,19 +25,24 @@ namespace Handbrake.Parsing
         public string Language { get; private set; }\r
 \r
         /// <summary>\r
-        /// Gets The primary format of this Audio Track\r
+        /// Gets or sets LanguageCode.\r
         /// </summary>\r
-        public string Format { get; private set; }\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 Additional format info for this Audio Track\r
+        /// Gets The primary format of this Audio Track\r
         /// </summary>\r
-        public string SubFormat { get; private set; }\r
+        public string Format { get; private set; }\r
 \r
         /// <summary>\r
         /// Gets The frequency (in MHz) of this Audio Track\r
         /// </summary>\r
-        public int Frequency { get; private set; }\r
+        public int SampleRate { get; private set; }\r
 \r
         /// <summary>\r
         /// Gets The bitrate (in kbps) of this Audio Track\r
@@ -45,9 +50,48 @@ namespace Handbrake.Parsing
         public int Bitrate { get; private set; }\r
 \r
         /// <summary>\r
-        /// Gets ISO639_2.\r
+        /// Create a new Audio Track object\r
         /// </summary>\r
-        public string ISO639_2 { get; private set; }\r
+        /// <param name="track">\r
+        /// The track.\r
+        /// </param>\r
+        /// <param name="lang">\r
+        /// The lang.\r
+        /// </param>\r
+        /// <param name="langCode">\r
+        /// The lang code.\r
+        /// </param>\r
+        /// <param name="desc">\r
+        /// The desc.\r
+        /// </param>\r
+        /// <param name="format">\r
+        /// The format.\r
+        /// </param>\r
+        /// <param name="samplerate">\r
+        /// The samplerate.\r
+        /// </param>\r
+        /// <param name="bitrate">\r
+        /// The bitrate.\r
+        /// </param>\r
+        /// <returns>\r
+        /// A new Audio Track\r
+        /// </returns>\r
+        public static AudioTrack CreateAudioTrack(int track, string lang, string langCode, string desc, string format, int samplerate, int bitrate)\r
+        {\r
+            AudioTrack newTrack = new AudioTrack\r
+                {\r
+                    TrackNumber = track,\r
+                    Language = lang,\r
+                    LanguageCode = langCode,\r
+                    Description = desc,\r
+                    Format = format,\r
+                    SampleRate = samplerate,\r
+                    Bitrate = bitrate\r
+                };\r
+\r
+            return newTrack;\r
+\r
+        }\r
 \r
         /// <summary>\r
         /// Parse the CLI input to an Audio Track object\r
@@ -77,12 +121,11 @@ namespace Handbrake.Parsing
                                     {\r
                                         TrackNumber = int.Parse(track.Groups[1].Value.Trim()), \r
                                         Language = track.Groups[2].Value, \r
-                                        Format = m.Groups[3].Value, \r
-                                        SubFormat = subformat, \r
-                                        Frequency = int.Parse(samplerateVal), \r
-                                        Bitrate = int.Parse(bitrateVal), \r
-                                        ISO639_2 =\r
-                                            iso639_2.Value.Replace("iso639-2: ", string.Empty).Replace(")", string.Empty)\r
+                                        Format = m.Groups[3].Value,\r
+                                        Description = subformat, \r
+                                        SampleRate = int.Parse(samplerateVal), \r
+                                        Bitrate = int.Parse(bitrateVal),\r
+                                        LanguageCode = iso639_2.Value.Replace("iso639-2: ", string.Empty).Replace(")", string.Empty)\r
                                     };\r
                 return thisTrack;\r
             }\r
@@ -119,10 +162,10 @@ namespace Handbrake.Parsing
         /// <returns>A string formatted as: {track #} {language} ({format}) ({sub-format})</returns>\r
         public override string ToString()\r
         {\r
-            if (SubFormat == null)\r
+            if (Description == null)\r
                 return string.Format("{0} {1} ({2})", TrackNumber, Language, Format);\r
 \r
-            return string.Format("{0} {1} ({2}) ({3})", TrackNumber, Language, Format, SubFormat);\r
+            return string.Format("{0} {1} ({2}) ({3})", TrackNumber, Language, Format, Description);\r
         }\r
     }\r
 }
\ No newline at end of file
index 4b3bb2d..ca8fc30 100644 (file)
@@ -26,6 +26,23 @@ namespace Handbrake.Parsing
         public TimeSpan Duration { get; private set; }\r
 \r
         /// <summary>\r
+        /// Create a chapter Object\r
+        /// </summary>\r
+        /// <param name="number">\r
+        /// The number.\r
+        /// </param>\r
+        /// <param name="duration">\r
+        /// The duration.\r
+        /// </param>\r
+        /// <returns>\r
+        /// A new Chapter Object\r
+        /// </returns>\r
+        public static Chapter CreateChapterOjbect(int number, TimeSpan duration)\r
+        {\r
+            return new Chapter { ChapterNumber = number, Duration = duration };\r
+        }\r
+\r
+        /// <summary>\r
         /// Parse a CLI string to a Chapter object\r
         /// </summary>\r
         /// <param name="output">\r
index 52a0729..fd0cdc5 100644 (file)
@@ -9,6 +9,8 @@ namespace Handbrake.Parsing
     using System.IO;\r
     using System.Text.RegularExpressions;\r
 \r
+    using Handbrake.Model;\r
+\r
     /// <summary>\r
     /// An object that represents a subtitle associated with a Title, in a DVD\r
     /// </summary>\r
@@ -32,7 +34,41 @@ namespace Handbrake.Parsing
         /// <summary>\r
         /// Gets the Subtitle Type\r
         /// </summary>\r
-        public string Type { get; private set; }\r
+        public SubtitleType SubtitleType { get; private set; }\r
+\r
+        /// <summary>\r
+        /// Gets Subtitle Type\r
+        /// </summary>\r
+        public string TypeString\r
+        {\r
+            get\r
+            {\r
+                return this.SubtitleType == SubtitleType.Picture ? "Bitmap" : "Text";\r
+            }\r
+        }\r
+\r
+        /// <summary>\r
+        /// Create a new Subtitle Object\r
+        /// </summary>\r
+        /// <param name="track">\r
+        /// The track.\r
+        /// </param>\r
+        /// <param name="lang">\r
+        /// The lang.\r
+        /// </param>\r
+        /// <param name="langCode">\r
+        /// The lang code.\r
+        /// </param>\r
+        /// <param name="type">\r
+        /// The type.\r
+        /// </param>\r
+        /// <returns>\r
+        /// A Subtitle Object\r
+        /// </returns>\r
+        public static Subtitle CreateSubtitleObject(int track, string lang, string langCode, SubtitleType type)\r
+        {\r
+            return new Subtitle { TrackNumber = track, Language = lang, LanguageCode = langCode, SubtitleType = type };\r
+        }\r
 \r
         /// <summary>\r
         /// Parse the input strings related to subtitles\r
@@ -55,7 +91,7 @@ namespace Handbrake.Parsing
                                            TrackNumber = int.Parse(m.Groups[1].Value.Trim()), \r
                                            Language = m.Groups[2].Value, \r
                                            LanguageCode = m.Groups[3].Value, \r
-                                           Type = m.Groups[4].Value\r
+                                           SubtitleType = m.Groups[4].Value.Contains("Text") ? SubtitleType.Text : SubtitleType.Picture\r
                                        };\r
                 return thisSubtitle;\r
             }\r
@@ -92,7 +128,7 @@ namespace Handbrake.Parsing
         /// <returns>A string formatted as: {track #} {language}</returns>\r
         public override string ToString()\r
         {\r
-            return string.Format("{0} {1} ({2})", TrackNumber, Language, Type);\r
+            return string.Format("{0} {1} ({2})", TrackNumber, Language, TypeString);\r
         }\r
     }\r
 }
\ No newline at end of file
index ab3a274..3a3e6ca 100644 (file)
@@ -12,6 +12,8 @@ namespace Handbrake.Parsing
     using System.IO;\r
     using System.Text.RegularExpressions;\r
 \r
+    using Handbrake.Model;\r
+\r
     /// <summary>\r
     /// An object that represents a single Title of a DVD\r
     /// </summary>\r
@@ -24,16 +26,16 @@ namespace Handbrake.Parsing
 \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
-            Angles = new List<string>();\r
             AudioTracks = new List<AudioTrack>();\r
             Chapters = new List<Chapter>();\r
             Subtitles = new List<Subtitle>();\r
         }\r
 \r
+        #region Properties\r
+\r
         /// <summary>\r
         /// Gets a Collection of chapters in this Title\r
         /// </summary>\r
@@ -55,16 +57,6 @@ namespace Handbrake.Parsing
         public int TitleNumber { get; private set; }\r
 \r
         /// <summary>\r
-        /// Gets a value indicating whether this is a MainTitle.\r
-        /// </summary>\r
-        public bool MainTitle { get; private set; }\r
-\r
-        /// <summary>\r
-        /// Gets the Source Name\r
-        /// </summary>\r
-        public string SourceName { get; private set; }\r
-\r
-        /// <summary>\r
         /// Gets the length in time of this Title\r
         /// </summary>\r
         public TimeSpan Duration { get; private set; }\r
@@ -77,7 +69,12 @@ namespace Handbrake.Parsing
         /// <summary>\r
         /// Gets the aspect ratio of this Title\r
         /// </summary>\r
-        public float AspectRatio { get; private set; }\r
+        public double AspectRatio { get; private set; }\r
+\r
+        /// <summary>\r
+        /// Gets AngleCount.\r
+        /// </summary>\r
+        public int AngleCount { get; private set; }\r
 \r
         /// <summary>\r
         /// Gets Par Value\r
@@ -92,17 +89,93 @@ namespace Handbrake.Parsing
         /// 2: L\r
         /// 3: R\r
         /// </summary>\r
-        public int[] AutoCropDimensions { get; private set; }\r
+        public Cropping AutoCropDimensions { get; private set; }\r
 \r
         /// <summary>\r
-        /// Gets a Collection of Angles in this Title\r
+        /// Gets the FPS of the source.\r
         /// </summary>\r
-        public List<string> Angles { get; private set; }\r
+        public double Fps { get; private set; }\r
 \r
         /// <summary>\r
-        /// Gets the FPS of the source.\r
+        /// Gets a value indicating whether this is a MainTitle.\r
         /// </summary>\r
-        public float Fps { get; private set; }\r
+        public bool MainTitle { get; private set; }\r
+\r
+        /// <summary>\r
+        /// Gets the Source Name\r
+        /// </summary>\r
+        public string SourceName { get; private set; }\r
+\r
+        #endregion\r
+\r
+        /// <summary>\r
+        /// Creates a Title\r
+        /// </summary>\r
+        /// <param name="angles">\r
+        /// The angles.\r
+        /// </param>\r
+        /// <param name="aspectRatio">\r
+        /// The aspect Ratio.\r
+        /// </param>\r
+        /// <param name="audioTracks">\r
+        /// The audio Tracks.\r
+        /// </param>\r
+        /// <param name="crop">\r
+        /// The crop.\r
+        /// </param>\r
+        /// <param name="chapters">\r
+        /// The chapters.\r
+        /// </param>\r
+        /// <param name="duration">\r
+        /// The duration.\r
+        /// </param>\r
+        /// <param name="fps">\r
+        /// The fps.\r
+        /// </param>\r
+        /// <param name="mainTitle">\r
+        /// The main Title.\r
+        /// </param>\r
+        /// <param name="parVal">\r
+        /// The par Val.\r
+        /// </param>\r
+        /// <param name="resolution">\r
+        /// The resolution.\r
+        /// </param>\r
+        /// <param name="sourceName">\r
+        /// The source Name.\r
+        /// </param>\r
+        /// <param name="subtitles">\r
+        /// The subtitles.\r
+        /// </param>\r
+        /// <param name="titleNumber">\r
+        /// The title Number.\r
+        /// </param>\r
+        /// <returns>\r
+        /// A Title Object\r
+        /// </returns>\r
+        public static Title CreateTitle(int angles, double aspectRatio, List<AudioTrack> audioTracks, Cropping crop, List<Chapter> chapters,\r
+                                 TimeSpan duration, float fps, bool mainTitle, Size parVal, Size resolution, string sourceName, List<Subtitle> subtitles,\r
+                                 int titleNumber)\r
+        {\r
+            Title title = new Title\r
+            {\r
+                AngleCount = angles,\r
+                AspectRatio = aspectRatio,\r
+                AudioTracks = audioTracks,\r
+                AutoCropDimensions = crop,\r
+                Chapters = chapters,\r
+                Duration = duration,\r
+                Fps = fps,\r
+                MainTitle = mainTitle,\r
+                ParVal = parVal,\r
+                Resolution = resolution,\r
+                SourceName = sourceName,\r
+                Subtitles = subtitles,\r
+                TitleNumber = titleNumber\r
+            };\r
+\r
+            return title;\r
+        }\r
 \r
         /// <summary>\r
         /// Parse the Title Information\r
@@ -142,8 +215,7 @@ namespace Handbrake.Parsing
                     int angleCount;\r
                     int.TryParse(angleList, out angleCount);\r
 \r
-                    for (int i = 1; i <= angleCount; i++)\r
-                        thisTitle.Angles.Add(i.ToString());\r
+                    thisTitle.AngleCount = angleCount;\r
                 }\r
             }\r
 \r
@@ -165,11 +237,15 @@ namespace Handbrake.Parsing
             // Get autocrop region for this title\r
             m = Regex.Match(output.ReadLine(), @"^  \+ autocrop: ([0-9]*)/([0-9]*)/([0-9]*)/([0-9]*)");\r
             if (m.Success)\r
-                thisTitle.AutoCropDimensions = new[]\r
-                                           {\r
-                                               int.Parse(m.Groups[1].Value), int.Parse(m.Groups[2].Value), \r
-                                               int.Parse(m.Groups[3].Value), int.Parse(m.Groups[4].Value)\r
-                                           };\r
+            {\r
+                thisTitle.AutoCropDimensions = new Cropping\r
+                    {\r
+                        Top = int.Parse(m.Groups[1].Value),\r
+                        Bottom = int.Parse(m.Groups[2].Value),\r
+                        Left = int.Parse(m.Groups[3].Value),\r
+                        Right = int.Parse(m.Groups[4].Value)\r
+                    };\r
+            }\r
 \r
             thisTitle.Chapters.AddRange(Chapter.ParseList(output));\r
 \r
@@ -210,5 +286,6 @@ namespace Handbrake.Parsing
         {\r
             return string.Format("{0} ({1:00}:{2:00}:{3:00})", TitleNumber, Duration.Hours, Duration.Minutes, Duration.Seconds);\r
         }\r
+\r
     }\r
 }
\ No newline at end of file
index 8d62325..139f00a 100644 (file)
@@ -1,7 +1,4 @@
 <StyleCopSettings Version="4.3">\r
-  <GlobalSettings>\r
-    <StringProperty Name="MergeSettingsFiles">NoMerge</StringProperty>\r
-  </GlobalSettings>\r
   <Parsers>\r
     <Parser ParserId="Microsoft.StyleCop.CSharp.CsParser">\r
       <ParserSettings>\r
   <Analyzers>\r
     <Analyzer AnalyzerId="Microsoft.StyleCop.CSharp.DocumentationRules">\r
       <Rules>\r
-        <Rule Name="FileHeaderMustShowCopyright">\r
+        <Rule Name="PropertyDocumentationMustHaveValueText">\r
+          <RuleSettings>\r
+            <BooleanProperty Name="Enabled">True</BooleanProperty>\r
+          </RuleSettings>\r
+        </Rule>\r
+        <Rule Name="DocumentationTextMustMeetMinimumCharacterLength">\r
           <RuleSettings>\r
             <BooleanProperty Name="Enabled">False</BooleanProperty>\r
           </RuleSettings>\r
         </Rule>\r
-        <Rule Name="FileHeaderMustHaveCopyrightText">\r
+        <Rule Name="DocumentationTextMustContainWhitespace">\r
           <RuleSettings>\r
             <BooleanProperty Name="Enabled">False</BooleanProperty>\r
           </RuleSettings>\r
         </Rule>\r
-        <Rule Name="FileHeaderMustContainFileName">\r
+        <Rule Name="EnumerationItemsMustBeDocumented">\r
           <RuleSettings>\r
             <BooleanProperty Name="Enabled">False</BooleanProperty>\r
           </RuleSettings>\r
         </Rule>\r
-        <Rule Name="FileHeaderFileNameDocumentationMustMatchFileName">\r
+        <Rule Name="FileMustHaveHeader">\r
           <RuleSettings>\r
             <BooleanProperty Name="Enabled">False</BooleanProperty>\r
           </RuleSettings>\r
         </Rule>\r
-        <Rule Name="FileHeaderMustHaveValidCompanyText">\r
+        <Rule Name="FileHeaderMustShowCopyright">\r
           <RuleSettings>\r
             <BooleanProperty Name="Enabled">False</BooleanProperty>\r
           </RuleSettings>\r
         </Rule>\r
-        <Rule Name="FileMustHaveHeader">\r
+        <Rule Name="FileHeaderMustHaveCopyrightText">\r
           <RuleSettings>\r
             <BooleanProperty Name="Enabled">False</BooleanProperty>\r
           </RuleSettings>\r
         </Rule>\r
-        <Rule Name="PropertyDocumentationMustHaveValueText">\r
+        <Rule Name="FileHeaderMustContainFileName">\r
           <RuleSettings>\r
-            <BooleanProperty Name="Enabled">True</BooleanProperty>\r
+            <BooleanProperty Name="Enabled">False</BooleanProperty>\r
           </RuleSettings>\r
         </Rule>\r
-        <Rule Name="DocumentationTextMustMeetMinimumCharacterLength">\r
+        <Rule Name="FileHeaderFileNameDocumentationMustMatchFileName">\r
           <RuleSettings>\r
             <BooleanProperty Name="Enabled">False</BooleanProperty>\r
           </RuleSettings>\r
         </Rule>\r
-        <Rule Name="DocumentationTextMustContainWhitespace">\r
+        <Rule Name="FileHeaderMustHaveValidCompanyText">\r
           <RuleSettings>\r
             <BooleanProperty Name="Enabled">False</BooleanProperty>\r
           </RuleSettings>\r
         </Rule>\r
       </Rules>\r
       <AnalyzerSettings>\r
-        <StringProperty Name="CompanyName">HandBrake Project</StringProperty>\r
-        <StringProperty Name="Copyright">Copyright 2010 HandBrake Team - It may be used under the terms of the GNU General Public License.</StringProperty>\r
+        <StringProperty Name="CompanyName">HandBrake Project (http://handbrake.fr)</StringProperty>\r
+        <StringProperty Name="Copyright">This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.</StringProperty>\r
       </AnalyzerSettings>\r
     </Analyzer>\r
     <Analyzer AnalyzerId="Microsoft.StyleCop.CSharp.MaintainabilityRules">\r
index 1a1cfae..91e3970 100644 (file)
@@ -1377,7 +1377,10 @@ namespace Handbrake
                 {\r
                     drop_angle.Visible = true;\r
                     lbl_angle.Visible = true;\r
-                    drop_angle.Items.AddRange(selectedTitle.Angles.ToArray());\r
+\r
+                    for (int i = 1; i <= selectedTitle.AngleCount; i++)\r
+                        drop_angle.Items.Add(i.ToString());\r
+\r
                     if (drop_angle.Items.Count != 0)\r
                         drop_angle.SelectedIndex = 0;\r
                 }\r