2001-10-03 17:10:38 +04:00
|
|
|
/////////////////////////////////////////////////////////////////////////
|
2011-02-25 01:05:47 +03:00
|
|
|
// $Id$
|
2001-10-03 17:10:38 +04:00
|
|
|
/////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2015-01-11 23:13:50 +03:00
|
|
|
// Copyright (C) 2001-2015 The Bochs Project
|
2001-04-10 05:04:59 +04: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
|
2009-02-08 12:05:52 +03:00
|
|
|
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
2009-02-08 00:05:31 +03:00
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////
|
2001-04-10 05:04:59 +04:00
|
|
|
|
2008-07-12 19:21:36 +04:00
|
|
|
// Josef Drexler coded the original version of the lowlevel sound support
|
2013-07-14 19:14:53 +04:00
|
|
|
// for Linux using OSS. The current version also supports OSS on FreeBSD.
|
2001-04-10 05:04:59 +04:00
|
|
|
|
2004-09-11 19:39:53 +04:00
|
|
|
#if (defined(linux) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__))
|
2001-04-10 05:04:59 +04:00
|
|
|
|
2015-02-07 00:31:30 +03:00
|
|
|
class bx_sound_oss_c : public bx_sound_lowlevel_c {
|
2001-04-10 05:04:59 +04:00
|
|
|
public:
|
2015-02-07 00:31:30 +03:00
|
|
|
bx_sound_oss_c();
|
|
|
|
virtual ~bx_sound_oss_c();
|
2001-04-10 05:04:59 +04:00
|
|
|
|
2015-02-07 00:31:30 +03:00
|
|
|
virtual int get_type() {return BX_SOUNDLOW_OSS;}
|
2012-06-09 00:49:39 +04:00
|
|
|
|
2011-04-22 17:11:47 +04:00
|
|
|
virtual int openmidioutput(const char *mididev);
|
2015-01-31 13:48:22 +03:00
|
|
|
virtual int midiready();
|
2011-04-22 17:11:47 +04:00
|
|
|
virtual int sendmidicommand(int delta, int command, int length, Bit8u data[]);
|
|
|
|
virtual int closemidioutput();
|
2001-04-10 05:04:59 +04:00
|
|
|
|
2011-04-22 17:11:47 +04:00
|
|
|
virtual int openwaveoutput(const char *wavedev);
|
2015-01-31 13:48:22 +03:00
|
|
|
virtual int set_pcm_params(bx_pcm_param_t param);
|
2015-02-07 00:31:30 +03:00
|
|
|
virtual int waveout(int length, Bit8u data[]);
|
2011-04-22 17:11:47 +04:00
|
|
|
virtual int closewaveoutput();
|
2001-04-10 05:04:59 +04:00
|
|
|
|
2011-04-22 17:11:47 +04:00
|
|
|
virtual int openwaveinput(const char *wavedev, sound_record_handler_t rh);
|
2015-02-08 11:53:20 +03:00
|
|
|
virtual int startwaverecord(bx_pcm_param_t *param);
|
2011-04-22 17:11:47 +04:00
|
|
|
virtual int getwavepacket(int length, Bit8u data[]);
|
|
|
|
virtual int stopwaverecord();
|
|
|
|
virtual int closewaveinput();
|
|
|
|
|
|
|
|
static void record_timer_handler(void *);
|
|
|
|
void record_timer(void);
|
2001-04-10 05:04:59 +04:00
|
|
|
private:
|
2008-07-19 16:01:54 +04:00
|
|
|
FILE *midi;
|
2011-04-24 22:45:37 +04:00
|
|
|
int wave_fd[2];
|
2015-02-08 11:53:20 +03:00
|
|
|
bx_pcm_param_t wavein_param;
|
2001-04-10 05:04:59 +04:00
|
|
|
};
|
|
|
|
|
2008-07-12 19:21:36 +04:00
|
|
|
#endif
|