Skip to content

Commit

Permalink
[cosmetics] - whitespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Memphiz committed Aug 14, 2012
1 parent 4ccd363 commit 688eaf2
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 49 deletions.
14 changes: 7 additions & 7 deletions xbmc/cores/AudioEngine/Engines/CoreAudio/CoreAudioAE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ void CCoreAudioAE::SetVolume(float volume)
// we need this because m_volume is init'ed via
// SetVolume and need to also init m_volumeBeforeMute.
if (!m_muted)
m_volumeBeforeMute = volume;
m_volumeBeforeMute = volume;

HAL->SetVolume(m_volume);
}
Expand All @@ -376,7 +376,7 @@ void CCoreAudioAE::SetMute(const bool enabled)
m_muted = enabled;
if(m_muted)
{
m_volumeBeforeMute = m_volume;
m_volumeBeforeMute = m_volume;
SetVolume(VOLUME_MINIMUM);
}
else
Expand All @@ -393,10 +393,10 @@ bool CCoreAudioAE::IsMuted()
void CCoreAudioAE::SetSoundMode(const int mode)
{
m_soundMode = mode;

/* stop all currently playing sounds if they are being turned off */
if (mode == AE_SOUND_OFF || (mode == AE_SOUND_IDLE && m_streamsPlaying))
StopAllSounds();
StopAllSounds();
}

bool CCoreAudioAE::SupportsRaw()
Expand Down Expand Up @@ -436,7 +436,7 @@ IAEStream* CCoreAudioAE::MakeStream(enum AEDataFormat dataFormat,

Start();

m_streamsPlaying = true;
m_streamsPlaying = true;

return stream;
}
Expand Down Expand Up @@ -467,7 +467,7 @@ IAEStream* CCoreAudioAE::FreeStream(IAEStream *stream)
m_streamsPlaying = !m_streams.empty();

streamLock.Leave();

// When we have been in passthrough mode, reinit the hardware to come back to anlog out
if (/*m_streams.empty() || */ m_rawPassthrough)
{
Expand Down Expand Up @@ -633,7 +633,7 @@ OSStatus CCoreAudioAE::OnRender(AudioUnitRenderActionFlags *actionFlags,
//int size = frames * HAL->m_BytesPerFrame;

for (UInt32 i = 0; i < ioData->mNumberBuffers; i++)
bzero(ioData->mBuffers[i].mData, ioData->mBuffers[i].mDataByteSize);
bzero(ioData->mBuffers[i].mData, ioData->mBuffers[i].mDataByteSize);

if (!m_Initialized)
{
Expand Down
36 changes: 18 additions & 18 deletions xbmc/cores/AudioEngine/Engines/CoreAudio/CoreAudioAE.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class CCoreAudioAE : public IAE, public ICoreAudioSource
// Give the HAL access to the engine
friend class CCoreAudioAEHAL;
CCoreAudioAEHAL *HAL;

public:
virtual void Shutdown();

Expand All @@ -88,19 +88,19 @@ class CCoreAudioAE : public IAE, public ICoreAudioSource
virtual void SetMute(const bool enabled);
virtual bool IsMuted();
virtual void SetSoundMode(const int mode);


virtual bool SupportsRaw();

CCoreAudioAEHAL* GetHAL();

// returns a new stream for data in the specified format
virtual IAEStream* MakeStream(enum AEDataFormat dataFormat,
virtual IAEStream* MakeStream(enum AEDataFormat dataFormat,
unsigned int sampleRate,unsigned int encodedSamplerate,
CAEChannelInfo channelLayout, unsigned int options = 0);

virtual IAEStream* FreeStream(IAEStream *stream);

// returns a new sound object
virtual IAESound* MakeSound(const std::string& file);
void StopAllSounds();
Expand All @@ -114,17 +114,17 @@ class CCoreAudioAE : public IAE, public ICoreAudioSource

virtual void EnumerateOutputDevices(AEDeviceList &devices, bool passthrough);

virtual OSStatus Render(AudioUnitRenderActionFlags* actionFlags,
const AudioTimeStamp* pTimeStamp, UInt32 busNumber,
virtual OSStatus Render(AudioUnitRenderActionFlags* actionFlags,
const AudioTimeStamp* pTimeStamp, UInt32 busNumber,
UInt32 frameCount, AudioBufferList* pBufList);


private:
CCriticalSection m_callbackLock;
CCriticalSection m_streamLock;
CCriticalSection m_soundLock;
CCriticalSection m_soundSampleLock;

// currently playing sounds
typedef struct {
CCoreAudioAESound *owner;
Expand All @@ -139,29 +139,29 @@ class CCoreAudioAE : public IAE, public ICoreAudioSource
StreamList m_streams;
SoundList m_sounds;
SoundStateList m_playing_sounds;

// Prevent multiple init/deinit
bool m_Initialized;
bool m_callbackRunning;

AEAudioFormat m_format;
unsigned int m_chLayoutCount;
bool m_rawPassthrough;

enum AEStdChLayout m_stdChLayout;

bool OpenCoreAudio(unsigned int sampleRate, bool forceRaw, enum AEDataFormat rawDataFormat);
void Deinitialize();
void Start();
void Stop();

OSStatus OnRender(AudioUnitRenderActionFlags *actionFlags,
const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber,
OSStatus OnRender(AudioUnitRenderActionFlags *actionFlags,
const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber,
UInt32 inNumberFrames, AudioBufferList *ioData);

float m_volume;
float m_volumeBeforeMute;
float m_volumeBeforeMute;
bool m_muted;
int m_soundMode;
bool m_streamsPlaying;
bool m_streamsPlaying;
};
34 changes: 17 additions & 17 deletions xbmc/cores/AudioEngine/Engines/CoreAudio/CoreAudioAEHALIOS.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ class CCoreAudioUnit
public:
CCoreAudioUnit();
virtual ~CCoreAudioUnit();

virtual bool Open(AUGraph audioGraph, AudioComponentDescription desc);
virtual bool Open(AUGraph audioGraph, OSType type, OSType subType, OSType manufacturer);
virtual void Close();
virtual bool SetInputSource(ICoreAudioSource* pSource);
virtual bool IsInitialized() {return m_Initialized;}
virtual bool GetFormat(AudioStreamBasicDescription* pDesc, AudioUnitScope scope, AudioUnitElement bus);
virtual bool GetFormat(AudioStreamBasicDescription* pDesc, AudioUnitScope scope, AudioUnitElement bus);
virtual bool SetFormat(AudioStreamBasicDescription* pDesc, AudioUnitScope scope, AudioUnitElement bus);
virtual bool SetMaxFramesPerSlice(UInt32 maxFrames);
virtual void GetFormatDesc(AEAudioFormat format, AudioStreamBasicDescription *streamDesc);
Expand All @@ -83,11 +83,11 @@ class CCoreAudioUnit
protected:
bool SetRenderProc();
bool RemoveRenderProc();
static OSStatus RenderCallback(void *inRefCon,
AudioUnitRenderActionFlags *ioActionFlags,
const AudioTimeStamp *inTimeStamp,
UInt32 inBusNumber,
UInt32 inNumberFrames,
static OSStatus RenderCallback(void *inRefCon,
AudioUnitRenderActionFlags *ioActionFlags,
const AudioTimeStamp *inTimeStamp,
UInt32 inBusNumber,
UInt32 inNumberFrames,
AudioBufferList *ioData);
ICoreAudioSource* m_pSource;
AudioUnit m_audioUnit;
Expand All @@ -104,7 +104,7 @@ class CAUOutputDevice : public CCoreAudioUnit
CAUOutputDevice();
virtual ~CAUOutputDevice();
UInt32 GetBufferFrameSize();

/*
Float32 GetCurrentVolume();
bool SetCurrentVolume(Float32 vol);
Expand All @@ -117,13 +117,13 @@ class CAUMultiChannelMixer : public CAUOutputDevice
public:
CAUMultiChannelMixer();
virtual ~CAUMultiChannelMixer();

UInt32 GetInputBusCount();
bool SetInputBusFormat(UInt32 busCount, AudioStreamBasicDescription *pFormat);
bool SetInputBusCount(UInt32 busCount);
UInt32 GetOutputBusCount();
bool SetOutputBusCount(UInt32 busCount);

Float32 GetCurrentVolume();
bool SetCurrentVolume(Float32 vol);
};
Expand All @@ -132,22 +132,22 @@ class CCoreAudioGraph
{
private:
AUGraph m_audioGraph;

CAUOutputDevice *m_audioUnit;
CAUMultiChannelMixer *m_mixerUnit;
CAUOutputDevice *m_inputUnit;

int m_reservedBusNumber[MAX_CONNECTION_LIMIT];
bool m_initialized;
bool m_allowMixing;

typedef std::list<CAUOutputDevice*> AUUnitList;
AUUnitList m_auUnitList;

public:
CCoreAudioGraph();
~CCoreAudioGraph();

bool Open(ICoreAudioSource *pSource, AEAudioFormat &format, bool allowMixing);
bool Close();
bool Start();
Expand Down Expand Up @@ -178,10 +178,10 @@ class CCoreAudioAEHALIOS : public ICoreAudioAEHAL
unsigned int m_NumLatencyFrames;
unsigned int m_OutputBufferIndex;
CCoreAudioAE *m_ae;

CCoreAudioAEHALIOS();
virtual ~CCoreAudioAEHALIOS();

virtual bool InitializePCM(ICoreAudioSource *pSource, AEAudioFormat &format, bool allowMixing);
virtual bool InitializePCMEncoded(ICoreAudioSource *pSource, AEAudioFormat &format);
virtual bool Initialize(ICoreAudioSource *ae, bool passThrough, AEAudioFormat &format, AEDataFormat rawDataFormat, std::string &device);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ bool CCoreAudioAEHALOSX::InitializeEncoded(AudioDeviceID outputDevice, AEAudioFo
{
// check pcm output formats
unsigned int bps = CAEUtil::DataFormatToBits(AE_FMT_S16NE);
if (desc.mFormat.mChannelsPerFrame == m_initformat.m_channelLayout.Count() &&
if (desc.mFormat.mChannelsPerFrame == m_initformat.m_channelLayout.Count() &&
desc.mFormat.mBitsPerChannel == bps &&
desc.mFormat.mSampleRate == m_initformat.m_sampleRate )
{
Expand All @@ -179,7 +179,7 @@ bool CCoreAudioAEHALOSX::InitializeEncoded(AudioDeviceID outputDevice, AEAudioFo
// check encoded formats
if (desc.mFormat.mFormatID == kAudioFormat60958AC3 || desc.mFormat.mFormatID == 'IAC3')
{
if (desc.mFormat.mChannelsPerFrame == m_initformat.m_channelLayout.Count() &&
if (desc.mFormat.mChannelsPerFrame == m_initformat.m_channelLayout.Count() &&
desc.mFormat.mSampleRate == m_initformat.m_sampleRate )
{
outputFormat = desc.mFormat; // Select this format
Expand All @@ -206,7 +206,7 @@ bool CCoreAudioAEHALOSX::InitializeEncoded(AudioDeviceID outputDevice, AEAudioFo
}

CLog::Log(LOGDEBUG, "CCoreAudioAEHALOSX::InitializeEncoded: "
"Selected stream[%u] - id: 0x%04X, Physical Format: %s",
"Selected stream[%u] - id: 0x%04X, Physical Format: %s",
m_OutputBufferIndex, (uint)outputStream, StreamDescriptionToString(outputFormat, formatString));

// TODO: Auto hogging sets this for us. Figure out how/when to turn it off or use it
Expand Down
6 changes: 3 additions & 3 deletions xbmc/cores/AudioEngine/Engines/CoreAudio/CoreAudioGraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class CCoreAudioGraph
public:
CCoreAudioGraph();
~CCoreAudioGraph();

bool Open(ICoreAudioSource *pSource, AEAudioFormat &format, AudioDeviceID deviceId,
bool allowMixing, AudioChannelLayoutTag layoutTag);
bool Close();
Expand All @@ -59,11 +59,11 @@ class CCoreAudioGraph

private:
AUGraph m_audioGraph;

CAUOutputDevice *m_inputUnit;
CAUOutputDevice *m_audioUnit;
CAUMatrixMixer *m_mixerUnit;

int m_reservedBusNumber[MAX_CONNECTION_LIMIT];
bool m_initialized;
AudioDeviceID m_deviceId;
Expand Down
2 changes: 1 addition & 1 deletion xbmc/cores/AudioEngine/Engines/CoreAudio/ICoreAudioAEHAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class CAUOutputDevice;
*/
class ICoreAudioAEHAL
{
protected:
protected:
ICoreAudioAEHAL() {}
virtual ~ICoreAudioAEHAL() {}

Expand Down

0 comments on commit 688eaf2

Please sign in to comment.