LeviLamina
Loading...
Searching...
No Matches
SoundPlayerInterface.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/audio/SoundPauseSource.h"
7#include "mc/deps/core/file/PathBuffer.h"
8#include "mc/deps/core/utility/EnableNonOwnerReferences.h"
9
10// auto generated forward declare list
11// clang-format off
13class Vec3;
16struct PlaySoundOptions;
19namespace Core { class Path; }
20namespace Core { class PathView; }
21class SoundItem;
22// clang-format on
23
25public:
26 // virtual functions
27 // NOLINTBEGIN
28 virtual ~SoundPlayerInterface() /*override*/ = default;
29
30 virtual uint64 play(
31 ::std::string const& name,
32 ::Vec3 const& pos,
33 float volume,
34 float pitch,
35 ::std::optional<::ServerSoundHandle> serverSoundHandle
36 ) = 0;
37
38 virtual uint64 play(::PlaySoundOptions options) = 0;
39
40 virtual uint64 playUI(::std::string const& name, float volume, float pitch) = 0;
41
42 virtual void playMusic(::std::string const& eventName, float volume, uint& playlistIndex) = 0;
43
44 virtual void playMusic(::std::string const& eventName, float volume) = 0;
45
46 virtual bool isLoadingMusic() const = 0;
47
48 virtual bool isPlayingMusicEvent(::std::string const& eventName) const = 0;
49
50 virtual bool isPlayingMusic(::Core::PathView soundPath) const = 0;
51
52 virtual void fadeToStopMusic(float fadeSeconds) = 0;
53
54 virtual void setMusicCommandVolumeMultiplier(float volumeMultiplier) = 0;
55
56 virtual void fadeOut(uint64 handle, float duration) = 0;
57
58 virtual void stopMusic() = 0;
59
60 virtual void stop(::std::string const& name) = 0;
61
62 virtual void stop(uint64 handle) = 0;
63
64 virtual void stop(::ServerSoundHandle serverSoundHandle) = 0;
65
66 virtual void setVolume(::ServerSoundHandle serverSoundHandle, float volume) = 0;
67
68 virtual void setPitch(::ServerSoundHandle serverSoundHandle, float pitch) = 0;
69
70 virtual void fade(::ServerSoundHandle serverSoundHandle, float duration, float targetVolume) = 0;
71
72 virtual void setPlaybackPosition(::ServerSoundHandle serverSoundHandle, float seconds) = 0;
73
74 virtual void pause(::ServerSoundHandle serverSoundHandle, ::SoundPauseSource source) = 0;
75
76 virtual void resume(::ServerSoundHandle serverSoundHandle, ::SoundPauseSource source) = 0;
77
78 virtual void stopAllSounds() = 0;
79
80 virtual void pauseAllPlayingSounds(::SoundPauseSource source) = 0;
81
82 virtual void resumeAllPreviouslyPlayingSounds(::SoundPauseSource source) = 0;
83
84 virtual void pauseMusic(bool state) = 0;
85
86 virtual ::Core::PathBuffer<::std::string> const& getCurrentlyPlayingMusicPath() = 0;
87
88 virtual bool getItem(::std::string const& eventName, ::Core::PathView soundPath, ::SoundItem& soundItem) const = 0;
89
90 virtual uint64 registerLoop(
91 ::std::string const& name,
92 ::std::function<void(::LoopingSoundState&)> getSoundState,
93 float fadeInDuration,
94 float fadeOutDuration
95 ) = 0;
96
97 virtual void unregisterLoop(uint64 handle, bool hard) = 0;
98
99 virtual ::std::optional<::std::string> getSubtitle(::std::string const& name) const = 0;
100
101 virtual bool isPlayingSound(uint64 handle) const = 0;
102
103 virtual bool isPlayingSound(::Core::Path const& soundName) const = 0;
104
105 virtual bool isPlayingSound(::ServerSoundHandle serverSoundHandle) const = 0;
106
107 virtual uint64 playAttached(
108 ::std::string const& eventName,
109 ::std::function<void(::SoundInstanceProperties&)>&& getSoundProperties
110 ) = 0;
111
112 virtual ::std::optional<::PlayingSoundAttributes> tryGetPlayingSoundAttributes(uint64 handle) const = 0;
113
114 virtual ::std::optional<::LoopingSoundAttributes> tryGetLoopingSoundAttributes(uint64 handle) const = 0;
115 // NOLINTEND
116};
Definition EnableNonOwnerReferences.h:7
Definition PathView.h:19
Definition Path.h:11
Definition ServerSoundHandle.h:5
Definition SoundItem.h:5
Definition SoundPlayerInterface.h:24
Definition Vec3.h:10
Definition LoopingSoundAttributes.h:8
Definition LoopingSoundState.h:5
Definition PlaySoundOptions.h:5
Definition PlayingSoundAttributes.h:5
Definition SoundInstanceProperties.h:5