Coding style consistency.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30224 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -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.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
#ifndef _MIXER_CORE_H
|
#ifndef _MIXER_CORE_H
|
||||||
@@ -24,11 +24,10 @@ class Resampler;
|
|||||||
// but for now we redefine type 12
|
// but for now we redefine type 12
|
||||||
#define B_CHANNEL_MONO B_CHANNEL_TOP_CENTER
|
#define B_CHANNEL_MONO B_CHANNEL_TOP_CENTER
|
||||||
|
|
||||||
class MixerCore
|
class MixerCore {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
MixerCore(AudioMixer *node);
|
MixerCore(AudioMixer *node);
|
||||||
~MixerCore();
|
virtual ~MixerCore();
|
||||||
|
|
||||||
MixerSettings* Settings();
|
MixerSettings* Settings();
|
||||||
|
|
||||||
@@ -61,7 +60,7 @@ class MixerCore
|
|||||||
const media_multi_audio_format& format);
|
const media_multi_audio_format& format);
|
||||||
|
|
||||||
void SetOutputBufferGroup(BBufferGroup* group);
|
void SetOutputBufferGroup(BBufferGroup* group);
|
||||||
void SetTimingInfo(BTimeSource *ts,
|
void SetTimingInfo(BTimeSource* timeSource,
|
||||||
bigtime_t downstream_latency);
|
bigtime_t downstream_latency);
|
||||||
void EnableOutput(bool enabled);
|
void EnableOutput(bool enabled);
|
||||||
bool Start();
|
bool Start();
|
||||||
@@ -81,14 +80,17 @@ class MixerCore
|
|||||||
BList* fInputs;
|
BList* fInputs;
|
||||||
MixerOutput* fOutput;
|
MixerOutput* fOutput;
|
||||||
int32 fNextInputID;
|
int32 fNextInputID;
|
||||||
// true = the mix thread is running
|
|
||||||
bool fRunning;
|
bool fRunning;
|
||||||
// true = mix thread should be
|
// true = the mix thread is running
|
||||||
// started of it is not running
|
|
||||||
bool fStarted;
|
bool fStarted;
|
||||||
// true = mix thread should be
|
// true = mix thread should be
|
||||||
// started of it is not running
|
// started of it is not running
|
||||||
|
|
||||||
bool fOutputEnabled;
|
bool fOutputEnabled;
|
||||||
|
// true = mix thread should be
|
||||||
|
// started of it is not running
|
||||||
|
|
||||||
Resampler** fResampler; // array
|
Resampler** fResampler; // array
|
||||||
float* fMixBuffer;
|
float* fMixBuffer;
|
||||||
int32 fMixBufferFrameRate;
|
int32 fMixBufferFrameRate;
|
||||||
@@ -105,7 +107,8 @@ class MixerCore
|
|||||||
sem_id fMixThreadWaitSem;
|
sem_id fMixThreadWaitSem;
|
||||||
float fOutputGain;
|
float fOutputGain;
|
||||||
|
|
||||||
friend class MixerInput; // XXX debug only
|
friend class MixerInput;
|
||||||
|
// NOTE: debug only
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -115,18 +118,21 @@ MixerCore::Lock()
|
|||||||
fLocker->Lock();
|
fLocker->Lock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline bool
|
inline bool
|
||||||
MixerCore::LockWithTimeout(bigtime_t timeout)
|
MixerCore::LockWithTimeout(bigtime_t timeout)
|
||||||
{
|
{
|
||||||
return B_OK == fLocker->LockWithTimeout(timeout);
|
return fLocker->LockWithTimeout(timeout) == B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline void
|
inline void
|
||||||
MixerCore::Unlock()
|
MixerCore::Unlock()
|
||||||
{
|
{
|
||||||
fLocker->Unlock();
|
fLocker->Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline bool
|
inline bool
|
||||||
MixerCore::LockFromMixThread()
|
MixerCore::LockFromMixThread()
|
||||||
{
|
{
|
||||||
@@ -134,8 +140,12 @@ MixerCore::LockFromMixThread()
|
|||||||
if (LockWithTimeout(10000))
|
if (LockWithTimeout(10000))
|
||||||
return true;
|
return true;
|
||||||
// XXX accessing fMixThreadWaitSem is still a race condition :(
|
// 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;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif // _MIXER_CORE_H
|
||||||
|
|||||||
Reference in New Issue
Block a user