Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
CCoreAudioDevice Class Reference

#include <CoreAudioDevice.h>

Public Member Functions

 CCoreAudioDevice ()=default
 
 CCoreAudioDevice (AudioDeviceID deviceId)
 
virtual ~CCoreAudioDevice ()
 
bool Open (AudioDeviceID deviceId)
 
void Close ()
 
void Start ()
 
void Stop ()
 
void RemoveObjectListenerProc (AudioObjectPropertyListenerProc callback, void *pClientData)
 
bool SetObjectListenerProc (AudioObjectPropertyListenerProc callback, void *pClientData)
 
AudioDeviceID GetId () const
 
std::string GetName () const
 
bool IsDigital () const
 
UInt32 GetTransportType () const
 
UInt32 GetTotalOutputChannels () const
 
UInt32 GetNumChannelsOfStream (UInt32 streamIdx) const
 
bool GetStreams (AudioStreamIdList *pList)
 
bool IsRunning ()
 
bool SetHogStatus (bool hog)
 
pid_t GetHogStatus ()
 
bool SetMixingSupport (UInt32 mix)
 
bool GetMixingSupport ()
 
bool SetCurrentVolume (Float32 vol)
 
bool GetPreferredChannelLayout (CCoreAudioChannelLayout &layout) const
 
bool GetPreferredChannelLayoutForStereo (CCoreAudioChannelLayout &layout) const
 
bool GetDataSources (CoreAudioDataSourceList *pList) const
 
bool GetDataSource (UInt32 &dataSourceId) const
 
bool SetDataSource (UInt32 &dataSourceId)
 
std::string GetDataSourceName (UInt32 dataSourceId) const
 
std::string GetCurrentDataSourceName () const
 
Float64 GetNominalSampleRate ()
 
bool SetNominalSampleRate (Float64 sampleRate)
 
UInt32 GetNumLatencyFrames ()
 
UInt32 GetBufferSize ()
 
bool SetBufferSize (UInt32 size)
 
bool AddIOProc (AudioDeviceIOProc ioProc, void *pCallbackData)
 
bool RemoveIOProc ()
 

Static Public Member Functions

static void RegisterDeviceChangedCB (bool bRegister, AudioObjectPropertyListenerProc callback, void *ref)
 
static void RegisterDefaultOutputDeviceChangedCB (bool bRegister, AudioObjectPropertyListenerProc callback, void *ref)
 
static void SuppressDefaultOutputDeviceCB (unsigned int suppressTimeMs)
 

Static Protected Member Functions

static OSStatus defaultOutputDeviceChanged (AudioObjectID inObjectID, UInt32 inNumberAddresses, const AudioObjectPropertyAddress inAddresses[], void *inClientData)
 

Protected Attributes

bool m_Started = false
 
AudioDeviceID m_DeviceId = 0
 
int m_MixerRestore = -1
 
AudioDeviceIOProc m_IoProc = nullptr
 
AudioObjectPropertyListenerProc m_ObjectListenerProc = nullptr
 
Float64 m_SampleRateRestore = 0.0
 
pid_t m_HogPid = -1
 
unsigned int m_frameSize = 0
 
unsigned int m_OutputBufferIndex = 0
 
unsigned int m_BufferSizeRestore = 0
 

Static Protected Attributes

static XbmcThreads::EndTime m_callbackSuppressTimer
 
static AudioObjectPropertyListenerProc m_defaultOutputDeviceChangedCB = NULL
 

Constructor & Destructor Documentation

◆ CCoreAudioDevice() [1/2]

CCoreAudioDevice::CCoreAudioDevice ( )
default

◆ CCoreAudioDevice() [2/2]

CCoreAudioDevice::CCoreAudioDevice ( AudioDeviceID deviceId)
explicit

◆ ~CCoreAudioDevice()

CCoreAudioDevice::~CCoreAudioDevice ( )
virtual

Member Function Documentation

◆ AddIOProc()

bool CCoreAudioDevice::AddIOProc ( AudioDeviceIOProc ioProc,
void * pCallbackData )

◆ Close()

void CCoreAudioDevice::Close ( )

◆ defaultOutputDeviceChanged()

OSStatus CCoreAudioDevice::defaultOutputDeviceChanged ( AudioObjectID inObjectID,
UInt32 inNumberAddresses,
const AudioObjectPropertyAddress inAddresses[],
void * inClientData )
staticprotected

◆ GetBufferSize()

UInt32 CCoreAudioDevice::GetBufferSize ( )

◆ GetCurrentDataSourceName()

std::string CCoreAudioDevice::GetCurrentDataSourceName ( ) const

◆ GetDataSource()

bool CCoreAudioDevice::GetDataSource ( UInt32 & dataSourceId) const

◆ GetDataSourceName()

std::string CCoreAudioDevice::GetDataSourceName ( UInt32 dataSourceId) const

◆ GetDataSources()

bool CCoreAudioDevice::GetDataSources ( CoreAudioDataSourceList * pList) const

◆ GetHogStatus()

pid_t CCoreAudioDevice::GetHogStatus ( )

◆ GetId()

AudioDeviceID CCoreAudioDevice::GetId ( ) const
inline

◆ GetMixingSupport()

bool CCoreAudioDevice::GetMixingSupport ( )

◆ GetName()

std::string CCoreAudioDevice::GetName ( ) const

◆ GetNominalSampleRate()

Float64 CCoreAudioDevice::GetNominalSampleRate ( )

◆ GetNumChannelsOfStream()

UInt32 CCoreAudioDevice::GetNumChannelsOfStream ( UInt32 streamIdx) const

◆ GetNumLatencyFrames()

UInt32 CCoreAudioDevice::GetNumLatencyFrames ( )

◆ GetPreferredChannelLayout()

bool CCoreAudioDevice::GetPreferredChannelLayout ( CCoreAudioChannelLayout & layout) const

◆ GetPreferredChannelLayoutForStereo()

bool CCoreAudioDevice::GetPreferredChannelLayoutForStereo ( CCoreAudioChannelLayout & layout) const

◆ GetStreams()

bool CCoreAudioDevice::GetStreams ( AudioStreamIdList * pList)

◆ GetTotalOutputChannels()

UInt32 CCoreAudioDevice::GetTotalOutputChannels ( ) const

◆ GetTransportType()

UInt32 CCoreAudioDevice::GetTransportType ( ) const

◆ IsDigital()

bool CCoreAudioDevice::IsDigital ( ) const

◆ IsRunning()

bool CCoreAudioDevice::IsRunning ( )

◆ Open()

bool CCoreAudioDevice::Open ( AudioDeviceID deviceId)

◆ RegisterDefaultOutputDeviceChangedCB()

void CCoreAudioDevice::RegisterDefaultOutputDeviceChangedCB ( bool bRegister,
AudioObjectPropertyListenerProc callback,
void * ref )
static

◆ RegisterDeviceChangedCB()

void CCoreAudioDevice::RegisterDeviceChangedCB ( bool bRegister,
AudioObjectPropertyListenerProc callback,
void * ref )
static

◆ RemoveIOProc()

bool CCoreAudioDevice::RemoveIOProc ( )

◆ RemoveObjectListenerProc()

void CCoreAudioDevice::RemoveObjectListenerProc ( AudioObjectPropertyListenerProc callback,
void * pClientData )

◆ SetBufferSize()

bool CCoreAudioDevice::SetBufferSize ( UInt32 size)

◆ SetCurrentVolume()

bool CCoreAudioDevice::SetCurrentVolume ( Float32 vol)

◆ SetDataSource()

bool CCoreAudioDevice::SetDataSource ( UInt32 & dataSourceId)

◆ SetHogStatus()

bool CCoreAudioDevice::SetHogStatus ( bool hog)

◆ SetMixingSupport()

bool CCoreAudioDevice::SetMixingSupport ( UInt32 mix)

◆ SetNominalSampleRate()

bool CCoreAudioDevice::SetNominalSampleRate ( Float64 sampleRate)

◆ SetObjectListenerProc()

bool CCoreAudioDevice::SetObjectListenerProc ( AudioObjectPropertyListenerProc callback,
void * pClientData )

◆ Start()

void CCoreAudioDevice::Start ( )

◆ Stop()

void CCoreAudioDevice::Stop ( )

◆ SuppressDefaultOutputDeviceCB()

static void CCoreAudioDevice::SuppressDefaultOutputDeviceCB ( unsigned int suppressTimeMs)
inlinestatic

Member Data Documentation

◆ m_BufferSizeRestore

unsigned int CCoreAudioDevice::m_BufferSizeRestore = 0
protected

◆ m_callbackSuppressTimer

XbmcThreads::EndTime CCoreAudioDevice::m_callbackSuppressTimer
staticprotected

◆ m_defaultOutputDeviceChangedCB

AudioObjectPropertyListenerProc CCoreAudioDevice::m_defaultOutputDeviceChangedCB = NULL
staticprotected

◆ m_DeviceId

AudioDeviceID CCoreAudioDevice::m_DeviceId = 0
protected

◆ m_frameSize

unsigned int CCoreAudioDevice::m_frameSize = 0
protected

◆ m_HogPid

pid_t CCoreAudioDevice::m_HogPid = -1
protected

◆ m_IoProc

AudioDeviceIOProc CCoreAudioDevice::m_IoProc = nullptr
protected

◆ m_MixerRestore

int CCoreAudioDevice::m_MixerRestore = -1
protected

◆ m_ObjectListenerProc

AudioObjectPropertyListenerProc CCoreAudioDevice::m_ObjectListenerProc = nullptr
protected

◆ m_OutputBufferIndex

unsigned int CCoreAudioDevice::m_OutputBufferIndex = 0
protected

◆ m_SampleRateRestore

Float64 CCoreAudioDevice::m_SampleRateRestore = 0.0
protected

◆ m_Started

bool CCoreAudioDevice::m_Started = false
protected

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