2017-02-02 17:24:40 +01:00
|
|
|
//
|
|
|
|
// libtgvoip is free and unencumbered public domain software.
|
|
|
|
// For more information, see http://unlicense.org or the UNLICENSE file
|
|
|
|
// you should have received with this source code distribution.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef LIBTGVOIP_AUDIOOUTPUT_H
|
|
|
|
#define LIBTGVOIP_AUDIOOUTPUT_H
|
|
|
|
|
|
|
|
#include <stdint.h>
|
2017-04-28 13:17:56 +02:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2017-02-02 17:24:40 +01:00
|
|
|
#include "../MediaStreamItf.h"
|
|
|
|
|
2017-04-28 13:17:56 +02:00
|
|
|
namespace tgvoip{
|
|
|
|
|
|
|
|
class AudioInputDevice;
|
2017-07-13 17:43:13 +02:00
|
|
|
class VoIPController;
|
2017-04-28 13:17:56 +02:00
|
|
|
class AudioOutputDevice;
|
|
|
|
|
|
|
|
namespace audio{
|
|
|
|
class AudioOutput : public MediaStreamItf{
|
2017-02-02 17:24:40 +01:00
|
|
|
public:
|
2017-04-28 13:17:56 +02:00
|
|
|
AudioOutput();
|
|
|
|
AudioOutput(std::string deviceID);
|
2017-07-13 17:43:13 +02:00
|
|
|
AudioOutput(std::string deviceID, VoIPController* controller);
|
2017-04-28 13:17:56 +02:00
|
|
|
virtual ~AudioOutput();
|
2017-02-02 17:24:40 +01:00
|
|
|
virtual void Configure(uint32_t sampleRate, uint32_t bitsPerSample, uint32_t channels)=0;
|
|
|
|
virtual bool IsPlaying()=0;
|
2017-04-09 18:14:33 +02:00
|
|
|
virtual float GetLevel();
|
2017-02-02 17:24:40 +01:00
|
|
|
static int32_t GetEstimatedDelay();
|
2017-04-28 13:17:56 +02:00
|
|
|
virtual std::string GetCurrentDevice();
|
|
|
|
virtual void SetCurrentDevice(std::string deviceID);
|
2017-07-13 17:43:13 +02:00
|
|
|
static AudioOutput* Create(std::string deviceID, VoIPController* controller);
|
2017-04-28 13:17:56 +02:00
|
|
|
static void EnumerateDevices(std::vector<AudioOutputDevice>& devs);
|
|
|
|
bool IsInitialized();
|
2017-07-04 11:30:21 +02:00
|
|
|
|
2017-02-02 17:24:40 +01:00
|
|
|
#if defined(__ANDROID__)
|
|
|
|
static int systemVersion;
|
|
|
|
#endif
|
2017-04-17 20:57:07 +02:00
|
|
|
|
|
|
|
protected:
|
2017-04-28 13:17:56 +02:00
|
|
|
std::string currentDevice;
|
2017-04-17 20:57:07 +02:00
|
|
|
bool failed;
|
2017-05-06 01:18:34 +02:00
|
|
|
static int32_t estimatedDelay;
|
2017-02-02 17:24:40 +01:00
|
|
|
};
|
2017-04-28 13:17:56 +02:00
|
|
|
}}
|
2017-02-02 17:24:40 +01:00
|
|
|
|
|
|
|
#endif //LIBTGVOIP_AUDIOOUTPUT_H
|