final 1.64 checkin

This commit is contained in:
Chris Danford
2002-03-10 10:30:45 +00:00
parent 876b28d5db
commit 353fd47f85
9 changed files with 220 additions and 32 deletions
+57
View File
@@ -0,0 +1,57 @@
/*
-----------------------------------------------------------------------------
File: RandomSample.h
Desc: Holds multiple sounds samples and can play a random sound easily.
Copyright (c) 2001 Chris Danford. All rights reserved.
-----------------------------------------------------------------------------
*/
#ifndef _RandomSample_H_
#define _RandomSample_H_
#include "RageSound.h"
#include "RageSoundSample.h"
#include "RageUtil.h"
class RandomSample
{
public:
RandomSample();
~RandomSample();
virtual bool Load( CString sFilePath )
{
CString sDir, sFName, sExt;
splitrelpath( sFilePath, sDir, sFName, sExt );
sExt.MakeLower();
if( sExt == "" )
return LoadSoundDir( sFilePath );
else if( sExt == "set" )
return LoadRandomSample( sFilePath );
else
return LoadSound( sFilePath );
};
void PlayRandom();
void Pause();
void Stop();
private:
bool LoadSoundDir( CString sDir );
bool LoadRandomSample( CString sSetFilePath );
bool LoadSound( CString sSoundFilePath );
CArray<RageSoundSample*, RageSoundSample*> m_pSamples;
int m_iIndexLastPlayed;
};
#endif