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 *_renderModePopUpDesc;
00152     PopUpWidget *_renderModePopUp;
00153 
00154     //
00155     // Shader controls
00156     //
00157     bool _enableShaderSettings;
00158     StaticTextWidget *_shaderPopUpDesc;
00159     PopUpWidget *_shaderPopUp;
00160 
00161     //
00162     // Audio controls
00163     //
00164     bool _enableAudioSettings;
00165     StaticTextWidget *_midiPopUpDesc;
00166     PopUpWidget *_midiPopUp;
00167     StaticTextWidget *_oplPopUpDesc;
00168     PopUpWidget *_oplPopUp;
00169 
00170     StaticTextWidget *_mt32DevicePopUpDesc;
00171     PopUpWidget *_mt32DevicePopUp;
00172     StaticTextWidget *_gmDevicePopUpDesc;
00173     PopUpWidget *_gmDevicePopUp;
00174 
00175     //
00176     // MIDI controls
00177     //
00178     bool _enableMIDISettings;
00179     CheckboxWidget *_multiMidiCheckbox;
00180     StaticTextWidget *_midiGainDesc;
00181     SliderWidget *_midiGainSlider;
00182     StaticTextWidget *_midiGainLabel;
00183 
00184     //
00185     // MT-32 controls
00186     //
00187     bool _enableMT32Settings;
00188     CheckboxWidget *_mt32Checkbox;
00189     CheckboxWidget *_enableGSCheckbox;
00190 
00191     //
00192     // Subtitle controls
00193     //
00194     int getSubtitleMode(bool subtitles, bool speech_mute);
00195     bool _enableSubtitleSettings;
00196     StaticTextWidget *_subToggleDesc;
00197     RadiobuttonGroup *_subToggleGroup;
00198     RadiobuttonWidget *_subToggleSubOnly;
00199     RadiobuttonWidget *_subToggleSpeechOnly;
00200     RadiobuttonWidget *_subToggleSubBoth;
00201     static const char *_subModeDesc[];
00202     static const char *_lowresSubModeDesc[];
00203     StaticTextWidget *_subSpeedDesc;
00204     SliderWidget *_subSpeedSlider;
00205     StaticTextWidget *_subSpeedLabel;
00206 
00207     //
00208     // Volume controls
00209     //
00210     void updateMusicVolume(const int newValue) const;
00211     void updateSfxVolume(const int newValue) const;
00212     void updateSpeechVolume(const int newValue) const;
00213     bool _enableVolumeSettings;
00214 
00215     StaticTextWidget *_musicVolumeDesc;
00216     SliderWidget *_musicVolumeSlider;
00217     StaticTextWidget *_musicVolumeLabel;
00218 
00219     StaticTextWidget *_sfxVolumeDesc;
00220     SliderWidget *_sfxVolumeSlider;
00221     StaticTextWidget *_sfxVolumeLabel;
00222 
00223     StaticTextWidget *_speechVolumeDesc;
00224     SliderWidget *_speechVolumeSlider;
00225     StaticTextWidget *_speechVolumeLabel;
00226 
00227     CheckboxWidget *_muteCheckbox;
00228 
00229 protected:
00230     //
00231     // Game GUI options
00232     //
00233     Common::String _guioptions;
00234     Common::String _guioptionsString;
00235 
00236     //
00237     // Engine-specific controls
00238     //
00239     CheckboxWidgetList _engineCheckboxes;
00240 };
00241 
00242 
00243 class GlobalOptionsDialog : public OptionsDialog {
00244 public:
00245     GlobalOptionsDialog(LauncherDialog *launcher);
00246     ~GlobalOptionsDialog();
00247 
00248     virtual void apply();
00249     void close();
00250     void handleCommand(CommandSender *sender, uint32 cmd, uint32 data);
00251     void handleTickle();
00252 
00253     virtual void reflowLayout();
00254 
00255 protected:
00256     virtual void build();
00257     virtual void clean();
00258 
00259     Common::String _newTheme;
00260     LauncherDialog *_launcher;
00261 #ifdef GUI_ENABLE_KEYSDIALOG
00262     KeysDialog *_keysDialog;
00263 #endif
00264 #ifdef USE_FLUIDSYNTH
00265     FluidSynthSettingsDialog *_fluidSynthSettingsDialog;
00266 #endif
00267     StaticTextWidget *_savePath;
00268     ButtonWidget     *_savePathClearButton;
00269     StaticTextWidget *_themePath;
00270     ButtonWidget     *_themePathClearButton;
00271     StaticTextWidget *_extraPath;
00272     ButtonWidget     *_extraPathClearButton;
00273 #ifdef DYNAMIC_MODULES
00274     StaticTextWidget *_pluginsPath;
00275 #endif
00276 
00277     //
00278     // Misc controls
00279     //
00280     StaticTextWidget *_curTheme;
00281     StaticTextWidget *_rendererPopUpDesc;
00282     PopUpWidget *_rendererPopUp;
00283     StaticTextWidget *_autosavePeriodPopUpDesc;
00284     PopUpWidget *_autosavePeriodPopUp;
00285     StaticTextWidget *_guiLanguagePopUpDesc;
00286     PopUpWidget *_guiLanguagePopUp;
00287     CheckboxWidget *_guiLanguageUseGameLanguageCheckbox;
00288     CheckboxWidget *_useSystemDialogsCheckbox;
00289 
00290 
00291 #ifdef USE_UPDATES
00292     StaticTextWidget *_updatesPopUpDesc;
00293     PopUpWidget *_updatesPopUp;
00294 #endif
00295 
00296 #ifdef USE_CLOUD
00297     //
00298     // Cloud controls
00299     //
00300     uint32 _selectedStorageIndex;
00301     StaticTextWidget *_storagePopUpDesc;
00302     PopUpWidget *_storagePopUp;
00303     StaticTextWidget *_storageUsernameDesc;
00304     StaticTextWidget *_storageUsername;
00305     StaticTextWidget *_storageUsedSpaceDesc;
00306     StaticTextWidget *_storageUsedSpace;
00307     StaticTextWidget *_storageLastSyncDesc;
00308     StaticTextWidget *_storageLastSync;
00309     ButtonWidget     *_storageConnectButton;
00310     ButtonWidget     *_storageRefreshButton;
00311     ButtonWidget     *_storageDownloadButton;
00312     ButtonWidget     *_runServerButton;
00313     StaticTextWidget *_serverInfoLabel;
00314     ButtonWidget     *_rootPathButton;
00315     StaticTextWidget *_rootPath;
00316     ButtonWidget     *_rootPathClearButton;
00317     StaticTextWidget *_serverPortDesc;
00318     EditTextWidget *_serverPort;
00319     ButtonWidget     *_serverPortClearButton;
00320     bool _redrawCloudTab;
00321 #ifdef USE_SDL_NET
00322     bool _serverWasRunning;
00323 #endif
00324 
00325     void setupCloudTab();
00326 
00327 #ifdef USE_LIBCURL
00328     void storageInfoCallback(Cloud::Storage::StorageInfoResponse response);
00329     void storageListDirectoryCallback(Cloud::Storage::ListDirectoryResponse response);
00330     void storageErrorCallback(Networking::ErrorResponse response);
00331 #endif
00332 #endif // USE_CLOUD
00333 };
00334 
00335 } // End of namespace GUI
00336 
00337 #endif


Generated on Sat Mar 16 2019 05:01:49 for ResidualVM by doxygen 1.7.1
curved edge   curved edge