Emergency 20 Dokumentation  4.2.0
PreferencesAudioWindow.h
Go to the documentation of this file.
1 // Copyright (C) 2012-2018 Promotion Software GmbH
2 
3 
4 //[-------------------------------------------------------]
5 //[ Header guard ]
6 //[-------------------------------------------------------]
7 #pragma once
8 
9 
10 //[-------------------------------------------------------]
11 //[ Includes ]
12 //[-------------------------------------------------------]
14 
15 #include <qsf/audio/AudioProxy.h>
16 
17 
18 //[-------------------------------------------------------]
19 //[ Namespace ]
20 //[-------------------------------------------------------]
21 namespace em5
22 {
23 
24 
25  //[-------------------------------------------------------]
26  //[ Classes ]
27  //[-------------------------------------------------------]
33  {
34 
35 
36  //[-------------------------------------------------------]
37  //[ Public methods ]
38  //[-------------------------------------------------------]
39  public:
40  explicit PreferencesAudioWindow(qsf::GuiContext& guiContext);
41  void setBackButton(bool main);
42  void setInTutorial(bool tutorial);
43 
44 
45  //[-------------------------------------------------------]
46  //[ Public virtual qsf::GuiDocument methods ]
47  //[-------------------------------------------------------]
48  public:
49  virtual void processEvent(const std::string& eventKey, Rocket::Core::Event& event) override;
50 
51 
52  //[-------------------------------------------------------]
53  //[ Protected virtual em5::MainMenuWindowBase methods ]
54  //[-------------------------------------------------------]
55  protected:
56  virtual void onGoingBack() override;
57 
58 
59  //[-------------------------------------------------------]
60  //[ Protected virtual em5::GuiHotReloadSupport methods ]
61  //[-------------------------------------------------------]
62  protected:
63  virtual void onReloadGui() override;
64  virtual void onDocumentPreHide() override;
65 
66 
67  //[-------------------------------------------------------]
68  //[ Private methods ]
69  //[-------------------------------------------------------]
70  private:
71  void setupUI();
72  void loadSettings();
73  void setOldStates();
74 
75 
76  //[-------------------------------------------------------]
77  //[ Private definitions ]
78  //[-------------------------------------------------------]
79  private:
80  // This structure holds the volume of all music channels
81  struct AudioSettings
82  {
83  float generalVolume;
84  float effectVolume;
85  float interfaceVolume;
86  float musicVolume;
87  float speechVolume;
88  };
89 
90 
91  //[-------------------------------------------------------]
92  //[ Private data ]
93  //[-------------------------------------------------------]
94  private:
95  AudioSettings mCurrentAudioSettings;
96  AudioSettings mNewAudioSettings;
97  qsf::AudioProxy mAudioProxy;
98  bool mMousePressed;
99  bool mInMainMenu;
100 
101 
102  };
103 
104 
105 //[-------------------------------------------------------]
106 //[ Namespace ]
107 //[-------------------------------------------------------]
108 } // em5
Definition: ActionPriority.h:13
PreferencesAudioWindow(qsf::GuiContext &guiContext)
void setBackButton(bool main)
virtual void onGoingBack() override
virtual void onReloadGui() override
Gets called when the GUI should be reloaded.
virtual void processEvent(const std::string &eventKey, Rocket::Core::Event &event) override
Base window for main menu windows.
Definition: MainMenuWindowBase.h:40
The audio proxy resembles the playback of an audio asset.
Definition: AudioProxy.h:71
Ingame Graphical User Interface (GUI) context class.
Definition: GuiContext.h:62
virtual void onDocumentPreHide() override
void setInTutorial(bool tutorial)
Preferences window.
Definition: PreferencesAudioWindow.h:32