fix build and no audio out on macOS 11, closes issue #2080

This commit is contained in:
Colby Klein
2021-01-08 07:58:35 -08:00
parent a7f666ecdb
commit 261daef933
9 changed files with 18 additions and 15 deletions
+2
View File
@@ -135,6 +135,8 @@ RString ArchHooks_MacOSX::GetArchName() const
return "Mac OS X (i386)";
#elif defined(__x86_64__)
return "Mac OS X (x86_64)";
#elif defined(__aarch64__)
return "macOS (ARM64)";
#else
#error What arch?
#endif
+4 -3
View File
@@ -121,7 +121,7 @@ static void SetSampleRate( AudioUnit au, Float64 desiredRate )
RString RageSoundDriver_AU::Init()
{
ComponentDescription desc;
AudioComponentDescription desc;
desc.componentType = kAudioUnitType_Output;
desc.componentSubType = kAudioUnitSubType_DefaultOutput;
@@ -129,12 +129,13 @@ RString RageSoundDriver_AU::Init()
desc.componentFlags = 0;
desc.componentFlagsMask = 0;
Component comp = FindNextComponent( NULL, &desc );
AudioComponent comp = AudioComponentFindNext(NULL, &desc);
//Component comp = FindNextComponent( NULL, &desc );
if( comp == nullptr )
return "Failed to find the default output unit.";
OSStatus error = OpenAComponent( comp, &m_OutputUnit );
OSStatus error = AudioComponentInstanceNew( comp, &m_OutputUnit );
if( error != noErr || m_OutputUnit == nullptr )
return ERROR( "Could not open the default output unit", error );
+1 -1
View File
@@ -11,7 +11,7 @@
#include <mach/mach_error.h>
#include <vector>
#include <utility>
#include <ext/hash_map>
#include <unordered_map>
#include "RageLog.h"
#include "RageInputDevice.h"
+3 -3
View File
@@ -2,7 +2,7 @@
#include "JoystickDevice.h"
#include "RageLog.h"
using __gnu_cxx::hash_map;
using std::unordered_map;
Joystick::Joystick() : id( InputDevice_Invalid ),
x_axis( 0 ), y_axis( 0 ), z_axis( 0 ),
@@ -134,7 +134,7 @@ void JoystickDevice::Open()
ADD( x_rot ); ADD( y_rot ); ADD( z_rot );
ADD( hat );
#undef ADD
for( hash_map<IOHIDElementCookie,DeviceButton>::const_iterator j = js.mapping.begin(); j != js.mapping.end(); ++j )
for( unordered_map<IOHIDElementCookie,DeviceButton>::const_iterator j = js.mapping.begin(); j != js.mapping.end(); ++j )
AddElementToQueue( j->first );
}
}
@@ -231,7 +231,7 @@ void JoystickDevice::GetButtonPresses( vector<DeviceInput>& vPresses, IOHIDEleme
else
{
// hash_map<T,U>::operator[] is not const
hash_map<IOHIDElementCookie, DeviceButton>::const_iterator iter;
unordered_map<IOHIDElementCookie, DeviceButton>::const_iterator iter;
iter = js.mapping.find( cookie );
if( iter != js.mapping.end() )
+1 -1
View File
@@ -7,7 +7,7 @@ struct Joystick
{
InputDevice id;
// map cookie to button
__gnu_cxx::hash_map<IOHIDElementCookie, DeviceButton> mapping;
std::unordered_map<IOHIDElementCookie, DeviceButton> mapping;
IOHIDElementCookie x_axis, y_axis, z_axis, x_rot, y_rot, z_rot, hat;
int x_min, x_max;
int y_min, y_max;
+2 -2
View File
@@ -162,7 +162,7 @@ void KeyboardDevice::AddElement( int usagePage, int usage, IOHIDElementCookie co
void KeyboardDevice::Open()
{
for( hash_map<IOHIDElementCookie,DeviceButton>::const_iterator i = m_Mapping.begin(); i != m_Mapping.end(); ++i )
for( unordered_map<IOHIDElementCookie,DeviceButton>::const_iterator i = m_Mapping.begin(); i != m_Mapping.end(); ++i )
{
//LOG->Trace( "Adding %s to queue, cookie %p", DeviceButtonToString(i->second).c_str(), i->first );
AddElementToQueue( i->first );
@@ -171,7 +171,7 @@ void KeyboardDevice::Open()
void KeyboardDevice::GetButtonPresses( vector<DeviceInput>& vPresses, IOHIDElementCookie cookie, int value, const RageTimer& now ) const
{
hash_map<IOHIDElementCookie, DeviceButton>::const_iterator iter = m_Mapping.find( cookie );
unordered_map<IOHIDElementCookie, DeviceButton>::const_iterator iter = m_Mapping.find( cookie );
if( iter != m_Mapping.end() )
{
+1 -1
View File
@@ -6,7 +6,7 @@
class KeyboardDevice : public HIDDevice
{
private:
__gnu_cxx::hash_map<IOHIDElementCookie, DeviceButton> m_Mapping;
std::unordered_map<IOHIDElementCookie, DeviceButton> m_Mapping;
protected:
bool AddLogicalDevice( int usagePage, int usage );
+3 -3
View File
@@ -1,7 +1,7 @@
#include "global.h"
#include "MouseDevice.h"
using __gnu_cxx::hash_map;
using std::unordered_map;
Mouse::Mouse() : id( InputDevice_Invalid ),
x_axis( 0 ), y_axis( 0 ), z_axis( 0 ),
@@ -94,7 +94,7 @@ void MouseDevice::Open()
#define ADD(x) if( m.x ) AddElementToQueue( m.x )
ADD( x_axis ); ADD( y_axis ); ADD( z_axis );
#undef ADD
for( hash_map<IOHIDElementCookie,DeviceButton>::const_iterator i = m_Mapping.begin(); i != m_Mapping.end(); ++i )
for( unordered_map<IOHIDElementCookie,DeviceButton>::const_iterator i = m_Mapping.begin(); i != m_Mapping.end(); ++i )
AddElementToQueue( i->first );
}
@@ -124,7 +124,7 @@ void MouseDevice::GetButtonPresses( vector<DeviceInput>& vPresses, IOHIDElementC
}
else
{
hash_map<IOHIDElementCookie, DeviceButton>::const_iterator iter = m_Mapping.find( cookie );
unordered_map<IOHIDElementCookie, DeviceButton>::const_iterator iter = m_Mapping.find( cookie );
if( iter != m_Mapping.end() )
vPresses.push_back( DeviceInput(DEVICE_MOUSE, iter->second, value, now) );
}
+1 -1
View File
@@ -18,7 +18,7 @@ struct Mouse
class MouseDevice : public HIDDevice
{
private:
__gnu_cxx::hash_map<IOHIDElementCookie, DeviceButton> m_Mapping;
std::unordered_map<IOHIDElementCookie, DeviceButton> m_Mapping;
Mouse m_Mouse;
protected: