[yoshimi] Big MusicClient rewrite :)

  • From: Andrew Deryabin <andrew@xxxxxxxx>
  • To: yoshimi@xxxxxxxxxxxxx
  • Date: Thu, 31 Dec 2015 00:51:04 +0400

Hi Will, All,

Just pushed new commit 131ace1.

Don't panic about 8 removed files. If you will ever need them, you can checkout any previous commit and they will appear again.

Here is a step-by-step explanation of new changes:

I removed 8 files: AlsaJackClient.cpp/h, JackClient.cpp/h, JackAlsaClient.cpp/h, AlsaJackClient.cpp/h.
Now all combo driver functionality is handled by one class: MusicClient.

Interface became more universal. How it works:

Here is the function newMusicClient in MusicClient class. Before my changes this function created default audio/midi driver pair and if this had no success, yoshimi simply failed to start.

Now the behavior is different.
There are 3 drivers for audio: jack_audio, alsa_audio, null_audio
and 3 drivers for midi: jack_midi, alsa_midi, null_midi.

When creating new music client, default driver pair is tested first. If it fails, then new algorithm tries to open combos in following order:

jack_audio/jack_midi (if is was not the first)
jack_audio/alsa_midi
alsa_audio/alsa_midi
jack_audio/no_midi
alsa_audio/no_midi
no_audio/no_midi

Now yoshimi will never fail it's startup because of new driver 'no_audio' which is a simple thread, that calls masterAudio at constant intervals emulating virtual audio device.

Now, if default audio/midi pair fails, no questions are asked and fallback pairs are probed automatically. Don't know if there is a probability that user will tap 'No' to question about switching to alternate pair.

--
Regards,
Andrew

Other related posts: