kwave  18.07.70
Kwave::RecordDevice Class Referenceabstract

#include <RecordDevice.h>

Inheritance diagram for Kwave::RecordDevice:
Inheritance graph
Collaboration diagram for Kwave::RecordDevice:
Collaboration graph

Public Member Functions

 RecordDevice ()
 
virtual ~RecordDevice ()
 
virtual QString open (const QString &dev)=0
 
virtual int read (QByteArray &buffer, unsigned int offset)=0
 
virtual int close ()=0
 
virtual QStringList supportedDevices ()=0
 
virtual QString fileFilter ()
 
virtual int detectTracks (unsigned int &min, unsigned int &max)=0
 
virtual int setTracks (unsigned int &tracks)=0
 
virtual int tracks ()=0
 
virtual QList< double > detectSampleRates ()=0
 
virtual int setSampleRate (double &new_rate)=0
 
virtual double sampleRate ()=0
 
virtual QList< Kwave::Compression::TypedetectCompressions ()=0
 
virtual int setCompression (Kwave::Compression::Type new_compression)=0
 
virtual Kwave::Compression::Type compression ()=0
 
virtual QList< unsigned int > supportedBits ()=0
 
virtual int setBitsPerSample (unsigned int new_bits)=0
 
virtual int bitsPerSample ()=0
 
virtual QList< Kwave::SampleFormat::FormatdetectSampleFormats ()=0
 
virtual int setSampleFormat (Kwave::SampleFormat::Format new_format)=0
 
virtual Kwave::SampleFormat::Format sampleFormat ()=0
 
virtual Kwave::byte_order_t endianness ()=0
 

Detailed Description

Definition at line 37 of file RecordDevice.h.

Constructor & Destructor Documentation

◆ RecordDevice()

Kwave::RecordDevice::RecordDevice ( )
inline

Constructor

Definition at line 42 of file RecordDevice.h.

42 {}

◆ ~RecordDevice()

virtual Kwave::RecordDevice::~RecordDevice ( )
inlinevirtual

Destructor

Definition at line 45 of file RecordDevice.h.

References close(), open(), read(), and supportedDevices().

45 {}
Here is the call graph for this function:

Member Function Documentation

◆ bitsPerSample()

virtual int Kwave::RecordDevice::bitsPerSample ( )
pure virtual

Returns the current resolution in bits per sample or a negative error code if failed

Implemented in Kwave::RecordALSA, Kwave::RecordOSS, Kwave::RecordPulseAudio, and Kwave::RecordQt.

Referenced by Kwave::RecordPlugin::changeBitsPerSample(), fileFilter(), Kwave::RecordPlugin::paramsValid(), and Kwave::RecordPlugin::setupRecordThread().

Here is the caller graph for this function:

◆ close()

virtual int Kwave::RecordDevice::close ( )
pure virtual

Close the device

Implemented in Kwave::RecordPulseAudio, Kwave::RecordQt, Kwave::RecordALSA, and Kwave::RecordOSS.

Referenced by Kwave::RecordPlugin::closeDevice(), and ~RecordDevice().

Here is the caller graph for this function:

◆ compression()

virtual Kwave::Compression::Type Kwave::RecordDevice::compression ( )
pure virtual

Returns the current compression type (0==none)

Implemented in Kwave::RecordALSA, Kwave::RecordOSS, Kwave::RecordPulseAudio, and Kwave::RecordQt.

Referenced by Kwave::RecordPlugin::changeCompression(), and fileFilter().

Here is the caller graph for this function:

◆ detectCompressions()

virtual QList<Kwave::Compression::Type> Kwave::RecordDevice::detectCompressions ( )
pure virtual

Gets a list of supported compression types. If no compression is supported, the list might be empty.

Implemented in Kwave::RecordPulseAudio, Kwave::RecordQt, Kwave::RecordALSA, and Kwave::RecordOSS.

Referenced by Kwave::RecordPlugin::changeCompression(), and fileFilter().

Here is the caller graph for this function:

◆ detectSampleFormats()

virtual QList<Kwave::SampleFormat::Format> Kwave::RecordDevice::detectSampleFormats ( )
pure virtual

Gets a list of supported sample formats.

Note
this depends on the current setting of the compression!

Implemented in Kwave::RecordALSA, Kwave::RecordOSS, Kwave::RecordPulseAudio, and Kwave::RecordQt.

Referenced by Kwave::RecordPlugin::changeSampleFormat(), and fileFilter().

Here is the caller graph for this function:

◆ detectSampleRates()

virtual QList<double> Kwave::RecordDevice::detectSampleRates ( )
pure virtual

get a list of supported sample rates

Implemented in Kwave::RecordPulseAudio, Kwave::RecordQt, Kwave::RecordALSA, and Kwave::RecordOSS.

Referenced by Kwave::RecordPlugin::changeSampleRate(), and fileFilter().

Here is the caller graph for this function:

◆ detectTracks()

virtual int Kwave::RecordDevice::detectTracks ( unsigned int &  min,
unsigned int &  max 
)
pure virtual

Detect the minimum and maximum number of tracks. If the detection fails, minimum and maximum are set to zero.

Parameters
minreceives the lowest supported number of tracks
maxreceives the highest supported number of tracks
Returns
zero or positive number if ok, negative error number if failed

Implemented in Kwave::RecordPulseAudio, Kwave::RecordQt, Kwave::RecordALSA, and Kwave::RecordOSS.

Referenced by Kwave::RecordPlugin::changeTracks(), and fileFilter().

Here is the caller graph for this function:

◆ endianness()

virtual Kwave::byte_order_t Kwave::RecordDevice::endianness ( )
pure virtual

Returns the current endianness (big/little)

Implemented in Kwave::RecordALSA, Kwave::RecordOSS, Kwave::RecordPulseAudio, and Kwave::RecordQt.

Referenced by fileFilter(), Kwave::RecordPlugin::paramsValid(), and Kwave::RecordPlugin::setupRecordThread().

Here is the caller graph for this function:

◆ fileFilter()

virtual QString Kwave::RecordDevice::fileFilter ( )
inlinevirtual

return a string suitable for a "File Open..." dialog

Reimplemented in Kwave::RecordOSS.

Definition at line 75 of file RecordDevice.h.

References _, bitsPerSample(), compression(), detectCompressions(), detectSampleFormats(), detectSampleRates(), detectTracks(), endianness(), sampleFormat(), sampleRate(), setBitsPerSample(), setCompression(), setSampleFormat(), setSampleRate(), setTracks(), supportedBits(), and tracks().

Referenced by Kwave::RecordPlugin::setMethod().

75 { return _(""); }
#define _(m)
Definition: memcpy.c:66
Here is the call graph for this function:
Here is the caller graph for this function:

◆ open()

virtual QString Kwave::RecordDevice::open ( const QString &  dev)
pure virtual

Open the record device.

Parameters
devpath of the record device
Return values
QString()if successful
QString::number(ENODEV)if device not found
QString::number(EBUSY)if device is busy
QString::number(EINVAL)on invalid parameters
QString(...)device specific error message (already translated)

Implemented in Kwave::RecordPulseAudio, Kwave::RecordQt, Kwave::RecordALSA, and Kwave::RecordOSS.

Referenced by Kwave::RecordPlugin::setDevice(), and ~RecordDevice().

Here is the caller graph for this function:

◆ read()

virtual int Kwave::RecordDevice::read ( QByteArray &  buffer,
unsigned int  offset 
)
pure virtual

Read the raw audio data from the record device.

Parameters
bufferarray of bytes to receive the audio data might be resized for alignment
offsetoffset in bytes within the buffer
Returns
number of bytes read, zero or negative if failed

Implemented in Kwave::RecordPulseAudio, Kwave::RecordQt, Kwave::RecordALSA, and Kwave::RecordOSS.

Referenced by Kwave::RecordThread::run(), and ~RecordDevice().

Here is the caller graph for this function:

◆ sampleFormat()

virtual Kwave::SampleFormat::Format Kwave::RecordDevice::sampleFormat ( )
pure virtual

Returns the current sample format (signed/unsigned)

Implemented in Kwave::RecordALSA, Kwave::RecordOSS, Kwave::RecordPulseAudio, and Kwave::RecordQt.

Referenced by Kwave::RecordPlugin::changeSampleFormat(), fileFilter(), Kwave::RecordPlugin::paramsValid(), and Kwave::RecordPlugin::setupRecordThread().

Here is the caller graph for this function:

◆ sampleRate()

virtual double Kwave::RecordDevice::sampleRate ( )
pure virtual

Returns the current sample rate of the device

Implemented in Kwave::RecordPulseAudio, Kwave::RecordQt, Kwave::RecordALSA, and Kwave::RecordOSS.

Referenced by Kwave::RecordPlugin::changeSampleRate(), and fileFilter().

Here is the caller graph for this function:

◆ setBitsPerSample()

virtual int Kwave::RecordDevice::setBitsPerSample ( unsigned int  new_bits)
pure virtual

Set the resolution in bits per sample

Parameters
new_bitsresolution [bits/sample]

Implemented in Kwave::RecordALSA, Kwave::RecordOSS, Kwave::RecordPulseAudio, and Kwave::RecordQt.

Referenced by Kwave::RecordPlugin::changeBitsPerSample(), and fileFilter().

Here is the caller graph for this function:

◆ setCompression()

virtual int Kwave::RecordDevice::setCompression ( Kwave::Compression::Type  new_compression)
pure virtual

Try to set a new compression type.

Parameters
new_compressionthe identifier of the new compression
Returns
zero on success, negative error code if failed
See also
class Kwave::Compression

Implemented in Kwave::RecordALSA, Kwave::RecordPulseAudio, Kwave::RecordOSS, and Kwave::RecordQt.

Referenced by Kwave::RecordPlugin::changeCompression(), and fileFilter().

Here is the caller graph for this function:

◆ setSampleFormat()

virtual int Kwave::RecordDevice::setSampleFormat ( Kwave::SampleFormat::Format  new_format)
pure virtual

Try to set a new sample format (signed/unsigned)

Parameters
new_formatthe identifier for the new format
Returns
zero on success, negative error code if failed
See also
class SampleFormat

Implemented in Kwave::RecordALSA, Kwave::RecordOSS, Kwave::RecordPulseAudio, and Kwave::RecordQt.

Referenced by Kwave::RecordPlugin::changeSampleFormat(), and fileFilter().

Here is the caller graph for this function:

◆ setSampleRate()

virtual int Kwave::RecordDevice::setSampleRate ( double &  new_rate)
pure virtual

Try to set a new sample rate.

Parameters
new_ratethe sample rate to be set [samples/second], can be modified and rounded up/down to the nearest supported sample rate if the underlying driver supports that.
Returns
zero on success, negative error code if failed

Implemented in Kwave::RecordPulseAudio, Kwave::RecordQt, Kwave::RecordALSA, and Kwave::RecordOSS.

Referenced by Kwave::RecordPlugin::changeSampleRate(), and fileFilter().

Here is the caller graph for this function:

◆ setTracks()

virtual int Kwave::RecordDevice::setTracks ( unsigned int &  tracks)
pure virtual

Try to set a new number of tracks.

Note
the device must be open
Parameters
tracksthe number of tracks to be set, can be modified and decreased to the next supported number of tracks if the underlying driver supports that.
Returns
zero on success, negative error code if failed

Implemented in Kwave::RecordPulseAudio, Kwave::RecordQt, Kwave::RecordALSA, and Kwave::RecordOSS.

Referenced by Kwave::RecordPlugin::changeTracks(), and fileFilter().

Here is the caller graph for this function:

◆ supportedBits()

virtual QList<unsigned int> Kwave::RecordDevice::supportedBits ( )
pure virtual

Detect a list of supported bits per sample.

Note
this depends on the compression type
Returns
a list of bits per sample, empty if failed

Implemented in Kwave::RecordALSA, Kwave::RecordOSS, Kwave::RecordPulseAudio, and Kwave::RecordQt.

Referenced by Kwave::RecordPlugin::changeBitsPerSample(), and fileFilter().

Here is the caller graph for this function:

◆ supportedDevices()

virtual QStringList Kwave::RecordDevice::supportedDevices ( )
pure virtual

return a string list with supported device names

Implemented in Kwave::RecordPulseAudio, Kwave::RecordQt, Kwave::RecordALSA, and Kwave::RecordOSS.

Referenced by Kwave::RecordPlugin::setDevice(), Kwave::RecordPlugin::setMethod(), and ~RecordDevice().

Here is the caller graph for this function:

◆ tracks()

virtual int Kwave::RecordDevice::tracks ( )
pure virtual

Returns the current number of tracks

Implemented in Kwave::RecordPulseAudio, Kwave::RecordQt, Kwave::RecordALSA, and Kwave::RecordOSS.

Referenced by Kwave::RecordPlugin::changeTracks(), and fileFilter().

Here is the caller graph for this function:

The documentation for this class was generated from the following file: