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:
|
2024-05-27 21:12:46 -03:00
|
|
|
SoundEffect();
|
|
|
|
SoundEffect(String const& fileName);
|
2024-05-24 23:12:29 -03:00
|
|
|
~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
|