ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

options.h

Go to the documentation of this file.
00001 /* ScummVM - Graphic Adventure Engine
00002  *
00003  * ScummVM is the legal property of its developers, whose names
00004  * are too numerous to list here. Please refer to the COPYRIGHT
00005  * file distributed with this source distribution.
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020  *
00021  */
00022 
00023 #ifndef OPTIONS_DIALOG_H
00024 #define OPTIONS_DIALOG_H
00025 
00026 #include "engines/metaengine.h"
00027 
00028 #include "gui/dialog.h"
00029 #include "common/str.h"
00030 #include "audio/mididrv.h"
00031 
00032 #ifdef GUI_ENABLE_KEYSDIALOG
00033 #include "gui/KeysDialog.h"
00034 #endif
00035 
00036 #ifdef USE_FLUIDSYNTH
00037 #include "gui/fluidsynth-dialog.h"
00038 #endif
00039 
00040 #ifdef USE_LIBCURL
00041 #include "backends/cloud/storage.h"
00042 #endif
00043 
00044 namespace Common {
00045 class RemapWidget;
00046 }
00047 
00048 namespace GUI {
00049 class LauncherDialog;
00050 
00051 class CheckboxWidget;
00052 class EditTextWidget;
00053 class PopUpWidget;
00054 class SliderWidget;
00055 class StaticTextWidget;
00056 class TabWidget;
00057 class ButtonWidget;
00058 class CommandSender;
00059 class GuiObject;
00060 class RadiobuttonGroup;
00061 class RadiobuttonWidget;
00062 
00063 class OptionsDialog : public Dialog {
00064 public:
00065     OptionsDialog(const Common::String &domain, int x, int y, int w, int h);
00066     OptionsDialog(const Common::String &domain, const Common::String &name);
00067     ~OptionsDialog() override;
00068 
00069     void init();
00070 
00071     void open() override;
00072     virtual void apply();
00073     void close() override;
00074     void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
00075     void handleTickle() override;
00076     void handleOtherEvent(const Common::Event &event) override;
00077 
00078     const Common::String& getDomain() const { return _domain; }
00079 
00080     void reflowLayout() override;
00081 
00082 protected:
00084     Common::String _domain;
00085 
00086     ButtonWidget *_soundFontButton;
00087     StaticTextWidget *_soundFont;
00088     ButtonWidget *_soundFontClearButton;
00089 
00090     virtual void build();
00091     virtual void clean();
00092     void rebuild();
00093 
00094 
00095     void addControlControls(GuiObject *boss, const Common::String &prefix);
00096     void addKeyMapperControls(GuiObject *boss, const Common::String &prefix, const Common::Array<Common::Keymap *> &keymaps, const Common::String &domain);
00097     void addAchievementsControls(GuiObject *boss, const Common::String &prefix, const Common::AchievementsInfo &info);
00098     void addGraphicControls(GuiObject *boss, const Common::String &prefix);
00099     void addShaderControls(GuiObject *boss, const Common::String &prefix);
00100     void addAudioControls(GuiObject *boss, const Common::String &prefix);
00101     void addMIDIControls(GuiObject *boss, const Common::String &prefix);
00102     void addMT32Controls(GuiObject *boss, const Common::String &prefix);
00103     void addVolumeControls(GuiObject *boss, const Common::String &prefix);
00104     // The default value is the launcher's non-scaled talkspeed value. When SCUMM uses the widget,
00105     // it uses its own scale
00106     void addSubtitleControls(GuiObject *boss, const Common::String &prefix, int maxSliderVal = 255);
00107 
00108     void setGraphicSettingsState(bool enabled);
00109     void setShaderSettingsState(bool enabled);
00110     void setAudioSettingsState(bool enabled);
00111     void setMIDISettingsState(bool enabled);
00112     void setMT32SettingsState(bool enabled);
00113     void setVolumeSettingsState(bool enabled);
00114     void setSubtitleSettingsState(bool enabled);
00115 
00116     virtual void setupGraphicsTab();
00117 
00118     bool loadMusicDeviceSetting(PopUpWidget *popup, Common::String setting, MusicType preferredType = MT_AUTO);
00119     void saveMusicDeviceSetting(PopUpWidget *popup, Common::String setting);
00120 
00121     TabWidget *_tabWidget;
00122     int _graphicsTabId;
00123     int _midiTabId;
00124     int _pathsTabId;
00125 
00126 private:
00127 
00128     //
00129     // Control controls
00130     //
00131     bool _enableControlSettings;
00132 
00133     CheckboxWidget *_touchpadCheckbox;
00134     CheckboxWidget *_onscreenCheckbox;
00135     CheckboxWidget *_swapMenuAndBackBtnsCheckbox;
00136 
00137     StaticTextWidget *_kbdMouseSpeedDesc;
00138     SliderWidget *_kbdMouseSpeedSlider;
00139     StaticTextWidget *_kbdMouseSpeedLabel;
00140     StaticTextWidget *_joystickDeadzoneDesc;
00141     SliderWidget *_joystickDeadzoneSlider;
00142     StaticTextWidget *_joystickDeadzoneLabel;
00143 
00144     //
00145     // KeyMapper controls
00146     //
00147     Common::RemapWidget *_keymapperWidget;
00148 
00149     //
00150     // Graphics controls
00151     //
00152     bool _enableGraphicSettings;
00153     StaticTextWidget *_gfxPopUpDesc;
00154     PopUpWidget *_gfxPopUp;
00155     StaticTextWidget *_stretchPopUpDesc;
00156     PopUpWidget *_stretchPopUp;
00157     CheckboxWidget *_fullscreenCheckbox;
00158     CheckboxWidget *_filteringCheckbox;
00159     CheckboxWidget *_aspectCheckbox;
00160     CheckboxWidget *_vsyncCheckbox; // ResidualVM specific
00161     StaticTextWidget *_rendererTypePopUpDesc; // ResidualVM specific
00162     PopUpWidget *_rendererTypePopUp; // ResidualVM specific
00163     StaticTextWidget *_antiAliasPopUpDesc; // ResidualVM specific
00164     PopUpWidget *_antiAliasPopUp; // ResidualVM specific
00165     StaticTextWidget *_renderModePopUpDesc;
00166     PopUpWidget *_renderModePopUp;
00167 
00168     //
00169     // Shader controls
00170     //
00171     bool _enableShaderSettings;
00172     StaticTextWidget *_shaderPopUpDesc;
00173     PopUpWidget *_shaderPopUp;
00174 
00175     //
00176     // Audio controls
00177     //
00178     bool _enableAudioSettings;
00179     StaticTextWidget *_midiPopUpDesc;
00180     PopUpWidget *_midiPopUp;
00181     StaticTextWidget *_oplPopUpDesc;
00182     PopUpWidget *_oplPopUp;
00183 
00184     StaticTextWidget *_mt32DevicePopUpDesc;
00185     PopUpWidget *_mt32DevicePopUp;
00186     StaticTextWidget *_gmDevicePopUpDesc;
00187     PopUpWidget *_gmDevicePopUp;
00188 
00189     //
00190     // MIDI controls
00191     //
00192     bool _enableMIDISettings;
00193     CheckboxWidget *_multiMidiCheckbox;
00194     StaticTextWidget *_midiGainDesc;
00195     SliderWidget *_midiGainSlider;
00196     StaticTextWidget *_midiGainLabel;
00197 
00198     //
00199     // MT-32 controls
00200     //
00201     bool _enableMT32Settings;
00202     CheckboxWidget *_mt32Checkbox;
00203     CheckboxWidget *_enableGSCheckbox;
00204 
00205     //
00206     // Subtitle controls
00207     //
00208     int getSubtitleMode(bool subtitles, bool speech_mute);
00209     bool _enableSubtitleSettings;
00210     StaticTextWidget *_subToggleDesc;
00211     RadiobuttonGroup *_subToggleGroup;
00212     RadiobuttonWidget *_subToggleSubOnly;
00213     RadiobuttonWidget *_subToggleSpeechOnly;
00214     RadiobuttonWidget *_subToggleSubBoth;
00215     static const char *_subModeDesc[];
00216     static const char *_lowresSubModeDesc[];
00217     StaticTextWidget *_subSpeedDesc;
00218     SliderWidget *_subSpeedSlider;
00219     StaticTextWidget *_subSpeedLabel;
00220 
00221     //
00222     // Volume controls
00223     //
00224     void updateMusicVolume(const int newValue) const;
00225     void updateSfxVolume(const int newValue) const;
00226     void updateSpeechVolume(const int newValue) const;
00227     bool _enableVolumeSettings;
00228 
00229     StaticTextWidget *_musicVolumeDesc;
00230     SliderWidget *_musicVolumeSlider;
00231     StaticTextWidget *_musicVolumeLabel;
00232 
00233     StaticTextWidget *_sfxVolumeDesc;
00234     SliderWidget *_sfxVolumeSlider;
00235     StaticTextWidget *_sfxVolumeLabel;
00236 
00237     StaticTextWidget *_speechVolumeDesc;
00238     SliderWidget *_speechVolumeSlider;
00239     StaticTextWidget *_speechVolumeLabel;
00240 
00241     CheckboxWidget *_muteCheckbox;
00242 
00243 protected:
00244     //
00245     // Game GUI options
00246     //
00247     Common::String _guioptions;
00248     Common::String _guioptionsString;
00249 };
00250 
00251 
00252 class GlobalOptionsDialog : public OptionsDialog, public CommandSender {
00253 public:
00254     GlobalOptionsDialog(LauncherDialog *launcher);
00255     ~GlobalOptionsDialog() override;
00256 
00257     void apply() override;
00258     void close() override;
00259     void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
00260     void handleTickle() override;
00261 
00262     void reflowLayout() override;
00263 
00264 protected:
00265     void build() override;
00266     void clean() override;
00267 
00268     Common::String _newTheme;
00269     LauncherDialog *_launcher;
00270 #ifdef GUI_ENABLE_KEYSDIALOG
00271     KeysDialog *_keysDialog;
00272 #endif
00273 #ifdef USE_FLUIDSYNTH
00274     FluidSynthSettingsDialog *_fluidSynthSettingsDialog;
00275 #endif
00276 
00277     void addMIDIControls(GuiObject *boss, const Common::String &prefix);
00278 
00279     StaticTextWidget *_savePath;
00280     ButtonWidget     *_savePathClearButton;
00281     StaticTextWidget *_themePath;
00282     ButtonWidget     *_themePathClearButton;
00283     StaticTextWidget *_extraPath;
00284     ButtonWidget     *_extraPathClearButton;
00285 #ifdef DYNAMIC_MODULES
00286     StaticTextWidget *_pluginsPath;
00287     ButtonWidget     *_pluginsPathClearButton;
00288 #endif
00289 
00290     void addPathsControls(GuiObject *boss, const Common::String &prefix, bool lowres);
00291 
00292     //
00293     // Misc controls
00294     //
00295     StaticTextWidget *_curTheme;
00296     StaticTextWidget *_rendererPopUpDesc;
00297     PopUpWidget *_rendererPopUp;
00298     StaticTextWidget *_autosavePeriodPopUpDesc;
00299     PopUpWidget *_autosavePeriodPopUp;
00300     StaticTextWidget *_guiLanguagePopUpDesc;
00301     PopUpWidget *_guiLanguagePopUp;
00302     CheckboxWidget *_guiLanguageUseGameLanguageCheckbox;
00303     CheckboxWidget *_useSystemDialogsCheckbox;
00304 
00305 
00306 #ifdef USE_UPDATES
00307     StaticTextWidget *_updatesPopUpDesc;
00308     PopUpWidget *_updatesPopUp;
00309 #endif
00310 
00311     void addMiscControls(GuiObject *boss, const Common::String &prefix, bool lowres);
00312 
00313 #ifdef USE_CLOUD
00314 #ifdef USE_LIBCURL
00315     //
00316     // Cloud controls
00317     //
00318     uint32 _selectedStorageIndex;
00319     StaticTextWidget *_storagePopUpDesc;
00320     PopUpWidget      *_storagePopUp;
00321     StaticTextWidget *_storageDisabledHint;
00322     ButtonWidget     *_storageEnableButton;
00323     StaticTextWidget *_storageUsernameDesc;
00324     StaticTextWidget *_storageUsername;
00325     StaticTextWidget *_storageUsedSpaceDesc;
00326     StaticTextWidget *_storageUsedSpace;
00327     StaticTextWidget *_storageSyncHint;
00328     StaticTextWidget *_storageLastSyncDesc;
00329     StaticTextWidget *_storageLastSync;
00330     ButtonWidget     *_storageSyncSavesButton;
00331     StaticTextWidget *_storageDownloadHint;
00332     ButtonWidget     *_storageDownloadButton;
00333     StaticTextWidget *_storageDisconnectHint;
00334     ButtonWidget     *_storageDisconnectButton;
00335 
00336     bool _connectingStorage;
00337     StaticTextWidget *_storageWizardNotConnectedHint;
00338     StaticTextWidget *_storageWizardOpenLinkHint;
00339     StaticTextWidget *_storageWizardLink;
00340     StaticTextWidget *_storageWizardCodeHint;
00341     EditTextWidget   *_storageWizardCodeBox;
00342     ButtonWidget     *_storageWizardPasteButton;
00343     ButtonWidget     *_storageWizardConnectButton;
00344     StaticTextWidget *_storageWizardConnectionStatusHint;
00345     bool _redrawCloudTab;
00346 
00347     void addCloudControls(GuiObject *boss, const Common::String &prefix, bool lowres);
00348     void setupCloudTab();
00349     void shiftWidget(Widget *widget, const char *widgetName, int32 xOffset, int32 yOffset);
00350 
00351     void storageConnectionCallback(Networking::ErrorResponse response);
00352     void storageSavesSyncedCallback(Cloud::Storage::BoolResponse response);
00353     void storageErrorCallback(Networking::ErrorResponse response);
00354 #endif // USE_LIBCURL
00355 
00356 #ifdef USE_SDL_NET
00357     //
00358     // LAN controls
00359     //
00360     ButtonWidget     *_runServerButton;
00361     StaticTextWidget *_serverInfoLabel;
00362     ButtonWidget     *_rootPathButton;
00363     StaticTextWidget *_rootPath;
00364     ButtonWidget     *_rootPathClearButton;
00365     StaticTextWidget *_serverPortDesc;
00366     EditTextWidget   *_serverPort;
00367     ButtonWidget     *_serverPortClearButton;
00368     StaticTextWidget *_featureDescriptionLine1;
00369     StaticTextWidget *_featureDescriptionLine2;
00370     bool _serverWasRunning;
00371 
00372     void addNetworkControls(GuiObject *boss, const Common::String &prefix, bool lowres);
00373     void reflowNetworkTabLayout();
00374 #endif // USE_SDL_NET
00375 
00376 #endif // USE_CLOUD
00377     //
00378     // Accessibility controls
00379     //
00380 #ifdef USE_TTS
00381     bool _enableTTS;
00382     CheckboxWidget *_ttsCheckbox;
00383     PopUpWidget *_ttsVoiceSelectionPopUp;
00384 
00385     void addAccessibilityControls(GuiObject *boss, const Common::String &prefix);
00386 #endif
00387 };
00388 
00389 } // End of namespace GUI
00390 
00391 #endif


Generated on Sat May 30 2020 05:01:06 for ResidualVM by doxygen 1.7.1
curved edge   curved edge