LeviLamina
Loading...
Searching...
No Matches
LevelSoundManager.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/utility/NonOwnerPointer.h"
7#include "mc/deps/core/utility/pub_sub/Connector.h"
8#include "mc/deps/core/utility/pub_sub/Publisher.h"
9#include "mc/deps/core/utility/pub_sub/Subscription.h"
10#include "mc/deps/shared_types/legacy/LevelSoundEvent.h"
11#include "mc/network/NetworkIdentifierWithSubId.h"
12#include "mc/network/packet/LevelSoundEventPacket.h"
13#include "mc/world/level/ILevelSoundManagerConnector.h"
14#include "mc/world/level/ServerSoundDefinitionRegistry.h"
15#include "mc/world/level/ServerSoundInstanceManager.h"
16
17// auto generated forward declare list
18// clang-format off
20class BlockPos;
21class IDimension;
25class PacketSender;
26class Player;
30class Vec3;
31struct BroadcastOptions;
33struct DimensionType;
34struct PlaySoundOptions;
36namespace Bedrock::PubSub::ThreadModel { struct MultiThreaded; }
37// clang-format on
38
39class LevelSoundManager : public ::ILevelSoundManagerConnector {
40public:
41 // LevelSoundManager inner types declare
42 // clang-format off
47 // clang-format on
48
49 // LevelSoundManager inner types define
51 public:
52 // member variables
53 // NOLINTBEGIN
54 ::ll::TypedStorage<8, 176, ::LevelSoundEventPacket> mPacket;
55 ::ll::TypedStorage<8, 24, ::std::vector<::NetworkIdentifierWithSubId>> mNetworkIds;
56 // NOLINTEND
57 };
58
60 public:
61 // member variables
62 // NOLINTBEGIN
63 ::ll::TypedStorage<8, 176, ::LevelSoundEventPacket> mPacket;
64 // NOLINTEND
65 };
66
68 public:
69 // member variables
70 // NOLINTBEGIN
71 ::ll::TypedStorage<8, 176, ::LevelSoundEventPacket> mPacket;
72 ::ll::TypedStorage<8, 184, ::NetworkIdentifierWithSubId> mNetworkId;
73 // NOLINTEND
74 };
75
77 public:
78 // member variables
79 // NOLINTBEGIN
80 ::ll::TypedStorage<8, 176, ::LevelSoundEventPacket> mPacket;
81 // NOLINTEND
82 };
83
84 using QueuedSoundPacket = ::std::variant<
89
90public:
91 // member variables
92 // NOLINTBEGIN
93 ::ll::TypedStorage<8, 64, ::ServerSoundDefinitionRegistry> mServerSoundDefinitionRegistry;
94 ::ll::TypedStorage<8, 200, ::ServerSoundInstanceManager> mServerSoundInstanceManager;
95 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::SoundPlayerInterface>> mSoundPlayer;
96 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::PacketSender>> mLevelPacketSender;
97 ::ll::TypedStorage<1, 1, bool> mIsClientSide;
98 ::ll::TypedStorage<1, 1, bool> mServerAuthSoundEnabled;
99 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::LevelEventCoordinator> const> mLevelEventCoordinator;
100 ::ll::TypedStorage<
101 8,
102 24,
103 ::std::vector<::std::variant<
108 mSoundPacketQueue;
109 ::ll::TypedStorage<
110 8,
111 128,
113 void(::SoundEventIdentifier const&, ::Vec3 const&, int, ::ActorSoundIdentifier const&, bool),
115 0>>
116 mOnLevelSoundEvent;
117 ::ll::TypedStorage<
118 8,
119 128,
121 mOnLevelSoundEventWithVolumeAndPitch;
122 ::ll::TypedStorage<
123 8,
124 128,
126 mOnStopLevelSoundEvent;
128 mOnStopAllLevelSoundsEvent;
130 mOnStopMusicEvent;
131 ::ll::TypedStorage<
132 8,
133 128,
134 ::Bedrock::PubSub::
136 mOnRecordStartedEvent;
137 ::ll::TypedStorage<
138 8,
139 128,
141 mOnRecordStoppedEvent;
142 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mOnPlayerDisconnectedSubscription;
143 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mOnPlayerConnectedSubscription;
144 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mOnPlayerLeftDimensionSubscription;
145 // NOLINTEND
146
147public:
148 // prevent constructor by default
149 LevelSoundManager();
150
151public:
152 // virtual functions
153 // NOLINTBEGIN
154 virtual ::Bedrock::PubSub::Connector<
155 void(::SoundEventIdentifier const&, ::Vec3 const&, int, ::ActorSoundIdentifier const&, bool)>&
156 getOnLevelSoundEventConnector() /*override*/;
157
158 virtual ::Bedrock::PubSub::Connector<void(::PlaySoundOptions const&)>&
159 getOnLevelSoundEventWithVolumeAndPitchConnector() /*override*/;
160
161 virtual ::Bedrock::PubSub::Connector<void(::std::string const&)>& getOnStopLevelSoundEventConnector() /*override*/;
162
163 virtual ::Bedrock::PubSub::Connector<void()>& getOnStopAllLevelSoundsEventConnector() /*override*/;
164
165 virtual ::Bedrock::PubSub::Connector<void()>& getOnStopMusicEventConnector() /*override*/;
166 // NOLINTEND
167
168public:
169 // member functions
170 // NOLINTBEGIN
171 MCAPI LevelSoundManager(
172 ::Bedrock::NotNullNonOwnerPtr<::SoundPlayerInterface> soundPlayer,
173 bool isClientSide,
174 ::Bedrock::NotNullNonOwnerPtr<::LevelEventCoordinator> levelEventCoordinator,
175 ::Bedrock::NotNullNonOwnerPtr<::PacketSender> packetSender,
176 bool isServerAuthSoundEnabled
177 );
178
179 MCAPI void _queueSoundPacket(
180 ::std::variant<
185 );
186
187 MCAPI void
188 _stopBroadcastsForPlayer(::NetworkIdentifierWithSubId const& player, ::std::optional<::DimensionType> dimension);
189
190 MCAPI void broadcastSoundEvent(
191 ::IDimension& dimension,
192 ::SoundEventIdentifier const& soundEvent,
193 ::Vec3 const& pos,
194 int data,
195 ::ActorSoundIdentifier const& actorSoundIdentifier,
196 bool isGlobal,
197 ::Player* primaryLocalPlayer,
198 ::std::optional<::Vec3> const& fireAtPosition
199 );
200
201 MCAPI void broadcastSoundEvent(
202 ::IDimension& dimension,
203 ::SharedTypes::Legacy::LevelSoundEvent type,
204 ::Vec3 const& pos,
205 int data,
206 ::ActorSoundIdentifier const& actorSoundIdentifier,
207 bool isGlobal,
208 ::Player* primaryLocalPlayer,
209 ::std::optional<::Vec3> const& fireAtPosition
210 );
211
212 MCAPI ::std::optional<::ServerSoundInstance> createServerSoundInstance(
213 ::std::string const& soundEventName,
214 int loopCount,
215 ::std::optional<::NetworkIdentifierWithSubId> recipient,
216 ::std::optional<::BroadcastOptions> broadcast
217 );
218
219#ifdef LL_PLAT_C
220 MCAPI void handleUpdateSoundData(::ClientboundUpdateSoundDataPacketPayload const& payload);
221#endif
222
223 MCAPI void onViewRegionMoved(
224 ::NetworkIdentifierWithSubId const& player,
225 ::BlockPos const& position,
226 uint radius,
227 ::DimensionType dimension
228 );
229
230 MCAPI void playPredictiveSynchronizedSound(
231 ::IDimension& dimension,
232 ::SoundEventIdentifier const& soundEvent,
233 ::Vec3 const& pos,
234 ::Player* targetPlayer,
235 int data,
236 ::ActorSoundIdentifier const& actorSoundIdentifier,
237 bool isGlobal,
238 ::std::optional<::Vec3> const& fireAtPosition
239 );
240
241 MCAPI void playPredictiveSynchronizedSound(
242 ::IDimension& dimension,
243 ::SharedTypes::Legacy::LevelSoundEvent type,
244 ::Vec3 const& pos,
245 ::Player* targetPlayer,
246 int data,
247 ::ActorSoundIdentifier const& actorSoundIdentifier,
248 bool isGlobal,
249 ::std::optional<::Vec3> const& fireAtPosition
250 );
251
252 MCAPI void playSound(::SharedTypes::Legacy::LevelSoundEvent type, ::Vec3 const& pos, float volume, float pitch);
253
254 MCAPI void playSound(
255 ::SharedTypes::Legacy::LevelSoundEvent type,
256 ::Vec3 const& pos,
257 int data,
258 ::ActorSoundIdentifier const& actorSoundIdentifier,
259 bool isGlobal
260 );
261
262 MCAPI void playSoundForPlayerInDimension(
263 ::DimensionType dimensionType,
264 ::SharedTypes::Legacy::LevelSoundEvent type,
265 ::Vec3 const& pos,
266 int data,
267 ::ActorSoundIdentifier const& actorSoundIdentifier,
268 bool isGlobal,
269 ::Player* primaryLocalPlayer
270 );
271
272 MCAPI void playSynchronizedSound_DEPRECATED(
273 ::IDimension& dimension,
274 ::SharedTypes::Legacy::LevelSoundEvent type,
275 ::Vec3 const& pos,
276 ::Player* primaryLocalPlayer,
277 int data,
278 ::ActorSoundIdentifier const& actorSoundIdentifier,
279 bool isGlobal,
280 ::std::optional<::Vec3> const& fireAtPosition
281 );
282
283 MCAPI void processQueuedSoundPackets();
284
285 MCAPI void sendRecordStarted(
286 ::std::vector<::NetworkIdentifierWithSubId> const& recipients,
287 ::BlockPos const& blockPos,
288 ::ServerSoundHandle serverSoundHandle
289 );
290
291 MCAPI void subscribeToPlayerConnectionEvents(::IPlayerConnectionConnector& connector);
292
293 MCAPI void subscribeToPlayerDimensionTransfers(::IPlayerDimensionTransferConnector& connector);
294 // NOLINTEND
295
296public:
297 // constructor thunks
298 // NOLINTBEGIN
299 MCAPI void* $ctor(
300 ::Bedrock::NotNullNonOwnerPtr<::SoundPlayerInterface> soundPlayer,
301 bool isClientSide,
302 ::Bedrock::NotNullNonOwnerPtr<::LevelEventCoordinator> levelEventCoordinator,
303 ::Bedrock::NotNullNonOwnerPtr<::PacketSender> packetSender,
304 bool isServerAuthSoundEnabled
305 );
306 // NOLINTEND
307
308public:
309 // virtual function thunks
310 // NOLINTBEGIN
311 MCAPI ::Bedrock::PubSub::Connector<
312 void(::SoundEventIdentifier const&, ::Vec3 const&, int, ::ActorSoundIdentifier const&, bool)>&
313 $getOnLevelSoundEventConnector();
314
315 MCAPI ::Bedrock::PubSub::Connector<void(::PlaySoundOptions const&)>&
316 $getOnLevelSoundEventWithVolumeAndPitchConnector();
317
318 MCAPI ::Bedrock::PubSub::Connector<void(::std::string const&)>& $getOnStopLevelSoundEventConnector();
319
320 MCFOLD ::Bedrock::PubSub::Connector<void()>& $getOnStopAllLevelSoundsEventConnector();
321
322 MCAPI ::Bedrock::PubSub::Connector<void()>& $getOnStopMusicEventConnector();
323
324
325 // NOLINTEND
326};
Definition ActorSoundIdentifier.h:17
Definition Publisher.h:25
Definition BlockPos.h:17
Definition IDimension.h:24
Definition ILevelSoundManagerConnector.h:19
Definition IPlayerConnectionConnector.h:15
Definition IPlayerDimensionTransferConnector.h:15
Definition LevelEventCoordinator.h:26
Definition PacketSender.h:17
Definition Player.h:129
Definition ServerSoundHandle.h:5
Definition ServerSoundInstance.h:16
Definition SoundPlayerInterface.h:23
Definition Vec3.h:10
Definition BroadcastOptions.h:5
Definition ClientboundUpdateSoundDataPacketPayload.h:15
Definition DimensionType.h:5
Definition LevelSoundManager.h:59
Definition LevelSoundManager.h:76
Definition NetworkIdentifierWithSubId.h:10
Definition PlaySoundOptions.h:9
Definition SoundEventIdentifier.h:13