Mci.Sequencer.Status Class

 

About Mci.Sequencer.Status Class

 

Mci.Sequencer.Status class is mainly used for retrieving playback informations of MIDI (*.mid) files through Mci functions.

You can visit the following link for more info about the MCI command "status":

https://msdn.microsoft.com/en-us/library/windows/desktop/dd798683(v=vs.85).aspx

 

Mci.Sequencer.Status Class Methods

 

Mci.Sequencer.Status.CurrentTrack( ulong DeviceIndex) executes the MCI command "status current track". This function returns a string with the requested value or an empty string if fails.

ulong DeviceIndex: device index.

 

Mci.Sequencer.Status.DivisionType( ulong DeviceIndex) executes the MCI command "status division type". This function returns a string with the requested value or an empty string if fails.

ulong DeviceIndex: device index.

 

Mci.Sequencer.Status.Length( ulong DeviceIndex) executes the MCI command "status length". This function returns a string with the requested value or an empty string if fails.

ulong DeviceIndex: device index.

 

Mci.Sequencer.Status.LengthTrack( ulong DeviceIndex, string TrackNumber) executes the MCI command "status length track number".This function returns a string with the requested value or an empty string if fails.

ulong DeviceIndex: device index.
string TrackNumber: track number.

 

Mci.Sequencer.Status.MediaPresent( ulong DeviceIndex) executes the MCI command "status media present". This function returns a string with the requested value or an empty string if fails.

ulong DeviceIndex: device index.

 

Mci.Sequencer.Status.Mode( ulong DeviceIndex) executes the MCI command "status mode". This function returns a string with the requested value or an empty string if fails.

ulong DeviceIndex: device index.

 

Mci.Sequencer.Status.NumberOfTracks( ulong DeviceIndex) executes the MCI command "status number of tracks". This function returns a string with the requested value or an empty string if fails.

ulong DeviceIndex: device index.

 

Mci.Sequencer.Status.Offset( ulong DeviceIndex) executes the MCI command "status offset". This function returns a string with the requested value or an empty string if fails.

ulong DeviceIndex: device index.

 

Mci.Sequencer.Status.Port( ulong DeviceIndex) executes the MCI command "status port". This function returns a string with the requested value or an empty string if fails.

ulong DeviceIndex: device index.

 

Mci.Sequencer.Status.Position( ulong DeviceIndex) executes the MCI command "status position". This function returns a string with the requested value or an empty string if fails.

ulong DeviceIndex: device index.

 

Mci.Sequencer.Status.PositionTrack( ulong DeviceIndex, string TrackNumber) executes the MCI command "status position track number".This function returns a string with the requested value or an empty string if fails.

ulong DeviceIndex: device index.
string TrackNumber: track number.

 

Mci.Sequencer.Status.Ready( ulong DeviceIndex) executes the MCI command "status ready". This function returns a string with the requested value or an empty string if fails.

ulong DeviceIndex: device index.

 

Mci.Sequencer.Status.Slave( ulong DeviceIndex) executes the MCI command "status slave". This function returns a string with the requested value or an empty string if fails.

ulong DeviceIndex: device index.

 

Mci.Sequencer.Status.StartPosition( ulong DeviceIndex) executes the MCI command "status start position". This function returns a string with the requested value or an empty string if fails.

ulong DeviceIndex: device index.

 

Mci.Sequencer.Status.Tempo( ulong DeviceIndex) executes the MCI command "status tempo". This function returns a string with the requested value or an empty string if fails.

ulong DeviceIndex: device index.

 

Mci.Sequencer.Status.TimeFormat( ulong DeviceIndex) executes the MCI command "status time format". This function returns a string with the requested value or an empty string if fails.

ulong DeviceIndex: device index.

 

Mci.Sequencer.Status.IsPlaying( ulong DeviceIndex) executes the MCI command "status mode" and returns true if the result was equal to "playing" or false otherwise.

ulong DeviceIndex: device index.

 

Mci.Sequencer.Status.IsStopped( ulong DeviceIndex) executes the MCI command "status mode" and returns true if the result was equal to "stopped" or false otherwise.

ulong DeviceIndex: device index.

 

Mci.Sequencer.Status.IsPaused( ulong DeviceIndex) executes the MCI command "status mode" and returns true if the result was equal to "paused" or false otherwise.

ulong DeviceIndex: device index.

 

Code Example

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Giavapps.MIDI;

public class CodeExample : MonoBehaviour
{

private string FileName = "mymidi.mid";
private ulong DeviceIndex;

void Awake()
{
Mci.Initialize();//Initializes Mci
DeviceIndex = Mci.Sequencer.Open(FileName);//Opens the specified MIDI file into the MCI MIDI Sequencer for playback
}

void Update()
{

//Checks if space key is pressed
if(Input.GetKeyDown(KeyCode.Space))
{

//Checks if the MIDI file is playing…
if(Mci.Sequencer.Status.IsPlaying(DeviceIndex))
{
Mci.Sequencer.Stop(DeviceIndex);//Stops the MIDI file
}
else
{
Mci.Sequencer.Play(DeviceIndex);//Plays the MIDI file
}

}

}

void OnApplicationQuit()
{
Mci.Deinitialize();//Deinitializes Mci
}

}

 

I am Luigi Piscopo, also known as DJ GiDeejay / Producer / Remixer in the music world. I am a Producer with a lot of experience in photo editing, video editing, audio editing, graphic design, web design, programming and promotion.

Comments are closed.