kwave
18.07.70
|
#include <PlayBack-OSS.h>
Public Member Functions | |
PlayBackOSS () | |
virtual | ~PlayBackOSS () Q_DECL_OVERRIDE |
virtual QString | open (const QString &device, double rate, unsigned int channels, unsigned int bits, unsigned int bufbase) Q_DECL_OVERRIDE |
virtual int | write (const Kwave::SampleArray &samples) Q_DECL_OVERRIDE |
virtual int | close () Q_DECL_OVERRIDE |
virtual QStringList | supportedDevices () Q_DECL_OVERRIDE |
virtual QString | fileFilter () Q_DECL_OVERRIDE |
virtual QList< unsigned int > | supportedBits (const QString &device) Q_DECL_OVERRIDE |
virtual int | detectChannels (const QString &device, unsigned int &min, unsigned int &max) Q_DECL_OVERRIDE |
![]() | |
virtual | ~PlayBackDevice () |
Protected Member Functions | |
void | format2mode (int format, int &compression, int &bits, Kwave::SampleFormat::Format &sample_format) const |
int | openDevice (const QString &device) |
void | flush () |
Protected Attributes | |
QString | m_device_name |
int | m_handle |
double | m_rate |
unsigned int | m_channels |
unsigned int | m_bits |
unsigned int | m_bufbase |
Kwave::SampleArray | m_buffer |
QByteArray | m_raw_buffer |
unsigned int | m_buffer_size |
unsigned int | m_buffer_used |
Kwave::SampleEncoder * | m_encoder |
int | m_oss_version |
Definition at line 37 of file PlayBack-OSS.h.
Kwave::PlayBackOSS::PlayBackOSS | ( | ) |
|
virtual |
Destructor
Definition at line 105 of file PlayBack-OSS.cpp.
References close().
|
virtual |
Closes the output device.
Implements Kwave::PlayBackDevice.
Definition at line 310 of file PlayBack-OSS.cpp.
References flush(), m_encoder, and m_handle.
Referenced by detectChannels(), supportedBits(), and ~PlayBackOSS().
|
virtual |
Detect the minimum and maximum number of channels. If the detection fails, minimum and maximum are set to zero.
device | filename of the device |
min | receives the lowest supported number of channels |
max | receives the highest supported number of channels |
Reimplemented from Kwave::PlayBackDevice.
Definition at line 572 of file PlayBack-OSS.cpp.
References close(), m_handle, MAX_CHANNELS, openDevice(), SNDCTL_DSP_CHANNELS, and Kwave::toInt().
|
virtual |
return a string suitable for a "File Open..." dialog
Reimplemented from Kwave::PlayBackDevice.
Definition at line 396 of file PlayBack-OSS.cpp.
References _.
|
protected |
Writes the output buffer to the device
Definition at line 293 of file PlayBack-OSS.cpp.
References Kwave::SampleEncoder::encode(), m_buffer, m_buffer_used, m_encoder, m_handle, m_raw_buffer, Kwave::SampleEncoder::rawBytesPerSample(), and write().
Referenced by close(), and write().
|
protected |
split a device format bitmask into its parameters. (copied from playback plugin)
format | the device specific format |
compression | receives a compression type |
bits | receives the number of bits per sample, related to the decoded stream |
sample_format | receives the sample format, as defined in libaudiofile (signed or unsigned) |
Definition at line 413 of file PlayBack-OSS.cpp.
References AFMT_S24_BE, AFMT_S24_LE, AFMT_S32_BE, AFMT_S32_LE, Kwave::Compression::G711_ALAW, Kwave::Compression::G711_ULAW, m_oss_version, Kwave::Compression::MPEG_LAYER_II, Kwave::Compression::MS_ADPCM, Kwave::Compression::NONE, Kwave::SampleFormat::Signed, Kwave::SampleFormat::Unknown, and Kwave::SampleFormat::Unsigned.
Referenced by supportedBits().
|
virtual |
Opens the device for playback.
Implements Kwave::PlayBackDevice.
Definition at line 111 of file PlayBack-OSS.cpp.
References _, AFMT_S24_LE, AFMT_S32_LE, DBG, Kwave::LittleEndian, m_bits, m_bufbase, m_buffer, m_buffer_size, m_buffer_used, m_channels, m_device_name, m_encoder, m_handle, m_oss_version, m_rate, m_raw_buffer, MAX_PLAYBACK_BUFFER, MIN_PLAYBACK_BUFFER, Kwave::SampleEncoder::rawBytesPerSample(), Kwave::SampleArray::resize(), Kwave::SampleFormat::Signed, SNDCTL_DSP_CHANNELS, SNDCTL_DSP_SETFMT, SNDCTL_DSP_SPEED, Kwave::toInt(), and Kwave::SampleFormat::Unsigned.
Referenced by openDevice().
|
protected |
Opens a physical device and returns its file descriptor
device | filename of the device |
Definition at line 492 of file PlayBack-OSS.cpp.
References DBG, m_handle, m_oss_version, and open().
Referenced by detectChannels(), and supportedBits().
|
virtual |
returns a list of supported bits per sample resolutions of a given device.
device | filename of the device |
Implements Kwave::PlayBackDevice.
Definition at line 525 of file PlayBack-OSS.cpp.
References close(), format2mode(), m_handle, Kwave::Compression::NONE, and openDevice().
|
virtual |
return a string list with supported device names
Reimplemented from Kwave::PlayBackDevice.
Definition at line 379 of file PlayBack-OSS.cpp.
References _, scanDirectory(), and scanFiles().
|
virtual |
Writes an array of samples to the output device.
Implements Kwave::PlayBackDevice.
Definition at line 259 of file PlayBack-OSS.cpp.
References flush(), m_buffer, m_buffer_size, m_buffer_used, MEMCPY, and Kwave::SampleArray::size().
Referenced by flush().
|
protected |
|
protected |
|
protected |
buffer with samples data
Definition at line 145 of file PlayBack-OSS.h.
|
protected |
Buffer size on bytes
Definition at line 151 of file PlayBack-OSS.h.
|
protected |
number of bytes in the buffer
Definition at line 154 of file PlayBack-OSS.h.
|
protected |
|
protected |
|
protected |
encoder for converting from samples to raw format
Definition at line 157 of file PlayBack-OSS.h.
|
protected |
Handle of the output device
Definition at line 130 of file PlayBack-OSS.h.
Referenced by close(), detectChannels(), flush(), open(), openDevice(), and supportedBits().
|
protected |
OSS driver version
Definition at line 160 of file PlayBack-OSS.h.
Referenced by format2mode(), open(), and openDevice().
|
protected |
|
protected |
buffer with raw data
Definition at line 148 of file PlayBack-OSS.h.