summaryrefslogtreecommitdiff
path: root/drivers/rtaudio/audio_driver_rtaudio.h
blob: 115953ce1f0defe309de9ba2fec0ca7f5e672774 (plain)
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
/*************************************************/
/*  audio_driver_rtaudio.h                       */
/*************************************************/
/*            This file is part of:              */
/*                GODOT ENGINE                   */
/*************************************************/
/*       Source code within this file is:        */
/*  (c) 2007-2016 Juan Linietsky, Ariel Manzur   */
/*             All Rights Reserved.              */
/*************************************************/

#ifndef AUDIO_DRIVER_RTAUDIO_H
#define AUDIO_DRIVER_RTAUDIO_H

#ifdef RTAUDIO_ENABLED

#include "servers/audio/audio_server_sw.h"
#include "drivers/rtaudio/RtAudio.h"

class AudioDriverRtAudio : public AudioDriverSW {


	static int callback( void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames,
	 double streamTime, RtAudioStreamStatus status, void *userData );
	OutputFormat output_format;
	Mutex *mutex;
	RtAudio *dac;
	int mix_rate;
	bool active;
public:


	virtual const char* get_name() const;

	virtual Error init();
	virtual void start();
	virtual int get_mix_rate() const ;
	virtual OutputFormat get_output_format() const;
	virtual void lock();
	virtual void unlock();
	virtual void finish();

	AudioDriverRtAudio();

};

#endif // AUDIO_DRIVER_RTAUDIO_H
#endif