Mercurial > audlegacy-plugins
comparison src/Input/console/Classic_Emu.h @ 0:13389e613d67 trunk
[svn] - initial import of audacious-plugins tree (lots to do)
author | nenolod |
---|---|
date | Mon, 18 Sep 2006 01:11:49 -0700 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:13389e613d67 |
---|---|
1 | |
2 // Classic game music emulator interface base class for emulators which use Blip_Buffer | |
3 // for sound output. | |
4 | |
5 // Game_Music_Emu 0.3.0 | |
6 | |
7 #ifndef CLASSIC_EMU_H | |
8 #define CLASSIC_EMU_H | |
9 | |
10 #include "Music_Emu.h" | |
11 class Blip_Buffer; | |
12 class blip_eq_t; | |
13 typedef long blip_time_t; | |
14 | |
15 class Classic_Emu : public Music_Emu { | |
16 public: | |
17 Classic_Emu(); | |
18 ~Classic_Emu(); | |
19 blargg_err_t set_sample_rate( long sample_rate ); | |
20 void set_buffer( Multi_Buffer* ); | |
21 void mute_voices( int ); | |
22 void play( long, sample_t* ); | |
23 void start_track( int track ); | |
24 void set_equalizer( equalizer_t const& ); | |
25 public: | |
26 // deprecated | |
27 blargg_err_t init( long rate ) { return set_sample_rate( rate ); } | |
28 protected: | |
29 virtual blargg_err_t setup_buffer( long clock_rate ); | |
30 virtual void set_voice( int index, Blip_Buffer* center, | |
31 Blip_Buffer* left, Blip_Buffer* right ) = 0; | |
32 virtual blip_time_t run( int msec, bool* added_stereo ); | |
33 virtual blip_time_t run_clocks( blip_time_t, bool* added_stereo ); | |
34 virtual void update_eq( blip_eq_t const& ) = 0; | |
35 private: | |
36 Multi_Buffer* buf; | |
37 Multi_Buffer* stereo_buffer; | |
38 long clock_rate; | |
39 }; | |
40 | |
41 inline void Classic_Emu::set_buffer( Multi_Buffer* new_buf ) | |
42 { | |
43 assert( !buf && new_buf ); | |
44 buf = new_buf; | |
45 } | |
46 | |
47 #endif | |
48 |