Exemplo n.º 1
0
func GetDestinations() (ret map[string]Destination) {
	destCount := C.MIDIGetNumberOfDestinations()
	fmt.Println("Found destination count:  ", destCount)

	ret = make(map[string]Destination)
	var x C.ItemCount = 0
	for ; x < destCount; x++ {
		dest := C.MIDIGetDestination(x)
		var destName C.CFStringRef
		C.MIDIObjectGetStringProperty((C.MIDIObjectRef)(dest), C.kMIDIPropertyName, &destName)
		cleanName := strings.Trim(cstrToStr(destName), "\u0000")
		ret[cleanName] = Destination{cleanName, CoreMidiEndpoint(dest)}
	}

	return
}
Exemplo n.º 2
0
func numberOfDestinations() int {
	return int(C.ItemCount(C.MIDIGetNumberOfDestinations()))
}