Files
itgmania212121/stepmania/src/RandomSample.h
T

48 lines
1019 B
C++
Raw Normal View History

#ifndef RANDOMSAMPLE_H
#define RANDOMSAMPLE_H
2002-03-10 10:30:45 +00:00
/*
-----------------------------------------------------------------------------
Class: RandomSample
2002-03-10 10:30:45 +00:00
Desc: Holds multiple sounds samples and can play a random sound easily.
2002-05-19 01:59:48 +00:00
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
2002-03-10 10:30:45 +00:00
-----------------------------------------------------------------------------
*/
2003-01-02 08:13:34 +00:00
#include "RageSound.h"
2002-03-10 10:30:45 +00:00
#include "RageUtil.h"
class RandomSample
{
public:
RandomSample();
2002-11-16 08:55:46 +00:00
virtual ~RandomSample();
2002-03-10 10:30:45 +00:00
virtual bool Load( CString sFilePath, int iMaxToLoad = 1000 /*load all*/ )
2002-03-10 10:30:45 +00:00
{
CString sDir, sFName, sExt;
splitrelpath( sFilePath, sDir, sFName, sExt );
sExt.MakeLower();
if( sExt == "" ) return LoadSoundDir( sFilePath, iMaxToLoad );
2002-04-28 20:42:32 +00:00
else return LoadSound( sFilePath );
2002-03-10 10:30:45 +00:00
};
void PlayRandom();
void Stop();
private:
bool LoadSoundDir( CString sDir, int iMaxToLoad );
2002-03-10 10:30:45 +00:00
bool LoadSound( CString sSoundFilePath );
2003-01-03 05:56:28 +00:00
vector<RageSound*> m_pSamples;
2002-03-10 10:30:45 +00:00
int m_iIndexLastPlayed;
};
#endif