Etterna 0.74.4
Loading...
Searching...
No Matches
RageSoundReader_Filter.h
1/* RageSoundReader_Filter - simplify the creation of filter RageSoundReaders. */
2
3#ifndef RAGE_SOUND_READER_FILTER_H
4#define RAGE_SOUND_READER_FILTER_H
5
6#include <memory>
7#include "RageSoundReader.h"
8
10{
11 public:
13 : m_pSource(pSource)
14 {
15 }
17 m_pSource = std::unique_ptr<RageSoundReader>(rhs.m_pSource->Copy());
18 }
19
20 int GetLength() const override { return m_pSource->GetLength(); }
21 int GetLength_Fast() const override { return m_pSource->GetLength_Fast(); }
22 int SetPosition(int iFrame) override
23 {
24 return m_pSource->SetPosition(iFrame);
25 }
26 int Read(float* pBuf, int iFrames) override
27 {
28 return m_pSource->Read(pBuf, iFrames);
29 }
30 int GetSampleRate() const override { return m_pSource->GetSampleRate(); }
31 unsigned GetNumChannels() const override
32 {
33 return m_pSource->GetNumChannels();
34 }
35 bool SetProperty(const std::string& sProperty, float fValue) override
36 {
37 return m_pSource->SetProperty(sProperty, fValue);
38 }
39 int GetNextSourceFrame() const override
40 {
41 return m_pSource->GetNextSourceFrame();
42 }
43 float GetStreamToSourceRatio() const override
44 {
45 return m_pSource->GetStreamToSourceRatio();
46 }
47 RageSoundReader* GetSource() override { return &*m_pSource; }
48 std::string GetError() const override { return m_pSource->GetError(); }
49
50 protected:
51 std::unique_ptr<RageSoundReader> m_pSource;
52};
53
54#endif
Definition RageSoundReader_Filter.h:10
Definition RageSoundReader.h:7