Files
itgmania212121/stepmania/src/arch/Sound/RageSoundDriver_DSound_Software.h
T

59 lines
1.1 KiB
C++
Raw Normal View History

2002-12-13 08:33:25 +00:00
#ifndef RAGE_SOUND_DSOUND_SOFTWARE
#define RAGE_SOUND_DSOUND_SOFTWARE
#include "RageSoundDriver.h"
2002-12-21 07:21:49 +00:00
#include "DSoundHelpers.h"
2003-08-05 01:32:51 +00:00
#include "RageThreads.h"
2004-01-12 02:38:17 +00:00
#include "RageTimer.h"
2002-12-13 08:33:25 +00:00
struct IDirectSound;
struct IDirectSoundBuffer;
2002-12-13 08:33:25 +00:00
class RageSound_DSound_Software: public RageSoundDriver
{
struct sound {
RageSound *snd;
2004-01-12 02:38:17 +00:00
RageTimer start_time;
2002-12-13 08:33:25 +00:00
bool stopping;
2002-12-21 23:14:46 +00:00
int flush_pos; /* state == STOPPING only */
2002-12-13 08:33:25 +00:00
sound() { snd = NULL; stopping=false; }
};
/* List of currently playing sounds: */
vector<sound *> sounds;
2002-12-21 05:16:05 +00:00
bool shutdown;
2002-12-21 07:21:49 +00:00
DSound ds;
DSoundBuf *str_ds;
2002-12-21 05:16:05 +00:00
bool GetData();
2002-12-21 05:16:05 +00:00
void Update(float delta);
static int MixerThread_start(void *p);
void MixerThread();
2003-08-05 01:32:51 +00:00
RageThread MixingThread;
2002-12-21 05:16:05 +00:00
2002-12-13 08:33:25 +00:00
/* virtuals: */
void StartMixing(RageSound *snd); /* used by RageSound */
void StopMixing(RageSound *snd); /* used by RageSound */
int GetPosition(const RageSound *snd) const;
float GetPlayLatency() const;
int GetSampleRate( int rate ) const;
2002-12-13 08:33:25 +00:00
public:
RageSound_DSound_Software();
~RageSound_DSound_Software();
};
#endif
/*
* Copyright (c) 2002 by the person(s) listed below. All rights reserved.
*
* Glenn Maynard
*/