Emergency 20 Dokumentation  4.2.0
AudioManager.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"
15 
16 #include <qsf/audio/AudioProxy.h>
17 
18 #include <boost/noncopyable.hpp>
19 
20 #include <vector>
21 #include <utility> // For std::pair
22 
23 
24 //[-------------------------------------------------------]
25 //[ Forward declarations ]
26 //[-------------------------------------------------------]
27 namespace qsf
28 {
29  class Clock;
30  class Map;
31  namespace game
32  {
33  class BitStream;
34  }
35 }
36 
37 
38 //[-------------------------------------------------------]
39 //[ Namespace ]
40 //[-------------------------------------------------------]
41 namespace em5
42 {
43  namespace multiplayer
44  {
45  namespace client
46  {
47 
48 
49  //[-------------------------------------------------------]
50  //[ Classes ]
51  //[-------------------------------------------------------]
56  class EM5_API_EXPORT AudioManager : public boost::noncopyable
57  {
58 
59 
60  //[-------------------------------------------------------]
61  //[ Public methods ]
62  //[-------------------------------------------------------]
63  public:
64  AudioManager();
65 
76  bool readAudioUpdateDataFromStream(const qsf::game::BitStream& bitStream);
77 
82  void interpolate(const qsf::Clock& clock);
83 
84  void setMap(qsf::Map& map);
85 
86  void shutdown();
87 
88 
89  //[-------------------------------------------------------]
90  //[ Private methods ]
91  //[-------------------------------------------------------]
92  public:
93  void handleAudioUpdateData(const AudioUpdateData& data);
94  void applyPlayAudio(qsf::AudioProxy& audioProxy, const AudioUpdateData& data);
95 
96 
97  //[-------------------------------------------------------]
98  //[ Private data ]
99  //[-------------------------------------------------------]
100  private:
101  qsf::Map* mCurrentMap;
102  std::vector<std::pair<int32, std::vector<AudioUpdateData>>> mAudioUpdateHistory;
103  std::unordered_map<uint32, qsf::AudioProxy> mActiveAudio;
104 
105 
106  };
107 
108 
109 //[-------------------------------------------------------]
110 //[ Namespace ]
111 //[-------------------------------------------------------]
112  } // client
113  } // multiplayer
114 } // em5
Definition: ActionPriority.h:13
Client side audio manager which handles audio update messages.
Definition: AudioManager.h:56
Map class.
Definition: Map.h:93
Clock class.
Definition: Clock.h:33
#define EM5_API_EXPORT
Definition: Export.h:28
Game bit stream class (just a wrapper for linnet bit stream)
Definition: BitStream.h:40
Definition: OperationMessages.h:507
Definition: PickupPersonByParamedicAction.h:21
The audio proxy resembles the playback of an audio asset.
Definition: AudioProxy.h:71