53 |
*/ |
*/ |
54 |
class AudioChannel { |
class AudioChannel { |
55 |
public: |
public: |
|
|
|
56 |
class ParameterName : public DeviceRuntimeParameterString { |
class ParameterName : public DeviceRuntimeParameterString { |
57 |
public: |
public: |
58 |
ParameterName(String s) : DeviceRuntimeParameterString(s) {} |
ParameterName(String s) : DeviceRuntimeParameterString(s) {} |
84 |
// attributes |
// attributes |
85 |
//String Name; ///< Arbitrary name of this audio channel |
//String Name; ///< Arbitrary name of this audio channel |
86 |
|
|
|
// constructors / destructor |
|
|
#ifdef __GNUC__ |
|
|
typedef std::map<String,DeviceRuntimeParameter*> DeviceRuntimeParameterMap; // nasty workaround for a GCC bug (see GCC bug #15980, #57) |
|
|
AudioChannel(uint BufferSize, String Name = "unnamed", std::map<String,DeviceRuntimeParameter*> ChannelParameters = DeviceRuntimeParameterMap()); |
|
|
AudioChannel(float* pBuffer, uint BufferSize, String Name = "unnamed", std::map<String,DeviceRuntimeParameter*> ChannelParameters = DeviceRuntimeParameterMap()); |
|
|
AudioChannel(AudioChannel* pMixChannel, String Name = "unnamed", std::map<String,DeviceRuntimeParameter*> ChannelParameters = DeviceRuntimeParameterMap()); |
|
|
#else |
|
|
AudioChannel(uint BufferSize, String Name = "unnamed", std::map<String,DeviceRuntimeParameter*> ChannelParameters = std::map<String,DeviceRuntimeParameter*>()); |
|
|
AudioChannel(float* pBuffer, uint BufferSize, String Name = "unnamed", std::map<String,DeviceRuntimeParameter*> ChannelParameters = std::map<String,DeviceRuntimeParameter*>()); |
|
|
AudioChannel(AudioChannel* pMixChannel, String Name = "unnamed", std::map<String,DeviceRuntimeParameter*> ChannelParameters = std::map<String,DeviceRuntimeParameter*>()); |
|
|
#endif // __GNUC__ |
|
|
virtual ~AudioChannel(); |
|
|
|
|
87 |
// methods |
// methods |
88 |
inline float* Buffer() { return pBuffer; } ///< Audio signal buffer |
inline float* Buffer() { return pBuffer; } ///< Audio signal buffer |
89 |
inline AudioChannel* MixChannel() { return pMixChannel; } ///< In case this channel is a mix channel, then it will return a pointer to the real channel this channel refers to, NULL otherwise. |
inline AudioChannel* MixChannel() { return pMixChannel; } ///< In case this channel is a mix channel, then it will return a pointer to the real channel this channel refers to, NULL otherwise. |
90 |
inline void Clear() { memset(pBuffer, 0, uiBufferSize * sizeof(float)); } ///< Reset audio buffer with silence |
inline void Clear() { memset(pBuffer, 0, uiBufferSize * sizeof(float)); } ///< Reset audio buffer with silence |
91 |
std::map<String,DeviceRuntimeParameter*> ChannelParameters(); |
std::map<String,DeviceRuntimeParameter*> ChannelParameters(); |
92 |
|
|
93 |
|
// constructors / destructor |
94 |
|
AudioChannel(uint ChannelNr, uint BufferSize); |
95 |
|
AudioChannel(uint ChannelNr, float* pBuffer, uint BufferSize); |
96 |
|
AudioChannel(uint ChannelNr, AudioChannel* pMixChannelDestination); |
97 |
|
virtual ~AudioChannel(); |
98 |
|
protected: |
99 |
|
uint ChannelNr; |
100 |
|
std::map<String,DeviceRuntimeParameter*> Parameters; |
101 |
private: |
private: |
102 |
float* pBuffer; |
float* pBuffer; |
103 |
uint uiBufferSize; |
uint uiBufferSize; |
104 |
AudioChannel* pMixChannel; |
AudioChannel* pMixChannel; |
105 |
bool UsesExternalBuffer; |
bool UsesExternalBuffer; |
|
std::map<String,DeviceRuntimeParameter*> mParameters; |
|
106 |
}; |
}; |
107 |
} |
} |
108 |
|
|