20 void SetPreferredSampleRate(
int iSampleRate)
22 m_iPreferredSampleRate = iSampleRate;
25 int LoadSound(std::string sPath);
30 void AddSound(
int iIndex,
float fOffsetSecs,
float fPan);
36 int GetNumSounds()
const {
return m_aSounds.size(); }
38 int GetLength()
const override;
39 int GetLength_Fast()
const override;
40 int SetPosition(
int iFrame)
override;
41 int Read(
float* pBuf,
int iFrames)
override;
42 int GetSampleRate()
const override {
return m_iActualSampleRate; }
43 unsigned GetNumChannels()
const override {
return m_iChannels; }
44 bool SetProperty(
const std::string& sProperty,
float fValue)
override;
45 int GetNextSourceFrame()
const override;
46 float GetStreamToSourceRatio()
const override;
47 std::string GetError()
const override {
return ""; }
50 int GetSampleRateInternal()
const;
52 int m_iPreferredSampleRate;
53 int m_iActualSampleRate;
56 std::map<std::string, RageSoundReader*> m_apNamedSounds;
57 std::vector<RageSoundReader*> m_apLoadedSounds;
66 int GetOffsetFrame(
int iSampleRate)
const
68 return int(int64_t(iOffsetMS) * iSampleRate / 1000);
70 bool operator<(
const Sound& rhs)
const
72 return iOffsetMS < rhs.iOffsetMS;
75 std::vector<Sound> m_aSounds;
79 unsigned m_iNextSound;
80 std::vector<Sound*> m_apActiveSounds;
82 void ActivateSound(Sound* s);
83 void ReleaseSound(Sound* s);