OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Fri, 4 Jun 2010 20:33:16 +0000 (20:33 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Fri, 4 Jun 2010 20:33:16 +0000 (20:33 +0000)
# interop
- Fix Namespaces
- Changed so it's .NET 3.5 compatible.
- Removed usings which were not needed and placed usings inside the namespace.

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

36 files changed:
win/C#/interop/DisplayStringAttribute.cs
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
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/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

index 3f7e62d..7c1f547 100644 (file)
@@ -1,10 +1,7 @@
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-\r
-namespace HandBrake.Interop\r
+namespace HandBrake.Interop\r
 {\r
+    using System;\r
+\r
     [AttributeUsage(AttributeTargets.Field)]\r
     public sealed class DisplayStringAttribute : Attribute\r
     {\r
index 7f08595..9500bda 100644 (file)
@@ -1,10 +1,7 @@
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-\r
-namespace HandBrake.Interop\r
+namespace HandBrake.Interop\r
 {\r
+    using System;\r
+\r
     public class EncodeProgressEventArgs : EventArgs\r
     {\r
         public float FractionComplete { get; set; }\r
index c9d1e1a..c50fc04 100644 (file)
@@ -1,16 +1,15 @@
-namespace HandBrake.Interop\r
+using HandBrake.Interop.Model;\r
+using HandBrake.Interop.Model.Encoding;\r
+using HandBrake.Interop.SourceData;\r
+\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 HandBrake.SourceData;\r
-    using HandBrake.Interop;\r
 \r
     /// <summary>\r
     /// A wrapper for a HandBrake instance.\r
                 HbLib.hb_register_error_handler(errorCallback);\r
             }\r
 \r
-            this.hbHandle = HbLib.hb_init(verbosity, update_check: 0);\r
+            this.hbHandle = HbLib.hb_init(verbosity, 0);\r
         }\r
 \r
         /// <summary>\r
             for (int i = 0; i < nativeJob.height; i++)\r
             {\r
                 Marshal.Copy(managedBuffer, i * nativeJob.width * 4, ptr, nativeJob.width * 4);\r
-                ptr = IntPtr.Add(ptr, bitmapData.Stride);\r
+                ptr = AddOffset(ptr, bitmapData.Stride);\r
             }\r
 \r
             bitmap.UnlockBits(bitmapData);\r
             }\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
index e2d6c08..9526847 100644 (file)
@@ -10,7 +10,7 @@
     <AppDesignerFolder>Properties</AppDesignerFolder>\r
     <RootNamespace>HandBrake.Interop</RootNamespace>\r
     <AssemblyName>HandBrakeInterop</AssemblyName>\r
-    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>\r
+    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
     <FileUpgradeFlags>\r
     </FileUpgradeFlags>\r
index e916322..da72521 100644 (file)
@@ -1,11 +1,7 @@
-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
+namespace HandBrake.Interop\r
 {\r
+    using System;\r
+    using System.Runtime.InteropServices;\r
 \r
     internal partial class NativeConstants\r
     {\r
index d53c688..05f5bfa 100644 (file)
@@ -2,8 +2,6 @@
 {\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 609a4ec..e361105 100644 (file)
@@ -1,10 +1,5 @@
 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 0d45cc1..e83edfc 100644 (file)
@@ -1,9 +1,6 @@
 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 a73b5ca..3956827 100644 (file)
@@ -1,10 +1,7 @@
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-\r
-namespace HandBrake.Interop\r
+namespace HandBrake.Interop\r
 {\r
+    using System;\r
+\r
     public class MessageLoggedEventArgs : EventArgs\r
     {\r
         public string Message { get; set; }\r
index 1ba0e8e..bc5aad2 100644 (file)
@@ -1,9 +1,4 @@
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-\r
-namespace HandBrake.Interop\r
+namespace HandBrake.Interop.Model\r
 {\r
     public class Cropping\r
     {\r
index 53058a9..54f8ec1 100644 (file)
@@ -1,11 +1,9 @@
-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\r
+namespace HandBrake.Interop.Model\r
 {\r
+    using System;\r
+    using System.Collections.Generic;\r
+    using System.Xml.Serialization;\r
+\r
     public class EncodeJob\r
     {\r
         public SourceType SourceType { get; set; }\r
index 65a7f23..2000729 100644 (file)
@@ -1,9 +1,4 @@
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-\r
-namespace HandBrake.Interop\r
+namespace HandBrake.Interop.Model.Encoding\r
 {\r
     public enum Anamorphic\r
     {\r
index b4eee52..cfa213f 100644 (file)
@@ -1,9 +1,4 @@
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-\r
-namespace HandBrake.Interop\r
+namespace HandBrake.Interop.Model.Encoding\r
 {\r
     public enum AudioEncoder\r
     {\r
index 8ff112c..b329ab4 100644 (file)
@@ -1,9 +1,4 @@
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-\r
-namespace HandBrake.Interop\r
+namespace HandBrake.Interop.Model.Encoding\r
 {\r
     public class AudioEncoding\r
     {\r
index 9060b01..263f937 100644 (file)
@@ -1,9 +1,4 @@
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-\r
-namespace HandBrake.Interop\r
+namespace HandBrake.Interop.Model.Encoding\r
 {\r
     public enum Decomb\r
     {\r
index 365f600..6729b27 100644 (file)
@@ -1,9 +1,4 @@
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-\r
-namespace HandBrake.Interop\r
+namespace HandBrake.Interop.Model.Encoding\r
 {\r
     public enum Deinterlace\r
     {\r
index 146cbfd..4a53d68 100644 (file)
@@ -1,9 +1,4 @@
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-\r
-namespace HandBrake.Interop\r
+namespace HandBrake.Interop.Model.Encoding\r
 {\r
     public enum Denoise\r
     {\r
index 028abf4..c9f6844 100644 (file)
@@ -1,9 +1,4 @@
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-\r
-namespace HandBrake.Interop\r
+namespace HandBrake.Interop.Model.Encoding\r
 {\r
     public enum Detelecine\r
     {\r
index 443abf4..57d7d5d 100644 (file)
@@ -2,6 +2,8 @@
 using System.Collections.Generic;\r
 using System.Linq;\r
 using System.Text;\r
+using HandBrake.Interop.Model;\r
+using HandBrake.Interop.Model.Encoding;\r
 \r
 namespace HandBrake.Interop\r
 {\r
index 2049d09..aca5c67 100644 (file)
@@ -1,9 +1,4 @@
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-\r
-namespace HandBrake.Interop\r
+namespace HandBrake.Interop.Model.Encoding\r
 {\r
     public enum Mixdown\r
     {\r
index bcf7095..04fbea1 100644 (file)
@@ -1,9 +1,4 @@
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-\r
-namespace HandBrake.Interop\r
+namespace HandBrake.Interop.Model.Encoding\r
 {\r
     public enum OutputExtension\r
     {\r
index 52549e7..a0dc0dd 100644 (file)
@@ -1,10 +1,4 @@
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-using System.ComponentModel;\r
-\r
-namespace HandBrake.Interop\r
+namespace HandBrake.Interop.Model.Encoding\r
 {\r
     public enum OutputFormat\r
     {\r
index 6c39e54..fa081de 100644 (file)
@@ -1,9 +1,4 @@
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-\r
-namespace HandBrake.Interop\r
+namespace HandBrake.Interop.Model.Encoding\r
 {\r
     public enum VideoEncodeRateType\r
     {\r
index 912117b..47f0b81 100644 (file)
@@ -1,9 +1,4 @@
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-\r
-namespace HandBrake.Interop\r
+namespace HandBrake.Interop.Model.Encoding\r
 {\r
     public enum VideoEncoder\r
     {\r
index f94cbd2..971365a 100644 (file)
@@ -1,9 +1,4 @@
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-\r
-namespace HandBrake.Interop\r
+namespace HandBrake.Interop.Model\r
 {\r
     public class Size\r
     {\r
index edfb68b..992209d 100644 (file)
@@ -1,9 +1,4 @@
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-\r
-namespace HandBrake.Interop\r
+namespace HandBrake.Interop.Model\r
 {\r
     public class SourceSubtitle\r
     {\r
index 1a53aab..f720a99 100644 (file)
@@ -1,4 +1,4 @@
-namespace HandBrake.Interop\r
+namespace HandBrake.Interop.Model\r
 {\r
     public enum SourceType\r
     {\r
index 199fe6a..8863582 100644 (file)
@@ -1,9 +1,4 @@
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-\r
-namespace HandBrake.Interop\r
+namespace HandBrake.Interop.Model\r
 {\r
     public class SrtSubtitle\r
     {\r
index 1fab735..10506d9 100644 (file)
@@ -1,10 +1,7 @@
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-\r
-namespace HandBrake.Interop\r
+namespace HandBrake.Interop.Model\r
 {\r
+    using System.Collections.Generic;\r
+\r
     public class Subtitles\r
     {\r
         public List<SrtSubtitle> SrtSubtitles { get; set; }\r
index c16c099..e0fd1be 100644 (file)
@@ -2,8 +2,6 @@
 {\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 f7e3a0f..5c0186b 100644 (file)
@@ -1,10 +1,7 @@
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-\r
-namespace HandBrake.Interop\r
+namespace HandBrake.Interop\r
 {\r
+    using System;\r
+\r
     public class ScanProgressEventArgs : EventArgs\r
     {\r
         public int CurrentTitle { get; set; }\r
index 735ddd9..13408b3 100644 (file)
@@ -1,15 +1,9 @@
 /*  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
+    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;\r
-using System.Collections.Generic;\r
-using System.IO;\r
-using System.Text.RegularExpressions;\r
-\r
-namespace HandBrake.SourceData\r
+namespace HandBrake.Interop.SourceData\r
 {\r
     /// <summary>\r
     /// An object represending an AudioTrack associated with a Title, in a DVD\r
index 8e41282..25c82c6 100644 (file)
@@ -1,16 +1,12 @@
 /*  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
+    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;\r
-using System.Collections.Generic;\r
-using System.IO;\r
-using System.Text.RegularExpressions;\r
-\r
-namespace HandBrake.SourceData\r
+namespace HandBrake.Interop.SourceData\r
 {\r
+    using System;\r
+\r
     /// <summary>\r
     /// An object representing a Chapter aosciated with a Title, in a DVD\r
     /// </summary>\r
index bf5d4e5..af9dc23 100644 (file)
@@ -1,14 +1,9 @@
 /*  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
+    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
+namespace HandBrake.Interop.SourceData\r
 {\r
     /// <summary>\r
     /// An object that represents a subtitle associated with a Title, in a DVD\r
index 68904fe..8955c7a 100644 (file)
@@ -1,9 +1,4 @@
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-\r
-namespace HandBrake.SourceData\r
+namespace HandBrake.Interop.SourceData\r
 {\r
     public enum SubtitleType\r
     {\r
index 8d69494..0d3da5d 100644 (file)
@@ -1,18 +1,16 @@
 /*  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
+    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;\r
-using System.Collections.Generic;\r
-using System.Globalization;\r
-using System.IO;\r
-using System.Text.RegularExpressions;\r
-using HandBrake.Interop;\r
+using HandBrake.Interop.Model;\r
 \r
-namespace HandBrake.SourceData\r
+namespace HandBrake.Interop.SourceData\r
 {\r
+    using System;\r
+    using System.Collections.Generic;\r
+    using System.Globalization;\r
+\r
     /// <summary>\r
     /// An object that represents a single Title of a DVD\r
     /// </summary>\r