Jump to content

MIDIAddLink

From EDM2
Revision as of 19:55, 11 January 2017 by Ak120 (talk | contribs)
MIDIAddLink( minstanceSource, minstanceTarget, ulSlotNumber, ulFlag );
MIDIAddLink creates a link from the source instance (minstanceSource) to the target instance (minstanceTarget) on the specified slot (ulSlotNumber).

Parameters

MINSTANCE minstanceSource (input)
The source instance number.
MINSTANCE minstanceTarget (input)
The target instance number.
ULONG ulSlotNumber (input)
The slot number of the source instance.
ULONG ulFlag (input)
This parameter is not currently used and must be set to 0.

Returns

ULONG rc
The following values can be returned
0 NO_ERROR Operation was successful.
7003 MIDIERR_INTERNAL_SYSTEM Error, The RTMIDI subsystem has become corrupt, and the application should terminate immediately, cleaning up as much as possible. Rebooting will most likely be necessary to restore RTMIDI to a functional state.
7007 MIDIERR_INVALID_FLAG Error, The ulFlag value is not set to 0.
7009 MIDIERR_INVALID_INSTANCE_NUMBER Error, Either the source or target instance number is invalid.
7010 MIDIERR_INVALID_PARAMETER Error, The ulSlotNumber parameter contains an invalid value.
7014 MIDIERR_NOT_ALLOWED Error, An attempt was made to create a link either between two instances not owned by this process or between a hardware node and an instance owned by another process.
7016 MIDIERR_RESOURCE_NOT_AVAILABLE Error, There are not enough resources to create any new links.

Include Info

#include <mididll.h>

Gotchas

A link is only allowed between two hardware nodes, a hardware node and an instance owned by this process, or between two instances which are owned by this process.

The value of the slot number (ulSlotNumber) depends on the class of the source instance. The class defines the number and meaning of the slots of its instances. Most classes only provide one slot, so ulSlotNumber will be 0 for these classes.

Sample Code

 #include <mididll.h>
 
 MINSTANCE miSource;
 MINSTANCE miTarget;
 ULONG ulSlot;
 
    /* Create a link from the instance identified with miSource       */
    /* to the instance identified with miTarget, on the slot          */
    /* of the source instance
 
 	rc = MIDIAddLink(miSource, miTarget, ulSlot, 0);
 
 	if (rc != 0)
 	{
 	  /* We got an error to take care of. */
 	}

See Also

  • MIDIRemoveLink
  • MIDIQueryInstanceInfo