Copyright © 2013-2014 MultiMedia Soft

MidiDevices.Open method

Previous pageReturn to chapter overviewNext page

Remarks

 

Opens a specific MIDI device installed inside the system and obtains back its unique identifier. An opened device can be close through the MidiDevices.Close method.

 

For further details about the use of MIDI devices see the ClassMidiDevices class section and the How to manage MIDI devices tutorial.

 

 

Syntax

 

[Visual Basic]

MidiDevices.MidiDevices.Open (

bInput as Boolean,

nDeviceIndex as Int16,

ByRef nDeviceUniqueId as Integer

) as enumDjcErrorCodes


 

[C#]

public enumDjcErrorCodes MidiDevices.Open (

bool bInput,

Int16 nDeviceIndex,

ref Int16 nDeviceUniqueId

);


 

[C++]

public: enumDjcErrorCodes MidiDevices.Open (

bool bInput,

Int16 nDeviceIndex,

Int16 __gc *nDeviceUniqueId

);


 

Parameter

Description

 

 

bInput

Boolean value that specifies if the open request is related to an input or an output device.

Supported values are the following:

Mnemonic constant

Meaning

false

The opening request is related to an output device

true

The opening request is related to an input device

nDeviceIndex

Number representing the zero-based index of the MIDI device. The number of available MIDI devices installed inside the system can be obtained through the MidiDevices.CountGet method.

nDeviceUniqueId

Reference that, on return from the method call, will contain the unique identifier of the MIDI device: this identifier will be used with other methods that will require access to the specific MIDI device.

 

 

Return value

 

Value

Meaning

 

 

Negative value

An error occurred. Check the LastError property value in order to see the last error.

enumDjcErrorCodes.ERR_DJC_NOERROR (0)

The method call was successful.