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
|
|
|
|
2015-02-24 00:32:34 +03:00
|
|
|
#if BX_HAVE_SOUND_OSS
|
2001-04-10 05:04:59 +04:00
|
|
|
|
2015-02-13 14:30:46 +03:00
|
|
|
class bx_soundlow_waveout_oss_c : public bx_soundlow_waveout_c {
|
|
|
|
public:
|
|
|
|
bx_soundlow_waveout_oss_c();
|
|
|
|
virtual ~bx_soundlow_waveout_oss_c();
|
|
|
|
|
|
|
|
virtual int openwaveoutput(const char *wavedev);
|
|
|
|
virtual int set_pcm_params(bx_pcm_param_t *param);
|
|
|
|
virtual int output(int length, Bit8u data[]);
|
|
|
|
private:
|
|
|
|
int waveout_fd;
|
|
|
|
};
|
|
|
|
|
2015-02-14 20:25:39 +03:00
|
|
|
class bx_soundlow_wavein_oss_c : public bx_soundlow_wavein_c {
|
|
|
|
public:
|
|
|
|
bx_soundlow_wavein_oss_c();
|
|
|
|
virtual ~bx_soundlow_wavein_oss_c();
|
|
|
|
|
|
|
|
virtual int openwaveinput(const char *wavedev, sound_record_handler_t rh);
|
|
|
|
virtual int startwaverecord(bx_pcm_param_t *param);
|
|
|
|
virtual int getwavepacket(int length, Bit8u data[]);
|
|
|
|
virtual int stopwaverecord();
|
|
|
|
|
|
|
|
static void record_timer_handler(void *);
|
|
|
|
void record_timer(void);
|
|
|
|
private:
|
|
|
|
int wavein_fd;
|
|
|
|
bx_pcm_param_t wavein_param;
|
|
|
|
};
|
|
|
|
|
2015-02-15 21:32:36 +03:00
|
|
|
class bx_soundlow_midiout_oss_c : public bx_soundlow_midiout_c {
|
2001-04-10 05:04:59 +04:00
|
|
|
public:
|
2015-02-15 21:32:36 +03:00
|
|
|
bx_soundlow_midiout_oss_c();
|
|
|
|
virtual ~bx_soundlow_midiout_oss_c();
|
2012-06-09 00:49:39 +04:00
|
|
|
|
2011-04-22 17:11:47 +04:00
|
|
|
virtual int openmidioutput(const char *mididev);
|
|
|
|
virtual int sendmidicommand(int delta, int command, int length, Bit8u data[]);
|
2015-02-17 21:28:25 +03:00
|
|
|
virtual int closemidioutput();
|
2001-04-10 05:04:59 +04:00
|
|
|
|
|
|
|
private:
|
2008-07-19 16:01:54 +04:00
|
|
|
FILE *midi;
|
2001-04-10 05:04:59 +04:00
|
|
|
};
|
|
|
|
|
2015-02-15 21:32:36 +03:00
|
|
|
class bx_sound_oss_c : public bx_sound_lowlevel_c {
|
|
|
|
public:
|
|
|
|
bx_sound_oss_c();
|
|
|
|
virtual ~bx_sound_oss_c() {}
|
|
|
|
|
|
|
|
virtual bx_soundlow_waveout_c* get_waveout();
|
|
|
|
virtual bx_soundlow_wavein_c* get_wavein();
|
|
|
|
virtual bx_soundlow_midiout_c* get_midiout();
|
|
|
|
};
|
|
|
|
|
2008-07-12 19:21:36 +04:00
|
|
|
#endif
|