Emergency 20 Dokumentation  4.2.0
FullscreenVideoWindow.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>
18 
19 
20 //[-------------------------------------------------------]
21 //[ Forward declarations ]
22 //[-------------------------------------------------------]
23 namespace Rocket
24 {
25  namespace Core
26  {
27  class ElementText;
28  }
29 }
30 namespace qsf
31 {
32  class AudioMixer;
33  class VideoPlayer;
34  class JobArguments;
35 }
36 
37 
38 //[-------------------------------------------------------]
39 //[ Namespace ]
40 //[-------------------------------------------------------]
41 namespace em5
42 {
43 
44 
45  //[-------------------------------------------------------]
46  //[ Classes ]
47  //[-------------------------------------------------------]
49  {
50 
51 
52  //[-------------------------------------------------------]
53  //[ Public methods ]
54  //[-------------------------------------------------------]
55  public:
56  explicit FullscreenVideoWindow(qsf::GuiContext& guiContext);
57  virtual ~FullscreenVideoWindow();
58 
68  void showVideoByFilename(const std::string& videoFile, bool exclusiveMode = true);
69 
70  void clearVideo();
71  bool isVideoPlaying() const;
72  qsf::VideoPlayer& getVideoPlayer() const;
73 
74 
75  //[-------------------------------------------------------]
76  //[ Public virtual qsf::GuiDocument methods ]
77  //[-------------------------------------------------------]
78  public:
79  virtual void processEvent(const std::string& eventKey, Rocket::Core::Event& event) override;
80  virtual void processViewportDimensionsChanged(int width, int height) override;
81 
82 
83  //[-------------------------------------------------------]
84  //[ Public virtual qsf::InputListener methods ]
85  //[-------------------------------------------------------]
86  public:
87  virtual void eventReceived(const qsf::InputEvent& inputEvent, Response& response) override;
88 
89 
90  //[-------------------------------------------------------]
91  //[ Private methods ]
92  //[-------------------------------------------------------]
93  private:
94  void onPlaybackFinished();
95  void onSyncVideo(const qsf::JobArguments& jobArgs);
96  void disableJobManagerAutoupdate(const qsf::StringHash& providerJobManagerId);
97 
98 
99  //[-------------------------------------------------------]
100  //[ Private data ]
101  //[-------------------------------------------------------]
102  private:
103  qsf::AudioMixer& mAudioMixer;
104  std::shared_ptr<qsf::VideoPlayer> mVideoPlayer;
105  bool mVideoPlaybackInProgress;
106  float mPreviousFpsLimitation;
107  glm::ivec2 mScreenSize;
108  std::vector<qsf::StringHash> mDisabledJobManagerAutoupdate;
109  qsf::WeakPtr<qsf::CameraComponent> mPreviousMainCamera;
110 
111 
112  };
113 
114 
115 //[-------------------------------------------------------]
116 //[ Namespace ]
117 //[-------------------------------------------------------]
118 } // em5
Definition: ActionPriority.h:13
Definition: FullscreenVideoWindow.h:48
Input listener class.
Definition: InputListener.h:43
Input event base class.
Definition: InputEvent.h:40
Graphical User Interface (GUI) document base class.
Definition: GuiDocument.h:51
#define EM5_API_EXPORT
Definition: Export.h:28
Audio mixer class.
Definition: AudioMixer.h:55
Definition: OverlayComponent.h:29
Job arguments class: holds data to be passed to the called job method by the job manager.
Definition: JobArguments.h:40
Definition: PickupPersonByParamedicAction.h:21
Ingame Graphical User Interface (GUI) context class.
Definition: GuiContext.h:62
Self-contained video player.
Definition: VideoPlayer.h:55
Definition: InputListener.h:51
Compile time string hash class.
Definition: StringHash.h:59