summaryrefslogtreecommitdiff
path: root/apps/codecs/libgme/resampler.h
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/libgme/resampler.h')
-rw-r--r--apps/codecs/libgme/resampler.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/apps/codecs/libgme/resampler.h b/apps/codecs/libgme/resampler.h
index 1d8f86670b..3f3710a54a 100644
--- a/apps/codecs/libgme/resampler.h
+++ b/apps/codecs/libgme/resampler.h
@@ -7,16 +7,15 @@
7#include "blargg_common.h" 7#include "blargg_common.h"
8#include "multi_buffer.h" 8#include "multi_buffer.h"
9 9
10typedef short sample_t; 10typedef short dsample_t;
11 11
12enum { stereo = 2 };
13enum { max_buf_size = 3960 }; 12enum { max_buf_size = 3960 };
14enum { max_resampler_size = 5942 }; 13enum { max_resampler_size = 5942 };
15enum { write_offset = 8 * stereo }; 14enum { write_offset = 8 * stereo };
16enum { gain_bits = 14 }; 15enum { gain_bits = 14 };
17 16
18struct Resampler { 17struct Resampler {
19 int (*callback)( void*, blip_time_t, int, sample_t* ); 18 int (*callback)( void*, blip_time_t, int, dsample_t* );
20 void* callback_data; 19 void* callback_data;
21 20
22 int sample_buffer_size; 21 int sample_buffer_size;
@@ -34,8 +33,8 @@ struct Resampler {
34 33
35 int rate_; 34 int rate_;
36 35
37 sample_t sample_buf [max_buf_size]; 36 dsample_t sample_buf [max_buf_size];
38 sample_t buf [max_resampler_size]; // Internal resampler 37 dsample_t buf [max_resampler_size]; // Internal resampler
39}; 38};
40 39
41static inline void Resampler_init( struct Resampler* this ) 40static inline void Resampler_init( struct Resampler* this )
@@ -50,9 +49,9 @@ static inline void Resampler_init( struct Resampler* this )
50 49
51blargg_err_t Resampler_reset( struct Resampler* this, int max_pairs ); 50blargg_err_t Resampler_reset( struct Resampler* this, int max_pairs );
52void Resampler_resize( struct Resampler* this, int pairs_per_frame ); 51void Resampler_resize( struct Resampler* this, int pairs_per_frame );
53void Resampler_play( struct Resampler* this, int count, sample_t* out, struct Blip_Buffer* ); 52void Resampler_play( struct Resampler* this, int count, dsample_t* out, struct Blip_Buffer* );
54 53
55static inline void Resampler_set_callback(struct Resampler* this, int (*func)( void*, blip_time_t, int, sample_t* ), void* user_data ) 54static inline void Resampler_set_callback(struct Resampler* this, int (*func)( void*, blip_time_t, int, dsample_t* ), void* user_data )
56{ 55{
57 this->callback = func; 56 this->callback = func;
58 this->callback_data = user_data; 57 this->callback_data = user_data;