[STYLE] remove (void) in () to be c++ coherent

This commit is contained in:
Edouard DUPIN 2014-05-15 21:37:39 +02:00
parent 490e993c6f
commit bb547a72d9
30 changed files with 252 additions and 252 deletions

View File

@ -58,7 +58,7 @@ const uint32_t airtaudio::api::SAMPLE_RATES[] = {
}; };
airtaudio::Api::Api(void) { airtaudio::Api::Api() {
m_stream.state = airtaudio::api::STREAM_CLOSED; m_stream.state = airtaudio::api::STREAM_CLOSED;
m_stream.mode = airtaudio::api::UNINITIALIZED; m_stream.mode = airtaudio::api::UNINITIALIZED;
m_stream.apiHandle = 0; m_stream.apiHandle = 0;
@ -66,7 +66,7 @@ airtaudio::Api::Api(void) {
m_stream.userBuffer[1] = 0; m_stream.userBuffer[1] = 0;
} }
airtaudio::Api::~Api(void) { airtaudio::Api::~Api() {
} }
@ -157,17 +157,17 @@ enum airtaudio::errorType airtaudio::Api::openStream(airtaudio::StreamParameters
return airtaudio::errorNone; return airtaudio::errorNone;
} }
uint32_t airtaudio::Api::getDefaultInputDevice(void) { uint32_t airtaudio::Api::getDefaultInputDevice() {
// Should be implemented in subclasses if possible. // Should be implemented in subclasses if possible.
return 0; return 0;
} }
uint32_t airtaudio::Api::getDefaultOutputDevice(void) { uint32_t airtaudio::Api::getDefaultOutputDevice() {
// Should be implemented in subclasses if possible. // Should be implemented in subclasses if possible.
return 0; return 0;
} }
enum airtaudio::errorType airtaudio::Api::closeStream(void) { enum airtaudio::errorType airtaudio::Api::closeStream() {
// MUST be implemented in subclasses! // MUST be implemented in subclasses!
return airtaudio::errorNone; return airtaudio::errorNone;
} }
@ -184,7 +184,7 @@ bool airtaudio::Api::probeDeviceOpen(uint32_t /*device*/,
return false; return false;
} }
void airtaudio::Api::tickStreamTime(void) { void airtaudio::Api::tickStreamTime() {
// Subclasses that do not provide their own implementation of // Subclasses that do not provide their own implementation of
// getStreamTime should call this function once per buffer I/O to // getStreamTime should call this function once per buffer I/O to
// provide basic stream time support. // provide basic stream time support.
@ -194,7 +194,7 @@ void airtaudio::Api::tickStreamTime(void) {
#endif #endif
} }
long airtaudio::Api::getStreamLatency(void) { long airtaudio::Api::getStreamLatency() {
if (verifyStream() != airtaudio::errorNone) { if (verifyStream() != airtaudio::errorNone) {
return 0; return 0;
} }
@ -210,7 +210,7 @@ long airtaudio::Api::getStreamLatency(void) {
return totalLatency; return totalLatency;
} }
double airtaudio::Api::getStreamTime(void) { double airtaudio::Api::getStreamTime() {
if (verifyStream() != airtaudio::errorNone) { if (verifyStream() != airtaudio::errorNone) {
return 0.0f; return 0.0f;
} }
@ -232,14 +232,14 @@ double airtaudio::Api::getStreamTime(void) {
#endif #endif
} }
uint32_t airtaudio::Api::getStreamSampleRate(void) { uint32_t airtaudio::Api::getStreamSampleRate() {
if (verifyStream() != airtaudio::errorNone) { if (verifyStream() != airtaudio::errorNone) {
return 0; return 0;
} }
return m_stream.sampleRate; return m_stream.sampleRate;
} }
enum airtaudio::errorType airtaudio::Api::verifyStream(void) { enum airtaudio::errorType airtaudio::Api::verifyStream() {
if (m_stream.state == airtaudio::api::STREAM_CLOSED) { if (m_stream.state == airtaudio::api::STREAM_CLOSED) {
ATA_ERROR("airtaudio::Api:: a stream is not open!"); ATA_ERROR("airtaudio::Api:: a stream is not open!");
return airtaudio::errorInvalidUse; return airtaudio::errorInvalidUse;
@ -247,7 +247,7 @@ enum airtaudio::errorType airtaudio::Api::verifyStream(void) {
return airtaudio::errorNone; return airtaudio::errorNone;
} }
void airtaudio::Api::clearStreamInfo(void) { void airtaudio::Api::clearStreamInfo() {
m_stream.mode = airtaudio::api::UNINITIALIZED; m_stream.mode = airtaudio::api::UNINITIALIZED;
m_stream.state = airtaudio::api::STREAM_CLOSED; m_stream.state = airtaudio::api::STREAM_CLOSED;
m_stream.sampleRate = 0; m_stream.sampleRate = 0;

View File

@ -92,7 +92,7 @@ namespace airtaudio {
struct timeval lastTickTimestamp; struct timeval lastTickTimestamp;
#endif #endif
Stream(void) : Stream() :
apiHandle(0), apiHandle(0),
deviceBuffer(0) { deviceBuffer(0) {
device[0] = 11111; device[0] = 11111;
@ -113,13 +113,13 @@ namespace airtaudio {
*/ */
class Api { class Api {
public: public:
Api(void); Api();
virtual ~Api(void); virtual ~Api();
virtual airtaudio::api::type getCurrentApi(void) = 0; virtual airtaudio::api::type getCurrentApi() = 0;
virtual uint32_t getDeviceCount(void) = 0; virtual uint32_t getDeviceCount() = 0;
virtual airtaudio::DeviceInfo getDeviceInfo(uint32_t _device) = 0; virtual airtaudio::DeviceInfo getDeviceInfo(uint32_t _device) = 0;
virtual uint32_t getDefaultInputDevice(void); virtual uint32_t getDefaultInputDevice();
virtual uint32_t getDefaultOutputDevice(void); virtual uint32_t getDefaultOutputDevice();
enum airtaudio::errorType openStream(airtaudio::StreamParameters *_outputParameters, enum airtaudio::errorType openStream(airtaudio::StreamParameters *_outputParameters,
airtaudio::StreamParameters *_inputParameters, airtaudio::StreamParameters *_inputParameters,
airtaudio::format _format, airtaudio::format _format,
@ -128,17 +128,17 @@ namespace airtaudio {
airtaudio::AirTAudioCallback _callback, airtaudio::AirTAudioCallback _callback,
void *_userData, void *_userData,
airtaudio::StreamOptions *_options); airtaudio::StreamOptions *_options);
virtual enum airtaudio::errorType closeStream(void); virtual enum airtaudio::errorType closeStream();
virtual enum airtaudio::errorType startStream(void) = 0; virtual enum airtaudio::errorType startStream() = 0;
virtual enum airtaudio::errorType stopStream(void) = 0; virtual enum airtaudio::errorType stopStream() = 0;
virtual enum airtaudio::errorType abortStream(void) = 0; virtual enum airtaudio::errorType abortStream() = 0;
long getStreamLatency(void); long getStreamLatency();
uint32_t getStreamSampleRate(void); uint32_t getStreamSampleRate();
virtual double getStreamTime(void); virtual double getStreamTime();
bool isStreamOpen(void) const { bool isStreamOpen() const {
return m_stream.state != airtaudio::api::STREAM_CLOSED; return m_stream.state != airtaudio::api::STREAM_CLOSED;
} }
bool isStreamRunning(void) const { bool isStreamRunning() const {
return m_stream.state == airtaudio::api::STREAM_RUNNING; return m_stream.state == airtaudio::api::STREAM_RUNNING;
} }
@ -162,16 +162,16 @@ namespace airtaudio {
airtaudio::StreamOptions *_options); airtaudio::StreamOptions *_options);
//! A protected function used to increment the stream time. //! A protected function used to increment the stream time.
void tickStreamTime(void); void tickStreamTime();
//! Protected common method to clear an RtApiStream structure. //! Protected common method to clear an RtApiStream structure.
void clearStreamInfo(void); void clearStreamInfo();
/*! /*!
Protected common method that throws an RtError (type = Protected common method that throws an RtError (type =
INVALID_USE) if a stream is not open. INVALID_USE) if a stream is not open.
*/ */
enum airtaudio::errorType verifyStream(void); enum airtaudio::errorType verifyStream();
/** /**
* @brief Protected method used to perform format, channel number, and/or interleaving * @brief Protected method used to perform format, channel number, and/or interleaving
* conversions between the user and device buffers. * conversions between the user and device buffers.

View File

@ -27,7 +27,7 @@ namespace airtaudio {
int32_t priority; int32_t priority;
// Default constructor. // Default constructor.
CallbackInfo(void) : CallbackInfo() :
object(0), object(0),
callback(0), callback(0),
userData(0), userData(0),

View File

@ -25,7 +25,7 @@ namespace airtaudio {
std::vector<uint32_t> sampleRates; //!< Supported sample rates (queried from list of standard rates). std::vector<uint32_t> sampleRates; //!< Supported sample rates (queried from list of standard rates).
airtaudio::format nativeFormats; //!< Bit mask of supported data formats. airtaudio::format nativeFormats; //!< Bit mask of supported data formats.
// Default constructor. // Default constructor.
DeviceInfo(void) : DeviceInfo() :
probed(false), probed(false),
outputChannels(0), outputChannels(0),
inputChannels(0), inputChannels(0),

View File

@ -11,7 +11,7 @@
#include <airtaudio/debug.h> #include <airtaudio/debug.h>
#include <iostream> #include <iostream>
std::vector<airtaudio::api::type> airtaudio::Interface::getCompiledApi(void) { std::vector<airtaudio::api::type> airtaudio::Interface::getCompiledApi() {
std::vector<airtaudio::api::type> apis; std::vector<airtaudio::api::type> apis;
// The order here will control the order of RtAudio's API search in // The order here will control the order of RtAudio's API search in
// the constructor. // the constructor.
@ -43,7 +43,7 @@ void airtaudio::Interface::openRtApi(airtaudio::api::type _api) {
} }
airtaudio::Interface::Interface(void) : airtaudio::Interface::Interface() :
m_rtapi(NULL) { m_rtapi(NULL) {
#if defined(__UNIX_JACK__) #if defined(__UNIX_JACK__)
addInterface(airtaudio::api::UNIX_JACK, airtaudio::api::Jack::Create); addInterface(airtaudio::api::UNIX_JACK, airtaudio::api::Jack::Create);
@ -77,8 +77,8 @@ airtaudio::Interface::Interface(void) :
#endif #endif
} }
void airtaudio::Interface::addInterface(airtaudio::api::type _api, Api* (*_callbackCreate)(void)) { void airtaudio::Interface::addInterface(airtaudio::api::type _api, Api* (*_callbackCreate)()) {
m_apiAvaillable.push_back(std::pair<airtaudio::api::type, Api* (*)(void)>(_api, _callbackCreate)); m_apiAvaillable.push_back(std::pair<airtaudio::api::type, Api* (*)()>(_api, _callbackCreate));
} }
enum airtaudio::errorType airtaudio::Interface::instanciate(airtaudio::api::type _api) { enum airtaudio::errorType airtaudio::Interface::instanciate(airtaudio::api::type _api) {
@ -123,7 +123,7 @@ enum airtaudio::errorType airtaudio::Interface::instanciate(airtaudio::api::type
return airtaudio::errorFail; return airtaudio::errorFail;
} }
airtaudio::Interface::~Interface(void) { airtaudio::Interface::~Interface() {
ATA_INFO("Remove interface"); ATA_INFO("Remove interface");
if (m_rtapi != NULL) { if (m_rtapi != NULL) {
delete m_rtapi; delete m_rtapi;

View File

@ -38,14 +38,14 @@ namespace airtaudio {
*/ */
class Interface { class Interface {
protected: protected:
std::vector<std::pair<airtaudio::api::type, Api* (*)(void)>> m_apiAvaillable; std::vector<std::pair<airtaudio::api::type, Api* (*)()>> m_apiAvaillable;
protected: protected:
airtaudio::Api *m_rtapi; airtaudio::Api *m_rtapi;
public: public:
/** /**
* @brief A static function to determine the current airtaudio version. * @brief A static function to determine the current airtaudio version.
*/ */
static std::string getVersion(void) { static std::string getVersion() {
return airtaudio::VERSION; return airtaudio::VERSION;
} }
/** /**
@ -55,25 +55,25 @@ namespace airtaudio {
* the enumerated list values. Note that there can be more than one * the enumerated list values. Note that there can be more than one
* API compiled for certain operating systems. * API compiled for certain operating systems.
*/ */
std::vector<airtaudio::api::type> getCompiledApi(void); std::vector<airtaudio::api::type> getCompiledApi();
/** /**
* @brief The class constructor. * @brief The class constructor.
* @note the creating of the basic instance is done by Instanciate * @note the creating of the basic instance is done by Instanciate
*/ */
Interface(void); Interface();
/** /**
* @brief The destructor. * @brief The destructor.
* *
* If a stream is running or open, it will be stopped and closed * If a stream is running or open, it will be stopped and closed
* automatically. * automatically.
*/ */
~Interface(void); ~Interface();
/** /**
* @brief Add an interface of the Possible List. * @brief Add an interface of the Possible List.
* @param[in] _api Type of the interface. * @param[in] _api Type of the interface.
* @param[in] _callbackCreate API creation callback. * @param[in] _callbackCreate API creation callback.
*/ */
void addInterface(airtaudio::api::type _api, Api* (*_callbackCreate)(void)); void addInterface(airtaudio::api::type _api, Api* (*_callbackCreate)());
/** /**
* @brief Create an interface instance * @brief Create an interface instance
*/ */
@ -81,7 +81,7 @@ namespace airtaudio {
/** /**
* @return the audio API specifier for the current instance of airtaudio. * @return the audio API specifier for the current instance of airtaudio.
*/ */
airtaudio::api::type getCurrentApi(void) { airtaudio::api::type getCurrentApi() {
if (m_rtapi == NULL) { if (m_rtapi == NULL) {
return airtaudio::api::UNSPECIFIED; return airtaudio::api::UNSPECIFIED;
} }
@ -94,7 +94,7 @@ namespace airtaudio {
* is called, thus supporting devices connected \e after instantiation. If * is called, thus supporting devices connected \e after instantiation. If
* a system error occurs during processing, a warning will be issued. * a system error occurs during processing, a warning will be issued.
*/ */
uint32_t getDeviceCount(void) { uint32_t getDeviceCount() {
if (m_rtapi == NULL) { if (m_rtapi == NULL) {
return 0; return 0;
} }
@ -126,7 +126,7 @@ namespace airtaudio {
* client's responsibility to verify that a device is available * client's responsibility to verify that a device is available
* before attempting to open a stream. * before attempting to open a stream.
*/ */
uint32_t getDefaultOutputDevice(void) { uint32_t getDefaultOutputDevice() {
if (m_rtapi == NULL) { if (m_rtapi == NULL) {
return 0; return 0;
} }
@ -141,7 +141,7 @@ namespace airtaudio {
* client's responsibility to verify that a device is available * client's responsibility to verify that a device is available
* before attempting to open a stream. * before attempting to open a stream.
*/ */
uint32_t getDefaultInputDevice(void) { uint32_t getDefaultInputDevice() {
if (m_rtapi == NULL) { if (m_rtapi == NULL) {
return 0; return 0;
} }
@ -202,7 +202,7 @@ namespace airtaudio {
* If a stream is not open, this function issues a warning and * If a stream is not open, this function issues a warning and
* returns (no exception is thrown). * returns (no exception is thrown).
*/ */
enum airtaudio::errorType closeStream(void) { enum airtaudio::errorType closeStream() {
if (m_rtapi == NULL) { if (m_rtapi == NULL) {
return airtaudio::errorInputNull; return airtaudio::errorInputNull;
} }
@ -216,7 +216,7 @@ namespace airtaudio {
* stream is not open. A warning is issued if the stream is already * stream is not open. A warning is issued if the stream is already
* running. * running.
*/ */
enum airtaudio::errorType startStream(void) { enum airtaudio::errorType startStream() {
if (m_rtapi == NULL) { if (m_rtapi == NULL) {
return airtaudio::errorInputNull; return airtaudio::errorInputNull;
} }
@ -230,7 +230,7 @@ namespace airtaudio {
* stream is not open. A warning is issued if the stream is already * stream is not open. A warning is issued if the stream is already
* stopped. * stopped.
*/ */
enum airtaudio::errorType stopStream(void) { enum airtaudio::errorType stopStream() {
if (m_rtapi == NULL) { if (m_rtapi == NULL) {
return airtaudio::errorInputNull; return airtaudio::errorInputNull;
} }
@ -243,7 +243,7 @@ namespace airtaudio {
* stream is not open. A warning is issued if the stream is already * stream is not open. A warning is issued if the stream is already
* stopped. * stopped.
*/ */
enum airtaudio::errorType abortStream(void) { enum airtaudio::errorType abortStream() {
if (m_rtapi == NULL) { if (m_rtapi == NULL) {
return airtaudio::errorInputNull; return airtaudio::errorInputNull;
} }
@ -252,7 +252,7 @@ namespace airtaudio {
/** /**
* @return true if a stream is open and false if not. * @return true if a stream is open and false if not.
*/ */
bool isStreamOpen(void) const { bool isStreamOpen() const {
if (m_rtapi == NULL) { if (m_rtapi == NULL) {
return false; return false;
} }
@ -261,7 +261,7 @@ namespace airtaudio {
/** /**
* @return true if the stream is running and false if it is stopped or not open. * @return true if the stream is running and false if it is stopped or not open.
*/ */
bool isStreamRunning(void) const { bool isStreamRunning() const {
if (m_rtapi == NULL) { if (m_rtapi == NULL) {
return false; return false;
} }
@ -271,7 +271,7 @@ namespace airtaudio {
* @brief If a stream is not open, an RtError (type = INVALID_USE) will be thrown. * @brief If a stream is not open, an RtError (type = INVALID_USE) will be thrown.
* @return the number of elapsed seconds since the stream was started. * @return the number of elapsed seconds since the stream was started.
*/ */
double getStreamTime(void) { double getStreamTime() {
if (m_rtapi == NULL) { if (m_rtapi == NULL) {
return 0.0; return 0.0;
} }
@ -286,7 +286,7 @@ namespace airtaudio {
* report latency, the return value will be zero. * report latency, the return value will be zero.
* @return The internal stream latency in sample frames. * @return The internal stream latency in sample frames.
*/ */
long getStreamLatency(void) { long getStreamLatency() {
if (m_rtapi == NULL) { if (m_rtapi == NULL) {
return 0; return 0;
} }
@ -298,7 +298,7 @@ namespace airtaudio {
* open, an RtError (type = INVALID_USE) will be thrown. * open, an RtError (type = INVALID_USE) will be thrown.
* @return Returns actual sample rate in use by the stream. * @return Returns actual sample rate in use by the stream.
*/ */
uint32_t getStreamSampleRate(void) { uint32_t getStreamSampleRate() {
if (m_rtapi == NULL) { if (m_rtapi == NULL) {
return 0; return 0;
} }

View File

@ -76,7 +76,7 @@ namespace airtaudio {
std::string streamName; //!< A stream name (currently used only in Jack). std::string streamName; //!< A stream name (currently used only in Jack).
int32_t priority; //!< Scheduling priority of callback thread (only used with flag RTAUDIO_SCHEDULE_REALTIME). int32_t priority; //!< Scheduling priority of callback thread (only used with flag RTAUDIO_SCHEDULE_REALTIME).
// Default constructor. // Default constructor.
StreamOptions(void) : StreamOptions() :
flags(0), flags(0),
numberOfBuffers(0), numberOfBuffers(0),
priority(0) {} priority(0) {}

View File

@ -19,7 +19,7 @@ namespace airtaudio {
uint32_t nChannels; //!< Number of channels. uint32_t nChannels; //!< Number of channels.
uint32_t firstChannel; //!< First channel index on device (default = 0). uint32_t firstChannel; //!< First channel index on device (default = 0).
// Default constructor. // Default constructor.
StreamParameters(void) : StreamParameters() :
deviceId(0), deviceId(0),
nChannels(0), nChannels(0),
firstChannel(0) { } firstChannel(0) { }

View File

@ -15,7 +15,7 @@
#include <airtaudio/debug.h> #include <airtaudio/debug.h>
#include <limits.h> #include <limits.h>
airtaudio::Api* airtaudio::api::Alsa::Create(void) { airtaudio::Api* airtaudio::api::Alsa::Create() {
return new airtaudio::api::Alsa(); return new airtaudio::api::Alsa();
} }
@ -29,7 +29,7 @@ struct AlsaHandle {
std::condition_variable runnable_cv; std::condition_variable runnable_cv;
bool runnable; bool runnable;
AlsaHandle(void) : AlsaHandle() :
synchronized(false), synchronized(false),
runnable(false) { runnable(false) {
xrun[0] = false; xrun[0] = false;
@ -39,17 +39,17 @@ struct AlsaHandle {
static void alsaCallbackHandler(void * _ptr); static void alsaCallbackHandler(void * _ptr);
airtaudio::api::Alsa::Alsa(void) { airtaudio::api::Alsa::Alsa() {
// Nothing to do here. // Nothing to do here.
} }
airtaudio::api::Alsa::~Alsa(void) { airtaudio::api::Alsa::~Alsa() {
if (m_stream.state != STREAM_CLOSED) { if (m_stream.state != STREAM_CLOSED) {
closeStream(); closeStream();
} }
} }
uint32_t airtaudio::api::Alsa::getDeviceCount(void) { uint32_t airtaudio::api::Alsa::getDeviceCount() {
unsigned nDevices = 0; unsigned nDevices = 0;
int32_t result, subdevice, card; int32_t result, subdevice, card;
char name[64]; char name[64];
@ -349,7 +349,7 @@ probeParameters:
return info; return info;
} }
void airtaudio::api::Alsa::saveDeviceInfo(void) { void airtaudio::api::Alsa::saveDeviceInfo() {
m_devices.clear(); m_devices.clear();
uint32_t nDevices = getDeviceCount(); uint32_t nDevices = getDeviceCount();
m_devices.resize(nDevices); m_devices.resize(nDevices);
@ -773,7 +773,7 @@ error:
return false; return false;
} }
enum airtaudio::errorType airtaudio::api::Alsa::closeStream(void) { enum airtaudio::errorType airtaudio::api::Alsa::closeStream() {
if (m_stream.state == STREAM_CLOSED) { if (m_stream.state == STREAM_CLOSED) {
ATA_ERROR("airtaudio::api::Alsa::closeStream(): no open stream to close!"); ATA_ERROR("airtaudio::api::Alsa::closeStream(): no open stream to close!");
return airtaudio::errorWarning; return airtaudio::errorWarning;
@ -826,7 +826,7 @@ enum airtaudio::errorType airtaudio::api::Alsa::closeStream(void) {
return airtaudio::errorNone; return airtaudio::errorNone;
} }
enum airtaudio::errorType airtaudio::api::Alsa::startStream(void) { enum airtaudio::errorType airtaudio::api::Alsa::startStream() {
// This method calls snd_pcm_prepare if the device isn't already in that state. // This method calls snd_pcm_prepare if the device isn't already in that state.
if (verifyStream() != airtaudio::errorNone) { if (verifyStream() != airtaudio::errorNone) {
return airtaudio::errorFail; return airtaudio::errorFail;
@ -872,7 +872,7 @@ unlock:
return airtaudio::errorSystemError; return airtaudio::errorSystemError;
} }
enum airtaudio::errorType airtaudio::api::Alsa::stopStream(void) { enum airtaudio::errorType airtaudio::api::Alsa::stopStream() {
if (verifyStream() != airtaudio::errorNone) { if (verifyStream() != airtaudio::errorNone) {
return airtaudio::errorFail; return airtaudio::errorFail;
} }
@ -913,7 +913,7 @@ unlock:
return airtaudio::errorSystemError; return airtaudio::errorSystemError;
} }
enum airtaudio::errorType airtaudio::api::Alsa::abortStream(void) { enum airtaudio::errorType airtaudio::api::Alsa::abortStream() {
if (verifyStream() != airtaudio::errorNone) { if (verifyStream() != airtaudio::errorNone) {
return airtaudio::errorFail; return airtaudio::errorFail;
} }
@ -950,7 +950,7 @@ unlock:
return airtaudio::errorSystemError; return airtaudio::errorSystemError;
} }
void airtaudio::api::Alsa::callbackEvent(void) { void airtaudio::api::Alsa::callbackEvent() {
AlsaHandle *apiInfo = (AlsaHandle *) m_stream.apiHandle; AlsaHandle *apiInfo = (AlsaHandle *) m_stream.apiHandle;
if (m_stream.state == STREAM_STOPPED) { if (m_stream.state == STREAM_STOPPED) {
std::unique_lock<std::mutex> lck(m_stream.mutex); std::unique_lock<std::mutex> lck(m_stream.mutex);

View File

@ -13,27 +13,27 @@ namespace airtaudio {
namespace api { namespace api {
class Alsa: public airtaudio::Api { class Alsa: public airtaudio::Api {
public: public:
static airtaudio::Api* Create(void); static airtaudio::Api* Create();
public: public:
Alsa(); Alsa();
~Alsa(); ~Alsa();
airtaudio::api::type getCurrentApi(void) { airtaudio::api::type getCurrentApi() {
return airtaudio::api::LINUX_ALSA; return airtaudio::api::LINUX_ALSA;
} }
uint32_t getDeviceCount(void); uint32_t getDeviceCount();
airtaudio::DeviceInfo getDeviceInfo(uint32_t _device); airtaudio::DeviceInfo getDeviceInfo(uint32_t _device);
enum airtaudio::errorType closeStream(void); enum airtaudio::errorType closeStream();
enum airtaudio::errorType startStream(void); enum airtaudio::errorType startStream();
enum airtaudio::errorType stopStream(void); enum airtaudio::errorType stopStream();
enum airtaudio::errorType abortStream(void); enum airtaudio::errorType abortStream();
// This function is intended for internal use only. It must be // This function is intended for internal use only. It must be
// public because it is called by the internal callback handler, // public because it is called by the internal callback handler,
// which is not a member of RtAudio. External use of this function // which is not a member of RtAudio. External use of this function
// will most likely produce highly undesireable results! // will most likely produce highly undesireable results!
void callbackEvent(void); void callbackEvent();
private: private:
std::vector<airtaudio::DeviceInfo> m_devices; std::vector<airtaudio::DeviceInfo> m_devices;
void saveDeviceInfo(void); void saveDeviceInfo();
bool probeDeviceOpen(uint32_t _device, bool probeDeviceOpen(uint32_t _device,
airtaudio::api::StreamMode _mode, airtaudio::api::StreamMode _mode,
uint32_t _channels, uint32_t _channels,

View File

@ -12,13 +12,13 @@
#include <airtaudio/debug.h> #include <airtaudio/debug.h>
#include <limits.h> #include <limits.h>
airtaudio::Api* airtaudio::api::Android::Create(void) { airtaudio::Api* airtaudio::api::Android::Create() {
ATA_INFO("Create Android device ... "); ATA_INFO("Create Android device ... ");
return new airtaudio::api::Android(); return new airtaudio::api::Android();
} }
airtaudio::api::Android::Android(void) { airtaudio::api::Android::Android() {
ATA_INFO("new Android"); ATA_INFO("new Android");
// On android, we set a static device ... // On android, we set a static device ...
ATA_INFO("get context"); ATA_INFO("get context");
@ -75,11 +75,11 @@ airtaudio::api::Android::Android(void) {
ATA_INFO("Create Android interface (end)"); ATA_INFO("Create Android interface (end)");
} }
airtaudio::api::Android::~Android(void) { airtaudio::api::Android::~Android() {
ATA_INFO("Destroy Android interface"); ATA_INFO("Destroy Android interface");
} }
uint32_t airtaudio::api::Android::getDeviceCount(void) { uint32_t airtaudio::api::Android::getDeviceCount() {
//ATA_INFO("Get device count:"<< m_devices.size()); //ATA_INFO("Get device count:"<< m_devices.size());
return m_devices.size(); return m_devices.size();
} }
@ -89,19 +89,19 @@ airtaudio::DeviceInfo airtaudio::api::Android::getDeviceInfo(uint32_t _device) {
return m_devices[_device]; return m_devices[_device];
} }
enum airtaudio::errorType airtaudio::api::Android::closeStream(void) { enum airtaudio::errorType airtaudio::api::Android::closeStream() {
ATA_INFO("Clese Stream"); ATA_INFO("Clese Stream");
// Can not close the stream now... // Can not close the stream now...
return airtaudio::errorNone; return airtaudio::errorNone;
} }
enum airtaudio::errorType airtaudio::api::Android::startStream(void) { enum airtaudio::errorType airtaudio::api::Android::startStream() {
ATA_INFO("Start Stream"); ATA_INFO("Start Stream");
// Can not close the stream now... // Can not close the stream now...
return airtaudio::errorNone; return airtaudio::errorNone;
} }
enum airtaudio::errorType airtaudio::api::Android::stopStream(void) { enum airtaudio::errorType airtaudio::api::Android::stopStream() {
ATA_INFO("Stop stream"); ATA_INFO("Stop stream");
ewol::Context& tmpContext = ewol::getContext(); ewol::Context& tmpContext = ewol::getContext();
tmpContext.audioCloseDevice(0); tmpContext.audioCloseDevice(0);
@ -109,7 +109,7 @@ enum airtaudio::errorType airtaudio::api::Android::stopStream(void) {
return airtaudio::errorNone; return airtaudio::errorNone;
} }
enum airtaudio::errorType airtaudio::api::Android::abortStream(void) { enum airtaudio::errorType airtaudio::api::Android::abortStream() {
ATA_INFO("Abort Stream"); ATA_INFO("Abort Stream");
ewol::Context& tmpContext = ewol::getContext(); ewol::Context& tmpContext = ewol::getContext();
tmpContext.audioCloseDevice(0); tmpContext.audioCloseDevice(0);

View File

@ -11,27 +11,27 @@ namespace airtaudio {
namespace api { namespace api {
class Android: public airtaudio::Api { class Android: public airtaudio::Api {
public: public:
static airtaudio::Api* Create(void); static airtaudio::Api* Create();
public: public:
Android(void); Android();
~Android(void); ~Android();
airtaudio::api::type getCurrentApi(void) { airtaudio::api::type getCurrentApi() {
return airtaudio::api::ANDROID_JAVA; return airtaudio::api::ANDROID_JAVA;
} }
uint32_t getDeviceCount(void); uint32_t getDeviceCount();
airtaudio::DeviceInfo getDeviceInfo(uint32_t _device); airtaudio::DeviceInfo getDeviceInfo(uint32_t _device);
enum airtaudio::errorType closeStream(void); enum airtaudio::errorType closeStream();
enum airtaudio::errorType startStream(void); enum airtaudio::errorType startStream();
enum airtaudio::errorType stopStream(void); enum airtaudio::errorType stopStream();
enum airtaudio::errorType abortStream(void); enum airtaudio::errorType abortStream();
// This function is intended for internal use only. It must be // This function is intended for internal use only. It must be
// public because it is called by the internal callback handler, // public because it is called by the internal callback handler,
// which is not a member of RtAudio. External use of this function // which is not a member of RtAudio. External use of this function
// will most likely produce highly undesireable results! // will most likely produce highly undesireable results!
void callbackEvent(void); void callbackEvent();
private: private:
std::vector<airtaudio::DeviceInfo> m_devices; std::vector<airtaudio::DeviceInfo> m_devices;
void saveDeviceInfo(void); void saveDeviceInfo();
bool probeDeviceOpen(uint32_t _device, bool probeDeviceOpen(uint32_t _device,
airtaudio::api::StreamMode _mode, airtaudio::api::StreamMode _mode,
uint32_t _channels, uint32_t _channels,

View File

@ -12,7 +12,7 @@
#include <airtaudio/Interface.h> #include <airtaudio/Interface.h>
#include <airtaudio/debug.h> #include <airtaudio/debug.h>
airtaudio::Api* airtaudio::api::Asio::Create(void) { airtaudio::Api* airtaudio::api::Asio::Create() {
return new airtaudio::api::Asio(); return new airtaudio::api::Asio();
} }
@ -50,7 +50,7 @@ struct AsioHandle {
bool internalDrain; // Indicates if stop is initiated from callback or not. bool internalDrain; // Indicates if stop is initiated from callback or not.
ASIOBufferInfo *bufferInfos; ASIOBufferInfo *bufferInfos;
HANDLE condition; HANDLE condition;
AsioHandle(void) : AsioHandle() :
drainCounter(0), drainCounter(0),
internalDrain(false), internalDrain(false),
bufferInfos(0) { bufferInfos(0) {
@ -63,7 +63,7 @@ static const char* getAsioErrorString(ASIOError _result);
static void sampleRateChanged(ASIOSampleRate _sRate); static void sampleRateChanged(ASIOSampleRate _sRate);
static long asioMessages(long _selector, long _value, void* _message, double* _opt); static long asioMessages(long _selector, long _value, void* _message, double* _opt);
airtaudio::api::Asio::Asio(void) { airtaudio::api::Asio::Asio() {
// ASIO cannot run on a multi-threaded appartment. You can call // ASIO cannot run on a multi-threaded appartment. You can call
// CoInitialize beforehand, but it must be for appartment threading // CoInitialize beforehand, but it must be for appartment threading
// (in which case, CoInitilialize will return S_FALSE here). // (in which case, CoInitilialize will return S_FALSE here).
@ -79,7 +79,7 @@ airtaudio::api::Asio::Asio(void) {
driverInfo.sysRef = GetForegroundWindow(); driverInfo.sysRef = GetForegroundWindow();
} }
airtaudio::api::Asio::~Asio(void) { airtaudio::api::Asio::~Asio() {
if (m_stream.state != STREAM_CLOSED) { if (m_stream.state != STREAM_CLOSED) {
closeStream(); closeStream();
} }
@ -88,7 +88,7 @@ airtaudio::api::Asio::~Asio(void) {
} }
} }
uint32_t airtaudio::api::Asio::getDeviceCount(void) { uint32_t airtaudio::api::Asio::getDeviceCount() {
return (uint32_t) drivers.asioGetNumDev(); return (uint32_t) drivers.asioGetNumDev();
} }
@ -200,7 +200,7 @@ static void bufferSwitch(long _index, ASIOBool _processNow) {
object->callbackEvent(_index); object->callbackEvent(_index);
} }
void airtaudio::api::Asio::saveDeviceInfo(void) { void airtaudio::api::Asio::saveDeviceInfo() {
m_devices.clear(); m_devices.clear();
uint32_t nDevices = getDeviceCount(); uint32_t nDevices = getDeviceCount();
m_devices.resize(nDevices); m_devices.resize(nDevices);
@ -563,7 +563,7 @@ error:
return false; return false;
} }
enum airtaudio::errorType airtaudio::api::Asio::closeStream(void) { enum airtaudio::errorType airtaudio::api::Asio::closeStream() {
if (m_stream.state == STREAM_CLOSED) { if (m_stream.state == STREAM_CLOSED) {
ATA_ERROR("airtaudio::api::Asio::closeStream(): no open stream to close!"); ATA_ERROR("airtaudio::api::Asio::closeStream(): no open stream to close!");
return airtaudio::errorWarning; return airtaudio::errorWarning;
@ -600,7 +600,7 @@ enum airtaudio::errorType airtaudio::api::Asio::closeStream(void) {
bool stopThreadCalled = false; bool stopThreadCalled = false;
enum airtaudio::errorType airtaudio::api::Asio::startStream(void) { enum airtaudio::errorType airtaudio::api::Asio::startStream() {
if (verifyStream() != airtaudio::errorNone) { if (verifyStream() != airtaudio::errorNone) {
return airtaudio::errorFail; return airtaudio::errorFail;
} }
@ -627,7 +627,7 @@ unlock:
return airtaudio::errorSystemError; return airtaudio::errorSystemError;
} }
enum airtaudio::errorType airtaudio::api::Asio::stopStream(void) { enum airtaudio::errorType airtaudio::api::Asio::stopStream() {
if (verifyStream() != airtaudio::errorNone) { if (verifyStream() != airtaudio::errorNone) {
return airtaudio::errorFail; return airtaudio::errorFail;
} }
@ -653,7 +653,7 @@ enum airtaudio::errorType airtaudio::api::Asio::stopStream(void) {
return airtaudio::errorSystemError; return airtaudio::errorSystemError;
} }
enum airtaudio::errorType airtaudio::api::Asio::abortStream(void) { enum airtaudio::errorType airtaudio::api::Asio::abortStream() {
if (verifyStream() != airtaudio::errorNone) { if (verifyStream() != airtaudio::errorNone) {
return airtaudio::errorFail; return airtaudio::errorFail;
} }

View File

@ -13,20 +13,20 @@ namespace airtaudio {
namespace api { namespace api {
class Asio: public airtaudio::Api { class Asio: public airtaudio::Api {
public: public:
static airtaudio::Api* Create(void); static airtaudio::Api* Create();
public: public:
Asio(); Asio();
~Asio(); ~Asio();
airtaudio::api::type getCurrentApi(void) { airtaudio::api::type getCurrentApi() {
return airtaudio::WINDOWS_ASIO; return airtaudio::WINDOWS_ASIO;
} }
uint32_t getDeviceCount(void); uint32_t getDeviceCount();
airtaudio::DeviceInfo getDeviceInfo(uint32_t _device); airtaudio::DeviceInfo getDeviceInfo(uint32_t _device);
enum airtaudio::errorType closeStream(void); enum airtaudio::errorType closeStream();
enum airtaudio::errorType startStream(void); enum airtaudio::errorType startStream();
enum airtaudio::errorType stopStream(void); enum airtaudio::errorType stopStream();
enum airtaudio::errorType abortStream(void); enum airtaudio::errorType abortStream();
long getStreamLatency(void); long getStreamLatency();
// This function is intended for internal use only. It must be // This function is intended for internal use only. It must be
// public because it is called by the internal callback handler, // public because it is called by the internal callback handler,
// which is not a member of RtAudio. External use of this function // which is not a member of RtAudio. External use of this function
@ -34,7 +34,7 @@ namespace airtaudio {
bool callbackEvent(long _bufferIndex); bool callbackEvent(long _bufferIndex);
private: private:
std::vector<airtaudio::DeviceInfo> m_devices; std::vector<airtaudio::DeviceInfo> m_devices;
void saveDeviceInfo(void); void saveDeviceInfo();
bool m_coInitialized; bool m_coInitialized;
bool probeDeviceOpen(uint32_t _device, bool probeDeviceOpen(uint32_t _device,
airtaudio::api::StreamMode _mode, airtaudio::api::StreamMode _mode,

View File

@ -18,7 +18,7 @@
#include <airtaudio/Interface.h> #include <airtaudio/Interface.h>
#include <airtaudio/debug.h> #include <airtaudio/debug.h>
airtaudio::Api* airtaudio::api::Core::Create(void) { airtaudio::Api* airtaudio::api::Core::Create() {
return new airtaudio::api::Core(); return new airtaudio::api::Core();
} }
@ -52,7 +52,7 @@ struct CoreHandle {
std::condition_variable condition; std::condition_variable condition;
int32_t drainCounter; // Tracks callback counts when draining int32_t drainCounter; // Tracks callback counts when draining
bool internalDrain; // Indicates if stop is initiated from callback or not. bool internalDrain; // Indicates if stop is initiated from callback or not.
CoreHandle(void) : CoreHandle() :
deviceBuffer(0), deviceBuffer(0),
drainCounter(0), drainCounter(0),
internalDrain(false) { internalDrain(false) {
@ -65,7 +65,7 @@ struct CoreHandle {
} }
}; };
airtaudio::api::Core::Core(void) { airtaudio::api::Core::Core() {
#if defined(AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER) #if defined(AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER)
// This is a largely undocumented but absolutely necessary // This is a largely undocumented but absolutely necessary
// requirement starting with OS-X 10.6. If not called, queries and // requirement starting with OS-X 10.6. If not called, queries and
@ -89,7 +89,7 @@ airtaudio::api::Core::Core(void) {
#endif #endif
} }
airtaudio::api::Core::~Core(void) { airtaudio::api::Core::~Core() {
// The subclass destructor gets called before the base class // The subclass destructor gets called before the base class
// destructor, so close an existing stream before deallocating // destructor, so close an existing stream before deallocating
// apiDeviceId memory. // apiDeviceId memory.
@ -98,7 +98,7 @@ airtaudio::api::Core::~Core(void) {
} }
} }
uint32_t airtaudio::api::Core::getDeviceCount(void) { uint32_t airtaudio::api::Core::getDeviceCount() {
// Find out how many audio devices there are, if any. // Find out how many audio devices there are, if any.
uint32_t dataSize; uint32_t dataSize;
AudioObjectPropertyAddress propertyAddress = { AudioObjectPropertyAddress propertyAddress = {
@ -114,7 +114,7 @@ uint32_t airtaudio::api::Core::getDeviceCount(void) {
return dataSize / sizeof(AudioDeviceID); return dataSize / sizeof(AudioDeviceID);
} }
uint32_t airtaudio::api::Core::getDefaultInputDevice(void) { uint32_t airtaudio::api::Core::getDefaultInputDevice() {
uint32_t nDevices = getDeviceCount(); uint32_t nDevices = getDeviceCount();
if (nDevices <= 1) { if (nDevices <= 1) {
return 0; return 0;
@ -158,7 +158,7 @@ uint32_t airtaudio::api::Core::getDefaultInputDevice(void) {
return 0; return 0;
} }
uint32_t airtaudio::api::Core::getDefaultOutputDevice(void) { uint32_t airtaudio::api::Core::getDefaultOutputDevice() {
uint32_t nDevices = getDeviceCount(); uint32_t nDevices = getDeviceCount();
if (nDevices <= 1) { if (nDevices <= 1) {
return 0; return 0;
@ -921,7 +921,7 @@ error:
return false; return false;
} }
enum airtaudio::errorType airtaudio::api::Core::closeStream(void) { enum airtaudio::errorType airtaudio::api::Core::closeStream() {
if (m_stream.state == STREAM_CLOSED) { if (m_stream.state == STREAM_CLOSED) {
ATA_ERROR("airtaudio::api::Core::closeStream(): no open stream to close!"); ATA_ERROR("airtaudio::api::Core::closeStream(): no open stream to close!");
return airtaudio::errorWarning; return airtaudio::errorWarning;
@ -969,7 +969,7 @@ enum airtaudio::errorType airtaudio::api::Core::closeStream(void) {
return airtaudio::errorNone; return airtaudio::errorNone;
} }
enum airtaudio::errorType airtaudio::api::Core::startStream(void) { enum airtaudio::errorType airtaudio::api::Core::startStream() {
if (verifyStream() != airtaudio::errorNone) { if (verifyStream() != airtaudio::errorNone) {
return airtaudio::errorFail; return airtaudio::errorFail;
} }
@ -1006,7 +1006,7 @@ unlock:
return airtaudio::errorSystemError; return airtaudio::errorSystemError;
} }
enum airtaudio::errorType airtaudio::api::Core::stopStream(void) { enum airtaudio::errorType airtaudio::api::Core::stopStream() {
if (verifyStream() != airtaudio::errorNone) { if (verifyStream() != airtaudio::errorNone) {
return airtaudio::errorFail; return airtaudio::errorFail;
} }
@ -1046,7 +1046,7 @@ unlock:
return airtaudio::errorSystemError; return airtaudio::errorSystemError;
} }
enum airtaudio::errorType airtaudio::api::Core::abortStream(void) { enum airtaudio::errorType airtaudio::api::Core::abortStream() {
if (verifyStream() != airtaudio::errorNone) { if (verifyStream() != airtaudio::errorNone) {
return airtaudio::errorFail; return airtaudio::errorFail;
} }

View File

@ -15,22 +15,22 @@ namespace airtaudio {
namespace api { namespace api {
class Core: public airtaudio::Api { class Core: public airtaudio::Api {
public: public:
static airtaudio::Api* Create(void); static airtaudio::Api* Create();
public: public:
Core(); Core();
~Core(); ~Core();
airtaudio::api::type getCurrentApi(void) { airtaudio::api::type getCurrentApi() {
return airtaudio::api::MACOSX_CORE; return airtaudio::api::MACOSX_CORE;
} }
uint32_t getDeviceCount(void); uint32_t getDeviceCount();
airtaudio::DeviceInfo getDeviceInfo(uint32_t _device); airtaudio::DeviceInfo getDeviceInfo(uint32_t _device);
uint32_t getDefaultOutputDevice(void); uint32_t getDefaultOutputDevice();
uint32_t getDefaultInputDevice(void); uint32_t getDefaultInputDevice();
enum airtaudio::errorType closeStream(void); enum airtaudio::errorType closeStream();
enum airtaudio::errorType startStream(void); enum airtaudio::errorType startStream();
enum airtaudio::errorType stopStream(void); enum airtaudio::errorType stopStream();
enum airtaudio::errorType abortStream(void); enum airtaudio::errorType abortStream();
long getStreamLatency(void); long getStreamLatency();
// This function is intended for internal use only. It must be // This function is intended for internal use only. It must be
// public because it is called by the internal callback handler, // public because it is called by the internal callback handler,
// which is not a member of RtAudio. External use of this function // which is not a member of RtAudio. External use of this function

View File

@ -12,27 +12,27 @@ namespace airtaudio {
class CoreIosPrivate; class CoreIosPrivate;
class CoreIos: public airtaudio::Api { class CoreIos: public airtaudio::Api {
public: public:
static airtaudio::Api* Create(void); static airtaudio::Api* Create();
public: public:
CoreIos(void); CoreIos();
~CoreIos(void); ~CoreIos();
airtaudio::api::type getCurrentApi(void) { airtaudio::api::type getCurrentApi() {
return airtaudio::api::IOS_CORE; return airtaudio::api::IOS_CORE;
} }
uint32_t getDeviceCount(void); uint32_t getDeviceCount();
airtaudio::DeviceInfo getDeviceInfo(uint32_t _device); airtaudio::DeviceInfo getDeviceInfo(uint32_t _device);
enum airtaudio::errorType closeStream(void); enum airtaudio::errorType closeStream();
enum airtaudio::errorType startStream(void); enum airtaudio::errorType startStream();
enum airtaudio::errorType stopStream(void); enum airtaudio::errorType stopStream();
enum airtaudio::errorType abortStream(void); enum airtaudio::errorType abortStream();
// This function is intended for internal use only. It must be // This function is intended for internal use only. It must be
// public because it is called by the internal callback handler, // public because it is called by the internal callback handler,
// which is not a member of RtAudio. External use of this function // which is not a member of RtAudio. External use of this function
// will most likely produce highly undesireable results! // will most likely produce highly undesireable results!
void callbackEvent(void); void callbackEvent();
private: private:
std::vector<airtaudio::DeviceInfo> m_devices; std::vector<airtaudio::DeviceInfo> m_devices;
void saveDeviceInfo(void); void saveDeviceInfo();
bool probeDeviceOpen(uint32_t _device, bool probeDeviceOpen(uint32_t _device,
airtaudio::api::StreamMode _mode, airtaudio::api::StreamMode _mode,
uint32_t _channels, uint32_t _channels,

View File

@ -11,7 +11,7 @@
#include <airtaudio/Interface.h> #include <airtaudio/Interface.h>
#include <airtaudio/debug.h> #include <airtaudio/debug.h>
airtaudio::Api* airtaudio::api::Ds::Create(void) { airtaudio::Api* airtaudio::api::Ds::Create() {
return new airtaudio::api::Ds(); return new airtaudio::api::Ds();
} }
@ -67,7 +67,7 @@ struct DsHandle {
DWORD dsPointerLeadTime[2]; // the number of bytes ahead of the safe pointer to lead by. DWORD dsPointerLeadTime[2]; // the number of bytes ahead of the safe pointer to lead by.
HANDLE condition; HANDLE condition;
DsHandle(void) : DsHandle() :
drainCounter(0), drainCounter(0),
internalDrain(false) { internalDrain(false) {
id[0] = 0; id[0] = 0;
@ -97,7 +97,7 @@ struct DsDevice {
bool validId[2]; bool validId[2];
bool found; bool found;
std::string name; std::string name;
DsDevice(void) : DsDevice() :
found(false) { found(false) {
validId[0] = false; validId[0] = false;
validId[1] = false; validId[1] = false;
@ -109,7 +109,7 @@ struct DsProbeData {
std::vector<struct DsDevice>* dsDevices; std::vector<struct DsDevice>* dsDevices;
}; };
airtaudio::api::Ds::Ds(void) { airtaudio::api::Ds::Ds() {
// Dsound will run both-threaded. If CoInitialize fails, then just // Dsound will run both-threaded. If CoInitialize fails, then just
// accept whatever the mainline chose for a threading model. // accept whatever the mainline chose for a threading model.
m_coInitialized = false; m_coInitialized = false;
@ -119,7 +119,7 @@ airtaudio::api::Ds::Ds(void) {
} }
} }
airtaudio::api::Ds::~Ds(void) { airtaudio::api::Ds::~Ds() {
if (m_coInitialized) { if (m_coInitialized) {
CoUninitialize(); // balanced call. CoUninitialize(); // balanced call.
} }
@ -129,17 +129,17 @@ airtaudio::api::Ds::~Ds(void) {
} }
// The DirectSound default output is always the first device. // The DirectSound default output is always the first device.
uint32_t airtaudio::api::Ds::getDefaultOutputDevice(void) { uint32_t airtaudio::api::Ds::getDefaultOutputDevice() {
return 0; return 0;
} }
// The DirectSound default input is always the first input device, // The DirectSound default input is always the first input device,
// which is the first capture device enumerated. // which is the first capture device enumerated.
uint32_t airtaudio::api::Ds::getDefaultInputDevice(void) { uint32_t airtaudio::api::Ds::getDefaultInputDevice() {
return 0; return 0;
} }
uint32_t airtaudio::api::Ds::getDeviceCount(void) { uint32_t airtaudio::api::Ds::getDeviceCount() {
// Set query flag for previously found devices to false, so that we // Set query flag for previously found devices to false, so that we
// can check for any devices that have disappeared. // can check for any devices that have disappeared.
for (uint32_t i=0; i<dsDevices.size(); i++) { for (uint32_t i=0; i<dsDevices.size(); i++) {
@ -848,7 +848,7 @@ error:
return false; return false;
} }
enum airtaudio::errorType airtaudio::api::Ds::closeStream(void) { enum airtaudio::errorType airtaudio::api::Ds::closeStream() {
if (m_stream.state == STREAM_CLOSED) { if (m_stream.state == STREAM_CLOSED) {
ATA_ERROR("airtaudio::api::Ds::closeStream(): no open stream to close!"); ATA_ERROR("airtaudio::api::Ds::closeStream(): no open stream to close!");
return airtaudio::errorWarning; return airtaudio::errorWarning;
@ -895,7 +895,7 @@ enum airtaudio::errorType airtaudio::api::Ds::closeStream(void) {
m_stream.state = STREAM_CLOSED; m_stream.state = STREAM_CLOSED;
} }
enum airtaudio::errorType airtaudio::api::Ds::startStream(void) { enum airtaudio::errorType airtaudio::api::Ds::startStream() {
if (verifyStream() != airtaudio::errorNone) { if (verifyStream() != airtaudio::errorNone) {
return airtaudio::errorFail; return airtaudio::errorFail;
} }
@ -944,7 +944,7 @@ unlock:
return airtaudio::errorNone; return airtaudio::errorNone;
} }
enum airtaudio::errorType airtaudio::api::Ds::stopStream(void) { enum airtaudio::errorType airtaudio::api::Ds::stopStream() {
if (verifyStream() != airtaudio::errorNone) { if (verifyStream() != airtaudio::errorNone) {
return airtaudio::errorFail; return airtaudio::errorFail;
} }
@ -1025,7 +1025,7 @@ unlock:
return airtaudio::errorNone; return airtaudio::errorNone;
} }
enum airtaudio::errorType airtaudio::api::Ds::abortStream(void) { enum airtaudio::errorType airtaudio::api::Ds::abortStream() {
if (verifyStream() != airtaudio::errorNone) { if (verifyStream() != airtaudio::errorNone) {
return airtaudio::errorFail; return airtaudio::errorFail;
} }
@ -1038,7 +1038,7 @@ enum airtaudio::errorType airtaudio::api::Ds::abortStream(void) {
return stopStream(); return stopStream();
} }
void airtaudio::api::Ds::callbackEvent(void) { void airtaudio::api::Ds::callbackEvent() {
if (m_stream.state == STREAM_STOPPED || m_stream.state == STREAM_STOPPING) { if (m_stream.state == STREAM_STOPPED || m_stream.state == STREAM_STOPPING) {
Sleep(50); // sleep 50 milliseconds Sleep(50); // sleep 50 milliseconds
return; return;

View File

@ -13,27 +13,27 @@ namespace airtaudio {
namespace api { namespace api {
class Ds: public airtaudio::Api { class Ds: public airtaudio::Api {
public: public:
static airtaudio::Api* Create(void); static airtaudio::Api* Create();
public: public:
Ds(void); Ds();
~Ds(void); ~Ds();
airtaudio::api::type getCurrentApi(void) { airtaudio::api::type getCurrentApi() {
return airtaudio::api::WINDOWS_DS; return airtaudio::api::WINDOWS_DS;
} }
uint32_t getDeviceCount(void); uint32_t getDeviceCount();
uint32_t getDefaultOutputDevice(void); uint32_t getDefaultOutputDevice();
uint32_t getDefaultInputDevice(void); uint32_t getDefaultInputDevice();
airtaudio::DeviceInfo getDeviceInfo(uint32_t _device); airtaudio::DeviceInfo getDeviceInfo(uint32_t _device);
enum airtaudio::errorType closeStream(void); enum airtaudio::errorType closeStream();
enum airtaudio::errorType startStream(void); enum airtaudio::errorType startStream();
enum airtaudio::errorType stopStream(void); enum airtaudio::errorType stopStream();
enum airtaudio::errorType abortStream(void); enum airtaudio::errorType abortStream();
long getStreamLatency(void); long getStreamLatency();
// This function is intended for internal use only. It must be // This function is intended for internal use only. It must be
// public because it is called by the internal callback handler, // public because it is called by the internal callback handler,
// which is not a member of RtAudio. External use of this function // which is not a member of RtAudio. External use of this function
// will most likely produce highly undesireable results! // will most likely produce highly undesireable results!
void callbackEvent(void); void callbackEvent();
private: private:
bool m_coInitialized; bool m_coInitialized;
bool m_buffersRolling; bool m_buffersRolling;

View File

@ -10,39 +10,39 @@
#include <airtaudio/api/Dummy.h> #include <airtaudio/api/Dummy.h>
#include <airtaudio/debug.h> #include <airtaudio/debug.h>
airtaudio::Api* airtaudio::api::Dummy::Create(void) { airtaudio::Api* airtaudio::api::Dummy::Create() {
return new airtaudio::api::Dummy(); return new airtaudio::api::Dummy();
} }
airtaudio::api::Dummy::Dummy(void) { airtaudio::api::Dummy::Dummy() {
m_errorText = "airtaudio::api::Dummy: This class provides no functionality."; m_errorText = "airtaudio::api::Dummy: This class provides no functionality.";
error(airtaudio::errorWarning); error(airtaudio::errorWarning);
} }
uint32_t airtaudio::api::Dummy::getDeviceCount(void) { uint32_t airtaudio::api::Dummy::getDeviceCount() {
return 0; return 0;
} }
rtaudio::DeviceInfo airtaudio::api::Dummy::getDeviceInfo(uint32_t _device) { rtaudio::DeviceInfo airtaudio::api::Dummy::getDeviceInfo(uint32_t _device) {
(void)_device; ()_device;
rtaudio::DeviceInfo info; rtaudio::DeviceInfo info;
return info; return info;
} }
enum airtaudio::errorType airtaudio::api::Dummy::closeStream(void) { enum airtaudio::errorType airtaudio::api::Dummy::closeStream() {
return airtaudio::errorNone; return airtaudio::errorNone;
} }
enum airtaudio::errorType airtaudio::api::Dummy::startStream(void) { enum airtaudio::errorType airtaudio::api::Dummy::startStream() {
return airtaudio::errorNone; return airtaudio::errorNone;
} }
enum airtaudio::errorType airtaudio::api::Dummy::stopStream(void) { enum airtaudio::errorType airtaudio::api::Dummy::stopStream() {
return airtaudio::errorNone; return airtaudio::errorNone;
} }
enum airtaudio::errorType airtaudio::api::Dummy::abortStream(void) { enum airtaudio::errorType airtaudio::api::Dummy::abortStream() {
return airtaudio::errorNone; return airtaudio::errorNone;
} }

View File

@ -15,18 +15,18 @@ namespace airtaudio {
namespace api { namespace api {
class Dummy: public airtaudio::Api { class Dummy: public airtaudio::Api {
public: public:
static airtaudio::Api* Create(void); static airtaudio::Api* Create();
public: public:
Dummy(void); Dummy();
airtaudio::api::type getCurrentApi(void) { airtaudio::api::type getCurrentApi() {
return airtaudio::api::RTAUDIO_DUMMY; return airtaudio::api::RTAUDIO_DUMMY;
} }
uint32_t getDeviceCount(void); uint32_t getDeviceCount();
airtaudio::DeviceInfo getDeviceInfo(uint32_t _device); airtaudio::DeviceInfo getDeviceInfo(uint32_t _device);
enum airtaudio::errorType closeStream(void); enum airtaudio::errorType closeStream();
enum airtaudio::errorType startStream(void); enum airtaudio::errorType startStream();
enum airtaudio::errorType stopStream(void); enum airtaudio::errorType stopStream();
enum airtaudio::errorType abortStream(void); enum airtaudio::errorType abortStream();
private: private:
bool probeDeviceOpen(uint32_t _device, bool probeDeviceOpen(uint32_t _device,
airtaudio::api::StreamMode _mode, airtaudio::api::StreamMode _mode,

View File

@ -15,7 +15,7 @@
#include <airtaudio/debug.h> #include <airtaudio/debug.h>
#include <string.h> #include <string.h>
airtaudio::Api* airtaudio::api::Jack::Create(void) { airtaudio::Api* airtaudio::api::Jack::Create() {
return new airtaudio::api::Jack(); return new airtaudio::api::Jack();
} }
@ -64,7 +64,7 @@ struct JackHandle {
int32_t drainCounter; // Tracks callback counts when draining int32_t drainCounter; // Tracks callback counts when draining
bool internalDrain; // Indicates if stop is initiated from callback or not. bool internalDrain; // Indicates if stop is initiated from callback or not.
JackHandle(void) : JackHandle() :
client(0), client(0),
drainCounter(0), drainCounter(0),
internalDrain(false) { internalDrain(false) {
@ -75,17 +75,17 @@ struct JackHandle {
} }
}; };
airtaudio::api::Jack::Jack(void) { airtaudio::api::Jack::Jack() {
// Nothing to do here. // Nothing to do here.
} }
airtaudio::api::Jack::~Jack(void) { airtaudio::api::Jack::~Jack() {
if (m_stream.state != STREAM_CLOSED) { if (m_stream.state != STREAM_CLOSED) {
closeStream(); closeStream();
} }
} }
uint32_t airtaudio::api::Jack::getDeviceCount(void) { uint32_t airtaudio::api::Jack::getDeviceCount() {
// See if we can become a jack client. // See if we can become a jack client.
jack_options_t options = (jack_options_t) (JackNoStartServer); //JackNullOption; jack_options_t options = (jack_options_t) (JackNoStartServer); //JackNullOption;
jack_status_t *status = NULL; jack_status_t *status = NULL;
@ -489,7 +489,7 @@ error:
return false; return false;
} }
enum airtaudio::errorType airtaudio::api::Jack::closeStream(void) { enum airtaudio::errorType airtaudio::api::Jack::closeStream() {
if (m_stream.state == STREAM_CLOSED) { if (m_stream.state == STREAM_CLOSED) {
ATA_ERROR("airtaudio::api::Jack::closeStream(): no open stream to close!"); ATA_ERROR("airtaudio::api::Jack::closeStream(): no open stream to close!");
return airtaudio::errorWarning; return airtaudio::errorWarning;
@ -526,7 +526,7 @@ enum airtaudio::errorType airtaudio::api::Jack::closeStream(void) {
return airtaudio::errorNone; return airtaudio::errorNone;
} }
enum airtaudio::errorType airtaudio::api::Jack::startStream(void) { enum airtaudio::errorType airtaudio::api::Jack::startStream() {
if (verifyStream() != airtaudio::errorNone) { if (verifyStream() != airtaudio::errorNone) {
return airtaudio::errorFail; return airtaudio::errorFail;
} }
@ -597,7 +597,7 @@ unlock:
return airtaudio::errorSystemError; return airtaudio::errorSystemError;
} }
enum airtaudio::errorType airtaudio::api::Jack::stopStream(void) { enum airtaudio::errorType airtaudio::api::Jack::stopStream() {
if (verifyStream() != airtaudio::errorNone) { if (verifyStream() != airtaudio::errorNone) {
return airtaudio::errorFail; return airtaudio::errorFail;
} }
@ -619,7 +619,7 @@ enum airtaudio::errorType airtaudio::api::Jack::stopStream(void) {
return airtaudio::errorNone; return airtaudio::errorNone;
} }
enum airtaudio::errorType airtaudio::api::Jack::abortStream(void) { enum airtaudio::errorType airtaudio::api::Jack::abortStream() {
if (verifyStream() != airtaudio::errorNone) { if (verifyStream() != airtaudio::errorNone) {
return airtaudio::errorFail; return airtaudio::errorFail;
} }

View File

@ -13,20 +13,20 @@ namespace airtaudio {
namespace api { namespace api {
class Jack: public airtaudio::Api { class Jack: public airtaudio::Api {
public: public:
static airtaudio::Api* Create(void); static airtaudio::Api* Create();
public: public:
Jack(void); Jack();
~Jack(void); ~Jack();
airtaudio::api::type getCurrentApi(void) { airtaudio::api::type getCurrentApi() {
return airtaudio::api::UNIX_JACK; return airtaudio::api::UNIX_JACK;
} }
uint32_t getDeviceCount(void); uint32_t getDeviceCount();
airtaudio::DeviceInfo getDeviceInfo(uint32_t _device); airtaudio::DeviceInfo getDeviceInfo(uint32_t _device);
enum airtaudio::errorType closeStream(void); enum airtaudio::errorType closeStream();
enum airtaudio::errorType startStream(void); enum airtaudio::errorType startStream();
enum airtaudio::errorType stopStream(void); enum airtaudio::errorType stopStream();
enum airtaudio::errorType abortStream(void); enum airtaudio::errorType abortStream();
long getStreamLatency(void); long getStreamLatency();
// This function is intended for internal use only. It must be // This function is intended for internal use only. It must be
// public because it is called by the internal callback handler, // public because it is called by the internal callback handler,
// which is not a member of RtAudio. External use of this function // which is not a member of RtAudio. External use of this function

View File

@ -19,7 +19,7 @@
#include <errno.h> #include <errno.h>
#include <math.h> #include <math.h>
airtaudio::Api* airtaudio::api::Oss::Create(void) { airtaudio::Api* airtaudio::api::Oss::Create() {
return new airtaudio::api::Oss(); return new airtaudio::api::Oss();
} }
@ -32,7 +32,7 @@ struct OssHandle {
bool xrun[2]; bool xrun[2];
bool triggered; bool triggered;
std::condition_variable runnable; std::condition_variable runnable;
OssHandle(void): OssHandle():
triggered(false) { triggered(false) {
id[0] = 0; id[0] = 0;
id[1] = 0; id[1] = 0;
@ -41,17 +41,17 @@ struct OssHandle {
} }
}; };
airtaudio::api::Oss::Oss(void) { airtaudio::api::Oss::Oss() {
// Nothing to do here. // Nothing to do here.
} }
airtaudio::api::Oss::~Oss(void) { airtaudio::api::Oss::~Oss() {
if (m_stream.state != STREAM_CLOSED) { if (m_stream.state != STREAM_CLOSED) {
closeStream(); closeStream();
} }
} }
uint32_t airtaudio::api::Oss::getDeviceCount(void) { uint32_t airtaudio::api::Oss::getDeviceCount() {
int32_t mixerfd = open("/dev/mixer", O_RDWR, 0); int32_t mixerfd = open("/dev/mixer", O_RDWR, 0);
if (mixerfd == -1) { if (mixerfd == -1) {
ATA_ERROR("airtaudio::api::Oss::getDeviceCount: error opening '/dev/mixer'."); ATA_ERROR("airtaudio::api::Oss::getDeviceCount: error opening '/dev/mixer'.");
@ -546,7 +546,7 @@ error:
return false; return false;
} }
enum airtaudio::errorType airtaudio::api::Oss::closeStream(void) { enum airtaudio::errorType airtaudio::api::Oss::closeStream() {
if (m_stream.state == STREAM_CLOSED) { if (m_stream.state == STREAM_CLOSED) {
ATA_ERROR("airtaudio::api::Oss::closeStream(): no open stream to close!"); ATA_ERROR("airtaudio::api::Oss::closeStream(): no open stream to close!");
return airtaudio::errorWarning; return airtaudio::errorWarning;
@ -592,7 +592,7 @@ enum airtaudio::errorType airtaudio::api::Oss::closeStream(void) {
return airtaudio::errorNone; return airtaudio::errorNone;
} }
enum airtaudio::errorType airtaudio::api::Oss::startStream(void) { enum airtaudio::errorType airtaudio::api::Oss::startStream() {
if (verifyStream() != airtaudio::errorNone) { if (verifyStream() != airtaudio::errorNone) {
return airtaudio::errorFail; return airtaudio::errorFail;
} }
@ -609,7 +609,7 @@ enum airtaudio::errorType airtaudio::api::Oss::startStream(void) {
handle->runnable.notify_one(); handle->runnable.notify_one();
} }
enum airtaudio::errorType airtaudio::api::Oss::stopStream(void) { enum airtaudio::errorType airtaudio::api::Oss::stopStream() {
if (verifyStream() != airtaudio::errorNone) { if (verifyStream() != airtaudio::errorNone) {
return airtaudio::errorFail; return airtaudio::errorFail;
} }
@ -673,7 +673,7 @@ unlock:
return airtaudio::errorSystemError; return airtaudio::errorSystemError;
} }
enum airtaudio::errorType airtaudio::api::Oss::abortStream(void) { enum airtaudio::errorType airtaudio::api::Oss::abortStream() {
if (verifyStream() != airtaudio::errorNone) { if (verifyStream() != airtaudio::errorNone) {
return airtaudio::errorFail; return airtaudio::errorFail;
} }
@ -713,7 +713,7 @@ unlock:
return airtaudio::errorSystemError; return airtaudio::errorSystemError;
} }
void airtaudio::api::Oss::callbackEvent(void) { void airtaudio::api::Oss::callbackEvent() {
OssHandle *handle = (OssHandle *) m_stream.apiHandle; OssHandle *handle = (OssHandle *) m_stream.apiHandle;
if (m_stream.state == STREAM_STOPPED) { if (m_stream.state == STREAM_STOPPED) {
std::unique_lock<std::mutex> lck(m_stream.mutex); std::unique_lock<std::mutex> lck(m_stream.mutex);

View File

@ -13,24 +13,24 @@ namespace airtaudio {
namespace api { namespace api {
class Oss: public airtaudio::Api { class Oss: public airtaudio::Api {
public: public:
static airtaudio::Api* Create(void); static airtaudio::Api* Create();
public: public:
Oss(void); Oss();
~Oss(void); ~Oss();
airtaudio::api::type getCurrentApi(void) { airtaudio::api::type getCurrentApi() {
return airtaudio::api::LINUX_OSS; return airtaudio::api::LINUX_OSS;
} }
uint32_t getDeviceCount(void); uint32_t getDeviceCount();
airtaudio::DeviceInfo getDeviceInfo(uint32_t _device); airtaudio::DeviceInfo getDeviceInfo(uint32_t _device);
enum airtaudio::errorType closeStream(void); enum airtaudio::errorType closeStream();
enum airtaudio::errorType startStream(void); enum airtaudio::errorType startStream();
enum airtaudio::errorType stopStream(void); enum airtaudio::errorType stopStream();
enum airtaudio::errorType abortStream(void); enum airtaudio::errorType abortStream();
// This function is intended for internal use only. It must be // This function is intended for internal use only. It must be
// public because it is called by the internal callback handler, // public because it is called by the internal callback handler,
// which is not a member of RtAudio. External use of this function // which is not a member of RtAudio. External use of this function
// will most likely produce highly undesireable results! // will most likely produce highly undesireable results!
void callbackEvent(void); void callbackEvent();
private: private:
bool probeDeviceOpen(uint32_t _device, bool probeDeviceOpen(uint32_t _device,
airtaudio::api::StreamMode _mode, airtaudio::api::StreamMode _mode,

View File

@ -20,7 +20,7 @@
#include <pulse/simple.h> #include <pulse/simple.h>
#include <cstdio> #include <cstdio>
airtaudio::Api* airtaudio::api::Pulse::Create(void) { airtaudio::Api* airtaudio::api::Pulse::Create() {
return new airtaudio::api::Pulse(); return new airtaudio::api::Pulse();
} }
@ -53,7 +53,7 @@ struct PulseAudioHandle {
std::thread* thread; std::thread* thread;
std::condition_variable runnable_cv; std::condition_variable runnable_cv;
bool runnable; bool runnable;
PulseAudioHandle(void) : PulseAudioHandle() :
s_play(0), s_play(0),
s_rec(0), s_rec(0),
runnable(false) { runnable(false) {
@ -61,13 +61,13 @@ struct PulseAudioHandle {
} }
}; };
airtaudio::api::Pulse::~Pulse(void) { airtaudio::api::Pulse::~Pulse() {
if (m_stream.state != STREAM_CLOSED) { if (m_stream.state != STREAM_CLOSED) {
closeStream(); closeStream();
} }
} }
uint32_t airtaudio::api::Pulse::getDeviceCount(void) { uint32_t airtaudio::api::Pulse::getDeviceCount() {
return 1; return 1;
} }
@ -96,7 +96,7 @@ static void pulseaudio_callback(void* _user) {
} }
} }
enum airtaudio::errorType airtaudio::api::Pulse::closeStream(void) { enum airtaudio::errorType airtaudio::api::Pulse::closeStream() {
PulseAudioHandle *pah = static_cast<PulseAudioHandle *>(m_stream.apiHandle); PulseAudioHandle *pah = static_cast<PulseAudioHandle *>(m_stream.apiHandle);
m_stream.callbackInfo.isRunning = false; m_stream.callbackInfo.isRunning = false;
if (pah) { if (pah) {
@ -130,7 +130,7 @@ enum airtaudio::errorType airtaudio::api::Pulse::closeStream(void) {
return airtaudio::errorNone; return airtaudio::errorNone;
} }
void airtaudio::api::Pulse::callbackEvent(void) { void airtaudio::api::Pulse::callbackEvent() {
PulseAudioHandle *pah = static_cast<PulseAudioHandle *>(m_stream.apiHandle); PulseAudioHandle *pah = static_cast<PulseAudioHandle *>(m_stream.apiHandle);
if (m_stream.state == STREAM_STOPPED) { if (m_stream.state == STREAM_STOPPED) {
std::unique_lock<std::mutex> lck(m_stream.mutex); std::unique_lock<std::mutex> lck(m_stream.mutex);
@ -208,7 +208,7 @@ unlock:
return; return;
} }
enum airtaudio::errorType airtaudio::api::Pulse::startStream(void) { enum airtaudio::errorType airtaudio::api::Pulse::startStream() {
PulseAudioHandle *pah = static_cast<PulseAudioHandle *>(m_stream.apiHandle); PulseAudioHandle *pah = static_cast<PulseAudioHandle *>(m_stream.apiHandle);
if (m_stream.state == STREAM_CLOSED) { if (m_stream.state == STREAM_CLOSED) {
ATA_ERROR("airtaudio::api::Pulse::startStream(): the stream is not open!"); ATA_ERROR("airtaudio::api::Pulse::startStream(): the stream is not open!");
@ -226,7 +226,7 @@ enum airtaudio::errorType airtaudio::api::Pulse::startStream(void) {
return airtaudio::errorNone; return airtaudio::errorNone;
} }
enum airtaudio::errorType airtaudio::api::Pulse::stopStream(void) { enum airtaudio::errorType airtaudio::api::Pulse::stopStream() {
PulseAudioHandle *pah = static_cast<PulseAudioHandle *>(m_stream.apiHandle); PulseAudioHandle *pah = static_cast<PulseAudioHandle *>(m_stream.apiHandle);
if (m_stream.state == STREAM_CLOSED) { if (m_stream.state == STREAM_CLOSED) {
ATA_ERROR("airtaudio::api::Pulse::stopStream(): the stream is not open!"); ATA_ERROR("airtaudio::api::Pulse::stopStream(): the stream is not open!");
@ -251,7 +251,7 @@ enum airtaudio::errorType airtaudio::api::Pulse::stopStream(void) {
return airtaudio::errorNone; return airtaudio::errorNone;
} }
enum airtaudio::errorType airtaudio::api::Pulse::abortStream(void) { enum airtaudio::errorType airtaudio::api::Pulse::abortStream() {
PulseAudioHandle *pah = static_cast<PulseAudioHandle*>(m_stream.apiHandle); PulseAudioHandle *pah = static_cast<PulseAudioHandle*>(m_stream.apiHandle);
if (m_stream.state == STREAM_CLOSED) { if (m_stream.state == STREAM_CLOSED) {
ATA_ERROR("airtaudio::api::Pulse::abortStream(): the stream is not open!"); ATA_ERROR("airtaudio::api::Pulse::abortStream(): the stream is not open!");

View File

@ -13,26 +13,26 @@ namespace airtaudio {
namespace api { namespace api {
class Pulse: public airtaudio::Api { class Pulse: public airtaudio::Api {
public: public:
static airtaudio::Api* Create(void); static airtaudio::Api* Create();
public: public:
~Pulse(void); ~Pulse();
airtaudio::api::type getCurrentApi(void) { airtaudio::api::type getCurrentApi() {
return airtaudio::api::LINUX_PULSE; return airtaudio::api::LINUX_PULSE;
} }
uint32_t getDeviceCount(void); uint32_t getDeviceCount();
airtaudio::DeviceInfo getDeviceInfo(uint32_t _device); airtaudio::DeviceInfo getDeviceInfo(uint32_t _device);
enum airtaudio::errorType closeStream(void); enum airtaudio::errorType closeStream();
enum airtaudio::errorType startStream(void); enum airtaudio::errorType startStream();
enum airtaudio::errorType stopStream(void); enum airtaudio::errorType stopStream();
enum airtaudio::errorType abortStream(void); enum airtaudio::errorType abortStream();
// This function is intended for internal use only. It must be // This function is intended for internal use only. It must be
// public because it is called by the internal callback handler, // public because it is called by the internal callback handler,
// which is not a member of RtAudio. External use of this function // which is not a member of RtAudio. External use of this function
// will most likely produce highly undesireable results! // will most likely produce highly undesireable results!
void callbackEvent(void); void callbackEvent();
private: private:
std::vector<airtaudio::DeviceInfo> m_devices; std::vector<airtaudio::DeviceInfo> m_devices;
void saveDeviceInfo(void); void saveDeviceInfo();
bool probeDeviceOpen(uint32_t _device, bool probeDeviceOpen(uint32_t _device,
airtaudio::api::StreamMode _mode, airtaudio::api::StreamMode _mode,
uint32_t _channels, uint32_t _channels,

View File

@ -8,7 +8,7 @@
#include <airtaudio/debug.h> #include <airtaudio/debug.h>
int32_t airtaudio::getLogId(void) { int32_t airtaudio::getLogId() {
static int32_t g_val = etk::log::registerInstance("airtaudio"); static int32_t g_val = etk::log::registerInstance("airtaudio");
return g_val; return g_val;
} }

View File

@ -12,7 +12,7 @@
#include <etk/log.h> #include <etk/log.h>
namespace airtaudio { namespace airtaudio {
int32_t getLogId(void); int32_t getLogId();
}; };
// TODO : Review this problem of multiple intanciation of "std::stringbuf sb" // TODO : Review this problem of multiple intanciation of "std::stringbuf sb"
#define ATA_BASE(info,data) \ #define ATA_BASE(info,data) \

View File

@ -14,7 +14,7 @@ class int24_t {
protected: protected:
uint8_t c3[3]; uint8_t c3[3];
public: public:
int24_t(void) {} int24_t() {}
int24_t& operator = (const int32_t& i) { int24_t& operator = (const int32_t& i) {
c3[0] = (i & 0x000000ff); c3[0] = (i & 0x000000ff);
c3[1] = (i & 0x0000ff00) >> 8; c3[1] = (i & 0x0000ff00) >> 8;
@ -38,7 +38,7 @@ class int24_t {
*this = (int32_t)c; *this = (int32_t)c;
} }
int32_t asInt(void) { int32_t asInt() {
int32_t i = c3[0] | (c3[1] << 8) | (c3[2] << 16); int32_t i = c3[0] | (c3[1] << 8) | (c3[2] << 16);
if (i & 0x800000) { if (i & 0x800000) {
i |= ~0xffffff; i |= ~0xffffff;