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
|
|
|
//
|
2015-01-11 23:13:50 +03:00
|
|
|
// Copyright (C) 2004-2015 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:
|
2015-02-01 15:33:21 +03:00
|
|
|
bx_sound_osx_c();
|
|
|
|
virtual ~bx_sound_osx_c();
|
|
|
|
|
|
|
|
virtual int get_type() {return BX_SOUNDLOW_OSX;}
|
|
|
|
|
|
|
|
virtual int openmidioutput(const char *mididev);
|
|
|
|
virtual int midiready();
|
|
|
|
virtual int sendmidicommand(int delta, int command, int length, Bit8u data[]);
|
|
|
|
virtual int closemidioutput();
|
|
|
|
|
|
|
|
virtual int openwaveoutput(const char *wavedev);
|
|
|
|
virtual int waveready();
|
|
|
|
virtual int set_pcm_params(bx_pcm_param_t param);
|
|
|
|
virtual int sendwavepacket(int length, Bit8u data[], bx_pcm_param_t *src_param);
|
|
|
|
virtual int stopwaveplayback();
|
|
|
|
virtual int closewaveoutput();
|
2004-02-10 01:23:53 +03:00
|
|
|
#ifdef BX_SOUND_OSX_use_converter
|
2015-02-01 15:33:21 +03:00
|
|
|
void nextbuffer(int *outDataSize, void **outData);
|
2004-02-10 01:23:53 +03:00
|
|
|
#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
|