2004-02-10 01:23:53 +03:00
|
|
|
/////////////////////////////////////////////////////////////////////////
|
2011-02-25 01:05:47 +03:00
|
|
|
// $Id$
|
2004-02-10 01:23:53 +03:00
|
|
|
/////////////////////////////////////////////////////////////////////////
|
2009-02-08 12:05:52 +03:00
|
|
|
//
|
2011-01-26 02:29:08 +03:00
|
|
|
// Copyright (C) 2004-2011 The Bochs Project
|
2009-02-08 12:05:52 +03:00
|
|
|
//
|
|
|
|
// This library is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU Lesser General Public
|
|
|
|
// License as published by the Free Software Foundation; either
|
|
|
|
// version 2 of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This library is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
// Lesser General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU Lesser General Public
|
|
|
|
// License along with this library; if not, write to the Free Software
|
|
|
|
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
2004-02-10 01:23:53 +03:00
|
|
|
|
|
|
|
// This file (SOUNDOSX.H) written and donated by Brian Huffman
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef macintosh
|
|
|
|
|
|
|
|
#include "bochs.h"
|
|
|
|
|
|
|
|
// uncomment one of these two:
|
|
|
|
#if BX_WITH_MACOS
|
|
|
|
#define BX_SOUND_OSX_use_quicktime
|
|
|
|
#else
|
|
|
|
#define BX_SOUND_OSX_use_converter
|
|
|
|
//#define BX_SOUND_OSX_use_quicktime
|
2011-04-25 15:22:19 +04:00
|
|
|
#include <CoreServices/CoreServices.h>
|
2004-02-10 01:23:53 +03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#define BX_SOUND_OSX_NBUF 8 // number of buffers for digital output
|
|
|
|
|
2011-03-19 15:57:13 +03:00
|
|
|
class bx_sound_osx_c : public bx_sound_lowlevel_c {
|
2004-02-10 01:23:53 +03:00
|
|
|
public:
|
2011-02-11 01:58:22 +03:00
|
|
|
bx_sound_osx_c(logfunctions *dev);
|
2011-01-26 02:29:08 +03:00
|
|
|
virtual ~bx_sound_osx_c();
|
2004-02-10 01:23:53 +03:00
|
|
|
|
2011-01-26 02:29:08 +03:00
|
|
|
virtual int waveready();
|
|
|
|
virtual int midiready();
|
2004-02-10 01:23:53 +03:00
|
|
|
|
2011-02-13 20:26:52 +03:00
|
|
|
virtual int openmidioutput(const char *mididev);
|
2011-01-26 02:29:08 +03:00
|
|
|
virtual int sendmidicommand(int delta, int command, int length, Bit8u data[]);
|
|
|
|
virtual int closemidioutput();
|
2004-02-10 01:23:53 +03:00
|
|
|
|
2011-02-13 20:26:52 +03:00
|
|
|
virtual int openwaveoutput(const char *wavedev);
|
2011-03-20 21:02:12 +03:00
|
|
|
virtual int startwaveplayback(int frequency, int bits, bx_bool stereo, int format);
|
2011-01-26 02:29:08 +03:00
|
|
|
virtual int sendwavepacket(int length, Bit8u data[]);
|
|
|
|
virtual int stopwaveplayback();
|
|
|
|
virtual int closewaveoutput();
|
2004-02-10 01:23:53 +03:00
|
|
|
#ifdef BX_SOUND_OSX_use_converter
|
|
|
|
void nextbuffer(int *outDataSize, void **outData);
|
|
|
|
#endif
|
|
|
|
|
2011-05-24 20:47:07 +04:00
|
|
|
virtual int openwaveinput(const char *wavedev, sound_record_handler_t rh);
|
|
|
|
virtual int startwaverecord(int frequency, int bits, bx_bool stereo, int format);
|
|
|
|
virtual int getwavepacket(int length, Bit8u data[]);
|
|
|
|
virtual int stopwaverecord();
|
|
|
|
virtual int closewaveinput();
|
|
|
|
|
|
|
|
static void record_timer_handler(void *);
|
|
|
|
void record_timer(void);
|
2004-02-10 01:23:53 +03:00
|
|
|
private:
|
|
|
|
int MidiOpen;
|
|
|
|
int WaveOpen;
|
|
|
|
|
2011-03-20 21:02:12 +03:00
|
|
|
Bit8u WaveData[BX_SOUND_OSX_NBUF][BX_SOUNDLOW_WAVEPACKETSIZE];
|
2004-02-10 01:23:53 +03:00
|
|
|
int WaveLength[BX_SOUND_OSX_NBUF];
|
|
|
|
int head, tail; // buffer pointers
|
2008-01-27 01:24:03 +03:00
|
|
|
|
2004-02-10 01:23:53 +03:00
|
|
|
#ifdef BX_SOUND_OSX_use_converter
|
|
|
|
int WavePlaying;
|
2011-04-25 15:22:19 +04:00
|
|
|
|
|
|
|
OSStatus core_audio_pause();
|
|
|
|
OSStatus core_audio_resume();
|
2004-02-10 01:23:53 +03:00
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // macintosh
|