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