| 298 | } |
| 299 | |
| 300 | void Window_Settings::RefreshAudioMidi() { |
| 301 | auto cfg = Audio().GetConfig(); |
| 302 | |
| 303 | bool used = false; |
| 304 | |
| 305 | if (cfg.fluidsynth_midi.IsOptionVisible()) { |
| 306 | AddOption(cfg.fluidsynth_midi, []() { Audio().SetFluidsynthEnabled(Audio().GetConfig().fluidsynth_midi.Toggle()); }); |
| 307 | if (!MidiDecoder::CheckFluidsynth(GetFrame().options.back().help2)) { |
| 308 | GetFrame().options.back().text += " [Not working]"; |
| 309 | GetFrame().options.back().color = Font::ColorKnockout; |
| 310 | } else if (cfg.fluidsynth_midi.Get()) { |
| 311 | GetFrame().options.back().text += " [In use]"; |
| 312 | used = true; |
| 313 | } |
| 314 | } |
| 315 | |
| 316 | if (cfg.wildmidi_midi.IsOptionVisible()) { |
| 317 | AddOption(cfg.wildmidi_midi, []() { Audio().SetWildMidiEnabled(Audio().GetConfig().wildmidi_midi.Toggle()); }); |
| 318 | if (!MidiDecoder::CheckWildMidi(GetFrame().options.back().help2)) { |
| 319 | GetFrame().options.back().text += " [Not working]"; |
| 320 | GetFrame().options.back().color = Font::ColorKnockout; |
| 321 | } else if (cfg.wildmidi_midi.Get() && !used) { |
| 322 | GetFrame().options.back().text += " [In use]"; |
| 323 | used = true; |
| 324 | } |
| 325 | } |
| 326 | |
| 327 | if (cfg.native_midi.IsOptionVisible()) { |
| 328 | AddOption(cfg.native_midi, []() { Audio().SetNativeMidiEnabled(Audio().GetConfig().native_midi.Toggle()); }); |
| 329 | auto midi_out = Audio().CreateAndGetMidiOut(); |
| 330 | if (!midi_out || !midi_out->IsInitialized(GetFrame().options.back().help2)) { |
| 331 | GetFrame().options.back().text += " [Not working]"; |
| 332 | GetFrame().options.back().color = Font::ColorKnockout; |
| 333 | } else if (cfg.native_midi.Get() && !used) { |
| 334 | GetFrame().options.back().text += " [In use]"; |
| 335 | used = true; |
| 336 | } |
| 337 | } |
| 338 | |
| 339 | if (cfg.fmmidi_midi.IsOptionVisible()) { |
| 340 | AddOption(cfg.fmmidi_midi, []() {}); |
| 341 | if (!used) { |
| 342 | GetFrame().options.back().text += " [In use]"; |
| 343 | } |
| 344 | } |
| 345 | |
| 346 | AddOption(MenuItem("> Information <", "The first active and working option is used for MIDI", ""), [](){}); |
| 347 | GetFrame().options.back().help2 = "Changes take effect when a new MIDI file is played"; |
| 348 | } |
| 349 | |
| 350 | void Window_Settings::RefreshAudioSoundfont() { |
| 351 | auto fs = Game_Config::GetSoundfontFilesystem(); |
nothing calls this directly
no test coverage detected