[matroska] r880 - in trunk/mkNETtools: CLI MuxEngine PluginHelper PluginManager Plugins/MatroskaInput Plugins/TestPlugin Plugins/WavPlugin

[email protected]
Newsgroups gmane.comp.multimedia.matroska.cvs
Message-ID <[email protected]>
Author: jcsston
Date: 2004-10-14 08:36:48 +0400 (Thu, 14 Oct 2004)
New Revision: 880

Added:
   trunk/mkNETtools/MuxEngine/InputTrackInfo.cs
   trunk/mkNETtools/MuxEngine/OutputTarget.cs
Modified:
   trunk/mkNETtools/CLI/CLI.csproj
   trunk/mkNETtools/CLI/Test.cs
   trunk/mkNETtools/MuxEngine/InputSource.cs
   trunk/mkNETtools/MuxEngine/MuxEngine.cs
   trunk/mkNETtools/MuxEngine/MuxEngine.csproj
   trunk/mkNETtools/MuxEngine/MuxThread.cs
   trunk/mkNETtools/PluginHelper/Interfaces.cs
   trunk/mkNETtools/PluginManager/PluginManager.cs
   trunk/mkNETtools/Plugins/MatroskaInput/MatroskaInput.cs
   trunk/mkNETtools/Plugins/MatroskaInput/MatroskaInput.csproj
   trunk/mkNETtools/Plugins/MatroskaInput/MatroskaInput.csproj.user
   trunk/mkNETtools/Plugins/TestPlugin/TestPlugin.cs
   trunk/mkNETtools/Plugins/WavPlugin/WavOutput.cs
Log:
Almost working, runs without crashing but no output file is created.

Modified: trunk/mkNETtools/CLI/CLI.csproj
===================================================================
--- trunk/mkNETtools/CLI/CLI.csproj	2004-10-13 17:24:39 UTC (rev 879)
+++ trunk/mkNETtools/CLI/CLI.csproj	2004-10-14 04:36:48 UTC (rev 880)
@@ -74,6 +74,11 @@
                     Project = "{7CBBC988-B4BD-4610-AA07-BE171A60D723}"
                     Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
                 />
+                <Reference
+                    Name = "MuxEngine"
+                    Project = "{A98EF19E-393D-4EDB-A83F-8D242E770363}"
+                    Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
+                />
             </References>
         </Build>
         <Files>

Modified: trunk/mkNETtools/CLI/Test.cs
===================================================================
--- trunk/mkNETtools/CLI/Test.cs	2004-10-13 17:24:39 UTC (rev 879)
+++ trunk/mkNETtools/CLI/Test.cs	2004-10-14 04:36:48 UTC (rev 880)
@@ -10,6 +10,9 @@
 */
 
 using System;
+using System.Threading;
+using mkNETtools.PluginManager;
+using mkNETtools.MuxEngine;
 
 namespace mkNETtools.CLI 
 {
@@ -27,12 +30,17 @@
       // Command line parsing
       ArgumentProcessor CommandLine = new ArgumentProcessor(Args);
 
+      string inputFilename;
+      string outputFilename;
+      
       // Look for specific arguments values and display them if they exist (return null if they don't)
-      if (CommandLine["i"] != null) 
+      inputFilename = CommandLine["i"];
+      if (CommandLine["i"] != null)
         Console.WriteLine("i value: " + CommandLine["i"]);
       else 
         Console.WriteLine("i not defined !");
 			
+      outputFilename = CommandLine["o"];
       if (CommandLine["o"] != null) 
         Console.WriteLine("o value: " + CommandLine["o"]);
       else 
@@ -41,11 +49,21 @@
       PluginManager.PluginManager manager = new PluginManager.PluginManager();
       foreach (string name in manager.PluginNames) 
       {
-        Console.Out.WriteLine("Plugin Name: " + name);
+        Console.Out.WriteLine("Loaded Plugin " + name);
       }
+      MuxEngine.MuxEngine engine = new MuxEngine.MuxEngine(manager);
+      engine.AddInput(inputFilename);
+      engine.OutputFilename = outputFilename;
+      engine.Start();
 
+      while (engine.Complete == false) 
+      {
+        Thread.Sleep(100);
+      }
+
+
       // Wait for key
-      Console.Out.WriteLine("Arguments parsed. Press a key...");
+      Console.Out.WriteLine("Press any key...");
       Console.Read();
     }
   }

Modified: trunk/mkNETtools/MuxEngine/InputSource.cs
===================================================================
--- trunk/mkNETtools/MuxEngine/InputSource.cs	2004-10-13 17:24:39 UTC (rev 879)
+++ trunk/mkNETtools/MuxEngine/InputSource.cs	2004-10-14 04:36:48 UTC (rev 880)
@@ -1,4 +1,5 @@
 using System;
+using System.Collections;
 using mkNETtools.PluginManager;
 using mkNETtools.PluginHelper;
 
@@ -9,11 +10,65 @@
 	/// </summary>
 	public class InputSource
 	{
+    protected string m_Filename = "";
     protected IBaseInputPlugin m_Plugin = null;
+    protected ArrayList m_Tracks = new ArrayList();
 
-		public InputSource(IBaseInputPlugin plugin)
+    private IBaseInputPlugin SearchForSupportedPlugin(PluginManager.PluginManager manager, string filename)
+    {
+      foreach (IBaseInputPlugin plugin in manager.InputPlugins) 
+      {
+        if (plugin.IsSupported(filename)) 
+        {          
+          return plugin;
+        }
+      }
+      return null;
+    }
+
+    private void FillTrackArray()
+    {
+      // Make sure the array is empty
+      m_Tracks.Clear();
+      m_Plugin.Open(m_Filename);
+      foreach (ITrackInfo track in m_Plugin.Tracks)
+      {
+        m_Tracks.Add(new InputTrackInfo(track));
+      }
+    }
+
+		public InputSource(PluginManager.PluginManager manager, string filename)
 		{
-      m_Plugin = plugin;
+      m_Plugin = SearchForSupportedPlugin(manager, filename);
+      if (m_Plugin == null)
+        throw new NotSupportedException("Input source: " + filename + " is not supported by any of the loaded input plugins.");
+
+      m_Filename = filename;
+      FillTrackArray();
 		}
+
+    public string Filename
+    {
+      get 
+      {        
+        return m_Filename;
+      }
+    }
+
+    public IBaseInputPlugin Plugin
+    {
+      get 
+      {        
+        return m_Plugin;
+      }
+    }
+
+    public InputTrackInfo [] Tracks
+    {
+      get 
+      {   
+        return (InputTrackInfo [])m_Tracks.ToArray(typeof(InputTrackInfo));
+      }
+    }
 	}
 }

Added: trunk/mkNETtools/MuxEngine/InputTrackInfo.cs
===================================================================
--- trunk/mkNETtools/MuxEngine/InputTrackInfo.cs	2004-10-13 17:24:39 UTC (rev 879)
+++ trunk/mkNETtools/MuxEngine/InputTrackInfo.cs	2004-10-14 04:36:48 UTC (rev 880)
@@ -0,0 +1,39 @@
+using System;
+using mkNETtools.PluginHelper;
+
+namespace mkNETtools.MuxEngine
+{
+	/// <summary>
+	/// Summary description for InputTrackInfo.
+	/// </summary>
+	public class InputTrackInfo
+	{
+    protected bool m_Enabled = true;
+    protected ITrackInfo m_Track = null;
+
+		public InputTrackInfo(ITrackInfo track)
+		{
+      m_Track = track;
+		}
+
+    public bool Enabled 
+    {
+      get 
+      {
+        return m_Enabled;
+      }
+      set
+      {
+        m_Enabled = value;
+      }
+    }
+
+    public ITrackInfo Track 
+    {
+      get 
+      {
+        return m_Track;
+      }
+    }
+	}
+}

Modified: trunk/mkNETtools/MuxEngine/MuxEngine.cs
===================================================================
--- trunk/mkNETtools/MuxEngine/MuxEngine.cs	2004-10-13 17:24:39 UTC (rev 879)
+++ trunk/mkNETtools/MuxEngine/MuxEngine.cs	2004-10-14 04:36:48 UTC (rev 880)
@@ -1,5 +1,6 @@
 using System;
 using System.Collections;
+using mkNETtools.PluginManager;
 
 namespace mkNETtools.MuxEngine
 {
@@ -8,19 +9,25 @@
 	/// </summary>
 	public class MuxEngine
 	{
+    PluginManager.PluginManager m_Manager = null;
     protected ArrayList m_Input = new ArrayList();
     protected string m_OutputFilename = "";
+    protected OutputTarget m_Output = null;
     protected MuxThread m_Thread = new MuxThread();
 
-		public MuxEngine()
+		public MuxEngine(PluginManager.PluginManager manager)
 		{
-			//
-			// TODO: Add constructor logic here
-			//
+			m_Manager = manager;
 		}
 
-    void AddInput(InputSource input) 
+    public void AddInput(string filename) 
     {
+      InputSource input = new InputSource(m_Manager, filename);
+      AddInput(input);
+    }
+
+    public void AddInput(InputSource input) 
+    {
       m_Input.Add(input);
     }
 
@@ -31,18 +38,27 @@
         return m_OutputFilename;
       }
       set
+      { 
+        m_Output = new OutputTarget(m_Manager, value);
+        m_OutputFilename = value;        
+      }
+    }
+
+    public bool Complete
+    {
+      get 
       {
-        m_OutputFilename = value;
+        return m_Thread.Complete;
       }
     }
 
-    void Start()
+    public void Start()
     {
-      m_Thread.Load(m_Input, m_OutputFilename);
+      m_Thread.Load(m_Input, m_Output);
       m_Thread.Start();
     }
 
-    void Stop()
+    public void Stop()
     {
       m_Thread.Stop();
     }

Modified: trunk/mkNETtools/MuxEngine/MuxEngine.csproj
===================================================================
--- trunk/mkNETtools/MuxEngine/MuxEngine.csproj	2004-10-13 17:24:39 UTC (rev 879)
+++ trunk/mkNETtools/MuxEngine/MuxEngine.csproj	2004-10-14 04:36:48 UTC (rev 880)
@@ -94,6 +94,11 @@
                     BuildAction = "Compile"
                 />
                 <File
+                    RelPath = "InputTrackInfo.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
                     RelPath = "MuxEngine.cs"
                     SubType = "Code"
                     BuildAction = "Compile"
@@ -103,6 +108,11 @@
                     SubType = "Code"
                     BuildAction = "Compile"
                 />
+                <File
+                    RelPath = "OutputTarget.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
             </Include>
         </Files>
     </CSHARP>

Modified: trunk/mkNETtools/MuxEngine/MuxThread.cs
===================================================================
--- trunk/mkNETtools/MuxEngine/MuxThread.cs	2004-10-13 17:24:39 UTC (rev 879)
+++ trunk/mkNETtools/MuxEngine/MuxThread.cs	2004-10-14 04:36:48 UTC (rev 880)
@@ -1,6 +1,7 @@
 using System;
 using System.Collections;
 using System.Threading;
+using mkNETtools.PluginHelper;
 
 namespace mkNETtools.MuxEngine
 {
@@ -11,8 +12,9 @@
 	{
     protected Thread m_Thread = null;
     protected bool m_bExit = false;
-    protected ArrayList m_Input;
-    protected string m_OutputFilename;
+    protected ArrayList m_Input = null;
+    protected OutputTarget m_Output = null;
+    protected bool m_Complete = false;
 
 		public MuxThread()
 		{
@@ -20,12 +22,20 @@
       m_Thread.Name = "Muxing Thread";
 		}
 
-    public void Load(ArrayList input, string outputFilename)
+    public void Load(ArrayList input, OutputTarget output)
     {
       m_Input = input;
-      m_OutputFilename = outputFilename;
+      m_Output = output;
     }
 
+    public bool Complete
+    {
+      get 
+      {
+        return m_Complete;
+      }
+    }
+
     public void Start()
     {
       m_Thread.Start();
@@ -38,13 +48,77 @@
         throw new ThreadInterruptedException("Muxing Thread failed to exit after 30 seconds");
     }
 
-    protected void ThreadProc()
+    private double LongestTrackDuration
     {
-      while (!m_bExit) 
+      get 
       {
+        double duration = 0.0;
+        foreach (InputSource input in m_Input)
+        {
+          foreach (InputTrackInfo track in input.Tracks)
+          {
+            if (track.Enabled) 
+            {
+              if (track.Track.Duration > duration)
+                duration = track.Track.Duration;
+            }
+          }
+        }
+        return duration;
+      }
+    }
+    /// <summary>
+    /// Main processing loop
+    /// </summary>
+    protected void ThreadProc()
+    {      
+      m_Complete = false;
+      try 
+      {
+        double totalDuration = this.LongestTrackDuration;
+        double lastTimecode = 0.0;
+        int lastPercent = 0;
 
-        Thread.Sleep(10);
+        while (!m_bExit) 
+        {
+          bool bEOF = true;
+          foreach (InputSource input in m_Input)
+          {
+            foreach (InputTrackInfo track in input.Tracks)
+            {
+              if (track.Enabled) 
+              {
+                Frame frame = input.Plugin.GetNextFrame(track.Track);
+                if (frame != null) 
+                {
+                  m_Output.Plugin.WriteFrame(ref frame);
+                  lastTimecode = frame.Timecode;
+                  bEOF = false;
+                }
+              }
+            }
+          }
+          int percent = (int)((100.0 / totalDuration) * lastTimecode);
+          if (percent != lastPercent) 
+          {
+            Console.Out.WriteLine(percent + "%");
+            lastPercent = percent;
+          }
+          Thread.Sleep(10);
+          if (bEOF)
+            break;
+        }
+        // Close the output file
+        m_Output.Plugin.Close();
+      } 
+      catch (Exception ex) 
+      {
+        throw;
       }
+      finally
+      {
+        m_Complete = true;
+      }
     }
 	}
 }

Added: trunk/mkNETtools/MuxEngine/OutputTarget.cs
===================================================================
--- trunk/mkNETtools/MuxEngine/OutputTarget.cs	2004-10-13 17:24:39 UTC (rev 879)
+++ trunk/mkNETtools/MuxEngine/OutputTarget.cs	2004-10-14 04:36:48 UTC (rev 880)
@@ -0,0 +1,53 @@
+using System;
+using mkNETtools.PluginManager;
+using mkNETtools.PluginHelper;
+
+namespace mkNETtools.MuxEngine
+{
+	/// <summary>
+	/// Summary description for OutputTarget.
+	/// </summary>
+	public class OutputTarget
+	{
+    protected string m_Filename = "";
+    protected IBaseOutputPlugin m_Plugin = null;
+
+    private IBaseOutputPlugin SearchForSupportedPlugin(PluginManager.PluginManager manager, string filename)
+    {
+      foreach (IBaseOutputPlugin plugin in manager.OutputPlugins) 
+      {
+        if (plugin.IsSupported(filename)) 
+        {          
+          return plugin;
+        }
+      }
+      return null;
+    }
+
+    public OutputTarget(PluginManager.PluginManager manager, string filename)
+    {
+      m_Plugin = SearchForSupportedPlugin(manager, filename);
+      if (m_Plugin == null)
+        throw new NotSupportedException("Output target: " + filename + " is not supported by any of the loaded output plugins.");
+
+      m_Filename = filename;
+      m_Plugin.Open(m_Filename);
+    }
+
+    public string Filename
+    {
+      get 
+      {        
+        return m_Filename;
+      }
+    }
+
+    public IBaseOutputPlugin Plugin
+    {
+      get 
+      {        
+        return m_Plugin;
+      }
+    }
+	}
+}

Modified: trunk/mkNETtools/PluginHelper/Interfaces.cs
===================================================================
--- trunk/mkNETtools/PluginHelper/Interfaces.cs	2004-10-13 17:24:39 UTC (rev 879)
+++ trunk/mkNETtools/PluginHelper/Interfaces.cs	2004-10-14 04:36:48 UTC (rev 880)
@@ -16,10 +16,9 @@
     /// </summary>
     //void Unload();
     /// <summary>
-    /// Get the plugin name
+    /// The plugin name
     /// </summary>
-    /// <returns>Plugin name</returns>
-    string GetPluginName();
+    string PluginName { get; }
   }
    
   /// <summary>
@@ -43,8 +42,9 @@
     /// <returns>Returns true is the file is supported</returns>
     bool IsSupported(string filename);
     /// <summary>
-    /// The default file extension
+    /// The default file extension(s)
     /// </summary>
+    /// <remarks>If there are more than one use |'s to separate them</remarks>
     string DefaultExt { get; }
   }
 
@@ -87,7 +87,7 @@
   /// <summary>
   /// Frame struct
   /// </summary>
-  public struct Frame
+  public class Frame
   {
     public ITrackInfo Track;
     public double Timecode;
@@ -102,14 +102,13 @@
   public interface IBaseInputPlugin : IBaseFilePlugin
   {
     /// <summary>
-    /// Get the source tracks for the currently open input file.
+    /// The source tracks for the currently open input file.
     /// </summary>
-    /// <returns>A array of ITrackInfo interfaces</returns>
     /// <remarks>
-    /// The returned array is read-only. Trying to set a property 
+    /// The array is read-only. Trying to set a property 
     /// will result in a MemberAccessException being thrown.
     /// </remarks>
-    ITrackInfo [] GetTracks();
+    ITrackInfo [] Tracks { get; }
     /// <summary>
     /// Get the next frame for a track
     /// </summary>
@@ -123,7 +122,7 @@
   /// </summary>
   public interface IBaseOutputPlugin : IBaseFilePlugin
   {      
-    void SetTracks(ITrackInfo [] tracks);
+    ITrackInfo [] Tracks { set; }
     void WriteFrame(ref Frame frame);
   }
 

Modified: trunk/mkNETtools/PluginManager/PluginManager.cs
===================================================================
--- trunk/mkNETtools/PluginManager/PluginManager.cs	2004-10-13 17:24:39 UTC (rev 879)
+++ trunk/mkNETtools/PluginManager/PluginManager.cs	2004-10-14 04:36:48 UTC (rev 880)
@@ -78,7 +78,7 @@
         for (int i = 0; i < plugins.Count; i++)
         {
           IBasePlugin plugin = (IBasePlugin)plugins[i];
-          output[i] = plugin.GetPluginName() + " : " + plugin.GetType().FullName;
+          output[i] = plugin.PluginName;// + " : " + plugin.GetType().FullName;
         }
         return output;
       }
@@ -100,9 +100,14 @@
 
         foreach (IBasePlugin plugin in plugins)
         {
-          if (plugin == typeof(IBaseInputPlugin)) 
+          Type [] types = plugin.GetType().GetInterfaces();
+          foreach (Type type in types) 
           {
-            inputPlugins.Add(plugin);
+            if (type == typeof(IBaseInputPlugin)) 
+            {
+              inputPlugins.Add(plugin);
+              break;
+            }
           }
         }
 
@@ -118,9 +123,13 @@
 
         foreach (IBasePlugin plugin in plugins)
         {
-          if (plugin == typeof(IBaseOutputPlugin)) 
+          Type [] types = plugin.GetType().GetInterfaces();
+          foreach (Type type in types) 
           {
-            outputPlugins.Add(plugin);
+            if (type == typeof(IBaseOutputPlugin)) 
+            {
+              outputPlugins.Add(plugin);
+            }
           }
         }
 

Modified: trunk/mkNETtools/Plugins/MatroskaInput/MatroskaInput.cs
===================================================================
--- trunk/mkNETtools/Plugins/MatroskaInput/MatroskaInput.cs	2004-10-13 17:24:39 UTC (rev 879)
+++ trunk/mkNETtools/Plugins/MatroskaInput/MatroskaInput.cs	2004-10-14 04:36:48 UTC (rev 880)
@@ -26,67 +26,76 @@
     public Frame GetNextFrame(ITrackInfo Track)
     {
       MatroskaFileFrame mFrame = m_File.getNextFrame(Track.Number);
+      // Check for EOS
+      if (mFrame == null)
+        return null;
+
       Frame frame = new Frame();
       frame.Track = Track;
-      frame.Timecode = mFrame.Timecode;
-      frame.Duration = mFrame.Duration;
+      frame.Timecode = (mFrame.Timecode * 1000.0);
+      frame.Duration = (mFrame.Duration * 1000.0);
       
       int referenceCount = 1;
       if (mFrame.References != null)
         referenceCount += mFrame.References.Length;
 
       frame.References = new double[referenceCount];
-      frame.References[0] = mFrame.Reference;
+      frame.References[0] = (mFrame.Reference * 1000.0);
       for (int i = 1; i < referenceCount; i++)
-        frame.References[i] = mFrame.References[i];
+        frame.References[i] = (mFrame.References[i] * 1000.0);
 
       return frame;
     }
 
-    public ITrackInfo [] GetTracks()
+    public ITrackInfo [] Tracks
     {
-      MatroskaFileTrack [] mTrackList = m_File.getTrackList();
-      ITrackInfo [] tracks = new ITrackInfo[mTrackList.Length];
-      for (int i = 0; i < mTrackList.Length; i++)
+      get 
       {
-        MatroskaFileTrack mTrack = mTrackList[i];
-        if (mTrack.TrackType == MatroskaDocType.track_audio) 
+        MatroskaFileTrack [] mTrackList = m_File.getTrackList();
+        ITrackInfo [] tracks = new ITrackInfo[mTrackList.Length];
+        for (int i = 0; i < mTrackList.Length; i++)
         {
-          AudioTrackInfo aTrack = new AudioTrackInfo();
+          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;
+            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();
+            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;
+            vTrack.DisplayHeight = mTrack.Video_DisplayHeight;
+            vTrack.DisplayWidth = mTrack.Video_DisplayWidth;
+            vTrack.Height = mTrack.Video_PixelHeight;
+            vTrack.Width = mTrack.Video_PixelWidth;
 
-          tracks[i] = vTrack;
+            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);
+          }
+          // Currently all Matroska tracks share the file duration
+          track.Duration = m_File.getDuration();
         }
-        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;
       }
-      return tracks;
     }
 
     #endregion
@@ -117,11 +126,11 @@
     {
       string ext = Path.GetExtension(filename).ToLower();
 
-      if (ext.CompareTo("mkv") != 0)
+      if (ext.CompareTo(".mkv") == 0)
         return true;
-      if (ext.CompareTo("mka") != 0)
+      if (ext.CompareTo(".mka") == 0)
         return true;
-      if (ext.CompareTo("mks") != 0)
+      if (ext.CompareTo(".mks") == 0)
         return true;
       
       return false;
@@ -131,9 +140,12 @@
 
     #region IBasePlugin Members
 
-    public string GetPluginName()
+    public string PluginName
     {
-      return "Matroska Input Plugin v1.0";
+      get 
+      {
+        return "Matroska Input Plugin v1.0";
+      }
     }
 
     #endregion

Modified: trunk/mkNETtools/Plugins/MatroskaInput/MatroskaInput.csproj
===================================================================
--- trunk/mkNETtools/Plugins/MatroskaInput/MatroskaInput.csproj	2004-10-13 17:24:39 UTC (rev 879)
+++ trunk/mkNETtools/Plugins/MatroskaInput/MatroskaInput.csproj	2004-10-14 04:36:48 UTC (rev 880)
@@ -77,18 +77,8 @@
                 <Reference
                     Name = "JEBML"
                     AssemblyName = "JEBML"
-                    HintPath = "JEBML.dll"
+                    HintPath = "..\..\..\JEBML\bin\Debug\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>

Modified: trunk/mkNETtools/Plugins/MatroskaInput/MatroskaInput.csproj.user
===================================================================
--- trunk/mkNETtools/Plugins/MatroskaInput/MatroskaInput.csproj.user	2004-10-13 17:24:39 UTC (rev 879)
+++ trunk/mkNETtools/Plugins/MatroskaInput/MatroskaInput.csproj.user	2004-10-14 04:36:48 UTC (rev 880)
@@ -1,7 +1,7 @@
 <VisualStudioProject>
     <CSHARP LastOpenVersion = "7.10.3077" >
         <Build>
-            <Settings ReferencePath = "D:\Visual Studio Projects\matroska\mkNETtools\Plugins\MatroskaInput\" >
+            <Settings ReferencePath = "D:\Visual Studio Projects\matroska\JEBML\bin\Debug\;D:\Visual Studio Projects\matroska\mkNETtools\Plugins\MatroskaInput\" >
                 <Config
                     Name = "Debug"
                     EnableASPDebugging = "false"

Modified: trunk/mkNETtools/Plugins/TestPlugin/TestPlugin.cs
===================================================================
--- trunk/mkNETtools/Plugins/TestPlugin/TestPlugin.cs	2004-10-13 17:24:39 UTC (rev 879)
+++ trunk/mkNETtools/Plugins/TestPlugin/TestPlugin.cs	2004-10-14 04:36:48 UTC (rev 880)
@@ -16,9 +16,12 @@
 
     #region IBasePlugin Members
 
-    public string GetPluginName()
+    public string PluginName
     {      
-      return "Test Plugin v1.0";
+      get 
+      {
+        return "Test Plugin v1.0";
+      }
     }
 
     #endregion

Modified: trunk/mkNETtools/Plugins/WavPlugin/WavOutput.cs
===================================================================
--- trunk/mkNETtools/Plugins/WavPlugin/WavOutput.cs	2004-10-13 17:24:39 UTC (rev 879)
+++ trunk/mkNETtools/Plugins/WavPlugin/WavOutput.cs	2004-10-14 04:36:48 UTC (rev 880)
@@ -24,52 +24,56 @@
 
     #region IBaseOutputPlugin Members
 
-    public void SetTracks(ITrackInfo [] tracks)
+    public ITrackInfo [] Tracks
     {
-      if (tracks.Length != 1)
-        throw new ArgumentException("Wav only supports one track!");
+      set 
+      {
+        ITrackInfo [] tracks = value;
+        if (tracks.Length != 1)
+          throw new ArgumentException("Wav only supports one track!");
             
-      try 
-      {
-        IAudioTrackInfo track = (IAudioTrackInfo)tracks[0];
+        try 
+        {
+          IAudioTrackInfo track = (IAudioTrackInfo)tracks[0];
         
-        m_Wfx = new WaveFormatEx();
-        m_Wfx.nChannels = (short)track.Channels;
-        m_Wfx.wBitsPerSample = (short)track.Bitdepth;
-        // Should I use the sampling rate or ouptut sampling rate?
-        m_Wfx.nSamplesPerSec = (int)track.SamplingRate;
-        //m_Wfx.nSamplesPerSec = (int)track.OutputSamplingRate;
-        m_Wfx.cbSize = 0;
+          m_Wfx = new WaveFormatEx();
+          m_Wfx.nChannels = (short)track.Channels;
+          m_Wfx.wBitsPerSample = (short)track.Bitdepth;
+          // Should I use the sampling rate or ouptut sampling rate?
+          m_Wfx.nSamplesPerSec = (int)track.SamplingRate;
+          //m_Wfx.nSamplesPerSec = (int)track.OutputSamplingRate;
+          m_Wfx.cbSize = 0;
 
-        if (track.CodecID == CodecIDs.AUDIO_ACM) 
+          if (track.CodecID == CodecIDs.AUDIO_ACM) 
+          {
+            MemoryStream memStream = new MemoryStream(track.CodecPrivate, 0, track.CodecPrivate.Length, false);
+            BinaryReader binReader = new BinaryReader(memStream);
+            m_Wfx.Read(binReader, track.CodecPrivate.Length);
+          }
+          else if (track.CodecID == CodecIDs.AUDIO_MPEG_LAYER3) 
+          {
+            m_Wfx.wFormatTag = (short)WaveFormatEx.WAVE_FORMAT_MPEG_LAYER3;
+            int wfxSize = m_Wfx.GetSize();
+            m_Wfx.cbSize = (short)(track.CodecPrivate.Length - wfxSize);
+            m_Wfx.cbData = new byte[m_Wfx.cbSize];
+            Array.Copy(track.CodecPrivate, wfxSize, m_Wfx.cbData, 0, m_Wfx.cbSize);
+          }
+          else if (track.CodecID == CodecIDs.AUDIO_MPEG_LAYER2 || track.CodecID == CodecIDs.AUDIO_MPEG_LAYER1) 
+          {
+            m_Wfx.wFormatTag = (short)WaveFormatEx.WAVE_FORMAT_MPEG_LAYER12;
+          }
+          else
+          {
+            throw new ArgumentException("CodecID: " + track.CodecID + " is not supported for wav output.");
+          }
+        } 
+        catch (InvalidCastException ex) 
         {
-          MemoryStream memStream = new MemoryStream(track.CodecPrivate, 0, track.CodecPrivate.Length, false);
-          BinaryReader binReader = new BinaryReader(memStream);
-          m_Wfx.Read(binReader, track.CodecPrivate.Length);
+          throw new ArgumentException("Wav only supports an audio track.", ex);
         }
-        else if (track.CodecID == CodecIDs.AUDIO_MPEG_LAYER3) 
-        {
-          m_Wfx.wFormatTag = (short)WaveFormatEx.WAVE_FORMAT_MPEG_LAYER3;
-          int wfxSize = m_Wfx.GetSize();
-          m_Wfx.cbSize = (short)(track.CodecPrivate.Length - wfxSize);
-          m_Wfx.cbData = new byte[m_Wfx.cbSize];
-          Array.Copy(track.CodecPrivate, wfxSize, m_Wfx.cbData, 0, m_Wfx.cbSize);
-        }
-        else if (track.CodecID == CodecIDs.AUDIO_MPEG_LAYER2 || track.CodecID == CodecIDs.AUDIO_MPEG_LAYER1) 
-        {
-          m_Wfx.wFormatTag = (short)WaveFormatEx.WAVE_FORMAT_MPEG_LAYER12;
-        }
-        else
-        {
-          throw new ArgumentException("CodecID: " + track.CodecID + " is not supported for wav output.");
-        }
-      } 
-      catch (InvalidCastException ex) 
-      {
-        throw new ArgumentException("Wav only supports an audio track.", ex);
+        // Now we can open the file
+        m_Writer.Open(m_Filename, m_Wfx);
       }
-      // Now we can open the file
-      m_Writer.Open(m_Filename, m_Wfx);
     }
 
     public void WriteFrame(ref Frame frame)
@@ -82,7 +86,6 @@
 
     #endregion
 
-
     #region IBaseFilePlugin Members
 
     public string DefaultExt
@@ -108,7 +111,7 @@
     {
       string ext = Path.GetExtension(filename).ToLower();
 
-      if (ext.CompareTo("wav") != 0)
+      if (ext.CompareTo(".wav") == 0)
         return true;
       
       return false;
@@ -118,9 +121,12 @@
 
     #region IBasePlugin Members
 
-    public string GetPluginName()
+    public string PluginName
     {
-      return "Wav Output Plugin v1.0";
+      get 
+      {
+        return "Wav Output Plugin v1.0";
+      }
     }
 
     #endregion
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.