Emergency 20 Dokumentation  4.2.0
SupervisorWindow.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 //[-------------------------------------------------------]
13 #include "em5/Export.h"
14 
15 #include <qsf/gui/GuiDocument.h>
16 #include <qsf/job/JobProxy.h>
17 #include <qsf/audio/AudioProxy.h>
19 
20 
21 //[-------------------------------------------------------]
22 //[ Forward declarations ]
23 //[-------------------------------------------------------]
24 namespace qsf
25 {
26  class Map;
27  class CameraTextureRenderComponent;
28 }
29 
30 
31 //[-------------------------------------------------------]
32 //[ Namespace ]
33 //[-------------------------------------------------------]
34 namespace em5
35 {
36 
37 
38  //[-------------------------------------------------------]
39  //[ Classes ]
40  //[-------------------------------------------------------]
46  {
47 
48 
49  //[-------------------------------------------------------]
50  //[ Public definitions ]
51  //[-------------------------------------------------------]
52  public:
53  static float VOLUME_THRESHOLD;
54  static float ANIMATION_FADE_TIME;
55 
56  enum State
57  {
64  STATE_STOP
65  };
66 
67 
68  //[-------------------------------------------------------]
69  //[ Public methods ]
70  //[-------------------------------------------------------]
71  public:
72  explicit SupervisorWindow(qsf::GuiContext& guiContext);
73  virtual ~SupervisorWindow();
74 
79  void setVisibleSupervisor(bool visible);
80 
90  void play(const std::string& audioPath, bool showVideo);
91 
96  void stop();
97 
102  void fadeOut();
103 
108  bool isRunning() const;
109 
110  void pause();
111 
112  void resume();
113 
114 
115  //[-------------------------------------------------------]
116  //[ Public virtual qsf::GuiDocument methods ]
117  //[-------------------------------------------------------]
118  public:
119  virtual void processEvent(const std::string& eventKey, Rocket::Core::Event& event) override;
120 
121 
122  //[-------------------------------------------------------]
123  //[ Private virtual qsf::GuiDocument methods ]
124  //[-------------------------------------------------------]
125  private:
126  virtual bool onPreShow() override;
127  virtual void onPreHide() override;
128 
129 
130  //[-------------------------------------------------------]
131  //[ Private methods ]
132  //[-------------------------------------------------------]
133  private:
134  void instantUpdateTexture();
135  void updateJob(const qsf::JobArguments& jobArguments);
136  qsf::CameraTextureRenderComponent* getCameraTextureRenderComponent() const;
137  void setCameraTextureRenderComponentActive(bool active);
138  void setAnimation(bool enabled, bool speaking, bool blend);
139  void setAudio(bool play);
140  void onUpdateEvents(const qsf::MessageParameters& parameters);
141 
142 
143  //[-------------------------------------------------------]
144  //[ Private data ]
145  //[-------------------------------------------------------]
146  private:
147  bool mVisibleSupervisor;
148  State mState;
149  qsf::Map* mMap;
150  uint64 mSupervisorEntityId;
151  qsf::Time mTimePassed;
152  std::string mAudioPath;
153  qsf::JobProxy mUpdateJobProxy;
154  qsf::AudioProxy mAudioProxy;
155  uint32 mFreeplayEventId;
156  qsf::MessageProxy mMessageProxy;
157 
158 
159  };
160 
161 
162 //[-------------------------------------------------------]
163 //[ Namespace ]
164 //[-------------------------------------------------------]
165 } // em5
Definition: ActionPriority.h:13
Supervisor puppeteer.
Definition: SupervisorWindow.h:45
Job proxy class.
Definition: JobProxy.h:51
Definition: SupervisorWindow.h:60
Message parameters class.
Definition: MessageParameters.h:34
Map class.
Definition: Map.h:93
unsigned int uint32
Definition: PlatformTypes.h:181
Graphical User Interface (GUI) document base class.
Definition: GuiDocument.h:51
#define EM5_API_EXPORT
Definition: Export.h:28
Camera render to texture component class.
Definition: CameraTextureRenderComponent.h:48
Definition: SupervisorWindow.h:62
Message listener proxy class.
Definition: MessageProxy.h:47
uint64_t uint64
Definition: PlatformTypes.h:184
Definition: SupervisorWindow.h:61
Job arguments class: holds data to be passed to the called job method by the job manager.
Definition: JobArguments.h:40
static float VOLUME_THRESHOLD
Definition: SupervisorWindow.h:53
State
Definition: SupervisorWindow.h:56
Definition: PickupPersonByParamedicAction.h:21
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
State
Definition: ProcessState.h:20
Definition: SupervisorWindow.h:58
Definition: SupervisorWindow.h:63
static float ANIMATION_FADE_TIME
Definition: SupervisorWindow.h:54
Definition: SupervisorWindow.h:59
Data type for encapsulating time information. It might represents points in time and time spans...
Definition: Time.h:32