19 void SetPreferredSampleRate(
int iSampleRate)
21 m_iPreferredSampleRate = iSampleRate;
24 int LoadSound(std::string sPath);
29 void AddSound(
int iIndex,
float fOffsetSecs,
float fPan);
35 int GetNumSounds()
const {
return m_aSounds.size(); }
37 int GetLength()
const override;
38 int GetLength_Fast()
const override;
39 int SetPosition(
int iFrame)
override;
40 int Read(
float* pBuf,
int iFrames)
override;
41 int GetSampleRate()
const override {
return m_iActualSampleRate; }
42 unsigned GetNumChannels()
const override {
return m_iChannels; }
43 bool SetProperty(
const std::string& sProperty,
float fValue)
override;
44 int GetNextSourceFrame()
const override;
45 float GetStreamToSourceRatio()
const override;
46 std::string GetError()
const override {
return ""; }
49 int GetSampleRateInternal()
const;
51 int m_iPreferredSampleRate;
52 int m_iActualSampleRate;
55 std::map<std::string, RageSoundReader*> m_apNamedSounds;
56 std::vector<RageSoundReader*> m_apLoadedSounds;
65 int GetOffsetFrame(
int iSampleRate)
const
67 return int(int64_t(iOffsetMS) * iSampleRate / 1000);
69 bool operator<(
const Sound& rhs)
const
71 return iOffsetMS < rhs.iOffsetMS;
74 std::vector<Sound> m_aSounds;
78 unsigned m_iNextSound;
79 std::vector<Sound*> m_apActiveSounds;
81 void ActivateSound(Sound* s);
82 void ReleaseSound(Sound* s);