2017-03-14 21:21:05 +03:00
|
|
|
/////////////////////////////////////////////////////////////////////////
|
|
|
|
// $Id$
|
|
|
|
/////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2021-01-23 15:06:11 +03:00
|
|
|
// Copyright (C) 2011-2021 The Bochs Project
|
2017-03-14 21:21:05 +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
|
|
|
|
|
|
|
|
// Define BX_PLUGGABLE in files that can be compiled into plugins. For
|
|
|
|
// platforms that require a special tag on exported symbols, BX_PLUGGABLE
|
|
|
|
// is used to know when we are exporting symbols and when we are importing.
|
|
|
|
#define BX_PLUGGABLE
|
|
|
|
|
|
|
|
// The dummy sound driver contains stubs for all features
|
|
|
|
|
2021-03-12 00:46:25 +03:00
|
|
|
#include "bochs.h"
|
|
|
|
#include "plugin.h"
|
2017-03-14 21:21:05 +03:00
|
|
|
|
|
|
|
#if BX_SUPPORT_SOUNDLOW
|
|
|
|
|
|
|
|
#include "soundlow.h"
|
|
|
|
|
2021-01-27 23:06:02 +03:00
|
|
|
PLUGIN_ENTRY_FOR_SND_MODULE(dummy)
|
2017-03-14 21:21:05 +03:00
|
|
|
{
|
2021-02-07 19:16:06 +03:00
|
|
|
if (mode == PLUGIN_PROBE) {
|
|
|
|
return (int)PLUGTYPE_SND;
|
|
|
|
}
|
2017-03-14 21:21:05 +03:00
|
|
|
return 0; // Success
|
|
|
|
}
|
|
|
|
|
|
|
|
class bx_sound_dummy_c : public bx_sound_lowlevel_c {
|
|
|
|
public:
|
|
|
|
bx_sound_dummy_c() : bx_sound_lowlevel_c("dummy") {}
|
|
|
|
virtual ~bx_sound_dummy_c() {}
|
|
|
|
|
|
|
|
virtual bx_soundlow_waveout_c* get_waveout();
|
|
|
|
virtual bx_soundlow_wavein_c* get_wavein();
|
|
|
|
virtual bx_soundlow_midiout_c* get_midiout();
|
|
|
|
} bx_sound_dummy;
|
|
|
|
|
2017-03-18 02:09:18 +03:00
|
|
|
// the dummy waveout class
|
|
|
|
|
|
|
|
class bx_soundlow_waveout_dummy_c : public bx_soundlow_waveout_c {
|
|
|
|
public:
|
|
|
|
bx_soundlow_waveout_dummy_c() : bx_soundlow_waveout_c() {}
|
|
|
|
virtual ~bx_soundlow_waveout_dummy_c() {}
|
|
|
|
|
|
|
|
virtual int sendwavepacket(int length, Bit8u data[], bx_pcm_param_t *src_param);
|
|
|
|
|
|
|
|
virtual int register_wave_callback(void *, get_wave_cb_t wd_cb);
|
|
|
|
virtual void unregister_wave_callback(int callback_id);
|
|
|
|
};
|
|
|
|
|
2017-03-14 21:21:05 +03:00
|
|
|
// bx_sound_dummy_c class implementation
|
|
|
|
|
|
|
|
bx_soundlow_waveout_c* bx_sound_dummy_c::get_waveout()
|
|
|
|
{
|
|
|
|
if (waveout == NULL) {
|
2017-03-18 02:09:18 +03:00
|
|
|
waveout = new bx_soundlow_waveout_dummy_c();
|
2017-03-14 21:21:05 +03:00
|
|
|
}
|
|
|
|
return waveout;
|
|
|
|
}
|
|
|
|
|
|
|
|
bx_soundlow_wavein_c* bx_sound_dummy_c::get_wavein()
|
|
|
|
{
|
|
|
|
if (wavein == NULL) {
|
|
|
|
wavein = new bx_soundlow_wavein_c();
|
|
|
|
}
|
|
|
|
return wavein;
|
|
|
|
}
|
|
|
|
|
|
|
|
bx_soundlow_midiout_c* bx_sound_dummy_c::get_midiout()
|
|
|
|
{
|
|
|
|
if (midiout == NULL) {
|
|
|
|
midiout = new bx_soundlow_midiout_c();
|
|
|
|
}
|
|
|
|
return midiout;
|
|
|
|
}
|
|
|
|
|
2017-03-18 02:09:18 +03:00
|
|
|
// bx_sound_waveout_dummy_c class implementation
|
|
|
|
|
|
|
|
int bx_soundlow_waveout_dummy_c::sendwavepacket(int length, Bit8u data[], bx_pcm_param_t *src_param)
|
|
|
|
{
|
|
|
|
UNUSED(length);
|
|
|
|
UNUSED(data);
|
|
|
|
UNUSED(src_param);
|
|
|
|
return BX_SOUNDLOW_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
int bx_soundlow_waveout_dummy_c::register_wave_callback(void *arg, get_wave_cb_t wd_cb)
|
|
|
|
{
|
|
|
|
UNUSED(arg);
|
|
|
|
UNUSED(wd_cb);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
void bx_soundlow_waveout_dummy_c::unregister_wave_callback(int callback_id)
|
|
|
|
{
|
|
|
|
UNUSED(callback_id);
|
|
|
|
}
|
|
|
|
|
2017-03-14 21:21:05 +03:00
|
|
|
#endif
|