- reformatting

This commit is contained in:
Dmytro Bogovych 2018-09-11 09:33:15 +03:00
parent b7d5df183b
commit 6deceec404
1 changed files with 42 additions and 42 deletions

View File

@ -25,7 +25,7 @@
using namespace Audio; using namespace Audio;
Device::Device() Device::Device()
:mConnection(nullptr) :mConnection(nullptr)
{ {
} }
@ -36,12 +36,12 @@ Device::~Device()
void Device::setConnection(DataConnection* connection) void Device::setConnection(DataConnection* connection)
{ {
mConnection = connection; mConnection = connection;
} }
DataConnection* Device::connection() DataConnection* Device::connection()
{ {
return mConnection; return mConnection;
} }
InputDevice::InputDevice() InputDevice::InputDevice()
@ -55,20 +55,20 @@ InputDevice::~InputDevice()
InputDevice* InputDevice::make(int devId) InputDevice* InputDevice::make(int devId)
{ {
#if defined(USE_NULL_AUDIO) #if defined(USE_NULL_AUDIO)
return new NullInputDevice(); return new NullInputDevice();
#else #else
#if defined(TARGET_WIN) && defined(_MSC_VER) #if defined(TARGET_WIN) && defined(_MSC_VER)
// return new WmmeInputDevice(index); // return new WmmeInputDevice(index);
return new DSoundInputDevice(DSoundHelper::deviceId2Guid(devId, true)); return new DSoundInputDevice(DSoundHelper::deviceId2Guid(devId, true));
#endif
#ifdef TARGET_OSX
return new MacInputDevice(devId);
#endif
#ifdef TARGET_ANDROID
return new AndroidInputDevice(devId);
#endif
#endif #endif
return nullptr; #ifdef TARGET_OSX
return new MacInputDevice(devId);
#endif
#ifdef TARGET_ANDROID
return new AndroidInputDevice(devId);
#endif
#endif
return nullptr;
} }
OutputDevice::OutputDevice() OutputDevice::OutputDevice()
@ -82,20 +82,20 @@ OutputDevice::~OutputDevice()
OutputDevice* OutputDevice::make(int devId) OutputDevice* OutputDevice::make(int devId)
{ {
#if defined(USE_NULL_AUDIO) #if defined(USE_NULL_AUDIO)
return new NullOutputDevice(); return new NullOutputDevice();
#else #else
#if defined(TARGET_WIN) #if defined(TARGET_WIN)
//return new WmmeOutputDevice(index); //return new WmmeOutputDevice(index);
return new DSoundOutputDevice(DSoundHelper::deviceId2Guid(devId, false)); return new DSoundOutputDevice(DSoundHelper::deviceId2Guid(devId, false));
#endif
#ifdef TARGET_OSX
return new MacOutputDevice(devId);
#endif
#ifdef TARGET_ANDROID
return new AndroidOutputDevice(devId);
#endif
#endif #endif
return nullptr; #ifdef TARGET_OSX
return new MacOutputDevice(devId);
#endif
#ifdef TARGET_ANDROID
return new AndroidOutputDevice(devId);
#endif
#endif
return nullptr;
} }
@ -110,31 +110,31 @@ Enumerator::~Enumerator()
int Enumerator::nameToIndex(const std::tstring& name) int Enumerator::nameToIndex(const std::tstring& name)
{ {
for (int i = 0; i < count(); i++) for (int i = 0; i < count(); i++)
if (nameAt(i) == name) if (nameAt(i) == name)
return i; return i;
return -1; return -1;
} }
Enumerator* Enumerator::make(bool useNull) Enumerator* Enumerator::make(bool useNull)
{ {
if (useNull) if (useNull)
return new NullEnumerator(); return new NullEnumerator();
#ifndef USE_NULL_AUDIO #ifndef USE_NULL_AUDIO
#ifdef TARGET_WIN #ifdef TARGET_WIN
if (winVersion() > Win_Xp) if (winVersion() > Win_Xp)
return new VistaEnumerator(); return new VistaEnumerator();
else else
return new XpEnumerator(); return new XpEnumerator();
#endif
#ifdef TARGET_OSX
return new MacEnumerator();
#endif
#endif #endif
return new NullEnumerator(); #ifdef TARGET_OSX
return new MacEnumerator();
#endif
#endif
return new NullEnumerator();
} }
// ----- OsEngine ------------ // ----- OsEngine ------------
@ -142,12 +142,12 @@ Enumerator* Enumerator::make(bool useNull)
OsEngine* OsEngine::instance() OsEngine* OsEngine::instance()
{ {
#ifdef USE_NULL_AUDIO #ifdef USE_NULL_AUDIO
return nullptr; return nullptr;
#endif #endif
#ifdef TARGET_ANDROID #ifdef TARGET_ANDROID
return &OpenSLEngine::instance(); return &OpenSLEngine::instance();
#endif #endif
return nullptr; return nullptr;
} }