final 1.64 checkin
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user