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 GUI {
00045 class LauncherDialog;
00046 
00047 class CheckboxWidget;
00048 class EditTextWidget;
00049 class PopUpWidget;
00050 class SliderWidget;
00051 class StaticTextWidget;
00052 class TabWidget;
00053 class ButtonWidget;
00054 class CommandSender;
00055 class GuiObject;
00056 class RadiobuttonGroup;
00057 class RadiobuttonWidget;
00058 
00059 class OptionsDialog : public Dialog {
00060     typedef Common::Array<CheckboxWidget *> CheckboxWidgetList;
00061 
00062 public:
00063     OptionsDialog(const Common::String &domain, int x, int y, int w, int h);
00064     OptionsDialog(const Common::String &domain, const Common::String &name);
00065     ~OptionsDialog();
00066 
00067     void init();
00068 
00069     void open();
00070     virtual void apply();
00071     void close();
00072     void handleCommand(CommandSender *sender, uint32 cmd, uint32 data);
00073     const Common::String& getDomain() const { return _domain; }
00074 
00075     virtual void reflowLayout();
00076 
00077 protected:
00079     Common::String _domain;
00080 
00081     ButtonWidget *_soundFontButton;
00082     StaticTextWidget *_soundFont;
00083     ButtonWidget *_soundFontClearButton;
00084 
00085     virtual void build();
00086     virtual void clean();
00087     void rebuild();
00088 
00089 
00090     void addControlControls(GuiObject *boss, const Common::String &prefix);
00091     void addGraphicControls(GuiObject *boss, const Common::String &prefix);
00092     void addShaderControls(GuiObject *boss, const Common::String &prefix);
00093     void addAudioControls(GuiObject *boss, const Common::String &prefix);
00094     void addMIDIControls(GuiObject *boss, const Common::String &prefix);
00095     void addMT32Controls(GuiObject *boss, const Common::String &prefix);
00096     void addVolumeControls(GuiObject *boss, const Common::String &prefix);
00097     // The default value is the launcher's non-scaled talkspeed value. When SCUMM uses the widget,
00098     // it uses its own scale
00099     void addSubtitleControls(GuiObject *boss, const Common::String &prefix, int maxSliderVal = 255);
00100     void addEngineControls(GuiObject *boss, const Common::String &prefix, const ExtraGuiOptions &engineOptions);
00101 
00102     void setGraphicSettingsState(bool enabled);
00103     void setAudioSettingsState(bool enabled);
00104     void setMIDISettingsState(bool enabled);
00105     void setMT32SettingsState(bool enabled);
00106     void setVolumeSettingsState(bool enabled);
00107     void setSubtitleSettingsState(bool enabled);
00108 
00109     virtual void setupGraphicsTab();
00110 
00111     bool loadMusicDeviceSetting(PopUpWidget *popup, Common::String setting, MusicType preferredType = MT_AUTO);
00112     void saveMusicDeviceSetting(PopUpWidget *popup, Common::String setting);
00113 
00114     TabWidget *_tabWidget;
00115     int _graphicsTabId;
00116     int _midiTabId;
00117     int _pathsTabId;
00118 
00119 private:
00120 
00121     //
00122     // Control controls
00123     //
00124     bool _enableControlSettings;
00125 
00126     CheckboxWidget *_touchpadCheckbox;
00127     CheckboxWidget *_onscreenCheckbox;
00128     CheckboxWidget *_swapMenuAndBackBtnsCheckbox;
00129 
00130     StaticTextWidget *_kbdMouseSpeedDesc;
00131     SliderWidget *_kbdMouseSpeedSlider;
00132     StaticTextWidget *_kbdMouseSpeedLabel;
00133     StaticTextWidget *_joystickDeadzoneDesc;
00134     SliderWidget *_joystickDeadzoneSlider;
00135     StaticTextWidget *_joystickDeadzoneLabel;
00136 
00137     //
00138     // Graphics controls
00139     //
00140     bool _enableGraphicSettings;
00141     StaticTextWidget *_gfxPopUpDesc;
00142     PopUpWidget *_gfxPopUp;
00143     StaticTextWidget *_stretchPopUpDesc;
00144     PopUpWidget *_stretchPopUp;
00145     CheckboxWidget *_fullscreenCheckbox;
00146     CheckboxWidget *_filteringCheckbox;
00147     CheckboxWidget *_aspectCheckbox;
00148     CheckboxWidget *_vsyncCheckbox; // ResidualVM specific
00149     StaticTextWidget *_rendererTypePopUpDesc; // ResidualVM specific
00150     PopUpWidget *_rendererTypePopUp; // ResidualVM specific
00151     StaticTextWidget *_antiAliasPopUpDesc; // ResidualVM specific
00152     PopUpWidget *_antiAliasPopUp; // ResidualVM specific
00153     StaticTextWidget *_renderModePopUpDesc;
00154     PopUpWidget *_renderModePopUp;
00155 
00156     //
00157     // Shader controls
00158     //
00159     bool _enableShaderSettings;
00160     StaticTextWidget *_shaderPopUpDesc;
00161     PopUpWidget *_shaderPopUp;
00162 
00163     //
00164     // Audio controls
00165     //
00166     bool _enableAudioSettings;
00167     StaticTextWidget *_midiPopUpDesc;
00168     PopUpWidget *_midiPopUp;
00169     StaticTextWidget *_oplPopUpDesc;
00170     PopUpWidget *_oplPopUp;
00171 
00172     StaticTextWidget *_mt32DevicePopUpDesc;
00173     PopUpWidget *_mt32DevicePopUp;
00174     StaticTextWidget *_gmDevicePopUpDesc;
00175     PopUpWidget *_gmDevicePopUp;
00176 
00177     //
00178     // MIDI controls
00179     //
00180     bool _enableMIDISettings;
00181     CheckboxWidget *_multiMidiCheckbox;
00182     StaticTextWidget *_midiGainDesc;
00183     SliderWidget *_midiGainSlider;
00184     StaticTextWidget *_midiGainLabel;
00185 
00186     //
00187     // MT-32 controls
00188     //
00189     bool _enableMT32Settings;
00190     CheckboxWidget *_mt32Checkbox;
00191     CheckboxWidget *_enableGSCheckbox;
00192 
00193     //
00194     // Subtitle controls
00195     //
00196     int getSubtitleMode(bool subtitles, bool speech_mute);
00197     bool _enableSubtitleSettings;
00198     StaticTextWidget *_subToggleDesc;
00199     RadiobuttonGroup *_subToggleGroup;
00200     RadiobuttonWidget *_subToggleSubOnly;
00201     RadiobuttonWidget *_subToggleSpeechOnly;
00202     RadiobuttonWidget *_subToggleSubBoth;
00203     static const char *_subModeDesc[];
00204     static const char *_lowresSubModeDesc[];
00205     StaticTextWidget *_subSpeedDesc;
00206     SliderWidget *_subSpeedSlider;
00207     StaticTextWidget *_subSpeedLabel;
00208 
00209     //
00210     // Volume controls
00211     //
00212     void updateMusicVolume(const int newValue) const;
00213     void updateSfxVolume(const int newValue) const;
00214     void updateSpeechVolume(const int newValue) const;
00215     bool _enableVolumeSettings;
00216 
00217     StaticTextWidget *_musicVolumeDesc;
00218     SliderWidget *_musicVolumeSlider;
00219     StaticTextWidget *_musicVolumeLabel;
00220 
00221     StaticTextWidget *_sfxVolumeDesc;
00222     SliderWidget *_sfxVolumeSlider;
00223     StaticTextWidget *_sfxVolumeLabel;
00224 
00225     StaticTextWidget *_speechVolumeDesc;
00226     SliderWidget *_speechVolumeSlider;
00227     StaticTextWidget *_speechVolumeLabel;
00228 
00229     CheckboxWidget *_muteCheckbox;
00230 
00231 protected:
00232     //
00233     // Game GUI options
00234     //
00235     Common::String _guioptions;
00236     Common::String _guioptionsString;
00237 
00238     //
00239     // Engine-specific controls
00240     //
00241     CheckboxWidgetList _engineCheckboxes;
00242 };
00243 
00244 
00245 class GlobalOptionsDialog : public OptionsDialog {
00246 public:
00247     GlobalOptionsDialog(LauncherDialog *launcher);
00248     ~GlobalOptionsDialog();
00249 
00250     virtual void apply();
00251     void close();
00252     void handleCommand(CommandSender *sender, uint32 cmd, uint32 data);
00253     void handleTickle();
00254 
00255     virtual void reflowLayout();
00256 
00257 protected:
00258     virtual void build();
00259     virtual void clean();
00260 
00261     Common::String _newTheme;
00262     LauncherDialog *_launcher;
00263 #ifdef GUI_ENABLE_KEYSDIALOG
00264     KeysDialog *_keysDialog;
00265 #endif
00266 #ifdef USE_FLUIDSYNTH
00267     FluidSynthSettingsDialog *_fluidSynthSettingsDialog;
00268 #endif
00269     StaticTextWidget *_savePath;
00270     ButtonWidget     *_savePathClearButton;
00271     StaticTextWidget *_themePath;
00272     ButtonWidget     *_themePathClearButton;
00273     StaticTextWidget *_extraPath;
00274     ButtonWidget     *_extraPathClearButton;
00275 #ifdef DYNAMIC_MODULES
00276     StaticTextWidget *_pluginsPath;
00277 #endif
00278 
00279     //
00280     // Misc controls
00281     //
00282     StaticTextWidget *_curTheme;
00283     StaticTextWidget *_rendererPopUpDesc;
00284     PopUpWidget *_rendererPopUp;
00285     StaticTextWidget *_autosavePeriodPopUpDesc;
00286     PopUpWidget *_autosavePeriodPopUp;
00287     StaticTextWidget *_guiLanguagePopUpDesc;
00288     PopUpWidget *_guiLanguagePopUp;
00289     CheckboxWidget *_guiLanguageUseGameLanguageCheckbox;
00290     CheckboxWidget *_useSystemDialogsCheckbox;
00291 
00292 
00293 #ifdef USE_UPDATES
00294     StaticTextWidget *_updatesPopUpDesc;
00295     PopUpWidget *_updatesPopUp;
00296 #endif
00297 
00298 #ifdef USE_CLOUD
00299     //
00300     // Cloud controls
00301     //
00302     uint32 _selectedStorageIndex;
00303     StaticTextWidget *_storagePopUpDesc;
00304     PopUpWidget *_storagePopUp;
00305     StaticTextWidget *_storageUsernameDesc;
00306     StaticTextWidget *_storageUsername;
00307     StaticTextWidget *_storageUsedSpaceDesc;
00308     StaticTextWidget *_storageUsedSpace;
00309     StaticTextWidget *_storageLastSyncDesc;
00310     StaticTextWidget *_storageLastSync;
00311     ButtonWidget     *_storageConnectButton;
00312     ButtonWidget     *_storageRefreshButton;
00313     ButtonWidget     *_storageDownloadButton;
00314     ButtonWidget     *_runServerButton;
00315     StaticTextWidget *_serverInfoLabel;
00316     ButtonWidget     *_rootPathButton;
00317     StaticTextWidget *_rootPath;
00318     ButtonWidget     *_rootPathClearButton;
00319     StaticTextWidget *_serverPortDesc;
00320     EditTextWidget *_serverPort;
00321     ButtonWidget     *_serverPortClearButton;
00322     bool _redrawCloudTab;
00323 #ifdef USE_SDL_NET
00324     bool _serverWasRunning;
00325 #endif
00326 
00327     void setupCloudTab();
00328 
00329 #ifdef USE_LIBCURL
00330     void storageInfoCallback(Cloud::Storage::StorageInfoResponse response);
00331     void storageListDirectoryCallback(Cloud::Storage::ListDirectoryResponse response);
00332     void storageErrorCallback(Networking::ErrorResponse response);
00333 #endif
00334 #endif // USE_CLOUD
00335 };
00336 
00337 } // End of namespace GUI
00338 
00339 #endif


Generated on Sat Nov 30 2019 05:00:32 for ResidualVM by doxygen 1.7.1
curved edge   curved edge