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

42 lines
867 B
C++

#ifndef XNA_SOUND_SOUNDEFFECT_HPP
#define XNA_SOUND_SOUNDEFFECT_HPP
#include "../default.hpp"
namespace xna {
struct SoundEffectInstance {
public:
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;
};
class SoundEffect {
public:
SoundEffect(AudioEngine& audioEngine, String const& fileName);
~SoundEffect();
void Play();
void Play(float volume, float pitch, float pan);
uptr<SoundEffectInstance> CreateInstance();
public:
struct PlatformImplementation;
uptr<PlatformImplementation> impl = nullptr;
};
using PSoundEffect = sptr<SoundEffect>;
}
#endif