Hi,
I am new to Juce 5. Few years back I used Juce 3. Now I am running into errors with couple of simple functions, I wonder what I might be missing?
midiInput = MidiInput::openDevice(0, this);
and
midiOutput = MidiOutput::openDevice(0);
VS 2019 error:
Severity Code Description Project File Line Suppression State
Error C2440 ‘=’: cannot convert from ‘std::unique_ptr<juce::MidiOutput,std::default_deletejuce::MidiOutput>’ to ‘juce::MidiOutput *’
and
Severity Code Description Project File Line Suppression State
Error C2440 ‘=’: cannot convert from ‘std::unique_ptr<juce::MidiInput,std::default_deletejuce::MidiInput>’ to ‘juce::MidiInput *’
Thank you so much for your time. I have to redesign completely some MIDI functions and now I am stack with the following.
If I try to startBackgroundThread then I get this unhandled exception bad access error: void CriticalSection::enter() const noexcept { EnterCriticalSection ((CRITICAL_SECTION*) lock); }
I’m afraid you need to look up how unique_ptr works.
A unique_ptr is a little wrapper object, moveable but not copyable, usually living on the stack or in a container. Its purpose is to own an object (pointee) and delete it automatically, once that unique_ptr goes out of scope.