shithub: dumb

Download patch

ref: ee94f03e1d576e6879122dc992f01f2df0b0078c
parent: e1e2edd45fe09a616b336f4e59fcff069da6af4e
author: Chris Moeller <kode54@gmail.com>
date: Sun Mar 23 09:05:08 EDT 2014

Oops wrong header

--- a/dumb/include/internal/resampler.h
+++ b/dumb/include/internal/resampler.h
@@ -1,39 +1,52 @@
-#ifndef _SINC_RESAMPLER_H_
-#define _SINC_RESAMPLER_H_
+#ifndef _RESAMPLER_H_
+#define _RESAMPLER_H_
 
 // Ugglay
-#ifdef SINC_DECORATE
+#ifdef RESAMPLER_DECORATE
 #define PASTE(a,b) a ## b
 #define EVALUATE(a,b) PASTE(a,b)
-#define sinc_init EVALUATE(SINC_DECORATE,_sinc_init)
-#define sinc_resampler_create EVALUATE(SINC_DECORATE,_sinc_resampler_create)
-#define sinc_resampler_delete EVALUATE(SINC_DECORATE,_sinc_resampler_delete)
-#define sinc_resampler_dup EVALUATE(SINC_DECORATE,_sinc_resampler_dup)
-#define sinc_resampler_dup_inplace EVALUATE(SINC_DECORATE,_sinc_resampler_dup_inplace)
-#define sinc_resampler_get_free_count EVALUATE(SINC_DECORATE,_sinc_resampler_get_free_count)
-#define sinc_resampler_write_sample EVALUATE(SINC_DECORATE,_sinc_resampler_write_sample)
-#define sinc_resampler_set_rate EVALUATE(SINC_DECORATE,_sinc_resampler_set_rate)
-#define sinc_resampler_ready EVALUATE(SINC_DECORATE,_sinc_resampler_ready)
-#define sinc_resampler_clear EVALUATE(SINC_DECORATE,_sinc_resampler_clear)
-#define sinc_resampler_get_sample_count EVALUATE(SINC_DECORATE,_sinc_resampler_get_sample_count)
-#define sinc_resampler_get_sample EVALUATE(SINC_DECORATE,_sinc_resampler_get_sample)
-#define sinc_resampler_remove_sample EVALUATE(SINC_DECORATE,_sinc_resampler_remove_sample)
+#define resampler_init EVALUATE(RESAMPLER_DECORATE,_resampler_init)
+#define resampler_create EVALUATE(RESAMPLER_DECORATE,_resampler_create)
+#define resampler_delete EVALUATE(RESAMPLER_DECORATE,_resampler_delete)
+#define resampler_dup EVALUATE(RESAMPLER_DECORATE,_resampler_dup)
+#define resampler_dup_inplace EVALUATE(RESAMPLER_DECORATE,_resampler_dup_inplace)
+#define resampler_set_quality EVALUATE(RESAMPLER_DECORATE,_resampler_set_quality)
+#define resampler_get_free_count EVALUATE(RESAMPLER_DECORATE,_resampler_get_free_count)
+#define resampler_write_sample EVALUATE(RESAMPLER_DECORATE,_resampler_write_sample)
+#define resampler_set_rate EVALUATE(RESAMPLER_DECORATE,_resampler_set_rate)
+#define resampler_ready EVALUATE(RESAMPLER_DECORATE,_resampler_ready)
+#define resampler_clear EVALUATE(RESAMPLER_DECORATE,_resampler_clear)
+#define resampler_get_sample_count EVALUATE(RESAMPLER_DECORATE,_resampler_get_sample_count)
+#define resampler_get_sample EVALUATE(RESAMPLER_DECORATE,_resampler_get_sample)
+#define resampler_remove_sample EVALUATE(RESAMPLER_DECORATE,_resampler_remove_sample)
 #endif
 
-void sinc_init(void);
+void resampler_init(void);
 
-void * sinc_resampler_create(void);
-void sinc_resampler_delete(void *);
-void * sinc_resampler_dup(const void *);
-void sinc_resampler_dup_inplace(void *, const void *);
+void * resampler_create(void);
+void resampler_delete(void *);
+void * resampler_dup(const void *);
+void resampler_dup_inplace(void *, const void *);
 
-int sinc_resampler_get_free_count(void *);
-void sinc_resampler_write_sample(void *, short sample);
-void sinc_resampler_set_rate( void *, double new_factor );
-int sinc_resampler_ready(void *);
-void sinc_resampler_clear(void *);
-int sinc_resampler_get_sample_count(void *);
-int sinc_resampler_get_sample(void *);
-void sinc_resampler_remove_sample(void *);
+enum
+{
+    RESAMPLER_QUALITY_MIN = 0,
+    RESAMPLER_QUALITY_ZOH = 0,
+    RESAMPLER_QUALITY_LINEAR = 1,
+    RESAMPLER_QUALITY_CUBIC = 2,
+    RESAMPLER_QUALITY_SINC = 3,
+    RESAMPLER_QUALITY_MAX = 3
+};
+
+void resampler_set_quality(void *, int quality);
+
+int resampler_get_free_count(void *);
+void resampler_write_sample(void *, short sample);
+void resampler_set_rate( void *, double new_factor );
+int resampler_ready(void *);
+void resampler_clear(void *);
+int resampler_get_sample_count(void *);
+int resampler_get_sample(void *);
+void resampler_remove_sample(void *);
 
 #endif