Starshatter_Open
Open source Starshatter engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
SoundD3D Class Reference

#include <SoundD3D.h>

Inheritance diagram for SoundD3D:
Sound

List of all members.

Public Member Functions

 SoundD3D (LPDIRECTSOUND card, DWORD flags, LPWAVEFORMATEX format)
 SoundD3D (LPDIRECTSOUND card, DWORD flags, LPWAVEFORMATEX format, DWORD len, LPBYTE data)
virtual ~SoundD3D ()
virtual void Update ()
virtual HRESULT StreamFile (const char *name, DWORD offset)
virtual HRESULT Load (DWORD bytes, BYTE *data)
virtual HRESULT Play ()
virtual HRESULT Rewind ()
virtual HRESULT Pause ()
virtual HRESULT Stop ()
virtual SoundDuplicate ()
virtual double GetTotalTime () const
virtual double GetTimeRemaining () const
virtual double GetTimeElapsed () const
virtual void SetVolume (long v)
virtual long GetPan () const
virtual void SetPan (long p)
virtual void SetLocation (const Vec3 &l)
virtual void SetVelocity (const Vec3 &v)
virtual float GetMinDistance () const
virtual void SetMinDistance (float f)
virtual float GetMaxDistance () const
virtual void SetMaxDistance (float f)
- Public Member Functions inherited from Sound
 Sound ()
virtual ~Sound ()
int operator== (const Sound &rhs) const
virtual void Release ()
int IsReady () const
int IsPlaying () const
int IsDone () const
int LoopCount () const
virtual DWORD GetFlags () const
virtual void SetFlags (DWORD f)
virtual DWORD GetStatus () const
virtual long GetVolume () const
virtual const Vec3GetLocation () const
virtual const Vec3GetVelocity () const
virtual void SetSoundCheck (SoundCheck *s)
virtual void AddToSoundCard ()
const char * GetFilename () const
void SetFilename (const char *s)

Static Public Member Functions

static const char * TYPENAME ()
- Static Public Member Functions inherited from Sound
static SoundCreateStream (const char *filename)
static SoundCreateOggStream (const char *filename)
static SoundCreate (DWORD flags, LPWAVEFORMATEX format)
static SoundCreate (DWORD flags, LPWAVEFORMATEX format, DWORD len, LPBYTE data)
static void SetListener (const Camera &cam, const Vec3 &vel)
static void UseSoundCard (SoundCard *s)

Protected Member Functions

void Localize ()
HRESULT AllocateBuffer (DWORD bytes)
HRESULT StreamOggFile ()
void StreamBlock ()
void StreamOggBlock ()
void RewindStream ()
void RewindOggStream ()

Protected Attributes

LPDIRECTSOUND soundcard
WAVEFORMATEX wfex
DSBUFFERDESC dsbd
LPDIRECTSOUNDBUFFER buffer
DWORD data_len
LPBYTE data
float min_dist
float max_dist
FILE * stream
DWORD stream_left
double total_time
DWORD min_safety
DWORD read_size
BYTE * transfer
DWORD w
DWORD r
DWORD stream_offset
bool eos_written
BYTE eos_latch
bool moved
ThreadSync sync
OggVorbis_File * ov_file
- Protected Attributes inherited from Sound
DWORD flags
DWORD status
long volume
int looped
Vec3 location
Vec3 velocity
SoundChecksound_check
char filename [64]

Additional Inherited Members

- Public Types inherited from Sound
enum  FlagEnum {
  AMBIENT = 0x0000, LOCALIZED = 0x0001, LOC_3D = 0x0002, MEMORY = 0x0000,
  STREAMED = 0x0004, ONCE = 0x0000, LOOP = 0x0008, FREE = 0x0000,
  LOCKED = 0x0010, DOPPLER = 0x0020, INTERFACE = 0x0040, OGGVORBIS = 0x4000,
  RESOURCE = 0x8000
}
enum  StatusEnum {
  UNINITIALIZED, INITIALIZING, READY, PLAYING,
  DONE
}
- Static Protected Attributes inherited from Sound
static SoundCardcreator = 0

Detailed Description

Definition at line 35 of file SoundD3D.h.


Constructor & Destructor Documentation

SoundD3D::SoundD3D ( LPDIRECTSOUND  card,
DWORD  flags,
LPWAVEFORMATEX  format 
)

Definition at line 363 of file SoundD3D.cpp.

SoundD3D::SoundD3D ( LPDIRECTSOUND  card,
DWORD  flags,
LPWAVEFORMATEX  format,
DWORD  len,
LPBYTE  data 
)

Definition at line 398 of file SoundD3D.cpp.

SoundD3D::~SoundD3D ( )
virtual

Definition at line 456 of file SoundD3D.cpp.


Member Function Documentation

HRESULT SoundD3D::AllocateBuffer ( DWORD  bytes)
protected

Definition at line 992 of file SoundD3D.cpp.

Sound * SoundD3D::Duplicate ( )
virtual

Reimplemented from Sound.

Definition at line 789 of file SoundD3D.cpp.

float SoundD3D::GetMaxDistance ( ) const
virtual

Reimplemented from Sound.

Definition at line 1215 of file SoundD3D.cpp.

float SoundD3D::GetMinDistance ( ) const
virtual

Reimplemented from Sound.

Definition at line 1200 of file SoundD3D.cpp.

long SoundD3D::GetPan ( ) const
virtual

Reimplemented from Sound.

Definition at line 1158 of file SoundD3D.cpp.

double SoundD3D::GetTimeElapsed ( ) const
virtual

Reimplemented from Sound.

Definition at line 1132 of file SoundD3D.cpp.

double SoundD3D::GetTimeRemaining ( ) const
virtual

Reimplemented from Sound.

Definition at line 1119 of file SoundD3D.cpp.

virtual double SoundD3D::GetTotalTime ( ) const
inlinevirtual

Reimplemented from Sound.

Definition at line 56 of file SoundD3D.h.

HRESULT SoundD3D::Load ( DWORD  bytes,
BYTE *  data 
)
virtual

Reimplemented from Sound.

Definition at line 939 of file SoundD3D.cpp.

void SoundD3D::Localize ( )
protected

Definition at line 666 of file SoundD3D.cpp.

HRESULT SoundD3D::Pause ( )
virtual

Reimplemented from Sound.

Definition at line 1086 of file SoundD3D.cpp.

HRESULT SoundD3D::Play ( )
virtual

Reimplemented from Sound.

Definition at line 1028 of file SoundD3D.cpp.

HRESULT SoundD3D::Rewind ( )
virtual

Reimplemented from Sound.

Definition at line 1057 of file SoundD3D.cpp.

void SoundD3D::RewindOggStream ( )
protected

Definition at line 639 of file SoundD3D.cpp.

void SoundD3D::RewindStream ( )
protected

Definition at line 609 of file SoundD3D.cpp.

void SoundD3D::SetLocation ( const Vec3 l)
virtual

Reimplemented from Sound.

Definition at line 1184 of file SoundD3D.cpp.

void SoundD3D::SetMaxDistance ( float  f)
virtual

Reimplemented from Sound.

Definition at line 1220 of file SoundD3D.cpp.

void SoundD3D::SetMinDistance ( float  f)
virtual

Reimplemented from Sound.

Definition at line 1206 of file SoundD3D.cpp.

void SoundD3D::SetPan ( long  p)
virtual

Reimplemented from Sound.

Definition at line 1170 of file SoundD3D.cpp.

void SoundD3D::SetVelocity ( const Vec3 v)
virtual

Reimplemented from Sound.

Definition at line 1191 of file SoundD3D.cpp.

void SoundD3D::SetVolume ( long  v)
virtual

Reimplemented from Sound.

Definition at line 1146 of file SoundD3D.cpp.

HRESULT SoundD3D::Stop ( )
virtual

Reimplemented from Sound.

Definition at line 1102 of file SoundD3D.cpp.

void SoundD3D::StreamBlock ( )
protected

Definition at line 549 of file SoundD3D.cpp.

HRESULT SoundD3D::StreamFile ( const char *  name,
DWORD  offset 
)
virtual

Reimplemented from Sound.

Definition at line 818 of file SoundD3D.cpp.

void SoundD3D::StreamOggBlock ( )
protected

Definition at line 577 of file SoundD3D.cpp.

HRESULT SoundD3D::StreamOggFile ( )
protected

Definition at line 884 of file SoundD3D.cpp.

static const char* SoundD3D::TYPENAME ( )
inlinestatic

Reimplemented from Sound.

Definition at line 38 of file SoundD3D.h.

void SoundD3D::Update ( )
virtual

Reimplemented from Sound.

Definition at line 480 of file SoundD3D.cpp.


Member Data Documentation

LPDIRECTSOUNDBUFFER SoundD3D::buffer
protected

Definition at line 86 of file SoundD3D.h.

LPBYTE SoundD3D::data
protected

Definition at line 89 of file SoundD3D.h.

DWORD SoundD3D::data_len
protected

Definition at line 88 of file SoundD3D.h.

DSBUFFERDESC SoundD3D::dsbd
protected

Definition at line 85 of file SoundD3D.h.

BYTE SoundD3D::eos_latch
protected

Definition at line 108 of file SoundD3D.h.

bool SoundD3D::eos_written
protected

Definition at line 107 of file SoundD3D.h.

float SoundD3D::max_dist
protected

Definition at line 96 of file SoundD3D.h.

float SoundD3D::min_dist
protected

Definition at line 95 of file SoundD3D.h.

DWORD SoundD3D::min_safety
protected

Definition at line 102 of file SoundD3D.h.

bool SoundD3D::moved
protected

Definition at line 109 of file SoundD3D.h.

OggVorbis_File* SoundD3D::ov_file
protected

Definition at line 112 of file SoundD3D.h.

DWORD SoundD3D::r
protected

Definition at line 105 of file SoundD3D.h.

DWORD SoundD3D::read_size
protected

Definition at line 103 of file SoundD3D.h.

LPDIRECTSOUND SoundD3D::soundcard
protected

Definition at line 83 of file SoundD3D.h.

FILE* SoundD3D::stream
protected

Definition at line 99 of file SoundD3D.h.

DWORD SoundD3D::stream_left
protected

Definition at line 100 of file SoundD3D.h.

DWORD SoundD3D::stream_offset
protected

Definition at line 106 of file SoundD3D.h.

ThreadSync SoundD3D::sync
protected

Definition at line 111 of file SoundD3D.h.

double SoundD3D::total_time
protected

Definition at line 101 of file SoundD3D.h.

BYTE* SoundD3D::transfer
protected

Definition at line 104 of file SoundD3D.h.

DWORD SoundD3D::w
protected

Definition at line 105 of file SoundD3D.h.

WAVEFORMATEX SoundD3D::wfex
protected

Definition at line 84 of file SoundD3D.h.


The documentation for this class was generated from the following files: