Hello everyone.
I have issues implementing the method stated in the title.
My goal was just to instantiate midi events on my application by selecting any device detected ( inside a combobox)
void MainComponent::comboBoxChanged(juce::ComboBox* comboBox)
{
if (comboBox == &midiDeviceComboBox)
{
const int selectedDeviceIndex = midiDeviceComboBox.getSelectedId() - 1;
if (selectedDeviceIndex >= 0 && selectedDeviceIndex < juce::MidiInput::getAvailableDevices().size())
{
// Handle the selected MIDI device here
const auto& selectedDeviceName = juce::MidiInput::getAvailableDevices()[selectedDeviceIndex];
juce::MidiInput* retrievedMidiInput;
retrievedMidiInput = juce::MidiInput::openDevice(selectedDeviceIndex, this);
if (retrievedMidiInput != nullptr)
{
// Start MIDI input
retrievedMidiInput->start();
}
}
}
}
After many tries and tweaks, I still get a "No matching function for call to 'openDevice’ " error from it.
Is there something I am still not getting or doing wrong?

