2012-06-09 14:12:05 +04:00
|
|
|
/////////////////////////////////////////////////////////////////////////
|
|
|
|
// $Id$
|
|
|
|
/////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2017-02-05 11:33:03 +03:00
|
|
|
// Copyright (C) 2012-2017 The Bochs Project
|
2012-06-09 14:12:05 +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
|
|
|
|
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
|
|
|
|
// Lowlevel sound output support for SDL written by Volker Ruppert
|
|
|
|
|
|
|
|
|
2015-02-24 00:32:34 +03:00
|
|
|
#if BX_HAVE_SOUND_SDL
|
2012-06-09 14:12:05 +04:00
|
|
|
|
|
|
|
#include "bochs.h"
|
2015-01-06 01:07:03 +03:00
|
|
|
#include <SDL_audio.h>
|
2012-06-09 14:12:05 +04:00
|
|
|
|
2015-02-13 14:30:46 +03:00
|
|
|
// the waveout class
|
2012-06-09 14:12:05 +04:00
|
|
|
|
2015-02-13 14:30:46 +03:00
|
|
|
class bx_soundlow_waveout_sdl_c : public bx_soundlow_waveout_c {
|
|
|
|
public:
|
|
|
|
bx_soundlow_waveout_sdl_c();
|
|
|
|
virtual ~bx_soundlow_waveout_sdl_c();
|
2012-06-09 14:12:05 +04:00
|
|
|
|
2015-02-13 14:30:46 +03:00
|
|
|
virtual int openwaveoutput(const char *wavedev);
|
|
|
|
virtual int set_pcm_params(bx_pcm_param_t *param);
|
2015-01-05 00:12:41 +03:00
|
|
|
|
2015-01-08 22:12:01 +03:00
|
|
|
virtual void unregister_wave_callback(int callback_id);
|
2017-02-05 11:33:03 +03:00
|
|
|
|
|
|
|
virtual void resampler(audio_buffer_t *inbuffer, audio_buffer_t *outbuffer);
|
|
|
|
|
2015-02-01 23:50:20 +03:00
|
|
|
virtual bx_bool mixer_common(Bit8u *buffer, int len);
|
2017-02-05 11:33:03 +03:00
|
|
|
|
2012-06-09 14:12:05 +04:00
|
|
|
private:
|
|
|
|
bx_bool WaveOpen;
|
2015-01-06 01:07:03 +03:00
|
|
|
SDL_AudioSpec fmt;
|
2012-06-09 14:12:05 +04:00
|
|
|
};
|
|
|
|
|
2015-02-13 14:30:46 +03:00
|
|
|
class bx_sound_sdl_c : public bx_sound_lowlevel_c {
|
|
|
|
public:
|
|
|
|
bx_sound_sdl_c();
|
|
|
|
virtual ~bx_sound_sdl_c() {}
|
|
|
|
|
|
|
|
virtual bx_soundlow_waveout_c* get_waveout();
|
|
|
|
};
|
|
|
|
|
2015-02-24 00:32:34 +03:00
|
|
|
#endif // BX_HAVE_SOUND_SDL
|