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

fix #276194 Allow MIDI devices to be refreshed without having to restart MuseScore #3962

Merged

Conversation

blackears
Copy link
Contributor

@blackears blackears commented Sep 15, 2018

Fixed a bug in PortAudio where it wasn't deleting PortMidi upon deletion, which left the old MIDI ports open and blocked any new Drivers from using them.

Also added a button to Preferences/I/O. Now if a user turns off/on their MIDI keyboard while Musescore is running, they can open the Preferences/I/O, press Rescan MIDI Input and they should be able to use their keyboard again.

@blackears blackears changed the title Allow MIDI devices to be refreshed without having to restart MuseScore 276194-Allow MIDI devices to be refreshed without having to restart MuseScore Sep 15, 2018
@RobFog
Copy link

RobFog commented Sep 15, 2018

Sounds very useful. 😃

@blackears blackears force-pushed the 276194-restarting-MIDI-driver branch 3 times, most recently from f173843 to ef1b565 Compare September 15, 2018 18:12
@anatoly-os
Copy link
Contributor

@blackears could you please add "fix #" at the beginning of the PR title. Also, please edit commit message and add "fix #276194: " at the beginning so the related issue will be closed automatically once this PR is merged.

@blackears blackears changed the title 276194-Allow MIDI devices to be refreshed without having to restart MuseScore fix #276194-Allow MIDI devices to be refreshed without having to restart MuseScore Sep 20, 2018
// rescanDrivers
//---------------------------------------------------------

void PreferenceDialog::rescanDriversClicked()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it possible to reuse the code to avoid duplication?

mscore/pa.cpp Show resolved Hide resolved
@Jojo-Schmitz
Copy link
Contributor

shouldn't the enable/disable MIDI toggle in the toolbar also result in a rescan?

@blackears
Copy link
Contributor Author

blackears commented Nov 13, 2018

It does not result in a rescan, but clicking Apply in the preferences can if you change your driver.

@blackears blackears force-pushed the 276194-restarting-MIDI-driver branch 2 times, most recently from c56b7c8 to 08ed13e Compare November 13, 2018 21:58
@Jojo-Schmitz
Copy link
Contributor

But maybe it should result in a rescan?

@blackears
Copy link
Contributor Author

I've updated it so that when you switch the MIDI toggle button to on, the audio engine will be rebuilt which should connect to any MIDI keyboard that has been added.

@anatoly-os anatoly-os changed the title fix #276194-Allow MIDI devices to be refreshed without having to restart MuseScore fix #276194 Allow MIDI devices to be refreshed without having to restart MuseScore Dec 21, 2018
@anatoly-os
Copy link
Contributor

@blackears could you please remove the dash after issue number? I will check the PR again and merge after the release, so it will be in one of the first updates to 3.0.

Fixed memory leak/lack of handle closing when deleting Port Audio engine.

Can now have MIDI devices be discovered by pressing button in Prefs/IO or by toggling the MIDI enabled button.
@anatoly-os anatoly-os merged commit 053673c into musescore:master Jan 5, 2019
@anatoly-os
Copy link
Contributor

@blackears great! I checked the case with my bluetooth headphones. I had to restart MuseScore when I plugged them, and now I'm able to switch to them on fly. Btw, there are two things which need to be fixed:

  1. There is a red coloured text which says "Every change on this page requires restarting MuseScore" which is not true
  2. The "Device" combobox in PortAudio group is not updated when reloading devices. To update them, I need to click at the API combobox, select the same "Core Audio".

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

4 participants