Author: jcsston
Date: 2004-10-13 10:30:48 +0400 (Wed, 13 Oct 2004)
New Revision: 877
Added:
trunk/mkNETtools/PluginHelper/ArrayCopy.cs
trunk/mkNETtools/PluginHelper/AudioTrackInfo.cs
trunk/mkNETtools/PluginHelper/TrackInfo.cs
trunk/mkNETtools/PluginHelper/VideoTrackInfo.cs
trunk/mkNETtools/Plugins/MatroskaInput/
trunk/mkNETtools/Plugins/MatroskaInput/AssemblyInfo.cs
trunk/mkNETtools/Plugins/MatroskaInput/MatroskaInput.cs
trunk/mkNETtools/Plugins/MatroskaInput/MatroskaInput.csproj
trunk/mkNETtools/Plugins/MatroskaInput/MatroskaInput.csproj.user
Modified:
trunk/mkNETtools/PluginHelper/Interfaces.cs
trunk/mkNETtools/PluginHelper/PluginHelper.csproj
trunk/mkNETtools/PluginHelper/PluginManager.cs
trunk/mkNETtools/Plugins/TestPlugin/TestPlugin.cs
trunk/mkNETtools/mkNETtools.sln
Log:
Improved track info interfaces. Added base track info classes.
Basic Matroska Input Plugin, using JEBML.
Added: trunk/mkNETtools/PluginHelper/ArrayCopy.cs
===================================================================
--- trunk/mkNETtools/PluginHelper/ArrayCopy.cs 2004-10-12 22:59:49 UTC (rev 876)
+++ trunk/mkNETtools/PluginHelper/ArrayCopy.cs 2004-10-13 06:30:48 UTC (rev 877)
@@ -0,0 +1,30 @@
+using System;
+
+namespace mkNETtools.PluginHelper
+{
+ /// <summary>
+ /// Summary description for ArrayCopy.
+ /// </summary>
+ public abstract class ArrayCopy
+ {
+ public static byte [] SByteToByte(sbyte [] data)
+ {
+ byte [] array = new byte[data.Length];
+
+ for (int b = 0; b < data.Length; b++)
+ array[b] = (byte)data[b];
+
+ return array;
+ }
+
+ public static sbyte [] ByteToSByte(byte [] data)
+ {
+ sbyte [] array = new sbyte[data.Length];
+
+ for (int b = 0; b < data.Length; b++)
+ array[b] = (sbyte)data[b];
+
+ return array;
+ }
+ }
+}
Added: trunk/mkNETtools/PluginHelper/AudioTrackInfo.cs
===================================================================
--- trunk/mkNETtools/PluginHelper/AudioTrackInfo.cs 2004-10-12 22:59:49 UTC (rev 876)
+++ trunk/mkNETtools/PluginHelper/AudioTrackInfo.cs 2004-10-13 06:30:48 UTC (rev 877)
@@ -0,0 +1,92 @@
+using System;
+
+namespace mkNETtools.PluginHelper
+{
+ /// <summary>
+ /// Summary description for AudioTrackInfo.
+ /// </summary>
+ public class AudioTrackInfo : TrackInfo, IAudioTrackInfo
+ {
+ private int m_Channels = 0;
+ private int m_Bitdepth = 0;
+ private double m_SamplingRate = 0.0;
+ private double m_OutputSamplingRate = 0.0;
+
+ public AudioTrackInfo()
+ {
+ //
+ // TODO: Add constructor logic here
+ //
+ }
+
+ /// <summary>
+ /// Create a copy of the IAudioTrackInfo
+ /// </summary>
+ /// <param name="Track">The IAudioTrackInfo to copy the data from</param>
+ /// <param name="ReadOnly">If true the copy with be read-only</param>
+ public AudioTrackInfo(IAudioTrackInfo Track, bool ReadOnly)
+ : base(Track, ReadOnly)
+ {
+ this.Channels = Track.Channels;
+ this.Bitdepth = Track.Bitdepth;
+ this.SamplingRate = Track.SamplingRate;
+ this.OutputSamplingRate = Track.OutputSamplingRate;
+ }
+
+ #region IAudioTrackInfo Members
+
+ public int Channels
+ {
+ get
+ {
+ return m_Channels;
+ }
+ set
+ {
+ CheckReadOnly();
+ m_Channels = value;
+ }
+ }
+
+ public int Bitdepth
+ {
+ get
+ {
+ return m_Bitdepth;
+ }
+ set
+ {
+ CheckReadOnly();
+ m_Bitdepth = value;
+ }
+ }
+
+ public double SamplingRate
+ {
+ get
+ {
+ return m_SamplingRate;
+ }
+ set
+ {
+ CheckReadOnly();
+ m_SamplingRate = value;
+ }
+ }
+
+ public double OutputSamplingRate
+ {
+ get
+ {
+ return m_OutputSamplingRate;
+ }
+ set
+ {
+ CheckReadOnly();
+ m_OutputSamplingRate = value;
+ }
+ }
+
+ #endregion
+ }
+}
Modified: trunk/mkNETtools/PluginHelper/Interfaces.cs
===================================================================
--- trunk/mkNETtools/PluginHelper/Interfaces.cs 2004-10-12 22:59:49 UTC (rev 876)
+++ trunk/mkNETtools/PluginHelper/Interfaces.cs 2004-10-13 06:30:48 UTC (rev 877)
@@ -10,11 +10,11 @@
/// <summary>
/// Load the plugin, alloc any resources needed
/// </summary>
- void Load();
+ //void Load();
/// <summary>
/// Unload the plugin, freeing any resources
/// </summary>
- void Unload();
+ //void Unload();
/// <summary>
/// Get the plugin name
/// </summary>
@@ -23,13 +23,42 @@
}
/// <summary>
+ /// Basic file plugin interface
+ /// </summary>
+ public interface IBaseFilePlugin : IBasePlugin
+ {
+ /// <summary>
+ /// Open a file for reading
+ /// </summary>
+ /// <param name="filename">The file to open</param>
+ void Open(string filename);
+ /// <summary>
+ /// Close the currently open file
+ /// </summary>
+ void Close();
+ /// <summary>
+ /// Detect if the passed file is supported
+ /// </summary>
+ /// <param name="filename">The file to check</param>
+ /// <returns>Returns true is the file is supported</returns>
+ bool IsSupported(string filename);
+ /// <summary>
+ /// The default file extension
+ /// </summary>
+ string DefaultExt { get; }
+ }
+
+ /// <summary>
/// Track infomation interface
/// </summary>
public interface ITrackInfo
{
- int GetNumber();
- string GetName();
- double GetDuration();
+ int Number { get; set; }
+ string Name { get; set; }
+ string Language { get; set; }
+ string CodecID { get; set; }
+ byte [] CodecPrivate { get; set; }
+ double Duration { get; set; }
}
/// <summary>
@@ -37,10 +66,10 @@
/// </summary>
public interface IAudioTrackInfo : ITrackInfo
{
- int GetChannels();
- int GetBitdepth();
- double GetSamplingRate();
- double GetOutputSamplingRate();
+ int Channels { get; set; }
+ int Bitdepth { get; set; }
+ double SamplingRate { get; set; }
+ double OutputSamplingRate { get; set; }
}
/// <summary>
@@ -48,33 +77,57 @@
/// </summary>
public interface IVideoTrackInfo : ITrackInfo
{
- int GetWidth();
- int GetHeight();
- int GetDisplayWidth();
- int GetDisplayHeight();
- double GetAvgFramerate();
+ int Width { get; set; }
+ int Height { get; set; }
+ int DisplayWidth { get; set; }
+ int DisplayHeight { get; set; }
+ double AvgFramerate { get; set; }
}
/// <summary>
+ /// Frame struct
+ /// </summary>
+ public struct Frame
+ {
+ public ITrackInfo Track;
+ public double Timecode;
+ public double Duration;
+ public byte [] Data;
+ public double [] References;
+ }
+
+ /// <summary>
/// Basic input plugin interface
/// </summary>
- public interface IBaseInputPlugin : IBasePlugin
+ public interface IBaseInputPlugin : IBaseFilePlugin
{
/// <summary>
- /// Open a file for reading
+ /// Get the source tracks for the currently open input file.
/// </summary>
- /// <param name="filename">The file to open</param>
- void Open(string filename);
+ /// <returns>A array of ITrackInfo interfaces</returns>
+ /// <remarks>
+ /// The returned array is read-only. Trying to set a property
+ /// will result in a MemberAccessException being thrown.
+ /// </remarks>
+ ITrackInfo [] GetTracks();
/// <summary>
- /// Close the currently open file
+ /// Get the next frame for a track
/// </summary>
- void Close();
-
- int GetTrackCount();
- ITrackInfo GetTrack(int index);
+ /// <param name="Track">The track to get the frame from.</param>
+ /// <returns>Returns the next frame. null on EOS.</returns>
+ Frame GetNextFrame(ITrackInfo Track);
}
/// <summary>
+ /// Basic output plugin interface
+ /// </summary>
+ public interface IBaseOutputPlugin : IBaseFilePlugin
+ {
+ void SetTracks(ITrackInfo [] tracks);
+ void WriteFrame(Frame frame);
+ }
+
+ /// <summary>
/// Attribute to mark a exported class to treated as a plugin
/// </summary>
[AttributeUsage(AttributeTargets.Class)]
Modified: trunk/mkNETtools/PluginHelper/PluginHelper.csproj
===================================================================
--- trunk/mkNETtools/PluginHelper/PluginHelper.csproj 2004-10-12 22:59:49 UTC (rev 876)
+++ trunk/mkNETtools/PluginHelper/PluginHelper.csproj 2004-10-13 06:30:48 UTC (rev 877)
@@ -69,16 +69,36 @@
AssemblyName = "System"
HintPath = "..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.dll"
/>
+ <Reference
+ Name = "System.Data"
+ AssemblyName = "System.Data"
+ HintPath = "C:\WINXP\Microsoft.NET\Framework\v1.1.4322\System.Data.dll"
+ />
+ <Reference
+ Name = "System.XML"
+ AssemblyName = "System.Xml"
+ HintPath = "C:\WINXP\Microsoft.NET\Framework\v1.1.4322\System.XML.dll"
+ />
</References>
</Build>
<Files>
<Include>
<File
+ RelPath = "ArrayCopy.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
RelPath = "AssemblyInfo.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
+ RelPath = "AudioTrackInfo.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
RelPath = "BaseController.cs"
SubType = "Code"
BuildAction = "Compile"
@@ -93,6 +113,16 @@
SubType = "Code"
BuildAction = "Compile"
/>
+ <File
+ RelPath = "TrackInfo.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "VideoTrackInfo.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
</Include>
</Files>
</CSHARP>
Modified: trunk/mkNETtools/PluginHelper/PluginManager.cs
===================================================================
--- trunk/mkNETtools/PluginHelper/PluginManager.cs 2004-10-12 22:59:49 UTC (rev 876)
+++ trunk/mkNETtools/PluginHelper/PluginManager.cs 2004-10-13 06:30:48 UTC (rev 877)
@@ -47,7 +47,7 @@
{
foreach (IBasePlugin plug in plugins)
{
- plug.Unload();
+ //plug.Unload();
}
plugins.Clear();
}
@@ -87,9 +87,10 @@
{
for (int i = 0; i < plugins.Count; i++)
{
- if (((IBasePlugin) plugins).GetType().Name == typename)
+ IBasePlugin plugin = (IBasePlugin)plugins;
+ if (plugin.GetType().Name == typename)
{
- ((IBasePlugin) plugins[i]).Unload();
+ //plugin.Unload();
plugins.RemoveAt(i);
return;
}
@@ -156,7 +157,7 @@
{
//create and load the type, add to collection
IBasePlugin iplug = (IBasePlugin) Activator.CreateInstance(type);
- iplug.Load();
+ //iplug.Load();
plugins.Add(iplug);
}
}
Added: trunk/mkNETtools/PluginHelper/TrackInfo.cs
===================================================================
--- trunk/mkNETtools/PluginHelper/TrackInfo.cs 2004-10-12 22:59:49 UTC (rev 876)
+++ trunk/mkNETtools/PluginHelper/TrackInfo.cs 2004-10-13 06:30:48 UTC (rev 877)
@@ -0,0 +1,137 @@
+using System;
+
+namespace mkNETtools.PluginHelper
+{
+ /// <summary>
+ /// Summary description for TrackInfo.
+ /// </summary>
+ public class TrackInfo : ITrackInfo
+ {
+ private bool m_ReadOnly = false;
+ private int m_Number = 0;
+ private string m_Name = "";
+ private string m_Language = "";
+ private string m_CodecID = "";
+ private byte [] m_CodecPrivate = new byte[0];
+
+ private double m_Duration = 0.0;
+
+ public TrackInfo()
+ {
+
+ }
+
+ /// <summary>
+ /// Create a copy of the ITrackInfo
+ /// </summary>
+ /// <param name="Track">The ITrackInfo to copy the data from</param>
+ /// <param name="ReadOnly">If true the copy with be read-only</param>
+ public TrackInfo(ITrackInfo Track, bool ReadOnly)
+ {
+ m_ReadOnly = ReadOnly;
+ this.Number = Track.Number;
+ this.Name = Track.Name;
+ this.Language = Track.Language;
+ this.CodecID = Track.CodecID;
+ this.CodecPrivate = Track.CodecPrivate;
+ this.Duration = Track.Duration;
+ }
+
+ protected void CheckReadOnly()
+ {
+ if (m_ReadOnly)
+ {
+ throw new MemberAccessException("Property in Read-Only mode");
+ }
+ }
+ #region ITrackInfo Members
+
+ public int Number
+ {
+ get
+ {
+ return m_Number;
+ }
+ set
+ {
+ CheckReadOnly();
+ m_Number = value;
+ }
+ }
+
+ public string Name
+ {
+ get
+ {
+ return m_Name;
+ }
+ set
+ {
+ CheckReadOnly();
+ if (value == null)
+ throw new ArgumentNullException("Name", "Name cannot be a null reference. Set a 0 length string instead.");
+ m_Name = value;
+ }
+ }
+
+ public string Language
+ {
+ get
+ {
+ return m_Language;
+ }
+ set
+ {
+ CheckReadOnly();
+ if (value == null)
+ throw new ArgumentNullException("Name", "Name cannot be a null reference. Set a 0 length string instead.");
+ m_Language = value;
+ }
+ }
+
+ public string CodecID
+ {
+ get
+ {
+ return m_CodecID;
+ }
+ set
+ {
+ CheckReadOnly();
+ if (value == null)
+ throw new ArgumentNullException("CodecID", "CodecID cannot be a null reference. Set a 0 length string instead.");
+ m_CodecID = value;
+ }
+ }
+
+ public byte [] CodecPrivate
+ {
+ get
+ {
+ return m_CodecPrivate;
+ }
+ set
+ {
+ CheckReadOnly();
+ if (value == null)
+ throw new ArgumentNullException("CodecPrivate", "CodecPrivate cannot be a null reference. Set a 0 sized byte array instead.");
+ m_CodecPrivate = value;
+ }
+ }
+
+ public double Duration
+ {
+ get
+ {
+ return m_Duration;
+ }
+ set
+ {
+ CheckReadOnly();
+ m_Duration = value;
+ }
+ }
+
+ #endregion
+ }
+}
Added: trunk/mkNETtools/PluginHelper/VideoTrackInfo.cs
===================================================================
--- trunk/mkNETtools/PluginHelper/VideoTrackInfo.cs 2004-10-12 22:59:49 UTC (rev 876)
+++ trunk/mkNETtools/PluginHelper/VideoTrackInfo.cs 2004-10-13 06:30:48 UTC (rev 877)
@@ -0,0 +1,107 @@
+using System;
+
+namespace mkNETtools.PluginHelper
+{
+ /// <summary>
+ /// Summary description for VideoTrackInfo.
+ /// </summary>
+ public class VideoTrackInfo : TrackInfo, IVideoTrackInfo
+ {
+ private int m_Width = 0;
+ private int m_Height = 0;
+ private int m_DisplayWidth = 0;
+ private int m_DisplayHeight = 0;
+ private double m_AvgFramerate = 0.0;
+
+ public VideoTrackInfo()
+ {
+ //
+ // TODO: Add constructor logic here
+ //
+ }
+
+ /// <summary>
+ /// Create a copy of the IVideoTrackInfo
+ /// </summary>
+ /// <param name="Track">The IVideoTrackInfo to copy the data from</param>
+ /// <param name="ReadOnly">If true the copy with be read-only</param>
+ public VideoTrackInfo(IVideoTrackInfo Track, bool ReadOnly)
+ : base(Track, ReadOnly)
+ {
+ this.Width = Track.Width;
+ this.Height = Track.Height;
+ this.DisplayWidth = Track.DisplayWidth;
+ this.DisplayHeight = Track.DisplayHeight;
+ this.AvgFramerate = Track.AvgFramerate;
+ }
+
+ #region IVideoTrackInfo Members
+
+ public int Width
+ {
+ get
+ {
+ return m_Width;
+ }
+ set
+ {
+ CheckReadOnly();
+ m_Width = value;
+ }
+ }
+
+ public int Height
+ {
+ get
+ {
+ return m_Height;
+ }
+ set
+ {
+ CheckReadOnly();
+ m_Height = value;
+ }
+ }
+
+ public int DisplayWidth
+ {
+ get
+ {
+ return m_DisplayWidth;
+ }
+ set
+ {
+ CheckReadOnly();
+ m_DisplayWidth = value;
+ }
+ }
+
+ public int DisplayHeight
+ {
+ get
+ {
+ return m_DisplayHeight;
+ }
+ set
+ {
+ CheckReadOnly();
+ m_DisplayHeight = value;
+ }
+ }
+
+ public double AvgFramerate
+ {
+ get
+ {
+ return m_AvgFramerate;
+ }
+ set
+ {
+ CheckReadOnly();
+ m_AvgFramerate = value;
+ }
+ }
+
+ #endregion
+ }
+}
Added: trunk/mkNETtools/Plugins/MatroskaInput/AssemblyInfo.cs
===================================================================
--- trunk/mkNETtools/Plugins/MatroskaInput/AssemblyInfo.cs 2004-10-12 22:59:49 UTC (rev 876)
+++ trunk/mkNETtools/Plugins/MatroskaInput/AssemblyInfo.cs 2004-10-13 06:30:48 UTC (rev 877)
@@ -0,0 +1,58 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+//
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+//
+[assembly: AssemblyTitle("")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("")]
+[assembly: AssemblyCopyright("")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+//
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+
+[assembly: AssemblyVersion("1.0.*")]
+
+//
+// In order to sign your assembly you must specify a key to use. Refer to the
+// Microsoft .NET Framework documentation for more information on assembly signing.
+//
+// Use the attributes below to control which key is used for signing.
+//
+// Notes:
+// (*) If no key is specified, the assembly is not signed.
+// (*) KeyName refers to a key that has been installed in the Crypto Service
+// Provider (CSP) on your machine. KeyFile refers to a file which contains
+// a key.
+// (*) If the KeyFile and the KeyName values are both specified, the
+// following processing occurs:
+// (1) If the KeyName can be found in the CSP, that key is used.
+// (2) If the KeyName does not exist and the KeyFile does exist, the key
+// in the KeyFile is installed into the CSP and used.
+// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
+// When specifying the KeyFile, the location of the KeyFile should be
+// relative to the project output directory which is
+// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
+// located in the project directory, you would specify the AssemblyKeyFile
+// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
+// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
+// documentation for more information on this.
+//
+[assembly: AssemblyDelaySign(false)]
+[assembly: AssemblyKeyFile("")]
+[assembly: AssemblyKeyName("")]
Added: trunk/mkNETtools/Plugins/MatroskaInput/MatroskaInput.cs
===================================================================
--- trunk/mkNETtools/Plugins/MatroskaInput/MatroskaInput.cs 2004-10-12 22:59:49 UTC (rev 876)
+++ trunk/mkNETtools/Plugins/MatroskaInput/MatroskaInput.cs 2004-10-13 06:30:48 UTC (rev 877)
@@ -0,0 +1,141 @@
+using System;
+using System.IO;
+using mkNETtools.PluginHelper;
+using org.ebml.matroska;
+using org.ebml.io;
+
+namespace mkNETtools.Plugins.MatroskaInput
+{
+ /// <summary>
+ /// Summary description for MatroskaInput Plugin.
+ /// </summary>
+ [PluginAttribute]
+ public class MatroskaInput : IBaseInputPlugin
+ {
+ protected MatroskaFile m_File = null;
+ protected DataSource m_DataSource = null;
+
+ public MatroskaInput()
+ {
+ //
+ // TODO: Add constructor logic here
+ //
+ }
+ #region IBaseInputPlugin Members
+
+ public Frame GetNextFrame(ITrackInfo Track)
+ {
+ MatroskaFileFrame mFrame = m_File.getNextFrame(Track.Number);
+ Frame frame = new Frame();
+ frame.Track = Track;
+ frame.Timecode = mFrame.Timecode;
+ frame.Duration = mFrame.Duration;
+
+ int referenceCount = 1;
+ if (mFrame.References != null)
+ referenceCount += mFrame.References.Length;
+
+ frame.References = new double[referenceCount];
+ frame.References[0] = mFrame.Reference;
+ for (int i = 1; i < referenceCount; i++)
+ frame.References[i] = mFrame.References[i];
+
+ return frame;
+ }
+
+ public ITrackInfo [] GetTracks()
+ {
+ MatroskaFileTrack [] mTrackList = m_File.getTrackList();
+ ITrackInfo [] tracks = new ITrackInfo[mTrackList.Length];
+ for (int i = 0; i < mTrackList.Length; i++)
+ {
+ MatroskaFileTrack mTrack = mTrackList[i];
+ if (mTrack.TrackType == MatroskaDocType.track_audio)
+ {
+ AudioTrackInfo aTrack = new AudioTrackInfo();
+
+ aTrack.Channels = mTrack.Audio_Channels;
+ aTrack.Bitdepth = mTrack.Audio_BitDepth;
+ aTrack.SamplingRate = mTrack.Audio_SamplingFrequency;
+ aTrack.OutputSamplingRate = mTrack.Audio_OutputSamplingFrequency;
+
+ tracks[i] = aTrack;
+ }
+ else if (mTrack.TrackType == MatroskaDocType.track_video)
+ {
+ VideoTrackInfo vTrack = new VideoTrackInfo();
+
+ vTrack.DisplayHeight = mTrack.Video_DisplayHeight;
+ vTrack.DisplayWidth = mTrack.Video_DisplayWidth;
+ vTrack.Height = mTrack.Video_PixelHeight;
+ vTrack.Width = mTrack.Video_PixelWidth;
+
+ tracks[i] = vTrack;
+ }
+ else
+ {
+ tracks[i] = new TrackInfo();
+ }
+ ITrackInfo track = tracks[i];
+ track.Number = mTrack.TrackNo;
+ track.Name = mTrack.Name;
+ track.Language = mTrack.Language;
+ track.CodecID = mTrack.CodecID;
+ if (mTrack.CodecPrivate != null)
+ {
+ track.CodecPrivate = ArrayCopy.SByteToByte(mTrack.CodecPrivate);
+ }
+ }
+ return tracks;
+ }
+
+ #endregion
+
+ #region IBaseFilePlugin Members
+
+ public string DefaultExt
+ {
+ get
+ {
+ return "mkv";
+ }
+ }
+
+ public void Close()
+ {
+ m_File = null;
+ m_DataSource = null;
+ }
+
+ public void Open(string filename)
+ {
+ m_DataSource = new FileDataSource(filename, "r");
+ m_File = new MatroskaFile(m_DataSource);
+ }
+
+ public bool IsSupported(string filename)
+ {
+ string ext = Path.GetExtension(filename).ToLower();
+
+ if (ext.CompareTo("mkv") != 0)
+ return true;
+ if (ext.CompareTo("mka") != 0)
+ return true;
+ if (ext.CompareTo("mks") != 0)
+ return true;
+
+ return false;
+ }
+
+ #endregion
+
+ #region IBasePlugin Members
+
+ public string GetPluginName()
+ {
+ return "Matroska Input Plugin v1.0";
+ }
+
+ #endregion
+ }
+}
Added: trunk/mkNETtools/Plugins/MatroskaInput/MatroskaInput.csproj
===================================================================
--- trunk/mkNETtools/Plugins/MatroskaInput/MatroskaInput.csproj 2004-10-12 22:59:49 UTC (rev 876)
+++ trunk/mkNETtools/Plugins/MatroskaInput/MatroskaInput.csproj 2004-10-13 06:30:48 UTC (rev 877)
@@ -0,0 +1,110 @@
+<VisualStudioProject>
+ <CSHARP
+ ProjectType = "Local"
+ ProductVersion = "7.10.3077"
+ SchemaVersion = "2.0"
+ ProjectGuid = "{47F9CE8F-27D5-4F85-8DE6-0D8FFBF62774}"
+ >
+ <Build>
+ <Settings
+ ApplicationIcon = ""
+ AssemblyKeyContainerName = ""
+ AssemblyName = "mkNETtools.Plugins.MatroskaInput"
+ AssemblyOriginatorKeyFile = ""
+ DefaultClientScript = "JScript"
+ DefaultHTMLPageLayout = "Grid"
+ DefaultTargetSchema = "IE50"
+ DelaySign = "false"
+ OutputType = "Library"
+ PreBuildEvent = ""
+ PostBuildEvent = ""
+ RootNamespace = "mkNETtools.Plugins.MatroskaInput"
+ RunPostBuildEvent = "OnBuildSuccess"
+ StartupObject = ""
+ >
+ <Config
+ Name = "Debug"
+ AllowUnsafeBlocks = "false"
+ BaseAddress = "285212672"
+ CheckForOverflowUnderflow = "false"
+ ConfigurationOverrideFile = ""
+ DefineConstants = "DEBUG;TRACE"
+ DocumentationFile = ""
+ DebugSymbols = "true"
+ FileAlignment = "4096"
+ IncrementalBuild = "false"
+ NoStdLib = "false"
+ NoWarn = ""
+ Optimize = "false"
+ OutputPath = "..\..\Debug\"
+ RegisterForComInterop = "false"
+ RemoveIntegerChecks = "false"
+ TreatWarningsAsErrors = "false"
+ WarningLevel = "4"
+ />
+ <Config
+ Name = "Release"
+ AllowUnsafeBlocks = "false"
+ BaseAddress = "285212672"
+ CheckForOverflowUnderflow = "false"
+ ConfigurationOverrideFile = ""
+ DefineConstants = "TRACE"
+ DocumentationFile = ""
+ DebugSymbols = "false"
+ FileAlignment = "4096"
+ IncrementalBuild = "false"
+ NoStdLib = "false"
+ NoWarn = ""
+ Optimize = "true"
+ OutputPath = "..\..\Release\"
+ RegisterForComInterop = "false"
+ RemoveIntegerChecks = "false"
+ TreatWarningsAsErrors = "false"
+ WarningLevel = "4"
+ />
+ </Settings>
+ <References>
+ <Reference
+ Name = "System"
+ AssemblyName = "System"
+ HintPath = "C:\WINXP\Microsoft.NET\Framework\v1.1.4322\System.dll"
+ />
+ <Reference
+ Name = "PluginHelper"
+ Project = "{BEE56F2B-43B9-407E-9579-BBE863D23AD7}"
+ Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
+ />
+ <Reference
+ Name = "JEBML"
+ AssemblyName = "JEBML"
+ HintPath = "JEBML.dll"
+ />
+ <Reference
+ Name = "IKVM.GNU.Classpath"
+ AssemblyName = "IKVM.GNU.Classpath"
+ HintPath = "IKVM.GNU.Classpath.dll"
+ />
+ <Reference
+ Name = "IKVM.Runtime"
+ AssemblyName = "IKVM.Runtime"
+ HintPath = "IKVM.Runtime.dll"
+ />
+ </References>
+ </Build>
+ <Files>
+ <Include>
+ <File
+ RelPath = "AssemblyInfo.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "MatroskaInput.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ </Include>
+ </Files>
+ </CSHARP>
+</VisualStudioProject>
+
Added: trunk/mkNETtools/Plugins/MatroskaInput/MatroskaInput.csproj.user
===================================================================
--- trunk/mkNETtools/Plugins/MatroskaInput/MatroskaInput.csproj.user 2004-10-12 22:59:49 UTC (rev 876)
+++ trunk/mkNETtools/Plugins/MatroskaInput/MatroskaInput.csproj.user 2004-10-13 06:30:48 UTC (rev 877)
@@ -0,0 +1,48 @@
+<VisualStudioProject>
+ <CSHARP LastOpenVersion = "7.10.3077" >
+ <Build>
+ <Settings ReferencePath = "D:\Visual Studio Projects\matroska\mkNETtools\Plugins\MatroskaInput\" >
+ <Config
+ Name = "Debug"
+ EnableASPDebugging = "false"
+ EnableASPXDebugging = "false"
+ EnableUnmanagedDebugging = "false"
+ EnableSQLServerDebugging = "false"
+ RemoteDebugEnabled = "false"
+ RemoteDebugMachine = ""
+ StartAction = "Project"
+ StartArguments = ""
+ StartPage = ""
+ StartProgram = ""
+ StartURL = ""
+ StartWorkingDirectory = ""
+ StartWithIE = "true"
+ />
+ <Config
+ Name = "Release"
+ EnableASPDebugging = "false"
+ EnableASPXDebugging = "false"
+ EnableUnmanagedDebugging = "false"
+ EnableSQLServerDebugging = "false"
+ RemoteDebugEnabled = "false"
+ RemoteDebugMachine = ""
+ StartAction = "Project"
+ StartArguments = ""
+ StartPage = ""
+ StartProgram = ""
+ StartURL = ""
+ StartWorkingDirectory = ""
+ StartWithIE = "false"
+ />
+ </Settings>
+ </Build>
+ <OtherProjectSettings
+ CopyProjectDestinationFolder = ""
+ CopyProjectUncPath = ""
+ CopyProjectOption = "0"
+ ProjectView = "ProjectFiles"
+ ProjectTrust = "0"
+ />
+ </CSHARP>
+</VisualStudioProject>
+
Modified: trunk/mkNETtools/Plugins/TestPlugin/TestPlugin.cs
===================================================================
--- trunk/mkNETtools/Plugins/TestPlugin/TestPlugin.cs 2004-10-12 22:59:49 UTC (rev 876)
+++ trunk/mkNETtools/Plugins/TestPlugin/TestPlugin.cs 2004-10-13 06:30:48 UTC (rev 877)
@@ -16,16 +16,6 @@
#region IBasePlugin Members
- public void Load()
- {
- // TODO: Add TestPlugin.Unload implementation
- }
-
- public void Unload()
- {
- // TODO: Add TestPlugin.Unload implementation
- }
-
public string GetPluginName()
{
return "Test Plugin v1.0";
Modified: trunk/mkNETtools/mkNETtools.sln
===================================================================
--- trunk/mkNETtools/mkNETtools.sln 2004-10-12 22:59:49 UTC (rev 876)
+++ trunk/mkNETtools/mkNETtools.sln 2004-10-13 06:30:48 UTC (rev 877)
@@ -11,6 +11,10 @@
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MatroskaInput", "Plugins\MatroskaInput\MatroskaInput.csproj", "{47F9CE8F-27D5-4F85-8DE6-0D8FFBF62774}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug
@@ -29,6 +33,10 @@
{6AABBCC0-FC46-4AA1-920C-4F6EFFB7E6E8}.Debug.Build.0 = Debug|.NET
{6AABBCC0-FC46-4AA1-920C-4F6EFFB7E6E8}.Release.ActiveCfg = Release|.NET
{6AABBCC0-FC46-4AA1-920C-4F6EFFB7E6E8}.Release.Build.0 = Release|.NET
+ {47F9CE8F-27D5-4F85-8DE6-0D8FFBF62774}.Debug.ActiveCfg = Debug|.NET
+ {47F9CE8F-27D5-4F85-8DE6-0D8FFBF62774}.Debug.Build.0 = Debug|.NET
+ {47F9CE8F-27D5-4F85-8DE6-0D8FFBF62774}.Release.ActiveCfg = Release|.NET
+ {47F9CE8F-27D5-4F85-8DE6-0D8FFBF62774}.Release.Build.0 = Release|.NET
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.