diff --git a/airtaudio/Api.cpp b/airtaudio/Api.cpp index a664545..5cf30dc 100644 --- a/airtaudio/Api.cpp +++ b/airtaudio/Api.cpp @@ -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.mode = airtaudio::api::UNINITIALIZED; m_stream.apiHandle = 0; @@ -66,7 +66,7 @@ airtaudio::Api::Api(void) { 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; } -uint32_t airtaudio::Api::getDefaultInputDevice(void) { +uint32_t airtaudio::Api::getDefaultInputDevice() { // Should be implemented in subclasses if possible. return 0; } -uint32_t airtaudio::Api::getDefaultOutputDevice(void) { +uint32_t airtaudio::Api::getDefaultOutputDevice() { // Should be implemented in subclasses if possible. return 0; } -enum airtaudio::errorType airtaudio::Api::closeStream(void) { +enum airtaudio::errorType airtaudio::Api::closeStream() { // MUST be implemented in subclasses! return airtaudio::errorNone; } @@ -184,7 +184,7 @@ bool airtaudio::Api::probeDeviceOpen(uint32_t /*device*/, return false; } -void airtaudio::Api::tickStreamTime(void) { +void airtaudio::Api::tickStreamTime() { // Subclasses that do not provide their own implementation of // getStreamTime should call this function once per buffer I/O to // provide basic stream time support. @@ -194,7 +194,7 @@ void airtaudio::Api::tickStreamTime(void) { #endif } -long airtaudio::Api::getStreamLatency(void) { +long airtaudio::Api::getStreamLatency() { if (verifyStream() != airtaudio::errorNone) { return 0; } @@ -210,7 +210,7 @@ long airtaudio::Api::getStreamLatency(void) { return totalLatency; } -double airtaudio::Api::getStreamTime(void) { +double airtaudio::Api::getStreamTime() { if (verifyStream() != airtaudio::errorNone) { return 0.0f; } @@ -232,14 +232,14 @@ double airtaudio::Api::getStreamTime(void) { #endif } -uint32_t airtaudio::Api::getStreamSampleRate(void) { +uint32_t airtaudio::Api::getStreamSampleRate() { if (verifyStream() != airtaudio::errorNone) { return 0; } 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) { ATA_ERROR("airtaudio::Api:: a stream is not open!"); return airtaudio::errorInvalidUse; @@ -247,7 +247,7 @@ enum airtaudio::errorType airtaudio::Api::verifyStream(void) { return airtaudio::errorNone; } -void airtaudio::Api::clearStreamInfo(void) { +void airtaudio::Api::clearStreamInfo() { m_stream.mode = airtaudio::api::UNINITIALIZED; m_stream.state = airtaudio::api::STREAM_CLOSED; m_stream.sampleRate = 0; diff --git a/airtaudio/Api.h b/airtaudio/Api.h index 4392be1..9946816 100644 --- a/airtaudio/Api.h +++ b/airtaudio/Api.h @@ -92,7 +92,7 @@ namespace airtaudio { struct timeval lastTickTimestamp; #endif - Stream(void) : + Stream() : apiHandle(0), deviceBuffer(0) { device[0] = 11111; @@ -113,13 +113,13 @@ namespace airtaudio { */ class Api { public: - Api(void); - virtual ~Api(void); - virtual airtaudio::api::type getCurrentApi(void) = 0; - virtual uint32_t getDeviceCount(void) = 0; + Api(); + virtual ~Api(); + virtual airtaudio::api::type getCurrentApi() = 0; + virtual uint32_t getDeviceCount() = 0; virtual airtaudio::DeviceInfo getDeviceInfo(uint32_t _device) = 0; - virtual uint32_t getDefaultInputDevice(void); - virtual uint32_t getDefaultOutputDevice(void); + virtual uint32_t getDefaultInputDevice(); + virtual uint32_t getDefaultOutputDevice(); enum airtaudio::errorType openStream(airtaudio::StreamParameters *_outputParameters, airtaudio::StreamParameters *_inputParameters, airtaudio::format _format, @@ -128,17 +128,17 @@ namespace airtaudio { airtaudio::AirTAudioCallback _callback, void *_userData, airtaudio::StreamOptions *_options); - virtual enum airtaudio::errorType closeStream(void); - virtual enum airtaudio::errorType startStream(void) = 0; - virtual enum airtaudio::errorType stopStream(void) = 0; - virtual enum airtaudio::errorType abortStream(void) = 0; - long getStreamLatency(void); - uint32_t getStreamSampleRate(void); - virtual double getStreamTime(void); - bool isStreamOpen(void) const { + virtual enum airtaudio::errorType closeStream(); + virtual enum airtaudio::errorType startStream() = 0; + virtual enum airtaudio::errorType stopStream() = 0; + virtual enum airtaudio::errorType abortStream() = 0; + long getStreamLatency(); + uint32_t getStreamSampleRate(); + virtual double getStreamTime(); + bool isStreamOpen() const { return m_stream.state != airtaudio::api::STREAM_CLOSED; } - bool isStreamRunning(void) const { + bool isStreamRunning() const { return m_stream.state == airtaudio::api::STREAM_RUNNING; } @@ -162,16 +162,16 @@ namespace airtaudio { airtaudio::StreamOptions *_options); //! A protected function used to increment the stream time. - void tickStreamTime(void); + void tickStreamTime(); //! Protected common method to clear an RtApiStream structure. - void clearStreamInfo(void); + void clearStreamInfo(); /*! Protected common method that throws an RtError (type = 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 * conversions between the user and device buffers. diff --git a/airtaudio/CallbackInfo.h b/airtaudio/CallbackInfo.h index a975bbd..d3fc368 100644 --- a/airtaudio/CallbackInfo.h +++ b/airtaudio/CallbackInfo.h @@ -27,7 +27,7 @@ namespace airtaudio { int32_t priority; // Default constructor. - CallbackInfo(void) : + CallbackInfo() : object(0), callback(0), userData(0), diff --git a/airtaudio/DeviceInfo.h b/airtaudio/DeviceInfo.h index 4be9df4..4856144 100644 --- a/airtaudio/DeviceInfo.h +++ b/airtaudio/DeviceInfo.h @@ -25,7 +25,7 @@ namespace airtaudio { std::vector sampleRates; //!< Supported sample rates (queried from list of standard rates). airtaudio::format nativeFormats; //!< Bit mask of supported data formats. // Default constructor. - DeviceInfo(void) : + DeviceInfo() : probed(false), outputChannels(0), inputChannels(0), diff --git a/airtaudio/Interface.cpp b/airtaudio/Interface.cpp index 66c8bfe..6d8215d 100644 --- a/airtaudio/Interface.cpp +++ b/airtaudio/Interface.cpp @@ -11,7 +11,7 @@ #include #include -std::vector airtaudio::Interface::getCompiledApi(void) { +std::vector airtaudio::Interface::getCompiledApi() { std::vector apis; // The order here will control the order of RtAudio's API search in // the constructor. @@ -43,7 +43,7 @@ void airtaudio::Interface::openRtApi(airtaudio::api::type _api) { } -airtaudio::Interface::Interface(void) : +airtaudio::Interface::Interface() : m_rtapi(NULL) { #if defined(__UNIX_JACK__) addInterface(airtaudio::api::UNIX_JACK, airtaudio::api::Jack::Create); @@ -77,8 +77,8 @@ airtaudio::Interface::Interface(void) : #endif } -void airtaudio::Interface::addInterface(airtaudio::api::type _api, Api* (*_callbackCreate)(void)) { - m_apiAvaillable.push_back(std::pair(_api, _callbackCreate)); +void airtaudio::Interface::addInterface(airtaudio::api::type _api, Api* (*_callbackCreate)()) { + m_apiAvaillable.push_back(std::pair(_api, _callbackCreate)); } 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; } -airtaudio::Interface::~Interface(void) { +airtaudio::Interface::~Interface() { ATA_INFO("Remove interface"); if (m_rtapi != NULL) { delete m_rtapi; diff --git a/airtaudio/Interface.h b/airtaudio/Interface.h index 21cf829..ba65318 100644 --- a/airtaudio/Interface.h +++ b/airtaudio/Interface.h @@ -38,14 +38,14 @@ namespace airtaudio { */ class Interface { protected: - std::vector> m_apiAvaillable; + std::vector> m_apiAvaillable; protected: airtaudio::Api *m_rtapi; public: /** * @brief A static function to determine the current airtaudio version. */ - static std::string getVersion(void) { + static std::string getVersion() { return airtaudio::VERSION; } /** @@ -55,25 +55,25 @@ namespace airtaudio { * the enumerated list values. Note that there can be more than one * API compiled for certain operating systems. */ - std::vector getCompiledApi(void); + std::vector getCompiledApi(); /** * @brief The class constructor. * @note the creating of the basic instance is done by Instanciate */ - Interface(void); + Interface(); /** * @brief The destructor. * * If a stream is running or open, it will be stopped and closed * automatically. */ - ~Interface(void); + ~Interface(); /** * @brief Add an interface of the Possible List. * @param[in] _api Type of the interface. * @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 */ @@ -81,7 +81,7 @@ namespace 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) { return airtaudio::api::UNSPECIFIED; } @@ -94,7 +94,7 @@ namespace airtaudio { * is called, thus supporting devices connected \e after instantiation. If * a system error occurs during processing, a warning will be issued. */ - uint32_t getDeviceCount(void) { + uint32_t getDeviceCount() { if (m_rtapi == NULL) { return 0; } @@ -126,7 +126,7 @@ namespace airtaudio { * client's responsibility to verify that a device is available * before attempting to open a stream. */ - uint32_t getDefaultOutputDevice(void) { + uint32_t getDefaultOutputDevice() { if (m_rtapi == NULL) { return 0; } @@ -141,7 +141,7 @@ namespace airtaudio { * client's responsibility to verify that a device is available * before attempting to open a stream. */ - uint32_t getDefaultInputDevice(void) { + uint32_t getDefaultInputDevice() { if (m_rtapi == NULL) { return 0; } @@ -202,7 +202,7 @@ namespace airtaudio { * If a stream is not open, this function issues a warning and * returns (no exception is thrown). */ - enum airtaudio::errorType closeStream(void) { + enum airtaudio::errorType closeStream() { if (m_rtapi == NULL) { return airtaudio::errorInputNull; } @@ -216,7 +216,7 @@ namespace airtaudio { * stream is not open. A warning is issued if the stream is already * running. */ - enum airtaudio::errorType startStream(void) { + enum airtaudio::errorType startStream() { if (m_rtapi == NULL) { return airtaudio::errorInputNull; } @@ -230,7 +230,7 @@ namespace airtaudio { * stream is not open. A warning is issued if the stream is already * stopped. */ - enum airtaudio::errorType stopStream(void) { + enum airtaudio::errorType stopStream() { if (m_rtapi == NULL) { return airtaudio::errorInputNull; } @@ -243,7 +243,7 @@ namespace airtaudio { * stream is not open. A warning is issued if the stream is already * stopped. */ - enum airtaudio::errorType abortStream(void) { + enum airtaudio::errorType abortStream() { if (m_rtapi == NULL) { return airtaudio::errorInputNull; } @@ -252,7 +252,7 @@ namespace airtaudio { /** * @return true if a stream is open and false if not. */ - bool isStreamOpen(void) const { + bool isStreamOpen() const { if (m_rtapi == NULL) { return false; } @@ -261,7 +261,7 @@ namespace airtaudio { /** * @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) { return false; } @@ -271,7 +271,7 @@ namespace airtaudio { * @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. */ - double getStreamTime(void) { + double getStreamTime() { if (m_rtapi == NULL) { return 0.0; } @@ -286,7 +286,7 @@ namespace airtaudio { * report latency, the return value will be zero. * @return The internal stream latency in sample frames. */ - long getStreamLatency(void) { + long getStreamLatency() { if (m_rtapi == NULL) { return 0; } @@ -298,7 +298,7 @@ namespace airtaudio { * open, an RtError (type = INVALID_USE) will be thrown. * @return Returns actual sample rate in use by the stream. */ - uint32_t getStreamSampleRate(void) { + uint32_t getStreamSampleRate() { if (m_rtapi == NULL) { return 0; } diff --git a/airtaudio/StreamOptions.h b/airtaudio/StreamOptions.h index 0950895..62fb78c 100644 --- a/airtaudio/StreamOptions.h +++ b/airtaudio/StreamOptions.h @@ -76,7 +76,7 @@ namespace airtaudio { 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). // Default constructor. - StreamOptions(void) : + StreamOptions() : flags(0), numberOfBuffers(0), priority(0) {} diff --git a/airtaudio/StreamParameters.h b/airtaudio/StreamParameters.h index 78b9c45..07a7743 100644 --- a/airtaudio/StreamParameters.h +++ b/airtaudio/StreamParameters.h @@ -19,7 +19,7 @@ namespace airtaudio { uint32_t nChannels; //!< Number of channels. uint32_t firstChannel; //!< First channel index on device (default = 0). // Default constructor. - StreamParameters(void) : + StreamParameters() : deviceId(0), nChannels(0), firstChannel(0) { } diff --git a/airtaudio/api/Alsa.cpp b/airtaudio/api/Alsa.cpp index 76eba0a..fa722a4 100644 --- a/airtaudio/api/Alsa.cpp +++ b/airtaudio/api/Alsa.cpp @@ -15,7 +15,7 @@ #include #include -airtaudio::Api* airtaudio::api::Alsa::Create(void) { +airtaudio::Api* airtaudio::api::Alsa::Create() { return new airtaudio::api::Alsa(); } @@ -29,7 +29,7 @@ struct AlsaHandle { std::condition_variable runnable_cv; bool runnable; - AlsaHandle(void) : + AlsaHandle() : synchronized(false), runnable(false) { xrun[0] = false; @@ -39,17 +39,17 @@ struct AlsaHandle { static void alsaCallbackHandler(void * _ptr); -airtaudio::api::Alsa::Alsa(void) { +airtaudio::api::Alsa::Alsa() { // Nothing to do here. } -airtaudio::api::Alsa::~Alsa(void) { +airtaudio::api::Alsa::~Alsa() { if (m_stream.state != STREAM_CLOSED) { closeStream(); } } -uint32_t airtaudio::api::Alsa::getDeviceCount(void) { +uint32_t airtaudio::api::Alsa::getDeviceCount() { unsigned nDevices = 0; int32_t result, subdevice, card; char name[64]; @@ -349,7 +349,7 @@ probeParameters: return info; } -void airtaudio::api::Alsa::saveDeviceInfo(void) { +void airtaudio::api::Alsa::saveDeviceInfo() { m_devices.clear(); uint32_t nDevices = getDeviceCount(); m_devices.resize(nDevices); @@ -773,7 +773,7 @@ error: return false; } -enum airtaudio::errorType airtaudio::api::Alsa::closeStream(void) { +enum airtaudio::errorType airtaudio::api::Alsa::closeStream() { if (m_stream.state == STREAM_CLOSED) { ATA_ERROR("airtaudio::api::Alsa::closeStream(): no open stream to close!"); return airtaudio::errorWarning; @@ -826,7 +826,7 @@ enum airtaudio::errorType airtaudio::api::Alsa::closeStream(void) { 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. if (verifyStream() != airtaudio::errorNone) { return airtaudio::errorFail; @@ -872,7 +872,7 @@ unlock: return airtaudio::errorSystemError; } -enum airtaudio::errorType airtaudio::api::Alsa::stopStream(void) { +enum airtaudio::errorType airtaudio::api::Alsa::stopStream() { if (verifyStream() != airtaudio::errorNone) { return airtaudio::errorFail; } @@ -913,7 +913,7 @@ unlock: return airtaudio::errorSystemError; } -enum airtaudio::errorType airtaudio::api::Alsa::abortStream(void) { +enum airtaudio::errorType airtaudio::api::Alsa::abortStream() { if (verifyStream() != airtaudio::errorNone) { return airtaudio::errorFail; } @@ -950,7 +950,7 @@ unlock: return airtaudio::errorSystemError; } -void airtaudio::api::Alsa::callbackEvent(void) { +void airtaudio::api::Alsa::callbackEvent() { AlsaHandle *apiInfo = (AlsaHandle *) m_stream.apiHandle; if (m_stream.state == STREAM_STOPPED) { std::unique_lock lck(m_stream.mutex); diff --git a/airtaudio/api/Alsa.h b/airtaudio/api/Alsa.h index dd3f8d2..a11281e 100644 --- a/airtaudio/api/Alsa.h +++ b/airtaudio/api/Alsa.h @@ -13,27 +13,27 @@ namespace airtaudio { namespace api { class Alsa: public airtaudio::Api { public: - static airtaudio::Api* Create(void); + static airtaudio::Api* Create(); public: Alsa(); ~Alsa(); - airtaudio::api::type getCurrentApi(void) { + airtaudio::api::type getCurrentApi() { return airtaudio::api::LINUX_ALSA; } - uint32_t getDeviceCount(void); + uint32_t getDeviceCount(); airtaudio::DeviceInfo getDeviceInfo(uint32_t _device); - enum airtaudio::errorType closeStream(void); - enum airtaudio::errorType startStream(void); - enum airtaudio::errorType stopStream(void); - enum airtaudio::errorType abortStream(void); + enum airtaudio::errorType closeStream(); + enum airtaudio::errorType startStream(); + enum airtaudio::errorType stopStream(); + enum airtaudio::errorType 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 callbackEvent(void); + void callbackEvent(); private: std::vector m_devices; - void saveDeviceInfo(void); + void saveDeviceInfo(); bool probeDeviceOpen(uint32_t _device, airtaudio::api::StreamMode _mode, uint32_t _channels, diff --git a/airtaudio/api/Android.cpp b/airtaudio/api/Android.cpp index 7dc1cfb..5844302 100644 --- a/airtaudio/api/Android.cpp +++ b/airtaudio/api/Android.cpp @@ -12,13 +12,13 @@ #include #include -airtaudio::Api* airtaudio::api::Android::Create(void) { +airtaudio::Api* airtaudio::api::Android::Create() { ATA_INFO("Create Android device ... "); return new airtaudio::api::Android(); } -airtaudio::api::Android::Android(void) { +airtaudio::api::Android::Android() { ATA_INFO("new Android"); // On android, we set a static device ... ATA_INFO("get context"); @@ -75,11 +75,11 @@ airtaudio::api::Android::Android(void) { ATA_INFO("Create Android interface (end)"); } -airtaudio::api::Android::~Android(void) { +airtaudio::api::Android::~Android() { 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()); return m_devices.size(); } @@ -89,19 +89,19 @@ airtaudio::DeviceInfo airtaudio::api::Android::getDeviceInfo(uint32_t _device) { return m_devices[_device]; } -enum airtaudio::errorType airtaudio::api::Android::closeStream(void) { +enum airtaudio::errorType airtaudio::api::Android::closeStream() { ATA_INFO("Clese Stream"); // Can not close the stream now... return airtaudio::errorNone; } -enum airtaudio::errorType airtaudio::api::Android::startStream(void) { +enum airtaudio::errorType airtaudio::api::Android::startStream() { ATA_INFO("Start Stream"); // Can not close the stream now... return airtaudio::errorNone; } -enum airtaudio::errorType airtaudio::api::Android::stopStream(void) { +enum airtaudio::errorType airtaudio::api::Android::stopStream() { ATA_INFO("Stop stream"); ewol::Context& tmpContext = ewol::getContext(); tmpContext.audioCloseDevice(0); @@ -109,7 +109,7 @@ enum airtaudio::errorType airtaudio::api::Android::stopStream(void) { return airtaudio::errorNone; } -enum airtaudio::errorType airtaudio::api::Android::abortStream(void) { +enum airtaudio::errorType airtaudio::api::Android::abortStream() { ATA_INFO("Abort Stream"); ewol::Context& tmpContext = ewol::getContext(); tmpContext.audioCloseDevice(0); diff --git a/airtaudio/api/Android.h b/airtaudio/api/Android.h index 302d1a3..bd095dd 100644 --- a/airtaudio/api/Android.h +++ b/airtaudio/api/Android.h @@ -11,27 +11,27 @@ namespace airtaudio { namespace api { class Android: public airtaudio::Api { public: - static airtaudio::Api* Create(void); + static airtaudio::Api* Create(); public: - Android(void); - ~Android(void); - airtaudio::api::type getCurrentApi(void) { + Android(); + ~Android(); + airtaudio::api::type getCurrentApi() { return airtaudio::api::ANDROID_JAVA; } - uint32_t getDeviceCount(void); + uint32_t getDeviceCount(); airtaudio::DeviceInfo getDeviceInfo(uint32_t _device); - enum airtaudio::errorType closeStream(void); - enum airtaudio::errorType startStream(void); - enum airtaudio::errorType stopStream(void); - enum airtaudio::errorType abortStream(void); + enum airtaudio::errorType closeStream(); + enum airtaudio::errorType startStream(); + enum airtaudio::errorType stopStream(); + enum airtaudio::errorType 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 callbackEvent(void); + void callbackEvent(); private: std::vector m_devices; - void saveDeviceInfo(void); + void saveDeviceInfo(); bool probeDeviceOpen(uint32_t _device, airtaudio::api::StreamMode _mode, uint32_t _channels, diff --git a/airtaudio/api/Asio.cpp b/airtaudio/api/Asio.cpp index 544ba5a..174320f 100644 --- a/airtaudio/api/Asio.cpp +++ b/airtaudio/api/Asio.cpp @@ -12,7 +12,7 @@ #include #include -airtaudio::Api* airtaudio::api::Asio::Create(void) { +airtaudio::Api* airtaudio::api::Asio::Create() { return new airtaudio::api::Asio(); } @@ -50,7 +50,7 @@ struct AsioHandle { bool internalDrain; // Indicates if stop is initiated from callback or not. ASIOBufferInfo *bufferInfos; HANDLE condition; - AsioHandle(void) : + AsioHandle() : drainCounter(0), internalDrain(false), bufferInfos(0) { @@ -63,7 +63,7 @@ static const char* getAsioErrorString(ASIOError _result); static void sampleRateChanged(ASIOSampleRate _sRate); 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 // CoInitialize beforehand, but it must be for appartment threading // (in which case, CoInitilialize will return S_FALSE here). @@ -79,7 +79,7 @@ airtaudio::api::Asio::Asio(void) { driverInfo.sysRef = GetForegroundWindow(); } -airtaudio::api::Asio::~Asio(void) { +airtaudio::api::Asio::~Asio() { if (m_stream.state != STREAM_CLOSED) { 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(); } @@ -200,7 +200,7 @@ static void bufferSwitch(long _index, ASIOBool _processNow) { object->callbackEvent(_index); } -void airtaudio::api::Asio::saveDeviceInfo(void) { +void airtaudio::api::Asio::saveDeviceInfo() { m_devices.clear(); uint32_t nDevices = getDeviceCount(); m_devices.resize(nDevices); @@ -563,7 +563,7 @@ error: return false; } -enum airtaudio::errorType airtaudio::api::Asio::closeStream(void) { +enum airtaudio::errorType airtaudio::api::Asio::closeStream() { if (m_stream.state == STREAM_CLOSED) { ATA_ERROR("airtaudio::api::Asio::closeStream(): no open stream to close!"); return airtaudio::errorWarning; @@ -600,7 +600,7 @@ enum airtaudio::errorType airtaudio::api::Asio::closeStream(void) { bool stopThreadCalled = false; -enum airtaudio::errorType airtaudio::api::Asio::startStream(void) { +enum airtaudio::errorType airtaudio::api::Asio::startStream() { if (verifyStream() != airtaudio::errorNone) { return airtaudio::errorFail; } @@ -627,7 +627,7 @@ unlock: return airtaudio::errorSystemError; } -enum airtaudio::errorType airtaudio::api::Asio::stopStream(void) { +enum airtaudio::errorType airtaudio::api::Asio::stopStream() { if (verifyStream() != airtaudio::errorNone) { return airtaudio::errorFail; } @@ -653,7 +653,7 @@ enum airtaudio::errorType airtaudio::api::Asio::stopStream(void) { return airtaudio::errorSystemError; } -enum airtaudio::errorType airtaudio::api::Asio::abortStream(void) { +enum airtaudio::errorType airtaudio::api::Asio::abortStream() { if (verifyStream() != airtaudio::errorNone) { return airtaudio::errorFail; } diff --git a/airtaudio/api/Asio.h b/airtaudio/api/Asio.h index 1d37b9b..c8194d6 100644 --- a/airtaudio/api/Asio.h +++ b/airtaudio/api/Asio.h @@ -13,20 +13,20 @@ namespace airtaudio { namespace api { class Asio: public airtaudio::Api { public: - static airtaudio::Api* Create(void); + static airtaudio::Api* Create(); public: Asio(); ~Asio(); - airtaudio::api::type getCurrentApi(void) { + airtaudio::api::type getCurrentApi() { return airtaudio::WINDOWS_ASIO; } - uint32_t getDeviceCount(void); + uint32_t getDeviceCount(); airtaudio::DeviceInfo getDeviceInfo(uint32_t _device); - enum airtaudio::errorType closeStream(void); - enum airtaudio::errorType startStream(void); - enum airtaudio::errorType stopStream(void); - enum airtaudio::errorType abortStream(void); - long getStreamLatency(void); + enum airtaudio::errorType closeStream(); + enum airtaudio::errorType startStream(); + enum airtaudio::errorType stopStream(); + enum airtaudio::errorType abortStream(); + long getStreamLatency(); // 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 @@ -34,7 +34,7 @@ namespace airtaudio { bool callbackEvent(long _bufferIndex); private: std::vector m_devices; - void saveDeviceInfo(void); + void saveDeviceInfo(); bool m_coInitialized; bool probeDeviceOpen(uint32_t _device, airtaudio::api::StreamMode _mode, diff --git a/airtaudio/api/Core.cpp b/airtaudio/api/Core.cpp index 3d0572d..f6b36d3 100644 --- a/airtaudio/api/Core.cpp +++ b/airtaudio/api/Core.cpp @@ -18,7 +18,7 @@ #include #include -airtaudio::Api* airtaudio::api::Core::Create(void) { +airtaudio::Api* airtaudio::api::Core::Create() { return new airtaudio::api::Core(); } @@ -52,7 +52,7 @@ struct CoreHandle { std::condition_variable condition; int32_t drainCounter; // Tracks callback counts when draining bool internalDrain; // Indicates if stop is initiated from callback or not. - CoreHandle(void) : + CoreHandle() : deviceBuffer(0), drainCounter(0), 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) // This is a largely undocumented but absolutely necessary // requirement starting with OS-X 10.6. If not called, queries and @@ -89,7 +89,7 @@ airtaudio::api::Core::Core(void) { #endif } -airtaudio::api::Core::~Core(void) { +airtaudio::api::Core::~Core() { // The subclass destructor gets called before the base class // destructor, so close an existing stream before deallocating // 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. uint32_t dataSize; AudioObjectPropertyAddress propertyAddress = { @@ -114,7 +114,7 @@ uint32_t airtaudio::api::Core::getDeviceCount(void) { return dataSize / sizeof(AudioDeviceID); } -uint32_t airtaudio::api::Core::getDefaultInputDevice(void) { +uint32_t airtaudio::api::Core::getDefaultInputDevice() { uint32_t nDevices = getDeviceCount(); if (nDevices <= 1) { return 0; @@ -158,7 +158,7 @@ uint32_t airtaudio::api::Core::getDefaultInputDevice(void) { return 0; } -uint32_t airtaudio::api::Core::getDefaultOutputDevice(void) { +uint32_t airtaudio::api::Core::getDefaultOutputDevice() { uint32_t nDevices = getDeviceCount(); if (nDevices <= 1) { return 0; @@ -921,7 +921,7 @@ error: return false; } -enum airtaudio::errorType airtaudio::api::Core::closeStream(void) { +enum airtaudio::errorType airtaudio::api::Core::closeStream() { if (m_stream.state == STREAM_CLOSED) { ATA_ERROR("airtaudio::api::Core::closeStream(): no open stream to close!"); return airtaudio::errorWarning; @@ -969,7 +969,7 @@ enum airtaudio::errorType airtaudio::api::Core::closeStream(void) { return airtaudio::errorNone; } -enum airtaudio::errorType airtaudio::api::Core::startStream(void) { +enum airtaudio::errorType airtaudio::api::Core::startStream() { if (verifyStream() != airtaudio::errorNone) { return airtaudio::errorFail; } @@ -1006,7 +1006,7 @@ unlock: return airtaudio::errorSystemError; } -enum airtaudio::errorType airtaudio::api::Core::stopStream(void) { +enum airtaudio::errorType airtaudio::api::Core::stopStream() { if (verifyStream() != airtaudio::errorNone) { return airtaudio::errorFail; } @@ -1046,7 +1046,7 @@ unlock: return airtaudio::errorSystemError; } -enum airtaudio::errorType airtaudio::api::Core::abortStream(void) { +enum airtaudio::errorType airtaudio::api::Core::abortStream() { if (verifyStream() != airtaudio::errorNone) { return airtaudio::errorFail; } diff --git a/airtaudio/api/Core.h b/airtaudio/api/Core.h index 4cea6b2..0174a37 100644 --- a/airtaudio/api/Core.h +++ b/airtaudio/api/Core.h @@ -15,22 +15,22 @@ namespace airtaudio { namespace api { class Core: public airtaudio::Api { public: - static airtaudio::Api* Create(void); + static airtaudio::Api* Create(); public: Core(); ~Core(); - airtaudio::api::type getCurrentApi(void) { + airtaudio::api::type getCurrentApi() { return airtaudio::api::MACOSX_CORE; } - uint32_t getDeviceCount(void); + uint32_t getDeviceCount(); airtaudio::DeviceInfo getDeviceInfo(uint32_t _device); - uint32_t getDefaultOutputDevice(void); - uint32_t getDefaultInputDevice(void); - enum airtaudio::errorType closeStream(void); - enum airtaudio::errorType startStream(void); - enum airtaudio::errorType stopStream(void); - enum airtaudio::errorType abortStream(void); - long getStreamLatency(void); + uint32_t getDefaultOutputDevice(); + uint32_t getDefaultInputDevice(); + enum airtaudio::errorType closeStream(); + enum airtaudio::errorType startStream(); + enum airtaudio::errorType stopStream(); + enum airtaudio::errorType abortStream(); + long getStreamLatency(); // 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 diff --git a/airtaudio/api/CoreIos.h b/airtaudio/api/CoreIos.h index ceb459d..20c73ba 100644 --- a/airtaudio/api/CoreIos.h +++ b/airtaudio/api/CoreIos.h @@ -12,27 +12,27 @@ namespace airtaudio { class CoreIosPrivate; class CoreIos: public airtaudio::Api { public: - static airtaudio::Api* Create(void); + static airtaudio::Api* Create(); public: - CoreIos(void); - ~CoreIos(void); - airtaudio::api::type getCurrentApi(void) { + CoreIos(); + ~CoreIos(); + airtaudio::api::type getCurrentApi() { return airtaudio::api::IOS_CORE; } - uint32_t getDeviceCount(void); + uint32_t getDeviceCount(); airtaudio::DeviceInfo getDeviceInfo(uint32_t _device); - enum airtaudio::errorType closeStream(void); - enum airtaudio::errorType startStream(void); - enum airtaudio::errorType stopStream(void); - enum airtaudio::errorType abortStream(void); + enum airtaudio::errorType closeStream(); + enum airtaudio::errorType startStream(); + enum airtaudio::errorType stopStream(); + enum airtaudio::errorType 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 callbackEvent(void); + void callbackEvent(); private: std::vector m_devices; - void saveDeviceInfo(void); + void saveDeviceInfo(); bool probeDeviceOpen(uint32_t _device, airtaudio::api::StreamMode _mode, uint32_t _channels, diff --git a/airtaudio/api/Ds.cpp b/airtaudio/api/Ds.cpp index 761b503..f4dd3ef 100644 --- a/airtaudio/api/Ds.cpp +++ b/airtaudio/api/Ds.cpp @@ -11,7 +11,7 @@ #include #include -airtaudio::Api* airtaudio::api::Ds::Create(void) { +airtaudio::Api* airtaudio::api::Ds::Create() { 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. HANDLE condition; - DsHandle(void) : + DsHandle() : drainCounter(0), internalDrain(false) { id[0] = 0; @@ -97,7 +97,7 @@ struct DsDevice { bool validId[2]; bool found; std::string name; - DsDevice(void) : + DsDevice() : found(false) { validId[0] = false; validId[1] = false; @@ -109,7 +109,7 @@ struct DsProbeData { std::vector* dsDevices; }; -airtaudio::api::Ds::Ds(void) { +airtaudio::api::Ds::Ds() { // Dsound will run both-threaded. If CoInitialize fails, then just // accept whatever the mainline chose for a threading model. m_coInitialized = false; @@ -119,7 +119,7 @@ airtaudio::api::Ds::Ds(void) { } } -airtaudio::api::Ds::~Ds(void) { +airtaudio::api::Ds::~Ds() { if (m_coInitialized) { CoUninitialize(); // balanced call. } @@ -129,17 +129,17 @@ airtaudio::api::Ds::~Ds(void) { } // The DirectSound default output is always the first device. -uint32_t airtaudio::api::Ds::getDefaultOutputDevice(void) { +uint32_t airtaudio::api::Ds::getDefaultOutputDevice() { return 0; } // The DirectSound default input is always the first input device, // which is the first capture device enumerated. -uint32_t airtaudio::api::Ds::getDefaultInputDevice(void) { +uint32_t airtaudio::api::Ds::getDefaultInputDevice() { 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 // can check for any devices that have disappeared. for (uint32_t i=0; i #include -airtaudio::Api* airtaudio::api::Dummy::Create(void) { +airtaudio::Api* airtaudio::api::Dummy::Create() { return new airtaudio::api::Dummy(); } -airtaudio::api::Dummy::Dummy(void) { +airtaudio::api::Dummy::Dummy() { m_errorText = "airtaudio::api::Dummy: This class provides no functionality."; error(airtaudio::errorWarning); } -uint32_t airtaudio::api::Dummy::getDeviceCount(void) { +uint32_t airtaudio::api::Dummy::getDeviceCount() { return 0; } rtaudio::DeviceInfo airtaudio::api::Dummy::getDeviceInfo(uint32_t _device) { - (void)_device; + ()_device; rtaudio::DeviceInfo info; return info; } -enum airtaudio::errorType airtaudio::api::Dummy::closeStream(void) { +enum airtaudio::errorType airtaudio::api::Dummy::closeStream() { return airtaudio::errorNone; } -enum airtaudio::errorType airtaudio::api::Dummy::startStream(void) { +enum airtaudio::errorType airtaudio::api::Dummy::startStream() { return airtaudio::errorNone; } -enum airtaudio::errorType airtaudio::api::Dummy::stopStream(void) { +enum airtaudio::errorType airtaudio::api::Dummy::stopStream() { return airtaudio::errorNone; } -enum airtaudio::errorType airtaudio::api::Dummy::abortStream(void) { +enum airtaudio::errorType airtaudio::api::Dummy::abortStream() { return airtaudio::errorNone; } diff --git a/airtaudio/api/Dummy.h b/airtaudio/api/Dummy.h index 73a6af7..71859a0 100644 --- a/airtaudio/api/Dummy.h +++ b/airtaudio/api/Dummy.h @@ -15,18 +15,18 @@ namespace airtaudio { namespace api { class Dummy: public airtaudio::Api { public: - static airtaudio::Api* Create(void); + static airtaudio::Api* Create(); public: - Dummy(void); - airtaudio::api::type getCurrentApi(void) { + Dummy(); + airtaudio::api::type getCurrentApi() { return airtaudio::api::RTAUDIO_DUMMY; } - uint32_t getDeviceCount(void); + uint32_t getDeviceCount(); airtaudio::DeviceInfo getDeviceInfo(uint32_t _device); - enum airtaudio::errorType closeStream(void); - enum airtaudio::errorType startStream(void); - enum airtaudio::errorType stopStream(void); - enum airtaudio::errorType abortStream(void); + enum airtaudio::errorType closeStream(); + enum airtaudio::errorType startStream(); + enum airtaudio::errorType stopStream(); + enum airtaudio::errorType abortStream(); private: bool probeDeviceOpen(uint32_t _device, airtaudio::api::StreamMode _mode, diff --git a/airtaudio/api/Jack.cpp b/airtaudio/api/Jack.cpp index b7d61a4..6f01644 100644 --- a/airtaudio/api/Jack.cpp +++ b/airtaudio/api/Jack.cpp @@ -15,7 +15,7 @@ #include #include -airtaudio::Api* airtaudio::api::Jack::Create(void) { +airtaudio::Api* airtaudio::api::Jack::Create() { return new airtaudio::api::Jack(); } @@ -64,7 +64,7 @@ struct JackHandle { int32_t drainCounter; // Tracks callback counts when draining bool internalDrain; // Indicates if stop is initiated from callback or not. - JackHandle(void) : + JackHandle() : client(0), drainCounter(0), internalDrain(false) { @@ -75,17 +75,17 @@ struct JackHandle { } }; -airtaudio::api::Jack::Jack(void) { +airtaudio::api::Jack::Jack() { // Nothing to do here. } -airtaudio::api::Jack::~Jack(void) { +airtaudio::api::Jack::~Jack() { if (m_stream.state != STREAM_CLOSED) { closeStream(); } } -uint32_t airtaudio::api::Jack::getDeviceCount(void) { +uint32_t airtaudio::api::Jack::getDeviceCount() { // See if we can become a jack client. jack_options_t options = (jack_options_t) (JackNoStartServer); //JackNullOption; jack_status_t *status = NULL; @@ -489,7 +489,7 @@ error: return false; } -enum airtaudio::errorType airtaudio::api::Jack::closeStream(void) { +enum airtaudio::errorType airtaudio::api::Jack::closeStream() { if (m_stream.state == STREAM_CLOSED) { ATA_ERROR("airtaudio::api::Jack::closeStream(): no open stream to close!"); return airtaudio::errorWarning; @@ -526,7 +526,7 @@ enum airtaudio::errorType airtaudio::api::Jack::closeStream(void) { return airtaudio::errorNone; } -enum airtaudio::errorType airtaudio::api::Jack::startStream(void) { +enum airtaudio::errorType airtaudio::api::Jack::startStream() { if (verifyStream() != airtaudio::errorNone) { return airtaudio::errorFail; } @@ -597,7 +597,7 @@ unlock: return airtaudio::errorSystemError; } -enum airtaudio::errorType airtaudio::api::Jack::stopStream(void) { +enum airtaudio::errorType airtaudio::api::Jack::stopStream() { if (verifyStream() != airtaudio::errorNone) { return airtaudio::errorFail; } @@ -619,7 +619,7 @@ enum airtaudio::errorType airtaudio::api::Jack::stopStream(void) { return airtaudio::errorNone; } -enum airtaudio::errorType airtaudio::api::Jack::abortStream(void) { +enum airtaudio::errorType airtaudio::api::Jack::abortStream() { if (verifyStream() != airtaudio::errorNone) { return airtaudio::errorFail; } diff --git a/airtaudio/api/Jack.h b/airtaudio/api/Jack.h index 4ad7e6e..c80506d 100644 --- a/airtaudio/api/Jack.h +++ b/airtaudio/api/Jack.h @@ -13,20 +13,20 @@ namespace airtaudio { namespace api { class Jack: public airtaudio::Api { public: - static airtaudio::Api* Create(void); + static airtaudio::Api* Create(); public: - Jack(void); - ~Jack(void); - airtaudio::api::type getCurrentApi(void) { + Jack(); + ~Jack(); + airtaudio::api::type getCurrentApi() { return airtaudio::api::UNIX_JACK; } - uint32_t getDeviceCount(void); + uint32_t getDeviceCount(); airtaudio::DeviceInfo getDeviceInfo(uint32_t _device); - enum airtaudio::errorType closeStream(void); - enum airtaudio::errorType startStream(void); - enum airtaudio::errorType stopStream(void); - enum airtaudio::errorType abortStream(void); - long getStreamLatency(void); + enum airtaudio::errorType closeStream(); + enum airtaudio::errorType startStream(); + enum airtaudio::errorType stopStream(); + enum airtaudio::errorType abortStream(); + long getStreamLatency(); // 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 diff --git a/airtaudio/api/Oss.cpp b/airtaudio/api/Oss.cpp index e49e4aa..670e18b 100644 --- a/airtaudio/api/Oss.cpp +++ b/airtaudio/api/Oss.cpp @@ -19,7 +19,7 @@ #include #include -airtaudio::Api* airtaudio::api::Oss::Create(void) { +airtaudio::Api* airtaudio::api::Oss::Create() { return new airtaudio::api::Oss(); } @@ -32,7 +32,7 @@ struct OssHandle { bool xrun[2]; bool triggered; std::condition_variable runnable; - OssHandle(void): + OssHandle(): triggered(false) { id[0] = 0; id[1] = 0; @@ -41,17 +41,17 @@ struct OssHandle { } }; -airtaudio::api::Oss::Oss(void) { +airtaudio::api::Oss::Oss() { // Nothing to do here. } -airtaudio::api::Oss::~Oss(void) { +airtaudio::api::Oss::~Oss() { if (m_stream.state != STREAM_CLOSED) { closeStream(); } } -uint32_t airtaudio::api::Oss::getDeviceCount(void) { +uint32_t airtaudio::api::Oss::getDeviceCount() { int32_t mixerfd = open("/dev/mixer", O_RDWR, 0); if (mixerfd == -1) { ATA_ERROR("airtaudio::api::Oss::getDeviceCount: error opening '/dev/mixer'."); @@ -546,7 +546,7 @@ error: return false; } -enum airtaudio::errorType airtaudio::api::Oss::closeStream(void) { +enum airtaudio::errorType airtaudio::api::Oss::closeStream() { if (m_stream.state == STREAM_CLOSED) { ATA_ERROR("airtaudio::api::Oss::closeStream(): no open stream to close!"); return airtaudio::errorWarning; @@ -592,7 +592,7 @@ enum airtaudio::errorType airtaudio::api::Oss::closeStream(void) { return airtaudio::errorNone; } -enum airtaudio::errorType airtaudio::api::Oss::startStream(void) { +enum airtaudio::errorType airtaudio::api::Oss::startStream() { if (verifyStream() != airtaudio::errorNone) { return airtaudio::errorFail; } @@ -609,7 +609,7 @@ enum airtaudio::errorType airtaudio::api::Oss::startStream(void) { handle->runnable.notify_one(); } -enum airtaudio::errorType airtaudio::api::Oss::stopStream(void) { +enum airtaudio::errorType airtaudio::api::Oss::stopStream() { if (verifyStream() != airtaudio::errorNone) { return airtaudio::errorFail; } @@ -673,7 +673,7 @@ unlock: return airtaudio::errorSystemError; } -enum airtaudio::errorType airtaudio::api::Oss::abortStream(void) { +enum airtaudio::errorType airtaudio::api::Oss::abortStream() { if (verifyStream() != airtaudio::errorNone) { return airtaudio::errorFail; } @@ -713,7 +713,7 @@ unlock: return airtaudio::errorSystemError; } -void airtaudio::api::Oss::callbackEvent(void) { +void airtaudio::api::Oss::callbackEvent() { OssHandle *handle = (OssHandle *) m_stream.apiHandle; if (m_stream.state == STREAM_STOPPED) { std::unique_lock lck(m_stream.mutex); diff --git a/airtaudio/api/Oss.h b/airtaudio/api/Oss.h index 729bb82..689d76d 100644 --- a/airtaudio/api/Oss.h +++ b/airtaudio/api/Oss.h @@ -13,24 +13,24 @@ namespace airtaudio { namespace api { class Oss: public airtaudio::Api { public: - static airtaudio::Api* Create(void); + static airtaudio::Api* Create(); public: - Oss(void); - ~Oss(void); - airtaudio::api::type getCurrentApi(void) { + Oss(); + ~Oss(); + airtaudio::api::type getCurrentApi() { return airtaudio::api::LINUX_OSS; } - uint32_t getDeviceCount(void); + uint32_t getDeviceCount(); airtaudio::DeviceInfo getDeviceInfo(uint32_t _device); - enum airtaudio::errorType closeStream(void); - enum airtaudio::errorType startStream(void); - enum airtaudio::errorType stopStream(void); - enum airtaudio::errorType abortStream(void); + enum airtaudio::errorType closeStream(); + enum airtaudio::errorType startStream(); + enum airtaudio::errorType stopStream(); + enum airtaudio::errorType 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 callbackEvent(void); + void callbackEvent(); private: bool probeDeviceOpen(uint32_t _device, airtaudio::api::StreamMode _mode, diff --git a/airtaudio/api/Pulse.cpp b/airtaudio/api/Pulse.cpp index 23ddaf5..9debc91 100644 --- a/airtaudio/api/Pulse.cpp +++ b/airtaudio/api/Pulse.cpp @@ -20,7 +20,7 @@ #include #include -airtaudio::Api* airtaudio::api::Pulse::Create(void) { +airtaudio::Api* airtaudio::api::Pulse::Create() { return new airtaudio::api::Pulse(); } @@ -53,7 +53,7 @@ struct PulseAudioHandle { std::thread* thread; std::condition_variable runnable_cv; bool runnable; - PulseAudioHandle(void) : + PulseAudioHandle() : s_play(0), s_rec(0), runnable(false) { @@ -61,13 +61,13 @@ struct PulseAudioHandle { } }; -airtaudio::api::Pulse::~Pulse(void) { +airtaudio::api::Pulse::~Pulse() { if (m_stream.state != STREAM_CLOSED) { closeStream(); } } -uint32_t airtaudio::api::Pulse::getDeviceCount(void) { +uint32_t airtaudio::api::Pulse::getDeviceCount() { 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(m_stream.apiHandle); m_stream.callbackInfo.isRunning = false; if (pah) { @@ -130,7 +130,7 @@ enum airtaudio::errorType airtaudio::api::Pulse::closeStream(void) { return airtaudio::errorNone; } -void airtaudio::api::Pulse::callbackEvent(void) { +void airtaudio::api::Pulse::callbackEvent() { PulseAudioHandle *pah = static_cast(m_stream.apiHandle); if (m_stream.state == STREAM_STOPPED) { std::unique_lock lck(m_stream.mutex); @@ -208,7 +208,7 @@ unlock: return; } -enum airtaudio::errorType airtaudio::api::Pulse::startStream(void) { +enum airtaudio::errorType airtaudio::api::Pulse::startStream() { PulseAudioHandle *pah = static_cast(m_stream.apiHandle); if (m_stream.state == STREAM_CLOSED) { 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; } -enum airtaudio::errorType airtaudio::api::Pulse::stopStream(void) { +enum airtaudio::errorType airtaudio::api::Pulse::stopStream() { PulseAudioHandle *pah = static_cast(m_stream.apiHandle); if (m_stream.state == STREAM_CLOSED) { 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; } -enum airtaudio::errorType airtaudio::api::Pulse::abortStream(void) { +enum airtaudio::errorType airtaudio::api::Pulse::abortStream() { PulseAudioHandle *pah = static_cast(m_stream.apiHandle); if (m_stream.state == STREAM_CLOSED) { ATA_ERROR("airtaudio::api::Pulse::abortStream(): the stream is not open!"); diff --git a/airtaudio/api/Pulse.h b/airtaudio/api/Pulse.h index dfad2a3..bbbb443 100644 --- a/airtaudio/api/Pulse.h +++ b/airtaudio/api/Pulse.h @@ -13,26 +13,26 @@ namespace airtaudio { namespace api { class Pulse: public airtaudio::Api { public: - static airtaudio::Api* Create(void); + static airtaudio::Api* Create(); public: - ~Pulse(void); - airtaudio::api::type getCurrentApi(void) { + ~Pulse(); + airtaudio::api::type getCurrentApi() { return airtaudio::api::LINUX_PULSE; } - uint32_t getDeviceCount(void); + uint32_t getDeviceCount(); airtaudio::DeviceInfo getDeviceInfo(uint32_t _device); - enum airtaudio::errorType closeStream(void); - enum airtaudio::errorType startStream(void); - enum airtaudio::errorType stopStream(void); - enum airtaudio::errorType abortStream(void); + enum airtaudio::errorType closeStream(); + enum airtaudio::errorType startStream(); + enum airtaudio::errorType stopStream(); + enum airtaudio::errorType 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 callbackEvent(void); + void callbackEvent(); private: std::vector m_devices; - void saveDeviceInfo(void); + void saveDeviceInfo(); bool probeDeviceOpen(uint32_t _device, airtaudio::api::StreamMode _mode, uint32_t _channels, diff --git a/airtaudio/debug.cpp b/airtaudio/debug.cpp index 3dc9cc9..a472586 100644 --- a/airtaudio/debug.cpp +++ b/airtaudio/debug.cpp @@ -8,7 +8,7 @@ #include -int32_t airtaudio::getLogId(void) { +int32_t airtaudio::getLogId() { static int32_t g_val = etk::log::registerInstance("airtaudio"); return g_val; } diff --git a/airtaudio/debug.h b/airtaudio/debug.h index 63ae5cf..a9161ff 100644 --- a/airtaudio/debug.h +++ b/airtaudio/debug.h @@ -12,7 +12,7 @@ #include namespace airtaudio { - int32_t getLogId(void); + int32_t getLogId(); }; // TODO : Review this problem of multiple intanciation of "std::stringbuf sb" #define ATA_BASE(info,data) \ diff --git a/airtaudio/int24_t.h b/airtaudio/int24_t.h index 283af54..f7073bf 100644 --- a/airtaudio/int24_t.h +++ b/airtaudio/int24_t.h @@ -14,7 +14,7 @@ class int24_t { protected: uint8_t c3[3]; public: - int24_t(void) {} + int24_t() {} int24_t& operator = (const int32_t& i) { c3[0] = (i & 0x000000ff); c3[1] = (i & 0x0000ff00) >> 8; @@ -38,7 +38,7 @@ class int24_t { *this = (int32_t)c; } - int32_t asInt(void) { + int32_t asInt() { int32_t i = c3[0] | (c3[1] << 8) | (c3[2] << 16); if (i & 0x800000) { i |= ~0xffffff;