summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorSoren Jorvang <soren.jorvang@gmail.com>2011-01-04 02:09:29 +0000
committerSoren Jorvang <soren.jorvang@gmail.com>2011-01-04 02:09:29 +0000
commitefe555fc16ebc62ab667189e43908215d64bb754 (patch)
treedfa2b0d73513bf5371abb65c4b0cff7c2a11d8d9 /Source/Core
parent58f5140233963944341fdbd7d6d1b7f585003196 (diff)
Some minor tidying of the OS X audio and wiimote code.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6736 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/AudioCommon/Src/CoreAudioSoundStream.cpp4
-rw-r--r--Source/Core/AudioCommon/Src/CoreAudioSoundStream.h6
-rw-r--r--Source/Core/Core/Src/HW/WiimoteReal/IOdarwin.mm13
-rw-r--r--Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.cpp2
-rw-r--r--Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.h4
5 files changed, 12 insertions, 17 deletions
diff --git a/Source/Core/AudioCommon/Src/CoreAudioSoundStream.cpp b/Source/Core/AudioCommon/Src/CoreAudioSoundStream.cpp
index 57e2e448ea..e4d54ffa0f 100644
--- a/Source/Core/AudioCommon/Src/CoreAudioSoundStream.cpp
+++ b/Source/Core/AudioCommon/Src/CoreAudioSoundStream.cpp
@@ -47,9 +47,10 @@ CoreAudioSound::~CoreAudioSound()
bool CoreAudioSound::Start()
{
OSStatus err;
- UInt32 enableIO;
AURenderCallbackStruct callback_struct;
AudioStreamBasicDescription format;
+ ComponentDescription desc;
+ UInt32 enableIO = 1;
desc.componentType = kAudioUnitType_Output;
desc.componentSubType = kAudioUnitSubType_DefaultOutput;
@@ -69,7 +70,6 @@ bool CoreAudioSound::Start()
return false;
}
- enableIO = 1;
AudioUnitSetProperty(audioUnit,
kAudioOutputUnitProperty_EnableIO,
kAudioUnitScope_Output, 0, &enableIO,
diff --git a/Source/Core/AudioCommon/Src/CoreAudioSoundStream.h b/Source/Core/AudioCommon/Src/CoreAudioSoundStream.h
index 6a1b96a5a8..9c6f7b0991 100644
--- a/Source/Core/AudioCommon/Src/CoreAudioSoundStream.h
+++ b/Source/Core/AudioCommon/Src/CoreAudioSoundStream.h
@@ -27,9 +27,6 @@
class CoreAudioSound : public SoundStream
{
#ifdef __APPLE__
- ComponentDescription desc;
- AudioUnit audioUnit;
-
public:
CoreAudioSound(CMixer *mixer);
virtual ~CoreAudioSound();
@@ -49,6 +46,9 @@ public:
virtual void Update();
void RenderSamples(void *target, UInt32 size);
+
+private:
+ AudioUnit audioUnit;
#else
public:
CoreAudioSound(CMixer *mixer) : SoundStream(mixer) {}
diff --git a/Source/Core/Core/Src/HW/WiimoteReal/IOdarwin.mm b/Source/Core/Core/Src/HW/WiimoteReal/IOdarwin.mm
index 1f5f2ceb9a..93eeb03357 100644
--- a/Source/Core/Core/Src/HW/WiimoteReal/IOdarwin.mm
+++ b/Source/Core/Core/Src/HW/WiimoteReal/IOdarwin.mm
@@ -92,14 +92,9 @@ extern "C" OSErr UpdateSystemActivity(UInt8 activity);
return;
}
- WARN_LOG(WIIMOTE, "Connection to wiimote %i closed", wm->index + 1);
+ WARN_LOG(WIIMOTE, "Lost channel to wiimote %i", wm->index + 1);
- [wm->btd closeConnection];
-
- wm->btd = NULL;
- wm->cchan = NULL;
- wm->ichan = NULL;
- wm->m_connected = false;
+ wm->RealDisconnect();
}
@end
@@ -181,7 +176,8 @@ bool Wiimote::Connect()
{
ConnectBT *cbt = [[ConnectBT alloc] init];
- if (IsConnected()) return false;
+ if (IsConnected())
+ return false;
[btd openL2CAPChannelSync: &cchan
withPSM: kBluetoothL2CAPPSMHIDControl delegate: cbt];
@@ -200,7 +196,6 @@ bool Wiimote::Connect()
m_connected = true;
Handshake();
-
SetLEDs(WIIMOTE_LED_1 << index);
[cbt release];
diff --git a/Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.cpp b/Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.cpp
index 96ef58d842..b75bd0cd6b 100644
--- a/Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.cpp
+++ b/Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.cpp
@@ -58,7 +58,7 @@ Wiimote::Wiimote(const unsigned int _index)
, dev_handle(0), stack(MSBT_STACK_UNKNOWN)
#endif
, leds(0)
- , m_connected(false), m_last_data_report(Report(NULL, 0)), m_channel(0)
+ , m_last_data_report(Report(NULL, 0)), m_channel(0), m_connected(false)
{
#if defined(__linux__) && HAVE_BLUEZ
bdaddr = (bdaddr_t){{0, 0, 0, 0, 0, 0}};
diff --git a/Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.h b/Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.h
index 24317b2b67..d5363c34dc 100644
--- a/Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.h
+++ b/Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.h
@@ -64,6 +64,7 @@ public:
void DisableDataReporting();
void Rumble();
void SendPacket(const u8 rpt_id, const void* const data, const unsigned int size);
+ void RealDisconnect();
const unsigned int index;
@@ -86,20 +87,19 @@ public:
#endif
unsigned char leds; // Currently lit leds
- bool m_connected;
protected:
Report m_last_data_report;
u16 m_channel;
private:
void ClearReadQueue();
- void RealDisconnect();
bool SendRequest(unsigned char report_type, unsigned char* data, int length);
bool Handshake();
void SetLEDs(int leds);
int IORead(unsigned char* buf);
int IOWrite(unsigned char* buf, int len);
+ bool m_connected;
Common::FifoQueue<Report> m_read_reports;
Common::FifoQueue<Report> m_write_reports;
};