mirror of
https://github.com/kyleneideck/BackgroundMusic
synced 2024-11-26 22:10:26 +00:00
BGMDriver: Clean up constructor initializer lists.
See https://isocpp.org/wiki/faq/ctors#ctor-initializer-order.
This commit is contained in:
parent
4e091c7398
commit
484ffa16f3
5 changed files with 19 additions and 15 deletions
|
@ -18,6 +18,7 @@
|
||||||
// BGMDriver
|
// BGMDriver
|
||||||
//
|
//
|
||||||
// Copyright © 2016 Kyle Neideck
|
// Copyright © 2016 Kyle Neideck
|
||||||
|
// Copyright © 2016 Josh Junon
|
||||||
// Portions copyright (C) 2013 Apple Inc. All Rights Reserved.
|
// Portions copyright (C) 2013 Apple Inc. All Rights Reserved.
|
||||||
//
|
//
|
||||||
// Based largely on SA_Device.cpp from Apple's SimpleAudioDriver Plug-In sample code. Also uses a few sections from Apple's
|
// Based largely on SA_Device.cpp from Apple's SimpleAudioDriver Plug-In sample code. Also uses a few sections from Apple's
|
||||||
|
@ -79,12 +80,12 @@ BGM_Device::BGM_Device()
|
||||||
mStateMutex("Device State"),
|
mStateMutex("Device State"),
|
||||||
mIOMutex("Device IO"),
|
mIOMutex("Device IO"),
|
||||||
mSampleRateShadow(0),
|
mSampleRateShadow(0),
|
||||||
|
mWrappedAudioEngine(NULL),
|
||||||
|
mClients(&mTaskQueue),
|
||||||
|
mInputStreamIsActive(true),
|
||||||
|
mOutputStreamIsActive(true),
|
||||||
mDeviceAudibleState(kBGMDeviceIsSilent),
|
mDeviceAudibleState(kBGMDeviceIsSilent),
|
||||||
mAudibleStateSampleTimes({0, 0, 0, 0}),
|
mAudibleStateSampleTimes({0, 0, 0, 0}),
|
||||||
mClients(&mTaskQueue),
|
|
||||||
mWrappedAudioEngine(NULL),
|
|
||||||
mInputStreamIsActive(true),
|
|
||||||
mOutputStreamIsActive(true),
|
|
||||||
//mInputMasterVolumeControlRawValueShadow(kDefaultMinRawVolumeValue),
|
//mInputMasterVolumeControlRawValueShadow(kDefaultMinRawVolumeValue),
|
||||||
mOutputMasterVolumeControlRawValueShadow(kDefaultMinRawVolumeValue),
|
mOutputMasterVolumeControlRawValueShadow(kDefaultMinRawVolumeValue),
|
||||||
mOutputMasterMinRawVolumeShadow(kDefaultMinRawVolumeValue),
|
mOutputMasterMinRawVolumeShadow(kDefaultMinRawVolumeValue),
|
||||||
|
|
|
@ -172,7 +172,7 @@ private:
|
||||||
CAMutex mStateMutex;
|
CAMutex mStateMutex;
|
||||||
CAMutex mIOMutex;
|
CAMutex mIOMutex;
|
||||||
|
|
||||||
UInt64 mSampleRateShadow; // Currently unused
|
UInt64 __unused mSampleRateShadow; // Currently unused.
|
||||||
const Float64 kSampleRateDefault = 44100.0;
|
const Float64 kSampleRateDefault = 44100.0;
|
||||||
// Before we can change sample rate, the host has to stop the device. The new sample rate is stored here while it does.
|
// Before we can change sample rate, the host has to stop the device. The new sample rate is stored here while it does.
|
||||||
Float64 mPendingSampleRate;
|
Float64 mPendingSampleRate;
|
||||||
|
|
|
@ -74,26 +74,30 @@ private:
|
||||||
BGM_Task(BGM_TaskID inTaskID = kBGMTaskUninitialized, bool inIsSync = false, UInt64 inArg1 = 0, UInt64 inArg2 = 0) : mNext(NULL), mTaskID(inTaskID), mIsSync(inIsSync), mArg1(inArg1), mArg2(inArg2) { };
|
BGM_Task(BGM_TaskID inTaskID = kBGMTaskUninitialized, bool inIsSync = false, UInt64 inArg1 = 0, UInt64 inArg2 = 0) : mNext(NULL), mTaskID(inTaskID), mIsSync(inIsSync), mArg1(inArg1), mArg2(inArg2) { };
|
||||||
|
|
||||||
BGM_TaskID GetTaskID() { return mTaskID; }
|
BGM_TaskID GetTaskID() { return mTaskID; }
|
||||||
UInt64 GetArg1() { return mArg1; }
|
|
||||||
UInt64 GetArg2() { return mArg2; }
|
|
||||||
UInt64 GetReturnValue() { return mReturnValue; }
|
|
||||||
void SetReturnValue(UInt64 inReturnValue) { mReturnValue = inReturnValue; }
|
|
||||||
bool IsComplete() { return mIsComplete; }
|
|
||||||
void MarkCompleted() { mIsComplete = true; }
|
|
||||||
// True if the thread that queued this task is blocking until the task is completed
|
// True if the thread that queued this task is blocking until the task is completed
|
||||||
bool IsSync() { return mIsSync; }
|
bool IsSync() { return mIsSync; }
|
||||||
|
|
||||||
|
UInt64 GetArg1() { return mArg1; }
|
||||||
|
UInt64 GetArg2() { return mArg2; }
|
||||||
|
|
||||||
|
UInt64 GetReturnValue() { return mReturnValue; }
|
||||||
|
void SetReturnValue(UInt64 inReturnValue) { mReturnValue = inReturnValue; }
|
||||||
|
|
||||||
|
bool IsComplete() { return mIsComplete; }
|
||||||
|
void MarkCompleted() { mIsComplete = true; }
|
||||||
|
|
||||||
// Used by TAtomicStack
|
// Used by TAtomicStack
|
||||||
BGM_Task* __nullable & next() { return mNext; }
|
BGM_Task* __nullable & next() { return mNext; }
|
||||||
BGM_Task* __nullable mNext;
|
BGM_Task* __nullable mNext;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BGM_TaskID mTaskID;
|
BGM_TaskID mTaskID;
|
||||||
|
bool mIsSync;
|
||||||
UInt64 mArg1;
|
UInt64 mArg1;
|
||||||
UInt64 mArg2;
|
UInt64 mArg2;
|
||||||
UInt64 mReturnValue = INT64_MAX;
|
UInt64 mReturnValue = INT64_MAX;
|
||||||
bool mIsComplete = false;
|
bool mIsComplete = false;
|
||||||
bool mIsSync;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -28,8 +28,8 @@ BGM_Client::BGM_Client(const AudioServerPlugInClientInfo* inClientInfo)
|
||||||
:
|
:
|
||||||
mClientID(inClientInfo->mClientID),
|
mClientID(inClientInfo->mClientID),
|
||||||
mProcessID(inClientInfo->mProcessID),
|
mProcessID(inClientInfo->mProcessID),
|
||||||
mBundleID(inClientInfo->mBundleID),
|
mIsNativeEndian(inClientInfo->mIsNativeEndian),
|
||||||
mIsNativeEndian(inClientInfo->mIsNativeEndian)
|
mBundleID(inClientInfo->mBundleID)
|
||||||
{
|
{
|
||||||
// The bundle ID ref we were passed is only valid until our plugin returns control to the HAL, so we need to retain
|
// The bundle ID ref we were passed is only valid until our plugin returns control to the HAL, so we need to retain
|
||||||
// it. (CACFString will handle the rest of its ownership/destruction.)
|
// it. (CACFString will handle the rest of its ownership/destruction.)
|
||||||
|
|
|
@ -42,7 +42,6 @@ class BGM_ClientTasks
|
||||||
friend class BGM_TaskQueue;
|
friend class BGM_TaskQueue;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
static bool StartIONonRT(BGM_Clients* inClients, UInt32 inClientID) { return inClients->StartIONonRT(inClientID); }
|
static bool StartIONonRT(BGM_Clients* inClients, UInt32 inClientID) { return inClients->StartIONonRT(inClientID); }
|
||||||
static bool StopIONonRT(BGM_Clients* inClients, UInt32 inClientID) { return inClients->StopIONonRT(inClientID); }
|
static bool StopIONonRT(BGM_Clients* inClients, UInt32 inClientID) { return inClients->StopIONonRT(inClientID); }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue