mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-16 02:20:07 +00:00
Moved public API classes into namespace tgvoip (CVoIPController -> tgvoip::VoIPController, CVoIPServerConfig -> tgvoip::ServerConfig) Endpoint is now a class instead of a struct; also, IP addresses are now wrapped into objects instead of relying on in_addr and in6_addr Full Windows port (Win32 threading + Winsock + WaveOut/WaveIn) Added support for ALSA audio I/O on Linux (closes #2) Abstracted away low-level networking to make it more portable Minor bugfixes
38 lines
928 B
C++
38 lines
928 B
C++
//
|
|
// 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_AUDIOOUTPUTWAVE_H
|
|
#define LIBTGVOIP_AUDIOOUTPUTWAVE_H
|
|
|
|
#include <windows.h>
|
|
#include "../../audio/AudioOutput.h"
|
|
|
|
namespace tgvoip{
|
|
namespace audio{
|
|
|
|
class AudioOutputWave : public CAudioOutput{
|
|
public:
|
|
AudioOutputWave();
|
|
virtual ~AudioOutputWave();
|
|
virtual void Configure(uint32_t sampleRate, uint32_t bitsPerSample, uint32_t channels);
|
|
virtual void Start();
|
|
virtual void Stop();
|
|
virtual bool IsPlaying();
|
|
|
|
private:
|
|
HWAVEOUT hWaveOut;
|
|
WAVEFORMATEX format;
|
|
WAVEHDR buffers[4];
|
|
static void CALLBACK WaveOutProc(HWAVEOUT hwo, UINT uMsg, DWORD_PTR dwInstance, DWORD_PTR dwParam1, DWORD_PTR dwParam2);
|
|
void OnBufferDone(WAVEHDR* hdr);
|
|
bool isPlaying;
|
|
};
|
|
|
|
}
|
|
}
|
|
|
|
#endif //LIBTGVOIP_AUDIOOUTPUTWAVE_H
|