Re: enumerate MIDI devices

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I think that's exactly what I needed! Thanks

On Wed, Feb 22, 2017 at 1:04 PM, Clemens Ladisch <clemens@xxxxxxxxxx> wrote:
Brian Sorahan wrote:
>       if card := C.snd_seq_client_info_get_card(cinfo); card >= 0 {
>               device.ID = fmt.Sprintf("hw:%d", card)
>       }

> But if I prefer to use the RawMIDI API to actually connect to the device

That particular device might not be available as a RawMIDI port.

> is this a reasonable way to formulate the device ID?

"hw:x" identifies the first RawMIDI port on that card, which is not
necessarily the same as the sequencer port.

To enumerate RawMIDI ports, use snd_ctl_rawmidi_next_device() (see the
source of amidi for an example).

> Does it even make sense to use the Sequencer API to list devices, but then
> use the RawMIDI API to open, read, and write?

No.


Regards,
Clemens

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Alsa-user mailing list
Alsa-user@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-user

[Index of Archives]     [ALSA Devel]     [Linux Audio Users]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

  Powered by Linux