Re: MIDIConstants.kMIDIPropertyName
Re: MIDIConstants.kMIDIPropertyName
- Subject: Re: MIDIConstants.kMIDIPropertyName
- From: Luke Bellandi <email@hidden>
- Date: Fri, 27 Sep 2002 10:10:02 -0700
Craig,
I'll need more specifics: you say you're getting a "wrong property"
message, which I would assume is -10836=kWrongMIDIPropertyType, in which
case I would think your code may be incorrect, or you're asking the wrong
MIDIObject for information (you say you've tried both the MIDIDevice and one
of its endpoints?...)
If (more likely) you are receiving the error -10835=kMIDIUnknown property
then that means the device driver will not provide you with that information
because it (likely) wasn9t written to support that property.
Properties in CoreMIDI are implemented by the device drivers, and the
drivers are not required to implement all properties. This requires your
app to be flexible in cases like this: you need to be able to handle cases
where you cannot get this information (and optionally, support cases where
you can get this information, thus enhancing the user-experience.)
Best,
Luke Bellandi
CoreAudio
On 9/27/02 6:26 AM, "Craig Bakalian" <email@hidden> wrote:
>
Hi Luke,
>
This is working fine. I do have one more problem if you don't mind.
>
I need
>
to check the device or endpoint to see if it transmits or receives midi
>
data (notes,
>
channels, whatever) before I set it to my gui for the user to select as
>
an input or
>
output. I don't want the user selecting a device that can't receive
>
midi messages
>
for an output. Likewise, the same for input. I have tried
>
>
>
MidiDevice.getDevice(i).getStringProperty(MIDIConstants.kMIDIPropertyRec
>
eivesNotes)
>
>
with no result. I get a error message stating that I am using the
>
wrong property. Any
>
Idea to who to get a devices or endpoints properties?
>
>
Craig Bakalian
>
>
On Thursday, September 26, 2002, at 05:07 PM, Luke Bellandi wrote:
>
>
>
>
>
> For what you're doing, you'll probably want to look up the chain a
>
> bit
>
> to get a string that would be interesting to the user.
>
>
>
> If you have any interest in working in C, you can check out the
>
> functions:
>
>
>
> OSStatus MIDIEndpointGetEntity( MIDIEndpointRef inEndpoint,
>
> MIDIEntityRef * outEntity);
>
>
>
> And...
>
>
>
> OSStatus MIDIEntityGetDevice( MIDIEntityRef inEntity,
>
> MIDIDeviceRef
>
> * outDevice);
>
>
>
> And then get the name property for the device and/or entity, and use
>
> that
>
> string to name/label your endpoint.
>
>
>
> In Java you should use the
>
>
>
> Int MIDIDevice.getNumberOfDevices();
>
> MIDIDevice MIDIDevice.getDevice(int index);
>
>
>
> Methods, and traverse the hierarchy down through entities and
>
> endpoints to
>
> then match up your source/destination endpoints with their parent
>
> devices
>
> and those properties.
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.