LMMS
Loading...
Searching...
No Matches
lmms::AudioAlsa Class Reference

#include <AudioAlsa.h>

Inheritance diagram for lmms::AudioAlsa:
lmms::AudioDevice

Classes

class  DeviceInfo
 Contains the relevant information about available ALSA devices. More...

Public Types

using DeviceInfoCollection = std::vector<DeviceInfo>

Public Member Functions

 AudioAlsa (bool &_success_ful, AudioEngine *audioEngine)
 ~AudioAlsa () override
Public Member Functions inherited from lmms::AudioDevice
 AudioDevice (const ch_cnt_t _channels, AudioEngine *audioEngine)
virtual ~AudioDevice ()
void lock ()
void unlock ()
virtual void registerPort (AudioBusHandle *port)
virtual void unregisterPort (AudioBusHandle *port)
virtual void renamePort (AudioBusHandle *port)
bool supportsCapture () const
sample_rate_t sampleRate () const
void processNextBuffer ()

Static Public Member Functions

static QString name ()
static QString probeDevice ()
static DeviceInfoCollection getAvailableDevices ()
 Creates a list of all available devices.

Private Member Functions

void startProcessing () override
void stopProcessing () override
void run () override
int setHWParams (const ch_cnt_t _channels, snd_pcm_access_t _access)
int setSWParams ()
int handleError (int _err)

Private Attributes

snd_pcm_t * m_handle
snd_pcm_uframes_t m_bufferSize
snd_pcm_uframes_t m_periodSize
snd_pcm_hw_params_t * m_hwParams
snd_pcm_sw_params_t * m_swParams
bool m_convertEndian

Additional Inherited Members

Protected Member Functions inherited from lmms::AudioDevice
virtual void writeBuffer (const SampleFrame *, const f_cnt_t)
f_cnt_t getNextBuffer (SampleFrame *_ab)
int convertToS16 (const SampleFrame *_ab, const f_cnt_t _frames, int_sample_t *_output_buffer, const bool _convert_endian=false)
void clearS16Buffer (int_sample_t *_outbuf, const f_cnt_t _frames)
ch_cnt_t channels () const
void setSampleRate (const sample_rate_t _new_sr)
void setChannels (const ch_cnt_t channels)
AudioEngineaudioEngine ()
Static Protected Member Functions inherited from lmms::AudioDevice
static void stopProcessingThread (QThread *thread)
Protected Attributes inherited from lmms::AudioDevice
bool m_supportsCapture

Member Typedef Documentation

◆ DeviceInfoCollection

Constructor & Destructor Documentation

◆ AudioAlsa()

lmms::AudioAlsa::AudioAlsa ( bool & _success_ful,
AudioEngine * audioEngine )

◆ ~AudioAlsa()

lmms::AudioAlsa::~AudioAlsa ( )
override

Member Function Documentation

◆ getAvailableDevices()

AudioAlsa::DeviceInfoCollection lmms::AudioAlsa::getAvailableDevices ( )
static

Creates a list of all available devices.

Uses the hints API of ALSA to collect all devices. This also includes plug devices. The reason to collect these and not the raw hardware devices (e.g. hw:0,0) is that hardware devices often have a very limited number of supported formats, etc. Plugs on the other hand are software components that map all types of formats and inputs to the hardware and therefore they are much more flexible and more what we want.

Further helpful info http://jan.newmarch.name/LinuxSound/Sampled/Alsa/.

Returns
A collection of devices found on the system.

◆ handleError()

int lmms::AudioAlsa::handleError ( int _err)
private

◆ name()

QString lmms::AudioAlsa::name ( )
inlinestatic

◆ probeDevice()

QString lmms::AudioAlsa::probeDevice ( )
static

◆ run()

void lmms::AudioAlsa::run ( )
overrideprivate

◆ setHWParams()

int lmms::AudioAlsa::setHWParams ( const ch_cnt_t _channels,
snd_pcm_access_t _access )
private

◆ setSWParams()

int lmms::AudioAlsa::setSWParams ( )
private

◆ startProcessing()

void lmms::AudioAlsa::startProcessing ( )
overrideprivatevirtual

Reimplemented from lmms::AudioDevice.

◆ stopProcessing()

void lmms::AudioAlsa::stopProcessing ( )
overrideprivatevirtual

Reimplemented from lmms::AudioDevice.

Member Data Documentation

◆ m_bufferSize

snd_pcm_uframes_t lmms::AudioAlsa::m_bufferSize
private

◆ m_convertEndian

bool lmms::AudioAlsa::m_convertEndian
private

◆ m_handle

snd_pcm_t* lmms::AudioAlsa::m_handle
private

◆ m_hwParams

snd_pcm_hw_params_t* lmms::AudioAlsa::m_hwParams
private

◆ m_periodSize

snd_pcm_uframes_t lmms::AudioAlsa::m_periodSize
private

◆ m_swParams

snd_pcm_sw_params_t* lmms::AudioAlsa::m_swParams
private

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