MythTV  master
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
AudioOutputSettings Class Reference

#include <audiooutputsettings.h>

Collaboration diagram for AudioOutputSettings:
Collaboration graph
[legend]

Public Member Functions

 AudioOutputSettings (bool invalid=false)
 
 AudioOutputSettings (const AudioOutputSettings &)=default
 
 ~AudioOutputSettings ()
 
AudioOutputSettingsoperator= (const AudioOutputSettings &)
 
AudioOutputSettingsGetCleaned (bool newcopy=false)
 Returns capabilities supported by the audio device amended to take into account the digital audio options (AC3 and DTS) Warning: do not call it twice in a row, will lead to invalid settings. More...
 
AudioOutputSettingsGetUsers (bool newcopy=false)
 Returns capabilities supported by the audio device amended to take into account the digital audio options (AC3 and DTS) as well as the user settings If newcopy = false, assume GetCleaned was called before hand. More...
 
int GetNextRate ()
 
void AddSupportedRate (int rate)
 
bool IsSupportedRate (int rate)
 
int NearestSupportedRate (int rate)
 
int BestSupportedRate ()
 
AudioFormat GetNextFormat ()
 
void AddSupportedFormat (AudioFormat format)
 
bool IsSupportedFormat (AudioFormat format)
 
AudioFormat BestSupportedFormat ()
 
void AddSupportedChannels (int channels)
 
bool IsSupportedChannels (int channels)
 
int BestSupportedChannels ()
 
void setPassthrough (int val)
 
int canPassthrough ()
 
bool canFeature (DigitalFeature arg)
 return DigitalFeature mask. More...
 
bool canFeature (unsigned int arg)
 
bool canAC3 ()
 return true if device can or may support AC3 (deprecated, see canFeature()) More...
 
bool canDTS ()
 return true if device can or may support DTS (deprecated, see canFeature()) More...
 
bool canLPCM ()
 return true if device supports multichannels PCM (deprecated, see canFeature()) More...
 
bool IsInvalid ()
 return true if class instance is marked invalid. More...
 
void setFeature (DigitalFeature arg)
 set the provided digital feature possible values are: More...
 
void setFeature (unsigned int arg)
 
void setFeature (bool val, DigitalFeature arg)
 clear or set digital feature internal mask More...
 
void setFeature (bool val, int arg)
 
void SetBestSupportedChannels (int channels)
 Force set the greatest number of channels supported by the audio device. More...
 
int GetMaxHDRate ()
 return the highest iec958 rate supported. More...
 
QString FeaturesToString (DigitalFeature arg)
 Display in human readable form the digital features supported by the output device. More...
 
QString FeaturesToString (void)
 
bool hasELD ()
 get the ELD flag More...
 
bool hasValidELD ()
 
void setELD (QByteArray *ba)
 set ELD data More...
 
ELDgetELD (void)
 retrieve ELD data More...
 
int BestSupportedChannelsELD ()
 Reports best supported channel number, restricted to ELD range. More...
 
int BestSupportedPCMChannelsELD ()
 Reports best supported PCM channel number, restricted to ELD. More...
 

Static Public Member Functions

static int FormatToBits (AudioFormat format)
 
static const char * FormatToString (AudioFormat format)
 
static int SampleSize (AudioFormat format)
 
static AudioFormat AVSampleFormatToFormat (AVSampleFormat format, int bits=0)
 Return AVSampleFormat closest equivalent to AudioFormat. More...
 
static AVSampleFormat FormatToAVSampleFormat (AudioFormat format)
 Return AudioFormat closest equivalent to AVSampleFormat Note that FORMAT_S24LSB and FORMAT_S24 have no direct equivalent use S32 instead. More...
 
static QString GetPassthroughParams (int codec, int codec_profile, int &samplerate, int &channels, bool canDTSHDMA)
 Setup samplerate and number of channels for passthrough. More...
 

Private Member Functions

void SortSupportedChannels ()
 

Private Attributes

int m_passthrough {-1}
 passthrough status -1 : no 0: unknown 1: yes More...
 
unsigned int m_features {FEATURE_NONE}
 
bool m_invalid {false}
 
bool m_has_eld {false}
 will be set to true if we were able to retrieve the device ELD (EDID like Data). More...
 
ELD m_eld
 
std::vector< int > m_sr
 
std::vector< int > m_rates
 
std::vector< int > m_channels
 
std::vector< AudioFormatm_sf
 
std::vector< AudioFormatm_formats
 
std::vector< int >::iterator m_sr_it
 
std::vector< AudioFormat >::iterator m_sf_it
 

Detailed Description

Definition at line 51 of file audiooutputsettings.h.

Constructor & Destructor Documentation

◆ AudioOutputSettings() [1/2]

AudioOutputSettings::AudioOutputSettings ( bool  invalid = false)
explicit

Definition at line 24 of file audiooutputsettings.cpp.

Referenced by GetCleaned().

◆ AudioOutputSettings() [2/2]

AudioOutputSettings::AudioOutputSettings ( const AudioOutputSettings )
default

◆ ~AudioOutputSettings()

AudioOutputSettings::~AudioOutputSettings ( )

Definition at line 35 of file audiooutputsettings.cpp.

Member Function Documentation

◆ operator=()

AudioOutputSettings & AudioOutputSettings::operator= ( const AudioOutputSettings rhs)

Definition at line 44 of file audiooutputsettings.cpp.

◆ GetCleaned()

AudioOutputSettings * AudioOutputSettings::GetCleaned ( bool  newcopy = false)

Returns capabilities supported by the audio device amended to take into account the digital audio options (AC3 and DTS) Warning: do not call it twice in a row, will lead to invalid settings.

Definition at line 319 of file audiooutputsettings.cpp.

Referenced by AudioOutputBase::GetOutputSettingsCleaned(), and GetUsers().

◆ GetUsers()

AudioOutputSettings * AudioOutputSettings::GetUsers ( bool  newcopy = false)

Returns capabilities supported by the audio device amended to take into account the digital audio options (AC3 and DTS) as well as the user settings If newcopy = false, assume GetCleaned was called before hand.

Definition at line 378 of file audiooutputsettings.cpp.

Referenced by AudioOutputBase::GetOutputSettingsUsers().

◆ GetNextRate()

int AudioOutputSettings::GetNextRate ( )

◆ AddSupportedRate()

void AudioOutputSettings::AddSupportedRate ( int  rate)

◆ IsSupportedRate()

bool AudioOutputSettings::IsSupportedRate ( int  rate)

Definition at line 82 of file audiooutputsettings.cpp.

Referenced by AudioOutputBase::CanPassthrough(), and GetCleaned().

◆ NearestSupportedRate()

int AudioOutputSettings::NearestSupportedRate ( int  rate)

Definition at line 103 of file audiooutputsettings.cpp.

Referenced by AudioOutputBase::Reconfigure().

◆ BestSupportedRate()

int AudioOutputSettings::BestSupportedRate ( )

Definition at line 96 of file audiooutputsettings.cpp.

Referenced by AudioTestThread::AudioTestThread().

◆ GetNextFormat()

AudioFormat AudioOutputSettings::GetNextFormat ( )

◆ AddSupportedFormat()

void AudioOutputSettings::AddSupportedFormat ( AudioFormat  format)

◆ IsSupportedFormat()

bool AudioOutputSettings::IsSupportedFormat ( AudioFormat  format)

Definition at line 138 of file audiooutputsettings.cpp.

Referenced by AudioOutputBase::CanPassthrough(), and GetCleaned().

◆ BestSupportedFormat()

AudioFormat AudioOutputSettings::BestSupportedFormat ( )

◆ FormatToBits()

int AudioOutputSettings::FormatToBits ( AudioFormat  format)
static

◆ FormatToString()

const char * AudioOutputSettings::FormatToString ( AudioFormat  format)
static

◆ SampleSize()

int AudioOutputSettings::SampleSize ( AudioFormat  format)
static

◆ AVSampleFormatToFormat()

AudioFormat AudioOutputSettings::AVSampleFormatToFormat ( AVSampleFormat  format,
int  bits = 0 
)
static

◆ FormatToAVSampleFormat()

AVSampleFormat AudioOutputSettings::FormatToAVSampleFormat ( AudioFormat  format)
static

Return AudioFormat closest equivalent to AVSampleFormat Note that FORMAT_S24LSB and FORMAT_S24 have no direct equivalent use S32 instead.

Definition at line 232 of file audiooutputsettings.cpp.

Referenced by AudioConvert::Process().

◆ AddSupportedChannels()

void AudioOutputSettings::AddSupportedChannels ( int  channels)

◆ IsSupportedChannels()

bool AudioOutputSettings::IsSupportedChannels ( int  channels)

◆ BestSupportedChannels()

int AudioOutputSettings::BestSupportedChannels ( )

◆ setPassthrough()

void AudioOutputSettings::setPassthrough ( int  val)
inline

◆ canPassthrough()

int AudioOutputSettings::canPassthrough ( )
inline

◆ canFeature() [1/2]

bool AudioOutputSettings::canFeature ( DigitalFeature  arg)
inline

return DigitalFeature mask.

possible values are:

  • FEATURE_AC3
  • FEATURE_DTS
  • FEATURE_LPCM
  • FEATURE_EAC3
  • FEATURE_TRUEHD
  • FEATURE_DTSHD

Definition at line 91 of file audiooutputsettings.h.

Referenced by AudioOutputBase::CanPassthrough(), GetMaxHDRate(), GetUsers(), AudioOutputBase::Reconfigure(), AudioOutputBase::SetupPassthrough(), TestDigitalFeature(), AudioConfigSettings::UpdateCapabilities(), and AudioSetupWizard::UpdateCapabilities().

◆ canFeature() [2/2]

bool AudioOutputSettings::canFeature ( unsigned int  arg)
inline

Definition at line 93 of file audiooutputsettings.h.

◆ canAC3()

bool AudioOutputSettings::canAC3 ( )
inline

return true if device can or may support AC3 (deprecated, see canFeature())

Definition at line 100 of file audiooutputsettings.h.

Referenced by AudioOutput::GetAudioDeviceConfig().

◆ canDTS()

bool AudioOutputSettings::canDTS ( )
inline

return true if device can or may support DTS (deprecated, see canFeature())

Definition at line 105 of file audiooutputsettings.h.

Referenced by AudioOutput::GetAudioDeviceConfig().

◆ canLPCM()

bool AudioOutputSettings::canLPCM ( )
inline

return true if device supports multichannels PCM (deprecated, see canFeature())

Definition at line 110 of file audiooutputsettings.h.

Referenced by AudioOutput::GetAudioDeviceConfig().

◆ IsInvalid()

bool AudioOutputSettings::IsInvalid ( )
inline

return true if class instance is marked invalid.

if true, you can not assume any of the other method returned values are valid

Definition at line 116 of file audiooutputsettings.h.

Referenced by AudioConfigSettings::CheckConfiguration(), AudioConfigSettings::CheckPassthrough(), AudioOutput::GetAudioDeviceConfig(), and AudioSetupWizard::Init().

◆ setFeature() [1/4]

void AudioOutputSettings::setFeature ( DigitalFeature  arg)
inline

set the provided digital feature possible values are:

  • FEATURE_AC3
  • FEATURE_DTS
  • FEATURE_LPCM
  • FEATURE_EAC3
  • FEATURE_TRUEHD
  • FEATURE_DTSHD

Definition at line 128 of file audiooutputsettings.h.

Referenced by GetCleaned(), AudioOutputOMX::GetOutputSettings(), GetUsers(), setFeature(), AudioConfigSettings::UpdateCapabilities(), and AudioSetupWizard::UpdateCapabilities().

◆ setFeature() [2/4]

void AudioOutputSettings::setFeature ( unsigned int  arg)
inline

Definition at line 129 of file audiooutputsettings.h.

◆ setFeature() [3/4]

void AudioOutputSettings::setFeature ( bool  val,
DigitalFeature  arg 
)

clear or set digital feature internal mask

Definition at line 308 of file audiooutputsettings.cpp.

◆ setFeature() [4/4]

void AudioOutputSettings::setFeature ( bool  val,
int  arg 
)

Definition at line 300 of file audiooutputsettings.cpp.

◆ SetBestSupportedChannels()

void AudioOutputSettings::SetBestSupportedChannels ( int  channels)

Force set the greatest number of channels supported by the audio device.

Definition at line 281 of file audiooutputsettings.cpp.

Referenced by GetUsers(), AudioConfigSettings::UpdateCapabilities(), and AudioSetupWizard::UpdateCapabilities().

◆ GetMaxHDRate()

int AudioOutputSettings::GetMaxHDRate ( )

return the highest iec958 rate supported.

return 0 if no HD rate are supported

Definition at line 435 of file audiooutputsettings.cpp.

Referenced by AudioPlayer::GetMaxHDRate(), and AudioOutputBase::SetupPassthrough().

◆ FeaturesToString() [1/2]

QString AudioOutputSettings::FeaturesToString ( DigitalFeature  arg)

Display in human readable form the digital features supported by the output device.

Definition at line 451 of file audiooutputsettings.cpp.

Referenced by AudioOutputBase::Reconfigure().

◆ FeaturesToString() [2/2]

QString AudioOutputSettings::FeaturesToString ( void  )
inline

Definition at line 154 of file audiooutputsettings.h.

◆ GetPassthroughParams()

QString AudioOutputSettings::GetPassthroughParams ( int  codec,
int  codec_profile,
int &  samplerate,
int &  channels,
bool  canDTSHDMA 
)
static

Setup samplerate and number of channels for passthrough.

Definition at line 483 of file audiooutputsettings.cpp.

Referenced by AudioOutputBase::SetupPassthrough().

◆ hasELD()

bool AudioOutputSettings::hasELD ( )

get the ELD flag

Definition at line 563 of file audiooutputsettings.cpp.

Referenced by AudioOutput::GetAudioDeviceConfig().

◆ hasValidELD()

bool AudioOutputSettings::hasValidELD ( )

◆ setELD()

void AudioOutputSettings::setELD ( QByteArray *  ba)

set ELD data

Definition at line 568 of file audiooutputsettings.cpp.

Referenced by AudioOutputALSA::GetOutputSettings().

◆ getELD()

ELD& AudioOutputSettings::getELD ( void  )
inline

retrieve ELD data

Definition at line 178 of file audiooutputsettings.h.

Referenced by AudioOutput::GetAudioDeviceConfig().

◆ BestSupportedChannelsELD()

int AudioOutputSettings::BestSupportedChannelsELD ( )

Reports best supported channel number, restricted to ELD range.

Definition at line 575 of file audiooutputsettings.cpp.

Referenced by AudioOutput::GetAudioDeviceConfig().

◆ BestSupportedPCMChannelsELD()

int AudioOutputSettings::BestSupportedPCMChannelsELD ( )

Reports best supported PCM channel number, restricted to ELD.

Definition at line 584 of file audiooutputsettings.cpp.

Referenced by GetCleaned().

◆ SortSupportedChannels()

void AudioOutputSettings::SortSupportedChannels ( )
private

Definition at line 274 of file audiooutputsettings.cpp.

Member Data Documentation

◆ m_passthrough

int AudioOutputSettings::m_passthrough {-1}
private

passthrough status -1 : no 0: unknown 1: yes

Definition at line 196 of file audiooutputsettings.h.

Referenced by GetCleaned(), and operator=().

◆ m_features

unsigned int AudioOutputSettings::m_features {FEATURE_NONE}
private

Definition at line 198 of file audiooutputsettings.h.

Referenced by operator=(), and setFeature().

◆ m_invalid

bool AudioOutputSettings::m_invalid {false}
private

Definition at line 200 of file audiooutputsettings.h.

Referenced by GetCleaned(), GetUsers(), and operator=().

◆ m_has_eld

bool AudioOutputSettings::m_has_eld {false}
private

will be set to true if we were able to retrieve the device ELD (EDID like Data).

ELD contains information about the audio processing capabilities of the device connected to the audio card ELD is usually retrieved from EDID CEA-861-E extension.

Definition at line 207 of file audiooutputsettings.h.

Referenced by hasELD(), hasValidELD(), operator=(), and setELD().

◆ m_eld

ELD AudioOutputSettings::m_eld
private

◆ m_sr

std::vector<int> AudioOutputSettings::m_sr
private

◆ m_rates

std::vector<int> AudioOutputSettings::m_rates
private

◆ m_channels

std::vector<int> AudioOutputSettings::m_channels
private

◆ m_sf

std::vector<AudioFormat> AudioOutputSettings::m_sf
private

◆ m_formats

std::vector<AudioFormat> AudioOutputSettings::m_formats
private

◆ m_sr_it

std::vector<int>::iterator AudioOutputSettings::m_sr_it
private

Definition at line 212 of file audiooutputsettings.h.

Referenced by AudioOutputSettings(), GetNextRate(), and operator=().

◆ m_sf_it

std::vector<AudioFormat>::iterator AudioOutputSettings::m_sf_it
private

Definition at line 213 of file audiooutputsettings.h.

Referenced by AudioOutputSettings(), GetNextFormat(), and operator=().


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