# MidiInput device unique identifier?

**URL:** <https://forum.juce.com/t/midiinput-device-unique-identifier/6344>\
**Category:** General JUCE discussion\
**Created:** [February 2, 2011, 12:59am UTC](https://forum.juce.com/t/midiinput-device-unique-identifier/6344 "2011-02-02T00:59:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheVinn](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/thevinn/32/806_2.png) [@TheVinn](https://forum.juce.com/u/TheVinn)\
**Post date:** [February 2, 2011, 12:59am UTC](https://forum.juce.com/t/midiinput-device-unique-identifier/6344/1 "2011-02-02T00:59:24Z")

</div>

AudioDeviceManager is really well defined with the ability to save and restore device identifiers and parameters to XML across launches.

But where is the MidiInput device support? All we get is an index and a name? Is the name guaranteed to be unique on all platforms? Can I save the name across launches?

How can I handle the case where the midi input devices change between launches?

---

<div class="post-metadata">

**Author:** ![atom](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/atom/32/113_2.png) [@atom](https://forum.juce.com/u/atom)\
**Post date:** [February 2, 2011, 8:54am UTC](https://forum.juce.com/t/midiinput-device-unique-identifier/6344/2 "2011-02-02T08:54:30Z")

</div>

you can’t, especialy on windows it’s impossible to be certain that a device you are opening is the device you closed remembered some time ago.

i save both the device index (int the device table that juce gives) and the device name as a String, and try to match both, if both don’t match try to match the name, if the name doesn’t match try to match the index, if that fails, give an error.
