如何处理多个相同MIDI USB设备 [英] How to deal with multiple identical MIDI USB devices

查看:622
本文介绍了如何处理多个相同MIDI USB设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的C#应用​​程序必须使用这些都是来自同一制造商的多个相同的USB MIDI接口。

My c# application must use multiple identical USB MIDI interfaces which are all from the same manufacturer.

在设备管理器中,所有设备都显示出相同的驱动程序名称/ CLSID - 只有PNPDeviceID是不同的。当我列出所有的MIDI输入/输出(使用MIDI点网),它们出现如下:

In device manager, all devices appear with the same driver name / CLSID - only the PNPDeviceID is different. When I list all MIDI inputs / outputs (using MIDI-dot-net), they appear as follows:


  • ACME-MIDI:端口1

  • 1- ACME-MIDI:端口1

  • 2 - ACME-MIDI:端口1

不幸的是,这些名字并不总是相同的设备相同。装置1的端口有时显示为ACME-MIDI:端口1,有时为1-ACME:端口1。(他们在重新启动后如发生变动)

Unfortunately, those names are not always the same for the same device. The ports of device 1 appear sometimes as "ACME-MIDI: Port 1" and sometimes as "1-ACME: Port 1" (they change e.g. after a reboot).

我用不同的方式试图找到属于什么样的名字是什么设备(的SetupDi,WMI,Win32_PnPSignedDriver,...),但我要么得到设备ID 端口名称它的报道,但我米找不到报道MIDI端口名称(ACME-MIDI:端口n)?使用设备ID或驱动程序键

I have used different ways trying to find what name belongs to what device (SetupDi, WMI, Win32_PnPSignedDriver, ...) but I either get the device ID OR the port names it reports, but I'm unable to find the reported MIDI port name (ACME-MIDI: Port n) using the device id or driver key.

任何建议

更新

我还在寻找一个解决方案列出一个MIDI USB的输入/输出端口接口一个给定的端口上(如使用Windows API)。看起来这是很棘手的,这就是为什么我开始对这个赏金。

I'm still looking for a solution to list the Input / Output ports of a MIDI USB interface on a given port (e.g. using Windows API). Seems like this is quite tricky, that's why I start a bounty on this.

推荐答案

不幸的是,使用MIDI API的就有当没有办法区分设备。你必须依靠自己的名字。幸运的是,而设备订单的可以的变化,这是我的经验,这通常不会发生在重新启动。然而,正如你所看到的,就可以了。

Unfortunately, when using the MIDI APIs alone there is no way to differentiate the devices. You must rely on their name. Fortunately, while the devices order can change, it's my experience that this doesn't typically happen on reboot. However, as you have seen, it can.

我已经在过去在自己的软件中提示用户按一个键或移动控制旋钮这样处理在设备上加以区别。

I've handled this in the past in my own software by prompting the user to press a key or move a control knob on a device to differentiate them.

这篇关于如何处理多个相同MIDI USB设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆