Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added option to MidiApi to stop printing errors and warnings #228

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

SarahVIAUD
Copy link

Added a static function to MidiApi to be able to stop printing warnings and errors to the console.
This is especially useful when RtMidi object is initialised with no device connected yet, we don't necessary want a warning being printed.

…gs and errors to the console.

This is especially useful when RtMidi object is initialised with no device connected yet, we don't necessary want a warning being printed.
@keinstein
Copy link

Why didn't you make the printing itself a callback, which is by default initalised. This could use the current API. Exposing it in RtMidi.h would allow the user code to fall back to the default. The benefit is that you have to keep track of it in only one place.

@SarahVIAUD
Copy link
Author

"The printing itself a callback"? Not sure I understand what you mean...
I do setup the error callback but for that I first have to create the RtMidiIn instance and the creation generates a warning message by itself when no device available because the error callback function cannot have been initialised yet.
With the current API I do not see a way to create RtMidiIn with the callback function already set up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants