- moved dummy sound output functions to a separate file

(TODO: create a separate 'soundmod' plugin, implement a PCI soundcard)
- output device / file parameter type changed to const char*
This commit is contained in:
Volker Ruppert 2011-02-13 17:26:52 +00:00
parent 2d3f3668c7
commit fa4d2822ec
10 changed files with 130 additions and 100 deletions

View File

@ -99,6 +99,7 @@ OBJS_THAT_SUPPORT_OTHER_PLUGINS = \
vmware3.o \
vmware4.o \
vvfat.o \
soundmod.o \
$(CDROM_OBJS) \
$(SOUNDLOW_OBJS) \
$(NETLOW_OBJS) \
@ -148,8 +149,8 @@ libbx_keyboard.la: keyboard.lo scancodes.lo
libbx_pit_wrap.la: pit82c54.lo pit_wrap.lo
$(LIBTOOL) --mode=link $(CXX) -module pit82c54.lo pit_wrap.lo -o libbx_pit.la -rpath $(PLUGIN_PATH)
libbx_sb16.la: sb16.lo $(SOUNDLOW_OBJS:.o=.lo)
$(LIBTOOL) --mode=link $(CXX) -module sb16.lo $(SOUNDLOW_OBJS:.o=.lo) -o libbx_sb16.la -rpath $(PLUGIN_PATH) $(SOUND_LINK_OPTS)
libbx_sb16.la: sb16.lo soundmod.lo $(SOUNDLOW_OBJS:.o=.lo)
$(LIBTOOL) --mode=link $(CXX) -module sb16.lo soundmod.lo $(SOUNDLOW_OBJS:.o=.lo) -o libbx_sb16.la -rpath $(PLUGIN_PATH) $(SOUND_LINK_OPTS)
libbx_ne2k.la: ne2k.lo $(NETLOW_OBJS:.o=.lo)
$(LIBTOOL) --mode=link $(CXX) -module ne2k.lo $(NETLOW_OBJS:.o=.lo) -o libbx_ne2k.la -rpath $(PLUGIN_PATH)
@ -183,8 +184,8 @@ bx_keyboard.dll: keyboard.o scancodes.o
bx_pit_wrap.dll: pit82c54.o pit_wrap.o
$(CXX) $(CXXFLAGS) -shared -o bx_pit.dll pit82c54.o pit_wrap.o $(WIN32_DLL_IMPORT_LIBRARY)
bx_sb16.dll: sb16.o $(SOUNDLOW_OBJS)
$(CXX) $(CXXFLAGS) -shared -o bx_sb16.dll sb16.o $(SOUNDLOW_OBJS) $(WIN32_DLL_IMPORT_LIBRARY) -lwinmm
bx_sb16.dll: sb16.o soundmod.o $(SOUNDLOW_OBJS)
$(CXX) $(CXXFLAGS) -shared -o bx_sb16.dll sb16.o soundmod.o $(SOUNDLOW_OBJS) $(WIN32_DLL_IMPORT_LIBRARY) -lwinmm
bx_ne2k.dll: ne2k.o $(NETLOW_OBJS)
$(CXX) $(CXXFLAGS) -shared -o bx_ne2k.dll ne2k.o $(NETLOW_OBJS) $(WIN32_DLL_IMPORT_LIBRARY)

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: sb16.cc,v 1.72 2011-02-10 22:58:22 vruppert Exp $
// $Id: sb16.cc,v 1.73 2011-02-13 17:25:25 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001-2011 The Bochs Project
@ -3668,78 +3668,6 @@ int bx_sb16_buffer::commandbytes(void)
return bytesneeded;
}
// The dummy output functions. They don't do anything
bx_sound_output_c::bx_sound_output_c(logfunctions *dev)
{
device = dev;
}
bx_sound_output_c::~bx_sound_output_c()
{
}
int bx_sound_output_c::waveready()
{
return BX_SOUND_OUTPUT_OK;
}
int bx_sound_output_c::midiready()
{
return BX_SOUND_OUTPUT_OK;
}
int bx_sound_output_c::openmidioutput(char *mididev)
{
UNUSED(mididev);
return BX_SOUND_OUTPUT_OK;
}
int bx_sound_output_c::sendmidicommand(int delta, int command, int length, Bit8u data[])
{
UNUSED(delta);
UNUSED(command);
UNUSED(length);
UNUSED(data);
return BX_SOUND_OUTPUT_OK;
}
int bx_sound_output_c::closemidioutput()
{
return BX_SOUND_OUTPUT_OK;
}
int bx_sound_output_c::openwaveoutput(char *wavedev)
{
UNUSED(wavedev);
return BX_SOUND_OUTPUT_OK;
}
int bx_sound_output_c::startwaveplayback(int frequency, int bits, int stereo, int format)
{
UNUSED(frequency);
UNUSED(bits);
UNUSED(stereo);
UNUSED(format);
return BX_SOUND_OUTPUT_OK;
}
int bx_sound_output_c::sendwavepacket(int length, Bit8u data[])
{
UNUSED(length);
UNUSED(data);
return BX_SOUND_OUTPUT_OK;
}
int bx_sound_output_c::stopwaveplayback()
{
return BX_SOUND_OUTPUT_OK;
}
int bx_sound_output_c::closewaveoutput()
{
return BX_SOUND_OUTPUT_OK;
}
// runtime parameter handler
Bit64s bx_sb16_c::sb16_param_handler(bx_param_c *param, int set, Bit64s val)
{

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: soundlnx.cc,v 1.24 2011-02-10 22:58:22 vruppert Exp $
// $Id: soundlnx.cc,v 1.25 2011-02-13 17:25:25 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001-2011 The Bochs Project
@ -67,7 +67,7 @@ int bx_sound_linux_c::midiready()
}
#if BX_HAVE_ALSASOUND
int bx_sound_linux_c::alsa_seq_open(char *alsadev)
int bx_sound_linux_c::alsa_seq_open(const char *alsadev)
{
char *mididev, *ptr;
int client, port, ret = 0;
@ -121,7 +121,7 @@ int bx_sound_linux_c::alsa_seq_open(char *alsadev)
}
#endif
int bx_sound_linux_c::openmidioutput(char *mididev)
int bx_sound_linux_c::openmidioutput(const char *mididev)
{
if ((mididev == NULL) || (strlen(mididev) < 1))
return BX_SOUND_OUTPUT_ERR;
@ -246,7 +246,7 @@ int bx_sound_linux_c::closemidioutput()
}
int bx_sound_linux_c::openwaveoutput(char *wavedev)
int bx_sound_linux_c::openwaveoutput(const char *wavedev)
{
#if BX_HAVE_ALSASOUND
use_alsa_pcm = !strcmp(wavedev, "alsa");

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: soundlnx.h,v 1.16 2011-02-10 22:58:22 vruppert Exp $
// $Id: soundlnx.h,v 1.17 2011-02-13 17:25:25 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001-2011 The Bochs Project
@ -41,11 +41,11 @@ public:
virtual int waveready();
virtual int midiready();
virtual int openmidioutput(char *mididev);
virtual int openmidioutput(const char *mididev);
virtual int sendmidicommand(int delta, int command, int length, Bit8u data[]);
virtual int closemidioutput();
virtual int openwaveoutput(char *wavedev);
virtual int openwaveoutput(const char *wavedev);
virtual int startwaveplayback(int frequency, int bits, int stereo, int format);
virtual int sendwavepacket(int length, Bit8u data[]);
virtual int stopwaveplayback();
@ -53,7 +53,7 @@ public:
private:
#if BX_HAVE_ALSASOUND
int alsa_seq_open(char *alsadev);
int alsa_seq_open(const char *alsadev);
int alsa_seq_output(int delta, int command, int length, Bit8u data[]);
int alsa_pcm_open(int frequency, int bits, int stereo, int format);
int alsa_pcm_write();

100
bochs/iodev/soundmod.cc Normal file
View File

@ -0,0 +1,100 @@
/////////////////////////////////////////////////////////////////////////
// $Id: soundmod.cc,v 1.1 2011-02-13 17:26:52 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2011 The Bochs Project
//
// 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
// The dummy sound output functions. They don't do anything.
// 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
#include "bochs.h"
#include "soundmod.h"
bx_sound_output_c::bx_sound_output_c(logfunctions *dev)
{
device = dev;
}
bx_sound_output_c::~bx_sound_output_c()
{
}
int bx_sound_output_c::waveready()
{
return BX_SOUND_OUTPUT_OK;
}
int bx_sound_output_c::midiready()
{
return BX_SOUND_OUTPUT_OK;
}
int bx_sound_output_c::openmidioutput(const char *mididev)
{
UNUSED(mididev);
return BX_SOUND_OUTPUT_OK;
}
int bx_sound_output_c::sendmidicommand(int delta, int command, int length, Bit8u data[])
{
UNUSED(delta);
UNUSED(command);
UNUSED(length);
UNUSED(data);
return BX_SOUND_OUTPUT_OK;
}
int bx_sound_output_c::closemidioutput()
{
return BX_SOUND_OUTPUT_OK;
}
int bx_sound_output_c::openwaveoutput(const char *wavedev)
{
UNUSED(wavedev);
return BX_SOUND_OUTPUT_OK;
}
int bx_sound_output_c::startwaveplayback(int frequency, int bits, int stereo, int format)
{
UNUSED(frequency);
UNUSED(bits);
UNUSED(stereo);
UNUSED(format);
return BX_SOUND_OUTPUT_OK;
}
int bx_sound_output_c::sendwavepacket(int length, Bit8u data[])
{
UNUSED(length);
UNUSED(data);
return BX_SOUND_OUTPUT_OK;
}
int bx_sound_output_c::stopwaveplayback()
{
return BX_SOUND_OUTPUT_OK;
}
int bx_sound_output_c::closewaveoutput()
{
return BX_SOUND_OUTPUT_OK;
}

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: soundmod.h,v 1.2 2011-02-10 22:58:22 vruppert Exp $
// $Id: soundmod.h,v 1.3 2011-02-13 17:25:25 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2011 The Bochs Project
@ -18,6 +18,7 @@
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// Common code for sound output modules
// this is the size of a DMA chunk sent to output
// it should not be too large to avoid lag, and not too
@ -45,11 +46,11 @@ public:
virtual int waveready();
virtual int midiready();
virtual int openmidioutput(char *mididev);
virtual int openmidioutput(const char *mididev);
virtual int sendmidicommand(int delta, int command, int length, Bit8u data[]);
virtual int closemidioutput();
virtual int openwaveoutput(char *wavedev);
virtual int openwaveoutput(const char *wavedev);
virtual int startwaveplayback(int frequency, int bits, int stereo, int format);
virtual int sendwavepacket(int length, Bit8u data[]);
virtual int stopwaveplayback();

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: soundosx.cc,v 1.15 2011-02-10 22:58:22 vruppert Exp $
// $Id: soundosx.cc,v 1.16 2011-02-13 17:25:25 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2004-2011 The Bochs Project
@ -92,7 +92,7 @@ int bx_sound_osx_c::midiready()
return BX_SOUND_OUTPUT_OK;
}
int bx_sound_osx_c::openmidioutput(char *mididev)
int bx_sound_osx_c::openmidioutput(const char *mididev)
{
#ifdef BX_SOUND_OSX_use_converter
ComponentDescription description;
@ -180,7 +180,7 @@ void WaveCallbackProc (SndChannelPtr chan, SndCommand *cmd)
}
#endif
int bx_sound_osx_c::openwaveoutput(char *wavedev)
int bx_sound_osx_c::openwaveoutput(const char *wavedev)
{
OSStatus err;

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: soundosx.h,v 1.6 2011-02-10 22:58:22 vruppert Exp $
// $Id: soundosx.h,v 1.7 2011-02-13 17:25:25 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2004-2011 The Bochs Project
@ -43,11 +43,11 @@ public:
virtual int waveready();
virtual int midiready();
virtual int openmidioutput(char *mididev);
virtual int openmidioutput(const char *mididev);
virtual int sendmidicommand(int delta, int command, int length, Bit8u data[]);
virtual int closemidioutput();
virtual int openwaveoutput(char *wavedev);
virtual int openwaveoutput(const char *wavedev);
virtual int startwaveplayback(int frequency, int bits, int stereo, int format);
virtual int sendwavepacket(int length, Bit8u data[]);
virtual int stopwaveplayback();

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: soundwin.cc,v 1.28 2011-02-10 22:58:22 vruppert Exp $
// $Id: soundwin.cc,v 1.29 2011-02-13 17:25:25 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001-2011 The Bochs Project
@ -110,7 +110,7 @@ int bx_sound_windows_c::midiready()
return BX_SOUND_OUTPUT_ERR;
}
int bx_sound_windows_c::openmidioutput(char *mididev)
int bx_sound_windows_c::openmidioutput(const char *mididev)
{
// could make the output device selectable,
// but currently only the midi mapper is supported
@ -185,7 +185,7 @@ int bx_sound_windows_c::closemidioutput()
return (ret == 0) ? BX_SOUND_OUTPUT_OK : BX_SOUND_OUTPUT_ERR;
}
int bx_sound_windows_c::openwaveoutput(char *wavedev)
int bx_sound_windows_c::openwaveoutput(const char *wavedev)
{
// could make the output device selectable,
// but currently only the wave mapper is supported

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: soundwin.h,v 1.10 2011-02-10 22:58:22 vruppert Exp $
// $Id: soundwin.h,v 1.11 2011-02-13 17:25:25 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001-2011 The Bochs Project
@ -172,11 +172,11 @@ public:
virtual int waveready();
virtual int midiready();
virtual int openmidioutput(char *mididev);
virtual int openmidioutput(const char *mididev);
virtual int sendmidicommand(int delta, int command, int length, Bit8u data[]);
virtual int closemidioutput();
virtual int openwaveoutput(char *wavedev);
virtual int openwaveoutput(const char *wavedev);
virtual int startwaveplayback(int frequency, int bits, int stereo, int format);
virtual int sendwavepacket(int length, Bit8u data[]);
virtual int stopwaveplayback();