Ticket #8476: midigain-gui.diff
File midigain-gui.diff, 4.5 KB (added by , 18 years ago) |
---|
-
gui/options.h
99 99 CheckboxWidget *_multiMidiCheckbox; 100 100 CheckboxWidget *_mt32Checkbox; 101 101 CheckboxWidget *_enableGSCheckbox; 102 StaticTextWidget *_midiGainDesc; 103 SliderWidget *_midiGainSlider; 104 StaticTextWidget *_midiGainLabel; 102 105 103 106 // 104 107 // Subtitle controls -
gui/themes/modern.ini
479 479 opYoffset=(opYoffset + buttonHeight + midiControlsSpacing) 480 480 mcGSCheckbox=mcx opYoffset (kFontHeight + 10 + 142) buttonHeight 481 481 opYoffset=(opYoffset + buttonHeight + midiControlsSpacing) 482 mcMidiGainText=mcx (opYoffset + 2) 80 kLineHeight 483 mcMidiGainText.align=kTextAlignRight 484 mcMidiGainSlider=(prev.x2 + 10) opYoffset sliderWidth sliderHeight 485 mcMidiGainLabel=(prev.x2 + 10) (opYoffset + 2) 40 kLineHeight 486 opYoffset=(opYoffset + sliderHeight + midiControlsSpacing) 482 487 483 488 [subtitleControls] 484 489 sbx=(opXoffset + 10) -
gui/options.cpp
58 58 // - aspect ratio, language, platform, debug mode/level, cd drive, joystick, multi midi, native mt32 59 59 60 60 enum { 61 kMidiGainChanged = 'mgch', 61 62 kMusicVolumeChanged = 'muvc', 62 63 kSfxVolumeChanged = 'sfvc', 63 64 kSubtitleToggle = 'sttg', … … 198 199 _soundFont->setLabel("None"); 199 200 else 200 201 _soundFont->setLabel(soundFont); 202 203 // MIDI gain setting 204 char buf[10]; 205 206 _midiGainSlider->setValue(ConfMan.getInt("midi_gain", _domain)); 207 sprintf(buf, "%.2f", (double)_midiGainSlider->getValue() / 100.0); 208 _midiGainLabel->setLabel(buf); 201 209 } 202 210 203 211 // Volume options … … 303 311 ConfMan.setBool("multi_midi", _multiMidiCheckbox->getState(), _domain); 304 312 ConfMan.setBool("native_mt32", _mt32Checkbox->getState(), _domain); 305 313 ConfMan.setBool("enable_gs", _enableGSCheckbox->getState(), _domain); 314 ConfMan.setInt("midi_gain", _midiGainSlider->getValue(), _domain); 306 315 307 316 String soundFont(_soundFont->getLabel()); 308 317 if (!soundFont.empty() && (soundFont != "None")) … … 311 320 ConfMan.removeKey("multi_midi", _domain); 312 321 ConfMan.removeKey("native_mt32", _domain); 313 322 ConfMan.removeKey("enable_gs", _domain); 323 ConfMan.removeKey("midi_gain", _domain); 314 324 ConfMan.removeKey("soundfont", _domain); 315 325 } 316 326 } … … 359 369 } 360 370 361 371 void OptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) { 372 char buf[10]; 373 362 374 switch (cmd) { 375 case kMidiGainChanged: 376 sprintf(buf, "%.2f", (double)_midiGainSlider->getValue() / 100.0); 377 _midiGainLabel->setLabel(buf); 378 _midiGainLabel->draw(); 379 break; 363 380 case kMusicVolumeChanged: 364 381 _musicVolumeLabel->setValue(_musicVolumeSlider->getValue()); 365 382 _musicVolumeLabel->draw(); … … 422 439 _multiMidiCheckbox->setEnabled(enabled); 423 440 _mt32Checkbox->setEnabled(enabled); 424 441 _enableGSCheckbox->setEnabled(enabled); 442 _midiGainDesc->setEnabled(enabled); 443 _midiGainSlider->setEnabled(enabled); 444 _midiGainLabel->setEnabled(enabled); 425 445 } 426 446 427 447 void OptionsDialog::setVolumeSettingsState(bool enabled) { … … 517 537 // GS Extensions setting 518 538 _enableGSCheckbox = new CheckboxWidget(boss, prefix + "mcGSCheckbox", "Enable Roland GS Mode", 0, 0); 519 539 540 // MIDI gain setting (FluidSynth uses this) 541 _midiGainDesc = new StaticTextWidget(boss, prefix + "mcMidiGainText", "MIDI gain:"); 542 _midiGainSlider = new SliderWidget(boss, prefix + "mcMidiGainSlider", kMidiGainChanged); 543 _midiGainSlider->setMinValue(0); 544 _midiGainSlider->setMaxValue(1000); 545 _midiGainLabel = new StaticTextWidget(boss, prefix + "mcMidiGainLabel", "1.00"); 546 520 547 _enableMIDISettings = true; 521 548 } 522 549 -
gui/theme-config.cpp
363 363 "opYoffset=(opYoffset + buttonHeight + midiControlsSpacing)\n" 364 364 "mcGSCheckbox=mcx opYoffset (kFontHeight + 10 + 142) buttonHeight\n" 365 365 "opYoffset=(opYoffset + buttonHeight + midiControlsSpacing)\n" 366 "mcMidiGainText=mcx (opYoffset + 2) 95 kLineHeight\n" 367 "mcMidiGainText.align=kTextAlignRight\n" 368 "mcMidiGainSlider=(prev.x2 + 10) opYoffset sliderWidth sliderHeight\n" 369 "mcMidiGainLabel=(prev.x2 + 10) (opYoffset + 2) 40 kLineHeight\n" 370 "opYoffset=(opYoffset + sliderHeight + midiControlsSpacing)\n" 366 371 "\n" 367 372 "[subtitleControls]\n" 368 373 "sbx=(opXoffset + 10)\n"