2015-05-24 07:55:12 +03:00
|
|
|
// Copyright 2008 Dolphin Emulator Project
|
2015-05-18 02:08:10 +03:00
|
|
|
// Licensed under GPLv2+
|
2013-04-21 09:17:03 +03:00
|
|
|
// Refer to the license.txt file included.
|
2009-09-25 00:35:06 +03:00
|
|
|
|
2014-02-10 20:54:46 +02:00
|
|
|
#pragma once
|
2009-09-25 00:35:06 +03:00
|
|
|
|
2011-01-02 04:49:30 +02:00
|
|
|
#ifdef __APPLE__
|
2009-10-23 20:10:27 +03:00
|
|
|
#include <AudioUnit/AudioUnit.h>
|
2011-01-02 04:49:30 +02:00
|
|
|
#endif
|
2009-09-25 00:35:06 +03:00
|
|
|
|
2014-02-17 12:18:15 +02:00
|
|
|
#include "AudioCommon/SoundStream.h"
|
2009-09-25 00:35:06 +03:00
|
|
|
|
2014-03-18 16:37:45 +02:00
|
|
|
class CoreAudioSound final : public SoundStream
|
2009-09-25 00:35:06 +03:00
|
|
|
{
|
2011-01-02 04:49:30 +02:00
|
|
|
#ifdef __APPLE__
|
2009-09-25 00:35:06 +03:00
|
|
|
public:
|
2016-06-24 11:43:46 +03:00
|
|
|
bool Start() override;
|
|
|
|
void SetVolume(int volume) override;
|
|
|
|
void SoundLoop() override;
|
|
|
|
void Stop() override;
|
|
|
|
void Update() override;
|
2013-03-20 03:51:12 +02:00
|
|
|
|
2016-06-24 11:43:46 +03:00
|
|
|
static bool isValid() { return true; }
|
2011-01-04 04:09:29 +02:00
|
|
|
private:
|
2016-06-24 11:43:46 +03:00
|
|
|
AudioUnit audioUnit;
|
|
|
|
int m_volume;
|
2011-02-02 20:21:20 +02:00
|
|
|
|
2016-06-24 11:43:46 +03:00
|
|
|
static OSStatus callback(void* inRefCon, AudioUnitRenderActionFlags* ioActionFlags,
|
|
|
|
const AudioTimeStamp* inTimeStamp, UInt32 inBusNumber,
|
|
|
|
UInt32 inNumberFrames, AudioBufferList* ioData);
|
2011-01-02 04:49:30 +02:00
|
|
|
#endif
|
2009-09-25 00:35:06 +03:00
|
|
|
};
|