Coding style consistency.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30224 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2009-04-17 09:56:58 +00:00
parent b71c18c4e8
commit 8152b7d177
@@ -1,5 +1,5 @@
/*
* Copyright 2007 Haiku Inc. All rights reserved.
* Copyright 2007-2009 Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _MIXER_CORE_H
@@ -24,11 +24,10 @@ class Resampler;
// but for now we redefine type 12
#define B_CHANNEL_MONO B_CHANNEL_TOP_CENTER
class MixerCore
{
class MixerCore {
public:
MixerCore(AudioMixer *node);
~MixerCore();
virtual ~MixerCore();
MixerSettings* Settings();
@@ -61,7 +60,7 @@ class MixerCore
const media_multi_audio_format& format);
void SetOutputBufferGroup(BBufferGroup* group);
void SetTimingInfo(BTimeSource *ts,
void SetTimingInfo(BTimeSource* timeSource,
bigtime_t downstream_latency);
void EnableOutput(bool enabled);
bool Start();
@@ -81,14 +80,17 @@ class MixerCore
BList* fInputs;
MixerOutput* fOutput;
int32 fNextInputID;
// true = the mix thread is running
bool fRunning;
// true = mix thread should be
// started of it is not running
// true = the mix thread is running
bool fStarted;
// true = mix thread should be
// started of it is not running
bool fOutputEnabled;
// true = mix thread should be
// started of it is not running
Resampler** fResampler; // array
float* fMixBuffer;
int32 fMixBufferFrameRate;
@@ -105,7 +107,8 @@ class MixerCore
sem_id fMixThreadWaitSem;
float fOutputGain;
friend class MixerInput; // XXX debug only
friend class MixerInput;
// NOTE: debug only
};
@@ -115,18 +118,21 @@ MixerCore::Lock()
fLocker->Lock();
}
inline bool
MixerCore::LockWithTimeout(bigtime_t timeout)
{
return B_OK == fLocker->LockWithTimeout(timeout);
return fLocker->LockWithTimeout(timeout) == B_OK;
}
inline void
MixerCore::Unlock()
{
fLocker->Unlock();
}
inline bool
MixerCore::LockFromMixThread()
{
@@ -134,8 +140,12 @@ MixerCore::LockFromMixThread()
if (LockWithTimeout(10000))
return true;
// XXX accessing fMixThreadWaitSem is still a race condition :(
if (B_WOULD_BLOCK != acquire_sem_etc(fMixThreadWaitSem, 1, B_RELATIVE_TIMEOUT, 0))
if (acquire_sem_etc(fMixThreadWaitSem, 1, B_RELATIVE_TIMEOUT, 0)
!= B_WOULD_BLOCK) {
return false;
}
}
#endif
}
#endif // _MIXER_CORE_H