RhythmGame 1.4.3
Loading...
Searching...
No Matches
NormalSound.h
Go to the documentation of this file.
1//
2// Created by PC on 24/02/2026.
3//
4
5#ifndef RHYTHMGAME_NORMALSOUND_H
6#define RHYTHMGAME_NORMALSOUND_H
7
8#include "Sound.h"
9
10namespace sounds {
11class AudioEngine;
12class SoundBuffer;
13class NormalSound : public Sound
14{
15 AudioEngine* engine;
16 std::shared_ptr<const SoundBuffer> buffer;
17 std::unique_ptr<ma_audio_buffer> audioBuffer =
18 std::make_unique<ma_audio_buffer>();
19 std::unique_ptr<ma_sound> sound = std::make_unique<ma_sound>();
20
21 public:
22 NormalSound(AudioEngine* engine, std::shared_ptr<const SoundBuffer> buffer);
23 ~NormalSound() override;
24 auto getBuffer() const -> const std::shared_ptr<const SoundBuffer>&;
25 void play() override;
26 void stop() override;
27 void setVolume(float volume) override;
28 auto isPlaying() const -> bool override;
29 auto getVolume() const -> float override;
30};
31} // namespace sounds
32
33#endif // RHYTHMGAME_NORMALSOUND_H
Definition AudioEngine.h:16
Definition NormalSound.h:14
void setVolume(float volume) override
Sets the volume of the sound.
Definition NormalSound.cpp:73
void stop() override
Stops the sound.
Definition NormalSound.cpp:61
auto getVolume() const -> float override
Gets the volume of the sound.
Definition NormalSound.cpp:79
~NormalSound() override
Definition NormalSound.cpp:43
auto isPlaying() const -> bool override
Is the sound playing right now?
Definition NormalSound.cpp:67
auto getBuffer() const -> const std::shared_ptr< const SoundBuffer > &
Definition NormalSound.cpp:85
void play() override
Plays the sound.
Definition NormalSound.cpp:55
A sound that can be played.
Definition Sound.h:25
The namespace for all sound related classes.
Definition HitRules.h:16