Yes, device ID values are 0-based. You should not assume any particular ordering, so if you want to separate the input and output devices, you should test each device for input or output and add it to the appropriate list.

The PmDefaults program does this. It is written in Java, but the code that populates the drop-down boxes should be easy to follow, and you might be interested to see the "test" button it provides where the user can verify correct output device selection, and a "test" light to show when input arrives on the selected input device.

I'll also mention that if you open devices for testing or anything else, you may end up with an exclusive lock on the device that prevents other applications from opening the device until the original program closes the device.

-Roger

On 2/16/11 7:40 AM, Tim Burgess wrote:

Hi,

I'm just checking my understanding of how PortMIDI enumerates the available I/O ports. I understand that device ID values are 0-based and that I can check whether a given port is an input or output device, but can I always assume that input ports are listed first, followed by output ports? I'm populating a couple of list boxes in a Windows application so that the user can choose which ports they want to use, so I need to convert the relevant list box index into a valid device ID to bind to a PmStream.

Best wishes.

Tim Burgess

Raised Bar Ltd

Phone:  +44 (0)1827 719822

Don't forget to vote for improved access to music and music technology at

http://www.raisedbar.net/petition.htm


_______________________________________________
media_api mailing list
[email protected]
http://lists.create.ucsb.edu/mailman/listinfo/media_api
_______________________________________________
media_api mailing list
[email protected]
http://lists.create.ucsb.edu/mailman/listinfo/media_api

Reply via email to