mirror of
https://github.com/Halofreak1990/XFXFramework
synced 2024-12-26 13:49:34 +01:00
Replaced all copyright symbols with (c) to improve cross-platform reading Added classes to XFX::Audio namespace Added and updated classes in XFX::Graphics namespace Updated event function signature Replaced const char* ToString() with const String& ToString()
67 lines
2.0 KiB
C++
67 lines
2.0 KiB
C++
/********************************************************
|
|
* SoundEffect.h *
|
|
* *
|
|
* XFX::Audio::SoundEffect definition file *
|
|
* Copyright (c) XFX Team. All Rights Reserved *
|
|
********************************************************/
|
|
#ifndef _XFX_AUDIO_SOUNDEFFECT_
|
|
#define _XFX_AUDIO_SOUNDEFFECT_
|
|
|
|
#include <System/Interfaces.h>
|
|
#include <System/String.h>
|
|
#include <System/TimeSpan.h>
|
|
#include <System/IO/Stream.h>
|
|
#include "Enums.h"
|
|
|
|
using namespace System;
|
|
using namespace System::IO;
|
|
|
|
namespace XFX
|
|
{
|
|
namespace Audio
|
|
{
|
|
class SoundEffectInstance;
|
|
|
|
//
|
|
class SoundEffect : public IDisposable, public Object
|
|
{
|
|
private:
|
|
static float distanceScale;
|
|
static float dopplerScale;
|
|
static float masterVolume;
|
|
static float speedOfSound;
|
|
|
|
void Dispose(bool disposing);
|
|
|
|
public:
|
|
static float getDistanceScale();
|
|
static void setDistanceScale(float value);
|
|
static float getDopplerScale();
|
|
static void setDopplerScale(float value);
|
|
TimeSpan getDuration() const;
|
|
bool IsDisposed() const;
|
|
static float getMasterVolume();
|
|
static void setMasterVolume(float value);
|
|
String Name;
|
|
static float getSpeedOfSound();
|
|
static void setSpeedOfSound(float value);
|
|
|
|
SoundEffect(byte buffer[], const int offset, const int count, const int sampleRate, AudioChannels_t channels, const int loopStart, const int loopLength);
|
|
SoundEffect(byte buffer[], const int sampleRate, const AudioChannels_t numChannels);
|
|
SoundEffect(const SoundEffect &obj);
|
|
~SoundEffect();
|
|
|
|
SoundEffectInstance* CreateInstance();
|
|
void Dispose();
|
|
static SoundEffect* FromStream(Stream * const stream);
|
|
static TimeSpan GetSampleDuration(int sizeInBytes, int sampleRate, AudioChannels_t channels);
|
|
static int GetSampleSizeInBytes(TimeSpan duration, int sampleRate, AudioChannels_t channels);
|
|
int GetType() const;
|
|
bool Play();
|
|
bool Play(const float volume, const float pitch, const float pan);
|
|
};
|
|
}
|
|
}
|
|
|
|
#endif //_XFX_AUDIO_SOUNDEFFECT_
|