1
0
mirror of https://github.com/borgesdan/xn65 synced 2024-12-29 21:54:47 +01:00
xn65/inc/audio/soundeffect.hpp

42 lines
867 B
C++
Raw Normal View History

2024-04-20 13:39:19 -03:00
#ifndef XNA_SOUND_SOUNDEFFECT_HPP
#define XNA_SOUND_SOUNDEFFECT_HPP
#include "../default.hpp"
namespace xna {
2024-05-24 23:12:29 -03:00
struct SoundEffectInstance {
2024-04-20 13:39:19 -03:00
public:
2024-05-24 23:12:29 -03:00
SoundEffectInstance();
~SoundEffectInstance();
void Play(bool loop = false);
void Stop(bool immediate = true);
void Pause();
void Resume();
void Volume(float volume);
void Pitch(float pitch);
void Pan(float pan);
bool IsLooped();
public:
struct PlatformImplementation;
uptr<PlatformImplementation> impl = nullptr;
2024-04-20 13:39:19 -03:00
};
2024-05-24 23:12:29 -03:00
class SoundEffect {
public:
SoundEffect(AudioEngine& audioEngine, String const& fileName);
~SoundEffect();
void Play();
void Play(float volume, float pitch, float pan);
uptr<SoundEffectInstance> CreateInstance();
2024-04-20 13:39:19 -03:00
public:
2024-05-24 23:12:29 -03:00
struct PlatformImplementation;
uptr<PlatformImplementation> impl = nullptr;
2024-04-20 13:39:19 -03:00
};
2024-05-27 16:44:01 -03:00
using PSoundEffect = sptr<SoundEffect>;
2024-04-20 13:39:19 -03:00
}
#endif