LeviLamina
Loading...
Searching...
No Matches
SoundSystemBase.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/file/PathBuffer.h"
7#include "mc/deps/core/sound/SoundFormat.h"
8
9// auto generated forward declare list
10// clang-format off
12class SoundEvent;
17namespace Core { class Path; }
18namespace Core { class PathView; }
19class SoundItem;
20struct SoundSystemGUID;
21// clang-format on
22
23class SoundSystemBase {
24public:
25 // member variables
26 // NOLINTBEGIN
29 // NOLINTEND
30
31public:
32 // prevent constructor by default
33 SoundSystemBase& operator=(SoundSystemBase const&);
34 SoundSystemBase(SoundSystemBase const&);
35 SoundSystemBase();
36
37public:
38 // virtual functions
39 // NOLINTBEGIN
40#ifdef LL_PLAT_S
41 virtual ~SoundSystemBase() = default;
42#else // LL_PLAT_C
43 virtual ~SoundSystemBase();
44#endif
45
46 virtual bool preinit();
47
48 virtual void init();
49
50 virtual void destroy();
51
52#ifdef LL_PLAT_S
53 virtual void setOutputDevice(::SoundSystemGUID&);
54#else // LL_PLAT_C
55 virtual void setOutputDevice(::SoundSystemGUID& outputDevice);
56#endif
57
58#ifdef LL_PLAT_S
59 virtual void setAsyncLoadFunction(::std::function<void(::SoundItem const&, ::std::function<void()>)>);
60#else // LL_PLAT_C
61 virtual void setAsyncLoadFunction(::std::function<void(::SoundItem const&, ::std::function<void()>)> asyncLoad);
62#endif
63
64#ifdef LL_PLAT_S
65 virtual void enable(bool);
66#else // LL_PLAT_C
67 virtual void enable(bool status);
68#endif
69
70#ifdef LL_PLAT_S
71 virtual void mute(bool);
72#else // LL_PLAT_C
73 virtual void mute(bool muted);
74#endif
75
76#ifdef LL_PLAT_S
77 virtual bool addListener(int const);
78#else // LL_PLAT_C
79 virtual bool addListener(int const handle);
80#endif
81
82#ifdef LL_PLAT_S
83 virtual void removeListener(int const);
84#else // LL_PLAT_C
85 virtual void removeListener(int const handle);
86#endif
87
88#ifdef LL_PLAT_S
89 virtual void setListenerDirection(int const, ::glm::vec3 const&, ::glm::vec3 const&);
90#else // LL_PLAT_C
91 virtual void setListenerDirection(int const listenerHandle, ::glm::vec3 const& forward, ::glm::vec3 const& up);
92#endif
93
94#ifdef LL_PLAT_S
95 virtual void setListenerPos(int const, float, float, float);
96#else // LL_PLAT_C
97 virtual void setListenerPos(int const listenerHandle, float x, float y, float z);
98#endif
99
100#ifdef LL_PLAT_S
101 virtual void setListenerVelocity(int const, float, float, float);
102#else // LL_PLAT_C
103 virtual void setListenerVelocity(int const listenerHandle, float x, float y, float z);
104#endif
105
106#ifdef LL_PLAT_S
107 virtual void setMainVolume(float);
108#else // LL_PLAT_C
109 virtual void setMainVolume(float vol);
110#endif
111
112#ifdef LL_PLAT_S
113 virtual void setMusicVolume(float);
114#else // LL_PLAT_C
115 virtual void setMusicVolume(float vol);
116#endif
117
118#ifdef LL_PLAT_S
119 virtual void setSoundVolume(float);
120#else // LL_PLAT_C
121 virtual void setSoundVolume(float vol);
122#endif
123
124#ifdef LL_PLAT_S
125 virtual void setSoundCategoryVolume(::std::string const&, float);
126#else // LL_PLAT_C
127 virtual void setSoundCategoryVolume(::std::string const& category, float vol);
128#endif
129
130#ifdef LL_PLAT_S
131 virtual void setTTSVolume(float);
132#else // LL_PLAT_C
133 virtual void setTTSVolume(float vol);
134#endif
135
136#ifdef LL_PLAT_S
137 virtual bool load(::Core::Path const&, bool);
138#else // LL_PLAT_C
139 virtual bool load(::Core::Path const& soundName, bool isStream);
140#endif
141
142#ifdef LL_PLAT_S
143 virtual bool loadRawFromMemory(::Core::Path const&, char const*, uint64, int, int, ::SoundFormat);
144#else // LL_PLAT_C
145 virtual bool loadRawFromMemory(
146 ::Core::Path const& soundName,
147 char const* data,
148 uint64 dataSize,
149 int numchannels,
150 int defaultfrequency,
151 ::SoundFormat format
152 );
153#endif
154
155#ifdef LL_PLAT_S
156 virtual bool loadFromMemory(::Core::Path const&, char const*, uint64);
157#else // LL_PLAT_C
158 virtual bool loadFromMemory(::Core::Path const& soundName, char const* data, uint64 dataSize);
159#endif
160
161 virtual bool loadExternalEvent(::std::string const&);
162
163#ifdef LL_PLAT_S
164 virtual void unload(::Core::Path const&);
165#else // LL_PLAT_C
166 virtual void unload(::Core::Path const& soundName);
167#endif
168
169 virtual void unloadAll();
170
171#ifdef LL_PLAT_S
172 virtual bool isSoundLoaded(::Core::Path const&);
173#else // LL_PLAT_C
174 virtual bool isSoundLoaded(::Core::Path const& name);
175#endif
176
177 virtual bool usesSoundBanks();
178
179 virtual void loadSoundBank(::std::string const&, bool);
180
181 virtual void unloadSoundBank(::std::string const&);
182
183 virtual void play(::std::string const&);
184
185 virtual void pause(::std::string const&);
186
187#ifdef LL_PLAT_S
188 virtual void stop(::std::string const&);
189#else // LL_PLAT_C
190 virtual void stop(::std::string const& soundName);
191#endif
192
193#ifdef LL_PLAT_S
194 virtual void stop(uint64);
195#else // LL_PLAT_C
196 virtual void stop(uint64 handle);
197#endif
198
199#ifdef LL_PLAT_S
200 virtual uint64 playEvent(::SoundEvent const&, ::std::string const&, float, float);
201#else // LL_PLAT_C
202 virtual uint64 playEvent(::SoundEvent const& soundEvent, ::std::string const& eventName, float volume, float pitch);
203#endif
204
205#ifdef LL_PLAT_S
206 virtual uint64 playEventAt(
207 ::SoundEvent const&,
208 ::std::string const&,
209 float,
210 float,
211 float,
212 float,
213 float,
214 ::std::optional<::ServerSoundHandle>
215 );
216#else // LL_PLAT_C
217 virtual uint64 playEventAt(
218 ::SoundEvent const& soundEvent,
219 ::std::string const& eventName,
220 float x,
221 float y,
222 float z,
223 float volume,
224 float pitch,
225 ::std::optional<::ServerSoundHandle> serverSoundHandle
226 );
227#endif
228
229#ifdef LL_PLAT_S
230 virtual uint64 playAt(
231 ::Core::Path const&,
232 ::SoundEvent const*,
233 ::std::string const&,
234 uint64,
235 float,
236 float,
237 float,
238 float,
239 float,
240 bool,
241 float,
242 float,
243 bool,
244 bool,
245 ::std::optional<::ServerSoundHandle>
246 );
247#else // LL_PLAT_C
248 virtual uint64 playAt(
249 ::Core::Path const& soundName,
250 ::SoundEvent const* soundEvent,
251 ::std::string const& eventName,
252 uint64 soundHandle,
253 float x,
254 float y,
255 float z,
256 float volume,
257 float pitch,
258 bool is3D,
259 float minDistance,
260 float maxDistance,
261 bool useLegacyMaxDistance,
262 bool isTTS,
263 ::std::optional<::ServerSoundHandle> serverSoundHandle
264 );
265#endif
266
267#ifdef LL_PLAT_S
268 virtual uint64
269 playEventAttached(::SoundEvent const&, ::std::string const&, ::std::function<void(::SoundInstanceProperties&)>&&);
270#else // LL_PLAT_C
271 virtual uint64 playEventAttached(
272 ::SoundEvent const& soundEvent,
273 ::std::string const& eventName,
274 ::std::function<void(::SoundInstanceProperties&)>&& getSoundProperties
275 );
276#endif
277
278#ifdef LL_PLAT_S
279 virtual bool isPlayingSound(uint64) const;
280#else // LL_PLAT_C
281 virtual bool isPlayingSound(uint64 handle) const;
282#endif
283
284#ifdef LL_PLAT_S
285 virtual void fadeOut(uint64, float) const;
286#else // LL_PLAT_C
287 virtual void fadeOut(uint64 handle, float duration) const;
288#endif
289
290#ifdef LL_PLAT_S
291 virtual void playMusic(::std::string const&, ::SoundItem const&);
292#else // LL_PLAT_C
293 virtual void playMusic(::std::string const& eventName, ::SoundItem const& soundItem);
294#endif
295
296#ifdef LL_PLAT_S
297 virtual bool isPlayingMusicEvent(::std::string const&) const;
298#else // LL_PLAT_C
299 virtual bool isPlayingMusicEvent(::std::string const& eventName) const;
300#endif
301
302#ifdef LL_PLAT_S
303 virtual bool isPlayingMusic(::Core::PathView) const;
304#else // LL_PLAT_C
305 virtual bool isPlayingMusic(::Core::PathView soundName) const;
306#endif
307
308 virtual bool isLoadingMusic() const;
309
310 virtual void cancelLoadMusic();
311
312 virtual ::Core::PathBuffer<::std::string> const& getCurrentlyPlayingMusicName() const;
313
314 virtual ::std::string getCurrentlyPlayingEventName() const;
315
316 virtual void stopMusic();
317
318 virtual void stopRecords();
319
320 virtual void stopAllSounds();
321
322 virtual void pauseAllPlayingSounds();
323
324 virtual void resumeAllPreviouslyPlayingSounds();
325
326#ifdef LL_PLAT_S
327 virtual void fadeMusicOut(float);
328#else // LL_PLAT_C
329 virtual void fadeMusicOut(float time);
330#endif
331
332 virtual bool isMusicChannelPlaying() const;
333
334#ifdef LL_PLAT_S
335 virtual void pauseMusic(bool);
336#else // LL_PLAT_C
337 virtual void pauseMusic(bool state);
338#endif
339
340#ifdef LL_PLAT_S
341 virtual void update(float);
342#else // LL_PLAT_C
343 virtual void update(float elapsedTime);
344#endif
345
346#ifdef LL_PLAT_S
347 virtual uint64 registerLoop(
348 ::SoundItem const&,
349 ::std::weak_ptr<::SoundEvent> const,
350 ::std::string const&,
351 ::std::function<void(::LoopingSoundState&)>,
352 float,
353 float
354 );
355#else // LL_PLAT_C
356 virtual uint64 registerLoop(
357 ::SoundItem const& soundItem,
358 ::std::weak_ptr<::SoundEvent> const soundEvent,
359 ::std::string const& eventName,
360 ::std::function<void(::LoopingSoundState&)> getSoundState,
361 float fadeInDuration,
362 float fadeOutDuration
363 );
364#endif
365
366#ifdef LL_PLAT_S
367 virtual void unregisterLoop(uint64, bool);
368#else // LL_PLAT_C
369 virtual void unregisterLoop(uint64 handle, bool hard);
370#endif
371
372#ifdef LL_PLAT_S
373 virtual void displayDebugStats(::std::string&) const;
374#else // LL_PLAT_C
375 virtual void displayDebugStats(::std::string& debugOutputFormat) const;
376#endif
377
378 virtual void startSnapshot(::std::string const&);
379
380 virtual void stopSnapshot(::std::string const&);
381
382 virtual void stopAllSnapshots();
383
384 virtual uint64 getNewSoundHandle();
385
386#ifdef LL_PLAT_S
387 virtual ::std::optional<::PlayingSoundAttributes> tryGetPlayingSoundAttributes(uint64) const;
388#else // LL_PLAT_C
389 virtual ::std::optional<::PlayingSoundAttributes> tryGetPlayingSoundAttributes(uint64 handle) const;
390#endif
391
392#ifdef LL_PLAT_S
393 virtual ::std::optional<::LoopingSoundAttributes> tryGetLoopingSoundAttributes(uint64) const;
394#else // LL_PLAT_C
395 virtual ::std::optional<::LoopingSoundAttributes> tryGetLoopingSoundAttributes(uint64 handle) const;
396#endif
397
398 // NOLINTEND
399
400public:
401 // member functions
402 // NOLINTBEGIN
403#ifdef LL_PLAT_C
404 MCNAPI int getNumListeners();
405#endif
406 // NOLINTEND
407
408public:
409 // destructor thunk
410 // NOLINTBEGIN
411 MCNAPI void $dtor();
412 // NOLINTEND
413
414public:
415 // virtual function thunks
416 // NOLINTBEGIN
417#ifdef LL_PLAT_C
418 MCNAPI bool $preinit();
419
420 MCNAPI void $init();
421
422 MCNAPI void $destroy();
423
424 MCNAPI void $setOutputDevice(::SoundSystemGUID& outputDevice);
425
426 MCNAPI void $setAsyncLoadFunction(::std::function<void(::SoundItem const&, ::std::function<void()>)> asyncLoad);
427
428 MCNAPI void $enable(bool status);
429
430 MCNAPI void $mute(bool muted);
431
432 MCNAPI bool $addListener(int const handle);
433
434 MCNAPI void $removeListener(int const handle);
435
436 MCNAPI void $setListenerDirection(int const listenerHandle, ::glm::vec3 const& forward, ::glm::vec3 const& up);
437
438 MCNAPI void $setListenerPos(int const listenerHandle, float x, float y, float z);
439
440 MCNAPI void $setListenerVelocity(int const listenerHandle, float x, float y, float z);
441
442 MCNAPI void $setMainVolume(float vol);
443
444 MCNAPI void $setMusicVolume(float vol);
445
446 MCNAPI void $setSoundVolume(float vol);
447
448 MCNAPI void $setSoundCategoryVolume(::std::string const& category, float vol);
449
450 MCNAPI void $setTTSVolume(float vol);
451
452 MCNAPI bool $load(::Core::Path const& soundName, bool isStream);
453
454 MCNAPI bool $loadRawFromMemory(
455 ::Core::Path const& soundName,
456 char const* data,
457 uint64 dataSize,
458 int numchannels,
459 int defaultfrequency,
460 ::SoundFormat format
461 );
462
463 MCNAPI bool $loadFromMemory(::Core::Path const& soundName, char const* data, uint64 dataSize);
464
465 MCNAPI bool $loadExternalEvent(::std::string const&);
466
467 MCNAPI void $unload(::Core::Path const& soundName);
468
469 MCNAPI void $unloadAll();
470
471 MCNAPI bool $isSoundLoaded(::Core::Path const& name);
472
473 MCNAPI bool $usesSoundBanks();
474
475 MCNAPI void $loadSoundBank(::std::string const&, bool);
476
477 MCNAPI void $unloadSoundBank(::std::string const&);
478
479 MCNAPI void $play(::std::string const&);
480
481 MCNAPI void $pause(::std::string const&);
482
483 MCNAPI void $stop(::std::string const& soundName);
484
485 MCNAPI void $stop(uint64 handle);
486
487 MCNAPI uint64 $playEvent(::SoundEvent const& soundEvent, ::std::string const& eventName, float volume, float pitch);
488
489 MCNAPI uint64 $playEventAt(
490 ::SoundEvent const& soundEvent,
491 ::std::string const& eventName,
492 float x,
493 float y,
494 float z,
495 float volume,
496 float pitch,
497 ::std::optional<::ServerSoundHandle> serverSoundHandle
498 );
499
500 MCNAPI uint64 $playAt(
501 ::Core::Path const& soundName,
502 ::SoundEvent const* soundEvent,
503 ::std::string const& eventName,
504 uint64 soundHandle,
505 float x,
506 float y,
507 float z,
508 float volume,
509 float pitch,
510 bool is3D,
511 float minDistance,
512 float maxDistance,
513 bool useLegacyMaxDistance,
514 bool isTTS,
515 ::std::optional<::ServerSoundHandle> serverSoundHandle
516 );
517
518 MCNAPI uint64 $playEventAttached(
519 ::SoundEvent const& soundEvent,
520 ::std::string const& eventName,
521 ::std::function<void(::SoundInstanceProperties&)>&& getSoundProperties
522 );
523
524 MCNAPI bool $isPlayingSound(uint64 handle) const;
525
526 MCNAPI void $fadeOut(uint64 handle, float duration) const;
527
528 MCNAPI void $playMusic(::std::string const& eventName, ::SoundItem const& soundItem);
529
530 MCNAPI bool $isPlayingMusicEvent(::std::string const& eventName) const;
531
532 MCNAPI bool $isPlayingMusic(::Core::PathView soundName) const;
533
534 MCNAPI bool $isLoadingMusic() const;
535
536 MCNAPI void $cancelLoadMusic();
537
538 MCNAPI ::Core::PathBuffer<::std::string> const& $getCurrentlyPlayingMusicName() const;
539
540 MCNAPI ::std::string $getCurrentlyPlayingEventName() const;
541
542 MCNAPI void $stopMusic();
543
544 MCNAPI void $stopRecords();
545
546 MCNAPI void $stopAllSounds();
547
548 MCNAPI void $pauseAllPlayingSounds();
549
550 MCNAPI void $resumeAllPreviouslyPlayingSounds();
551
552 MCNAPI void $fadeMusicOut(float time);
553
554 MCNAPI bool $isMusicChannelPlaying() const;
555
556 MCNAPI void $pauseMusic(bool state);
557
558 MCNAPI void $update(float elapsedTime);
559
560 MCNAPI uint64 $registerLoop(
561 ::SoundItem const& soundItem,
562 ::std::weak_ptr<::SoundEvent> const soundEvent,
563 ::std::string const& eventName,
564 ::std::function<void(::LoopingSoundState&)> getSoundState,
565 float fadeInDuration,
566 float fadeOutDuration
567 );
568
569 MCNAPI void $unregisterLoop(uint64 handle, bool hard);
570
571 MCNAPI void $displayDebugStats(::std::string& debugOutputFormat) const;
572
573 MCNAPI void $startSnapshot(::std::string const&);
574
575 MCNAPI void $stopSnapshot(::std::string const&);
576
577 MCNAPI void $stopAllSnapshots();
578
579 MCNAPI uint64 $getNewSoundHandle();
580
581 MCNAPI ::std::optional<::PlayingSoundAttributes> $tryGetPlayingSoundAttributes(uint64 handle) const;
582
583 MCNAPI ::std::optional<::LoopingSoundAttributes> $tryGetLoopingSoundAttributes(uint64 handle) const;
584#endif
585
586
587 // NOLINTEND
588
589public:
590 // vftables
591 // NOLINTBEGIN
592 MCNAPI static void** $vftable();
593 // NOLINTEND
594};
Definition PathView.h:19
Definition Path.h:12
Definition ServerSoundHandle.h:5
Definition SoundEvent.h:12
Definition SoundItem.h:5
MCAPI void $dtor()
static MCAPI void ** $vftable()
Definition LoopingSoundAttributes.h:8
Definition LoopingSoundState.h:5
Definition PlayingSoundAttributes.h:5
Definition SoundInstanceProperties.h:5
Definition SoundSystemGUID.h:5
Definition Alias.h:14