MIDIAddLink: Difference between revisions
Appearance
No edit summary |
|||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
MIDIAddLink creates a link from the source instance (''minstanceSource'') to the target instance (''minstanceTarget'') on the specified slot (''ulSlotNumber''). | |||
==Syntax== | |||
MIDIAddLink( ''minstanceSource'', ''minstanceTarget'', ''ulSlotNumber'', ''ulFlag'' ) | |||
===Parameters=== | ===Parameters=== | ||
; | ; minstanceSource (MINSTANCE) - input: The source instance number. | ||
: The source instance number. | ; minstanceTarget (MINSTANCE) - input: The target instance number. | ||
; | ; ulSlotNumber ([[ULONG]]) - input: The slot number of the source instance. | ||
: The target instance number. | ; ulFlag ([[ULONG]]) - input: This parameter is not currently used and must be set to 0. | ||
; | |||
: The slot number of the source instance. | |||
; | |||
: This parameter is not currently used and must be set to 0. | |||
===Returns=== | ===Returns=== | ||
; ULONG rc | ;ULONG rc:The following values can be returned | ||
: The following values can be returned | |||
{|class="wikitable" | {|class="wikitable" | ||
|align="RIGHT" |0 | |align="RIGHT" |0 | ||
Line 45: | Line 42: | ||
|Error, There are not enough resources to create any new links. | |Error, There are not enough resources to create any new links. | ||
|} | |} | ||
==Gotchas== | ==Gotchas== |
Latest revision as of 03:53, 25 April 2025
MIDIAddLink creates a link from the source instance (minstanceSource) to the target instance (minstanceTarget) on the specified slot (ulSlotNumber).
Syntax
MIDIAddLink( minstanceSource, minstanceTarget, ulSlotNumber, ulFlag )
Parameters
- minstanceSource (MINSTANCE) - input
- The source instance number.
- minstanceTarget (MINSTANCE) - input
- The target instance number.
- ulSlotNumber (ULONG) - input
- The slot number of the source instance.
- ulFlag (ULONG) - 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. |
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