1 /* 2 * Copyright (C) 2004 2005 2006, Magnus Hjorth 3 * 4 * This file is part of mhWaveEdit. 5 * 6 * mhWaveEdit is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * 11 * mhWaveEdit is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with mhWaveEdit; if not, write to the Free Software 18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 19 */ 20 21 22 /* Routines for converting sample rate, both realtime and block-based */ 23 24 #ifndef RATECONV_H_INCLUDED 25 #define RATECONV_H_INCLUDED 26 27 #include "datasource.h" 28 29 int rateconv_driver_count(gboolean realtime); 30 const char *rateconv_driver_id(gboolean realtime, int index); 31 const char *rateconv_driver_name(gboolean realtime, int index); 32 int rateconv_driver_index(gboolean realtime, const gchar *driver_id); 33 34 typedef void rateconv; 35 /* Returns TRUE if the converter prefers in/out data in floating-point format, 36 * for quality reasons. */ 37 gboolean rateconv_prefers_float(const char *driver_id); 38 rateconv *rateconv_new(gboolean realtime, const char *driver_id, 39 Dataformat *format, guint32 outrate, int dither_mode, 40 gboolean passthru); 41 /* data == NULL means no more data will be sent */ 42 gint rateconv_write(rateconv *conv, void *data, guint bufsize); 43 gint rateconv_read(rateconv *conv, void *buffer, guint bufsize); 44 gboolean rateconv_hasdata(rateconv *conv); 45 void rateconv_destroy(rateconv *conv); 46 47 /* Only for realtime converters */ 48 void rateconv_set_outrate(rateconv *conv, guint32 outrate); 49 50 #endif 51