Gives information about a slot: it includes the slot name, the slot direction and its connection set to the MidiShare ports
Boolean MidiGetSlotInfos (SlotRefNum ref, TSlotInfos * infos);
ref
- a 32-bit integer, the slot reference number.
infos
- a pointer to a TSlotInfos structure to be filled with the slot characteristics.
typedef struct TSlotInfos { SlotName name; SlotDirection direction; char cnx[32]; long reserved[2]; /* reserved for future use */ } TSlotInfos;Fields:
- name : contains the slot name.
- direction : indicates the slot direction, defined like below
- cnx : a 256 bits field to indicates the 256 ports connections state.
Types:
typedef enum { MIDIInputSlot=1, MIDIOutputSlot, MIDIInputOutputSlot } SlotDirection;
The result is a Boolean value which indicates whether MidiShare has been able to get information about the slot or not.
Print information about a driver slots. void PrintSlotsInfos(short driverRef) { TDriverInfos dInfos; TSlotInfos sInfos; if (MidiGetDriverInfos (driverRef, &dInfos)) { short i, j; SlotRefNum ref; printf( "List of %s slots :\n", dInfos.name); for( i = 1; i <= dInfos.slots; i++ ) { ref = MidiGetIndSlot(driverRef, i); if (MidiGetSlotInfos (ref, &sInfos)) { printf("\n%i : %s : ", ref, sInfos.name); switch (sInfos.direction) { case MIDIInputSlot: printf("input slot"); break; case MIDIOutputSlot: printf("output slot"); break; case MIDIInputOutputSlot: printf("input/output slot"); break; } printf(" : connected ports : "); for (j = 0; j < 256; j++) { if (IsAcceptedBit (dInfos.cnx, i)) printf("%d ", i); } } } } }