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