libER 0.1.4.2
ELDEN RING API library
Loading...
Searching...
No Matches
sound.hpp
Go to the documentation of this file.
1
8#pragma once
9
10#include <dantelion2/text.hpp>
12#include <detail/optref.hpp>
14
15namespace from {
16namespace CS {
17// Forward declaration for character sound playback
18class ChrIns;
19
25public:
30 enum sound_state : char {
31 INIT = 0,
32 PLAY = 1,
33 STOP = 2,
34 DIAL = 3
35 };
36
41 void stop_playback() noexcept {
42 this->sound_state_selector = STOP;
43 }
44
51 bool is_playing() const noexcept {
52 return this->sound_state_selector != INIT;
53 }
54
60 const sound_state get_playback_state() const noexcept {
61 return this->sound_state_selector;
62 }
63
64private:
65 friend class CSSound;
66
67 std::pair<int, int> sound;
68 void* wwise_obj;
69 void* liber_unknown[5];
70 void* liber_unknown;
71 sound_state sound_state_selector;
72 char liber_unknown;
73 char play_sound;
74 char liber_unknown;
75 std::pair<int, int> liber_unknown;
76 int liber_unknown;
77 char liber_unknown;
78 int liber_unknown;
79 DLTX::DLString play_sound_name;
80 DLTX::DLString stop_sound_name;
81 DLTX::DLString dialogue_sound_name;
82 short liber_unknown;
83};
84
89class CSSound {
90public:
91 FD4_SINGLETON_CLASS(CSSound);
92
104 char sound_type, int sound_id);
105
119 [[nodiscard]] LIBERAPI static DLUT::DLReferenceCountPtr<CSFD4SoundIns>
120 play_character_sound(char sound_type, int sound_id, ChrIns& chr,
121 int dummypoly = -1, bool follows_origin = true);
122};
123} // namespace CS
124} // namespace from
A single playable sound instance in the sound engine.
Definition sound.hpp:24
const sound_state get_playback_state() const noexcept
Get the playback state.
Definition sound.hpp:60
sound_state
The sound playback state.
Definition sound.hpp:30
bool is_playing() const noexcept
Is the sound playing?
Definition sound.hpp:51
void stop_playback() noexcept
Stop sound playback.
Definition sound.hpp:41
Singleton responsible for managing the sound engine.
Definition sound.hpp:89
static LIBERAPI DLUT::DLReferenceCountPtr< CSFD4SoundIns > play_system_sound(char sound_type, int sound_id)
Play a 2d system wwise sound.
static LIBERAPI DLUT::DLReferenceCountPtr< CSFD4SoundIns > play_character_sound(char sound_type, int sound_id, ChrIns &chr, int dummypoly=-1, bool follows_origin=true)
Play a wwise sound from a character.
Abstract class for implementing reference counting garbage collection.
Definition utility.hpp:44
A refcounted pointer that models std::shared_ptr<T>.
Definition utility.hpp:99
Optional references based on std::optional.
FD4_SINGLETON_CLASS implementation.
Dantelion2 strings.
std::pair< from::wstring, bool > DLString
Common Dantelion string type.
Definition text.hpp:232
Dantelion2 utility.