2015-04-10 22:06:17 +02:00
|
|
|
/** @file
|
|
|
|
* @author Edouard DUPIN
|
|
|
|
* @copyright 2011, Edouard DUPIN, all right reserved
|
|
|
|
* @license APACHE v2.0 (see license file)
|
|
|
|
* @fork from RTAudio
|
|
|
|
*/
|
2016-02-02 21:18:54 +01:00
|
|
|
#pragma once
|
|
|
|
#ifdef ORCHESTRA_BUILD_PULSE
|
2015-04-10 22:06:17 +02:00
|
|
|
|
|
|
|
namespace audio {
|
|
|
|
namespace orchestra {
|
|
|
|
namespace api {
|
|
|
|
class PulsePrivate;
|
|
|
|
class Pulse: public audio::orchestra::Api {
|
|
|
|
public:
|
2016-07-19 21:43:58 +02:00
|
|
|
static ememory::SharedPtr<audio::orchestra::Api> create();
|
2015-04-10 22:06:17 +02:00
|
|
|
public:
|
|
|
|
Pulse();
|
|
|
|
virtual ~Pulse();
|
2015-06-11 21:39:56 +02:00
|
|
|
const std::string& getCurrentApi() {
|
2016-04-29 23:16:07 +02:00
|
|
|
return audio::orchestra::typePulse;
|
2015-04-10 22:06:17 +02:00
|
|
|
}
|
|
|
|
uint32_t getDeviceCount();
|
|
|
|
audio::orchestra::DeviceInfo getDeviceInfo(uint32_t _device);
|
|
|
|
enum audio::orchestra::error closeStream();
|
|
|
|
enum audio::orchestra::error startStream();
|
|
|
|
enum audio::orchestra::error stopStream();
|
|
|
|
enum audio::orchestra::error abortStream();
|
|
|
|
// This function is intended for internal use only. It must be
|
|
|
|
// public because it is called by the internal callback handler,
|
|
|
|
// which is not a member of RtAudio. External use of this function
|
|
|
|
// will most likely produce highly undesireable results!
|
|
|
|
void callbackEventOneCycle();
|
|
|
|
void callbackEvent();
|
|
|
|
private:
|
2016-07-19 21:43:58 +02:00
|
|
|
ememory::SharedPtr<PulsePrivate> m_private;
|
2015-04-10 22:06:17 +02:00
|
|
|
std::vector<audio::orchestra::DeviceInfo> m_devices;
|
|
|
|
void saveDeviceInfo();
|
2015-07-07 22:39:09 +02:00
|
|
|
bool open(uint32_t _device,
|
|
|
|
audio::orchestra::mode _mode,
|
|
|
|
uint32_t _channels,
|
|
|
|
uint32_t _firstChannel,
|
|
|
|
uint32_t _sampleRate,
|
|
|
|
audio::format _format,
|
|
|
|
uint32_t *_bufferSize,
|
|
|
|
const audio::orchestra::StreamOptions& _options);
|
2015-04-10 22:06:17 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|