Home Banner image
Home

ProjectMIDI Assemblies

ProjectMIDI is implemented in multiple .NET assemblies:

  1. A core program (ProjectMIDI.exe)

    This program loads all of the other assemblies.

  2. Multiple .NET dynamic link library (DLL) assemblies

    These assemblies are used to implement Applets such as PDF as well as to allow ProjectMIDI to interface with different MIDI devices such as TD8 or GMSynth.

Loading Assemblies

ProjectMIDI.exe will search for and load other ProjectMIDI assemblies. These are identified by containing a class which implements the IProjectMidi interface. This interface has the following simple definition:


     // All ProjectMIDI Assemblies must include a class which derives from this interface.
     // The IProjectMidi interface is used to allow polymorphic access to each assembly.
     // It is the mother of all ProjectMIDI APIs.
     public interface IProjectMidi
     {
        void PerformStartProcessing( StartPhase phase );
     }

In addition, the class is given custom attributes to describe it to ProjectMIDI:


    [ProjectMidiAssemblyAttribute(AssemblyType.Applet, "YourAppletName" )]

Reflection is used to identify the properties, events and methods that are to be exposed to the rest of ProjectMIDI. This is the method used to allow late binding between assemblies.

Sample source code is included in the installation package. Refer to the Downloads page for the installer.

ProjectMIDI assemblies must be placed in the proper directory in order for ProjectMIDI to be able to find them.

Class implements IProjectMidi

ProjectMidi assemblies must include a class which implements the IProjectMidi interface. This class can then implement additional events, properties and methods. These may be exposed and made available to other ProjectMidi assemblies by giving them specific custom attributes as described below.

ProjectMidi Events

Events which happen within an assembly are exposed to the rest of the assemblies by giving them the [ProjectMidiEventAttribute] attribute. This attribute informs ProjectMIDI that this event can be connected to ProjectMidi Actions. This event must conform to the following signature:


   public delegate void ProjectMidiEventHandler(object sender, EventArgs e);
   
   public event ProjectMidiEventHandler EventName;

ProjectMidi Actions

Actions which are implemented within an assembly are exposed to the rest of the assemblies by giving them the [ProjectMidiActionAttribute] attribute. This attribute informs ProjectMIDI that ProjectMidi Events can be connected to them. These actions must conform to the following signature:


   public void HandlerName(object sender, EventArgs e);

As you can see, this signature matches the ProjectMidiEventHandler delegate signature listed above it.