2016-05-02 18:16:26 -07:00
|
|
|
#ifndef __AMUSE_IBACKENDVOICE_HPP__
|
|
|
|
#define __AMUSE_IBACKENDVOICE_HPP__
|
|
|
|
|
|
|
|
namespace amuse
|
|
|
|
{
|
|
|
|
|
|
|
|
/** Same channel enums from boo, used for matrix coefficient table index */
|
|
|
|
enum class AudioChannel
|
|
|
|
{
|
|
|
|
FrontLeft,
|
|
|
|
FrontRight,
|
|
|
|
RearLeft,
|
|
|
|
RearRight,
|
|
|
|
FrontCenter,
|
|
|
|
LFE,
|
|
|
|
SideLeft,
|
|
|
|
SideRight,
|
|
|
|
Unknown = 0xff
|
|
|
|
};
|
|
|
|
|
2016-05-07 15:10:57 -07:00
|
|
|
/** Same structure from boo, used to represent interleaved speaker layout */
|
|
|
|
struct ChannelMap
|
|
|
|
{
|
|
|
|
unsigned m_channelCount = 0;
|
|
|
|
AudioChannel m_channels[8] = {};
|
|
|
|
};
|
|
|
|
|
2016-05-18 22:55:10 -07:00
|
|
|
/** Client-implemented voice instance */
|
2016-05-02 18:16:26 -07:00
|
|
|
class IBackendVoice
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~IBackendVoice() = default;
|
|
|
|
|
2016-05-10 21:48:08 -07:00
|
|
|
/** Set new sample rate into platform voice (may result in artifacts while playing) */
|
|
|
|
virtual void resetSampleRate(double sampleRate)=0;
|
|
|
|
|
2016-05-02 18:16:26 -07:00
|
|
|
/** Set channel-gains for audio source (AudioChannel enum for array index) */
|
|
|
|
virtual void setMatrixCoefficients(const float coefs[8])=0;
|
|
|
|
|
|
|
|
/** Called by client to dynamically adjust the pitch of voices with dynamic pitch enabled */
|
2016-05-16 20:47:12 -07:00
|
|
|
virtual void setPitchRatio(double ratio, bool slew)=0;
|
2016-05-02 18:16:26 -07:00
|
|
|
|
|
|
|
/** Instructs platform to begin consuming sample data; invoking callback as needed */
|
|
|
|
virtual void start()=0;
|
|
|
|
|
|
|
|
/** Instructs platform to stop consuming sample data */
|
|
|
|
virtual void stop()=0;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // __AMUSE_IBACKENDVOICE_HPP__
|