From: bruceperens Date: Tue, 22 Apr 2014 01:25:43 +0000 (+0000) Subject: Implement audio device start/stop functions. X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=548f4e9c63270535fdd669f20222cc0343e466df;p=freetel-svn-tracking.git Implement audio device start/stop functions. git-svn-id: https://svn.code.sf.net/p/freetel/code@1541 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/freedv-server/source/audio_device.cpp b/freedv-server/source/audio_device.cpp index d02affa9..a4c712e1 100644 --- a/freedv-server/source/audio_device.cpp +++ b/freedv-server/source/audio_device.cpp @@ -32,4 +32,15 @@ namespace FreeDV { "Amplitude set to value outside of the range 0.0..1.0"); master_amplitude = value; } + + void + AudioDevice::start() + { + } + + void + AudioDevice::stop() + { + } + } diff --git a/freedv-server/source/drivers.h b/freedv-server/source/drivers.h index d92c92a3..e49e6497 100644 --- a/freedv-server/source/drivers.h +++ b/freedv-server/source/drivers.h @@ -298,6 +298,19 @@ public: /// \param value The new value for the current audio level. /// The value must be normalized within the range of 0.0 to 1.0. virtual void amplitude(float value); + + /// Start the audio device. + /// Input devices: start digitizing samples for the program to subsequently + /// read. + /// Output devices: prepare for samples to be sent. + /// The default implementation of this function does nothing. + virtual void start(); + + /// Stop the audio device. + /// Input devices: stop digitizing samples. + /// Output devices: stop playing samples. + /// The default implementation of this function does nothing. + virtual void stop(); }; /// Virtual base class for audio input drivers. @@ -324,6 +337,7 @@ public: /// \return The number of 16-bit audio samples that were actually read. /// This may be smaller than *length*, or it may be zero. virtual std::size_t + read16(std::int16_t * array, std::size_t length) = 0; };