Make USB gadget vendor and device strings configurable
probonopd opened this issue · comments
probonopd commented
Currently, REAPER (on WINE) shows MiniDexed as "MIDI Gadget MIDI 1".
We would like to rename "MIDI Gadget MIDI 1" to "MiniDexed MIDI 1" to make it easier to find in DAWs.
Currently, we need to patch Circle like this:
# Patch Circle so that descriptive strings are used in dmesg and in DAWs
sed -i -e 's|"Circle"|"probonopd"|g' circle-stdlib/libs/circle/lib/usb/gadget/usbmidigadget.cpp
sed -i -e 's|"MIDI Gadget"|"MiniDexed"|g' circle-stdlib/libs/circle/lib/usb/gadget/usbmidigadget.cpp
https://github.com/probonopd/MiniDexed/pull/588/files
@diyelectromusic thinks that patching it on-the-fly like this is not the way to go, hence I am asking for a more official way to configure this.
Reference:
Rene Stange commented
You have to create your own gadget class (e.g. CMiniDexedGadget) and use
CUSBMIDIGadget as its base class. In this new gadget class you only need to
define the method GetDescriptor() and override the method of the base class
CUSBMIDIGadget that way. In the GetDescriptor() method you can provide your
own string descriptors. All other descriptor requests can be handed over to
the method of the base class CUSBMIDIGadget::GetDescriptor(). Please have a
look into lib/usb/gadget/usbmidigadget.cpp for info, how the string
descriptors can be provided. The first descriptor in s_StringDescriptor[] is
the language ID, which does not need to be changed. The second string is the
Vendor name, the third the Product name.