Etterna 0.74.4
Loading...
Searching...
No Matches
RageSoundReader_ChannelSplit.h
1/* RageSoundReader_ChannelSplit - Split a sound channels into separate sounds.
2 */
3
4#ifndef RAGE_SOUND_READER_CHANNEL_SPLIT
5#define RAGE_SOUND_READER_CHANNEL_SPLIT
6
7#include <vector>
8
9#include "RageSoundReader.h"
10
12
14{
15 public:
17 ~RageSoundReader_Split() override;
18 RageSoundReader_Split* Copy() const override
19 {
20 return new RageSoundReader_Split(*this);
21 }
22
23 int GetLength() const override;
24 int GetLength_Fast() const override;
25 int SetPosition(int iFrame) override;
26 int Read(float* pBuf, int iFrames) override;
27 int GetSampleRate() const override;
28 unsigned GetNumChannels() const override;
29 bool SetProperty(const std::string& sProperty, float fValue) override;
30 int GetNextSourceFrame() const override;
31 float GetStreamToSourceRatio() const override;
32 std::string GetError() const override;
33
34 void AddSourceChannelToSound(int iFromChannel, int iToChannel);
35
36 private:
38 RageSoundSplitterImpl* pImpl); // create with RageSoundSplitter
39 friend class RageSoundSplitterImpl;
40 friend class RageSoundSplitter;
41
42 RageSoundSplitterImpl* m_pImpl;
43 struct ChannelMap
44 {
45 int m_iFromChannel;
46 int m_iToChannel;
47 ChannelMap(int iFromChannel, int iToChannel)
48 {
49 m_iFromChannel = iFromChannel;
50 m_iToChannel = iToChannel;
51 }
52 };
53 std::vector<ChannelMap> m_aChannels;
54
55 int m_iPositionFrame;
56 int m_iRequestFrames;
57 int m_iNumOutputChannels;
58};
59
61{
62 public:
65 RageSoundReader_Split* CreateSound();
66
67 private:
68 RageSoundSplitterImpl* m_pImpl;
69};
70
71#endif
Definition RageSoundReader_ChannelSplit.h:14
Definition RageSoundReader.h:7
Definition RageSoundReader_ChannelSplit.cpp:49
Definition RageSoundReader_ChannelSplit.h:61