5
* Copyright 2006 Daniel Sumorok. All rights reserved.
7
* This program is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; either version 2 of the License, or
10
* (at your option) any later version.
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
17
* You should have received a copy of the GNU General Public License
18
* along with this program; if not, write to the Free Software
19
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
#include "AudioBackEnd.h"
22
#include "MacOSX_sound_if.h"
24
OSXsoundOutput::OSXsoundOutput() :
29
void OSXsoundOutput::getMoreSamples(void *arg) {
32
me = (OSXsoundOutput *)arg;
38
if(me->callback == NULL) {
45
int OSXsoundOutput::start(int bitsPerSample, int numChannels, int sampleRate) {
47
player = new AudioBackEnd(bitsPerSample, numChannels, sampleRate);
49
player->setCallback(getMoreSamples, (void *)this);
55
int OSXsoundOutput::stop() {
64
OSXsoundOutput::~OSXsoundOutput() {
68
void OSXsoundOutput::setCallback(audioCallback fn) {
72
unsigned int OSXsoundOutput::bufferSizeFrames() {
74
return player->BufferSizeFrames();
80
int OSXsoundOutput::sendAudioBuffer(void *buffer, int numFrames) {
82
return player->sendAudioBuffer(buffer, numFrames);