-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathOutputDevice.hpp
54 lines (44 loc) · 1.21 KB
/
OutputDevice.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef OUTPUTDEVICE_H
#define OUTPUTDEVICE_H
#include "Util.hpp"
#include "AudioBuffer.hpp"
#include <iostream>
#include <vector>
namespace tsal {
// Forward declarations
class Mixer;
/** @class OutputDevice
* @brief Base class for a device that produces audio output
*
*/
class OutputDevice {
public:
OutputDevice(Mixer* mixer);
virtual ~OutputDevice() {};
virtual void getOutput(AudioBuffer<float> &buffer) { return; };
/**
* @brief Get the output for the device
*
* @return double
*/
virtual void setActive(bool active = true);
virtual void setMixer(Mixer* mixer) { mMixer = mixer; };
void setPanning(double panning);
void setGain(double gain);
void setVolume(double volume);
double getGain() const;
double getVolume() const;
bool isActive() const;
protected:
virtual void setChannelPanning(unsigned channelCount);
Mixer* mMixer = nullptr;
bool mActive = true;
double mAmp = 1.0;
double mPanning = 0.0;
std::vector<double> mChannelPanning;
static Util::ParameterRange<double> mGainRange;
static Util::ParameterRange<double> mVolumeRange;
static Util::ParameterRange<double> mPanningRange;
};
}
#endif