Copyright © 2013-2023 MultiMedia Soft

How to use the component in your projects

Previous pageReturn to chapter overviewNext page

First of all let us say that if this guide should not be clear to you, feel free to contact our support team for any doubt or curiosity you may have: we usually answer all of our customers questions in less than 24 hours. Note that the purpose of this guide is to give a taste of the main features available inside Active MIDI DJ Console for .NET.

 

As an integration to this guide, a certain number of examples of use of this component can be found inside the "Samples" folder: if during the setup phase you left the installation directory to its default, you will find them inside "C:\Program Files\MultiMedia Soft\Active MIDI DJ Console for .NET\Samples".

 

The first needed step is to add the component's reference to your project: see the Adding the component to a Visual Studio project section for details.

 

At this point we need to create a new instance of the component's class and, before starting MIDI management, to initialize the component: for this purpose it's mandatory a call to the Init method. The code snippet below shows how to perform instancing and initialization of the component inside a Winform application:

 

Visual Basic .NET

 

Imports Microsoft.VisualBasic

Imports System

Imports System.Collections.Generic

Imports System.ComponentModel

Imports System.Data

Imports System.Drawing

Imports System.Text

Imports System.Windows.Forms

 

// import the component's namespace

Imports ActiveDjConsoleNetApi

 

Namespace ProfileEditor

 Public Partial Class FormMain

         Inherits Form

         Public Sub New()

                 InitializeComponent()

         End Sub

 

         ' instance the component

         Dim m_djConsole As ActiveDjConsoleNetApi.ActiveDjConsoleNetApi = New ActiveDjConsoleNetApi.ActiveDjConsoleNetApi()

 

         Private Sub FormMain_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load

                 ' initialize the component

                 m_djConsole.Init()

 

                 ' do other stuffs with the component

                 ...

 

         End Sub

 

         Private Sub FormMain_FormClosing(ByVal sender As Object, ByVal e As FormClosingEventArgs) Handles MyBase.FormClosing

                 ' dispose the component

                 m_djConsole.Dispose()

         End Sub

 

 End Class

End Namespace

 

 

Visual C#

 

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Text;

using System.Windows.Forms;

 

// add the component's namespace

using ActiveDjConsoleNetApi;

 

namespace ProfileEditor

{

 public partial class FormMain : Form

 {

         public FormMain()

         {

                 InitializeComponent();

         }

 

         // instance the component

         ActiveDjConsoleNetApi.ActiveDjConsoleNetApi m_djConsole = new ActiveDjConsoleNetApi.ActiveDjConsoleNetApi();

 

         private void FormMain_Load(object sender, EventArgs e)

         {

                 // initialize the component

                 m_djConsole.Init();

 

 

                 // do other stuffs with the component

                 ...

 

         }

 

         private void FormMain_FormClosing(object sender, FormClosingEventArgs e)

         {

                 // dispose the component

                 m_djConsole.Dispose();

         }

 }

}

 

 

 

IMPORTANT: Before exiting the container application, in order to avoid memory leaks, it's recommended that you explicitly call the Dispose method of the component.

 

After having initialized the component, we can start adding the code needed for interfacing with physical and virtual MIDI devices connected and/or installed inside the system and leveraging the control's main fields of competency:

 

Receiving/sending standard and raw MIDI commands from/to the connected MIDI input/output devices: see the How to manage MIDI devices tutorial for details.
Managing interaction of the container application with connected MIDI DJ Consoles through mapping profiles: see the How to manage MIDI DJ consoles tutorial for details.
Managing the user interface of the embedded virtual MIDI piano keyboard: see the How to manage the virtual MIDI piano keyboard tutorial for details.