Author: jcsston
Date: 2004-10-13 20:13:35 +0400 (Wed, 13 Oct 2004)
New Revision: 878
Added:
trunk/mkNETtools/PluginHelper/CodecIDs.cs
trunk/mkNETtools/PluginManager/
trunk/mkNETtools/PluginManager/AssemblyInfo.cs
trunk/mkNETtools/PluginManager/BaseController.cs
trunk/mkNETtools/PluginManager/PluginManager.cs
trunk/mkNETtools/PluginManager/PluginManager.csproj
trunk/mkNETtools/PluginManager/PluginManager.csproj.user
trunk/mkNETtools/Plugins/WavPlugin/
trunk/mkNETtools/Plugins/WavPlugin/AssemblyInfo.cs
trunk/mkNETtools/Plugins/WavPlugin/WavOutput.cs
trunk/mkNETtools/Plugins/WavPlugin/WavPlugin.csproj
trunk/mkNETtools/Plugins/WavPlugin/WavPlugin.csproj.user
Removed:
trunk/mkNETtools/PluginHelper/BaseController.cs
trunk/mkNETtools/PluginHelper/PluginManager.cs
Modified:
trunk/mkNETtools/CLI/CLI.csproj
trunk/mkNETtools/CLI/Test.cs
trunk/mkNETtools/PluginHelper/Interfaces.cs
trunk/mkNETtools/PluginHelper/PluginHelper.csproj
trunk/mkNETtools/mkNETtools.sln
Log:
Moving some of the PluginManager code into it's own project.
Started a wav output plugin, using WavLib.
Modified: trunk/mkNETtools/CLI/CLI.csproj
===================================================================
--- trunk/mkNETtools/CLI/CLI.csproj 2004-10-13 06:30:48 UTC (rev 877)
+++ trunk/mkNETtools/CLI/CLI.csproj 2004-10-13 16:13:35 UTC (rev 878)
@@ -70,8 +70,8 @@
HintPath = "C:\WINXP\Microsoft.NET\Framework\v1.1.4322\System.dll"
/>
<Reference
- Name = "PluginHelper"
- Project = "{BEE56F2B-43B9-407E-9579-BBE863D23AD7}"
+ Name = "PluginManager"
+ Project = "{7CBBC988-B4BD-4610-AA07-BE171A60D723}"
Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
/>
</References>
Modified: trunk/mkNETtools/CLI/Test.cs
===================================================================
--- trunk/mkNETtools/CLI/Test.cs 2004-10-13 06:30:48 UTC (rev 877)
+++ trunk/mkNETtools/CLI/Test.cs 2004-10-13 16:13:35 UTC (rev 878)
@@ -43,7 +43,7 @@
if(CommandLine["debug"]!=null) Console.WriteLine("Debug value: "+CommandLine["debug"]);
else Console.WriteLine("Debug not defined !");
- mkNETtools.PluginHelper.PluginManager manager = new mkNETtools.PluginHelper.PluginManager();
+ PluginManager.PluginManager manager = new PluginManager.PluginManager();
foreach (string name in manager.PluginNames)
{
Console.Out.WriteLine("Plugin Name: " + name);
Deleted: trunk/mkNETtools/PluginHelper/BaseController.cs
Added: trunk/mkNETtools/PluginHelper/CodecIDs.cs
===================================================================
--- trunk/mkNETtools/PluginHelper/CodecIDs.cs 2004-10-13 06:30:48 UTC (rev 877)
+++ trunk/mkNETtools/PluginHelper/CodecIDs.cs 2004-10-13 16:13:35 UTC (rev 878)
@@ -0,0 +1,17 @@
+using System;
+
+namespace mkNETtools.PluginHelper
+{
+ /// <summary>
+ /// Summary description for CodecIDs.
+ /// </summary>
+ public class CodecIDs
+ {
+ static public string VIDEO_VFW = "V_MS/VFW/FOURCC";
+
+ static public string AUDIO_ACM = "A_MS/ACM";
+ static public string AUDIO_MPEG_LAYER1 = "A_MPEG/L1";
+ static public string AUDIO_MPEG_LAYER2 = "A_MPEG/L2";
+ static public string AUDIO_MPEG_LAYER3 = "A_MPEG/L3";
+ }
+}
Modified: trunk/mkNETtools/PluginHelper/Interfaces.cs
===================================================================
--- trunk/mkNETtools/PluginHelper/Interfaces.cs 2004-10-13 06:30:48 UTC (rev 877)
+++ trunk/mkNETtools/PluginHelper/Interfaces.cs 2004-10-13 16:13:35 UTC (rev 878)
@@ -124,7 +124,7 @@
public interface IBaseOutputPlugin : IBaseFilePlugin
{
void SetTracks(ITrackInfo [] tracks);
- void WriteFrame(Frame frame);
+ void WriteFrame(ref Frame frame);
}
/// <summary>
Modified: trunk/mkNETtools/PluginHelper/PluginHelper.csproj
===================================================================
--- trunk/mkNETtools/PluginHelper/PluginHelper.csproj 2004-10-13 06:30:48 UTC (rev 877)
+++ trunk/mkNETtools/PluginHelper/PluginHelper.csproj 2004-10-13 16:13:35 UTC (rev 878)
@@ -76,7 +76,7 @@
/>
<Reference
Name = "System.XML"
- AssemblyName = "System.Xml"
+ AssemblyName = "System.XML"
HintPath = "C:\WINXP\Microsoft.NET\Framework\v1.1.4322\System.XML.dll"
/>
</References>
@@ -99,7 +99,7 @@
BuildAction = "Compile"
/>
<File
- RelPath = "BaseController.cs"
+ RelPath = "CodecIDs.cs"
SubType = "Code"
BuildAction = "Compile"
/>
@@ -109,11 +109,6 @@
BuildAction = "Compile"
/>
<File
- RelPath = "PluginManager.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
RelPath = "TrackInfo.cs"
SubType = "Code"
BuildAction = "Compile"
Deleted: trunk/mkNETtools/PluginHelper/PluginManager.cs
Added: trunk/mkNETtools/PluginManager/AssemblyInfo.cs
===================================================================
--- trunk/mkNETtools/PluginManager/AssemblyInfo.cs 2004-10-13 06:30:48 UTC (rev 877)
+++ trunk/mkNETtools/PluginManager/AssemblyInfo.cs 2004-10-13 16:13:35 UTC (rev 878)
@@ -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/PluginManager/BaseController.cs
===================================================================
--- trunk/mkNETtools/PluginManager/BaseController.cs 2004-10-13 06:30:48 UTC (rev 877)
+++ trunk/mkNETtools/PluginManager/BaseController.cs 2004-10-13 16:13:35 UTC (rev 878)
@@ -0,0 +1,126 @@
+using System;
+using System.Reflection;
+using System.Runtime.Remoting;
+using System.IO;
+using mkNETtools.PluginHelper;
+
+namespace mkNETtools.PluginManager
+{
+ /// <summary>
+ /// Summary description for BaseController.
+ /// </summary>
+ public abstract class BaseController
+ {
+ private PluginManager pm;
+ private MarshalByRefObject[] objs;
+ private AppDomain plugdom;
+ private FileSystemWatcher fsw;
+
+ protected BaseController(params MarshalByRefObject[] objs)
+ {
+ this.objs = objs;
+ fsw = new FileSystemWatcher("./Plugins", "*.dll");
+ fsw.NotifyFilter = NotifyFilters.LastWrite
+ | NotifyFilters.FileName | NotifyFilters.Size;
+
+ fsw.Changed += new FileSystemEventHandler(FileHandling);
+ fsw.Created += new FileSystemEventHandler(FileHandling);
+ fsw.Deleted += new FileSystemEventHandler(FileHandling);
+
+ Init();
+ }
+
+ public bool EnableFileSystemWatcher
+ {
+ get {return fsw.EnableRaisingEvents;}
+ set
+ {
+ if (fsw.EnableRaisingEvents != value)
+ {
+ fsw.EnableRaisingEvents = value;
+ }
+ }
+ }
+
+ private void FileHandling(object sender, FileSystemEventArgs e)
+ {
+ switch (e.ChangeType)
+ {
+ case WatcherChangeTypes.Changed:
+ case WatcherChangeTypes.Created:
+ Init();
+ break;
+ case WatcherChangeTypes.Deleted:
+ Init();
+ break;
+ default:
+ break;
+ }
+ }
+
+ private void Init()
+ {
+ UnloadPluginManager();
+
+ plugdom = AppDomain.CreateDomain("Plugins");
+
+ string assname = typeof(PluginManager).Assembly.FullName;
+ string typename = typeof(PluginManager).FullName;
+ try
+ {
+ pm = plugdom.CreateInstanceAndUnwrap(assname, typename,
+ true, BindingFlags.Default, null, this.objs, null, null, null) as PluginManager;
+ }
+ catch (TargetInvocationException ex)
+ {
+ //fsw.EnableRaisingEvents = false;
+ Console.WriteLine(ex.Message);
+ UnloadPluginManager();
+ }
+ }
+
+ public void LoadPlugin(string filename)
+ {
+ if (pm != null)
+ pm.LoadPlugin(filename);
+ }
+
+ public void UnloadPlugin(string typename)
+ {
+ if (pm != null)
+ pm.UnloadPlugin(typename);
+ }
+
+ public string[] PluginNames
+ {
+ get
+ {
+ if (pm == null)
+ return new string[0];
+ else return pm.PluginNames;}
+ }
+
+ public void LoadPluginManager()
+ {
+ Init();
+ }
+
+ public void UnloadPluginManager()
+ {
+ if (pm != null)
+ {
+ try
+ {
+ pm.Unload();
+ if (plugdom != null)
+ AppDomain.Unload(plugdom);
+ }
+ finally
+ {
+ pm = null;
+ plugdom = null;
+ }
+ }
+ }
+ }
+}
Added: trunk/mkNETtools/PluginManager/PluginManager.cs
===================================================================
--- trunk/mkNETtools/PluginManager/PluginManager.cs 2004-10-13 06:30:48 UTC (rev 877)
+++ trunk/mkNETtools/PluginManager/PluginManager.cs 2004-10-13 16:13:35 UTC (rev 878)
@@ -0,0 +1,176 @@
+using System;
+using System.Collections;
+using System.Reflection;
+using System.Runtime.Remoting;
+using System.Runtime.Remoting.Lifetime;
+using System.IO;
+using mkNETtools.PluginHelper;
+
+namespace mkNETtools.PluginManager
+{
+ //[Serializable]
+ public class PluginManager : MarshalByRefObject
+ {
+ public override object InitializeLifetimeService()
+ {
+ //why does it it disconnect?
+ return null;
+ }
+
+ private ArrayList plugins = new ArrayList();
+
+ public PluginManager()
+ {
+ string [] files;
+ try
+ {
+
+ files = Directory.GetFiles("." + Path.DirectorySeparatorChar + "Plugins", "*.dll");
+ foreach (string file in files)
+ {
+ LoadPlugin(file);
+ }
+ }
+ catch (DirectoryNotFoundException ex)
+ {
+ // Just ignore this exception
+ ex = null;
+ }
+ // Look in the current folder
+ files = Directory.GetFiles("." + Path.DirectorySeparatorChar, "*.dll");
+ foreach (string file in files)
+ {
+ LoadPlugin(file);
+ }
+ }
+
+ public void Unload()
+ {
+ foreach (IBasePlugin plug in plugins)
+ {
+ //plug.Unload();
+ }
+ plugins.Clear();
+ }
+
+ public int PluginCount
+ {
+ get {return plugins.Count;}
+ }
+
+ private bool PluginsContains(Type type)
+ {
+ foreach (IBasePlugin plug in plugins)
+ {
+ if (plug.GetType() == type)
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public string [] PluginNames
+ {
+ get
+ {
+ string[] output = new string[plugins.Count];
+ for (int i =0 ; i< plugins.Count; i++)
+ {
+ IBasePlugin plugin = (IBasePlugin)plugins[i];
+ output[i] = plugin.GetPluginName() + " : " + plugin.GetType().FullName;
+ }
+ return output;
+ }
+ }
+
+ public void UnloadPlugin(string typename)
+ {
+ for (int i = 0; i < plugins.Count; i++)
+ {
+ IBasePlugin plugin = (IBasePlugin)plugins;
+ if (plugin.GetType().Name == typename)
+ {
+ //plugin.Unload();
+ plugins.RemoveAt(i);
+ return;
+ }
+ }
+ }
+
+ public void LoadPlugin(string filename)
+ {
+ Assembly pluginAssembly = null;
+ try
+ {
+ // the following replaces Assembly.LoadFrom()
+ FileStream stream = File.OpenRead(filename);
+ byte[] buffer = new byte[stream.Length];
+ stream.Read(buffer, 0, (int)stream.Length);
+ stream.Close();
+
+ byte[] debugbuffer = null;
+ try
+ {
+ //this wont show in VS.NET, but symbols IS in fact loaded
+ stream = File.OpenRead(filename.Replace(".dll", ".pdb"));
+ debugbuffer = new byte[stream.Length];
+ stream.Read(debugbuffer, 0, (int)stream.Length);
+ stream.Close();
+ }
+ catch (IOException ex)
+ {
+ // Couldn't load debug symbols
+ }
+ if (debugbuffer != null)
+ {
+ pluginAssembly = Assembly.Load(buffer, debugbuffer);
+ }
+ else
+ {
+ pluginAssembly = Assembly.Load(buffer);
+ }
+ }
+ catch (IOException ex)
+ {
+ // Failed to load the plugin from disk
+ Console.Error.WriteLine(ex);
+ }
+
+ if (pluginAssembly == null)
+ {
+ // Unable to the load the plugin
+ return;
+ }
+
+ try
+ {
+ Type[] types = pluginAssembly.GetExportedTypes();
+ foreach (Type type in types)
+ {
+ if (!PluginsContains(type) && !type.IsAbstract)
+ {
+ Type[] ifaces = type.GetInterfaces();
+ foreach (Type iface in ifaces)
+ {
+ if (iface == typeof(IBasePlugin)
+ & type.IsDefined(typeof(PluginAttribute),false))
+ {
+ //create and load the type, add to collection
+ IBasePlugin iplug = (IBasePlugin) Activator.CreateInstance(type);
+ //iplug.Load();
+ plugins.Add(iplug);
+ }
+ }
+ }
+ }
+ }
+ catch (TypeLoadException ex)
+ {
+ // Possibly the plugin was compiled with an older set of interfaces
+ Console.Error.WriteLine("Plugin interface load error, Possibly the plugin was compiled with an older set of interfaces?");
+ Console.Error.WriteLine(ex);
+ }
+ }
+ }
+}
Added: trunk/mkNETtools/PluginManager/PluginManager.csproj
===================================================================
--- trunk/mkNETtools/PluginManager/PluginManager.csproj 2004-10-13 06:30:48 UTC (rev 877)
+++ trunk/mkNETtools/PluginManager/PluginManager.csproj 2004-10-13 16:13:35 UTC (rev 878)
@@ -0,0 +1,100 @@
+<VisualStudioProject>
+ <CSHARP
+ ProjectType = "Local"
+ ProductVersion = "7.10.3077"
+ SchemaVersion = "2.0"
+ ProjectGuid = "{7CBBC988-B4BD-4610-AA07-BE171A60D723}"
+ >
+ <Build>
+ <Settings
+ ApplicationIcon = ""
+ AssemblyKeyContainerName = ""
+ AssemblyName = "mkNETtools.PluginManager"
+ AssemblyOriginatorKeyFile = ""
+ DefaultClientScript = "JScript"
+ DefaultHTMLPageLayout = "Grid"
+ DefaultTargetSchema = "IE50"
+ DelaySign = "false"
+ OutputType = "Library"
+ PreBuildEvent = ""
+ PostBuildEvent = ""
+ RootNamespace = "mkNETtools.PluginManager"
+ 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 = "mkNETtools.PluginManager.xml"
+ 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}"
+ />
+ </References>
+ </Build>
+ <Files>
+ <Include>
+ <File
+ RelPath = "AssemblyInfo.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "BaseController.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "PluginManager.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ </Include>
+ </Files>
+ </CSHARP>
+</VisualStudioProject>
+
Added: trunk/mkNETtools/PluginManager/PluginManager.csproj.user
===================================================================
--- trunk/mkNETtools/PluginManager/PluginManager.csproj.user 2004-10-13 06:30:48 UTC (rev 877)
+++ trunk/mkNETtools/PluginManager/PluginManager.csproj.user 2004-10-13 16:13:35 UTC (rev 878)
@@ -0,0 +1,48 @@
+<VisualStudioProject>
+ <CSHARP LastOpenVersion = "7.10.3077" >
+ <Build>
+ <Settings ReferencePath = "" >
+ <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 = "true"
+ />
+ </Settings>
+ </Build>
+ <OtherProjectSettings
+ CopyProjectDestinationFolder = ""
+ CopyProjectUncPath = ""
+ CopyProjectOption = "0"
+ ProjectView = "ProjectFiles"
+ ProjectTrust = "0"
+ />
+ </CSHARP>
+</VisualStudioProject>
+
Added: trunk/mkNETtools/Plugins/WavPlugin/AssemblyInfo.cs
===================================================================
--- trunk/mkNETtools/Plugins/WavPlugin/AssemblyInfo.cs 2004-10-13 06:30:48 UTC (rev 877)
+++ trunk/mkNETtools/Plugins/WavPlugin/AssemblyInfo.cs 2004-10-13 16:13:35 UTC (rev 878)
@@ -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/WavPlugin/WavOutput.cs
===================================================================
--- trunk/mkNETtools/Plugins/WavPlugin/WavOutput.cs 2004-10-13 06:30:48 UTC (rev 877)
+++ trunk/mkNETtools/Plugins/WavPlugin/WavOutput.cs 2004-10-13 16:13:35 UTC (rev 878)
@@ -0,0 +1,117 @@
+using System;
+using System.IO;
+using mkNETtools.PluginHelper;
+using WavLib;
+
+namespace mkNETtools.Plugins.WavPlugin
+{
+ /// <summary>
+ /// Summary description for WavInput.
+ /// </summary>
+ [PluginAttribute]
+ public class WavOutput : IBaseOutputPlugin
+ {
+ protected WavWriter m_Writer = null;
+ protected WaveFormatEx m_Wfx = new WaveFormatEx();
+
+ public WavOutput()
+ {
+ //
+ // TODO: Add constructor logic here
+ //
+ }
+
+ #region IBaseOutputPlugin Members
+
+ public void SetTracks(ITrackInfo [] tracks)
+ {
+ if (tracks.Length != 1)
+ throw new ArgumentException("Wav only supports one track!");
+
+ try
+ {
+ IAudioTrackInfo track = (IAudioTrackInfo)tracks[0];
+
+ m_Wfx.wFormatTag = 0;
+ 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)
+ {
+ 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_LAYER3)
+ {
+
+ }
+ 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);
+ }
+
+ }
+
+ public void WriteFrame(ref Frame frame)
+ {
+ m_Writer.WriteSampleData(ref frame.Data, 0, frame.Data.Length);
+ }
+
+ #endregion
+
+
+ #region IBaseFilePlugin Members
+
+ public string DefaultExt
+ {
+ get
+ {
+ return "wav";
+ }
+ }
+
+ public void Close()
+ {
+ m_Writer = null;
+ m_Wfx = new WaveFormatEx();
+ }
+
+ public void Open(string filename)
+ {
+ m_Writer = new WavWriter();
+ m_Writer.Open(filename, m_Wfx);
+ }
+
+ public bool IsSupported(string filename)
+ {
+ string ext = Path.GetExtension(filename).ToLower();
+
+ if (ext.CompareTo("wav") != 0)
+ return true;
+
+ return false;
+ }
+
+ #endregion
+
+ #region IBasePlugin Members
+
+ public string GetPluginName()
+ {
+ return "Wav Output Plugin v1.0";
+ }
+
+ #endregion
+ }
+}
Added: trunk/mkNETtools/Plugins/WavPlugin/WavPlugin.csproj
===================================================================
--- trunk/mkNETtools/Plugins/WavPlugin/WavPlugin.csproj 2004-10-13 06:30:48 UTC (rev 877)
+++ trunk/mkNETtools/Plugins/WavPlugin/WavPlugin.csproj 2004-10-13 16:13:35 UTC (rev 878)
@@ -0,0 +1,100 @@
+<VisualStudioProject>
+ <CSHARP
+ ProjectType = "Local"
+ ProductVersion = "7.10.3077"
+ SchemaVersion = "2.0"
+ ProjectGuid = "{B1ED75BD-38C8-423A-AAB1-01D8CD2AE297}"
+ >
+ <Build>
+ <Settings
+ ApplicationIcon = ""
+ AssemblyKeyContainerName = ""
+ AssemblyName = "mkNETtools.Plugins.WavPlugin"
+ AssemblyOriginatorKeyFile = ""
+ DefaultClientScript = "JScript"
+ DefaultHTMLPageLayout = "Grid"
+ DefaultTargetSchema = "IE50"
+ DelaySign = "false"
+ OutputType = "Library"
+ PreBuildEvent = ""
+ PostBuildEvent = ""
+ RootNamespace = "mkNETtools.Plugins.WavPlugin"
+ 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 = "WavLib"
+ AssemblyName = "WavLib"
+ HintPath = "WavLib.dll"
+ />
+ </References>
+ </Build>
+ <Files>
+ <Include>
+ <File
+ RelPath = "AssemblyInfo.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "WavOutput.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ </Include>
+ </Files>
+ </CSHARP>
+</VisualStudioProject>
+
Added: trunk/mkNETtools/Plugins/WavPlugin/WavPlugin.csproj.user
===================================================================
--- trunk/mkNETtools/Plugins/WavPlugin/WavPlugin.csproj.user 2004-10-13 06:30:48 UTC (rev 877)
+++ trunk/mkNETtools/Plugins/WavPlugin/WavPlugin.csproj.user 2004-10-13 16:13:35 UTC (rev 878)
@@ -0,0 +1,48 @@
+<VisualStudioProject>
+ <CSHARP LastOpenVersion = "7.10.3077" >
+ <Build>
+ <Settings ReferencePath = "D:\Visual Studio Projects\matroska\mkNETtools\Plugins\WavPlugin\" >
+ <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 = "true"
+ />
+ </Settings>
+ </Build>
+ <OtherProjectSettings
+ CopyProjectDestinationFolder = ""
+ CopyProjectUncPath = ""
+ CopyProjectOption = "0"
+ ProjectView = "ProjectFiles"
+ ProjectTrust = "0"
+ />
+ </CSHARP>
+</VisualStudioProject>
+
Modified: trunk/mkNETtools/mkNETtools.sln
===================================================================
--- trunk/mkNETtools/mkNETtools.sln 2004-10-13 06:30:48 UTC (rev 877)
+++ trunk/mkNETtools/mkNETtools.sln 2004-10-13 16:13:35 UTC (rev 878)
@@ -15,6 +15,14 @@
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PluginManager", "PluginManager\PluginManager.csproj", "{7CBBC988-B4BD-4610-AA07-BE171A60D723}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WavPlugin", "Plugins\WavPlugin\WavPlugin.csproj", "{B1ED75BD-38C8-423A-AAB1-01D8CD2AE297}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug
@@ -37,6 +45,14 @@
{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
+ {7CBBC988-B4BD-4610-AA07-BE171A60D723}.Debug.ActiveCfg = Debug|.NET
+ {7CBBC988-B4BD-4610-AA07-BE171A60D723}.Debug.Build.0 = Debug|.NET
+ {7CBBC988-B4BD-4610-AA07-BE171A60D723}.Release.ActiveCfg = Release|.NET
+ {7CBBC988-B4BD-4610-AA07-BE171A60D723}.Release.Build.0 = Release|.NET
+ {B1ED75BD-38C8-423A-AAB1-01D8CD2AE297}.Debug.ActiveCfg = Debug|.NET
+ {B1ED75BD-38C8-423A-AAB1-01D8CD2AE297}.Debug.Build.0 = Debug|.NET
+ {B1ED75BD-38C8-423A-AAB1-01D8CD2AE297}.Release.ActiveCfg = Release|.NET
+ {B1ED75BD-38C8-423A-AAB1-01D8CD2AE297}.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.