1 /* in_flac - Winamp2 FLAC input plugin
\r
2 * Copyright (C) 2000,2001,2002,2003,2004,2005,2006 Josh Coalson
\r
4 * This program is free software; you can redistribute it and/or
\r
5 * modify it under the terms of the GNU General Public License
\r
6 * as published by the Free Software Foundation; either version 2
\r
7 * of the License, or (at your option) any later version.
\r
9 * This program is distributed in the hope that it will be useful,
\r
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
12 * GNU General Public License for more details.
\r
14 * You should have received a copy of the GNU General Public License
\r
15 * along with this program; if not, write to the Free Software
\r
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
\r
19 #include "FLAC/all.h"
\r
20 #include "share/replaygain_synthesis.h"
\r
21 #include "plugin_common/all.h"
\r
27 #define SAMPLES_PER_WRITE 576
\r
29 #define BITRATE_HIST_SEGMENT_MSEC 500
\r
30 #define BITRATE_HIST_SIZE 64
\r
37 volatile FLAC__bool is_playing;
\r
38 volatile FLAC__bool abort_flag;
\r
39 volatile FLAC__bool eof;
\r
40 volatile int seek_to;
\r
41 FLAC__uint64 total_samples;
\r
42 unsigned bits_per_sample;
\r
43 unsigned output_bits_per_sample;
\r
45 unsigned sample_rate;
\r
46 int length_in_msec; /* int (instead of FLAC__uint64) only because that's what Winamp uses; seeking won't work right if this maxes out */
\r
47 unsigned average_bps;
\r
48 FLAC__bool has_replaygain;
\r
49 double replay_scale;
\r
50 DitherContext dither_context;
\r
51 } stream_data_struct;
\r
57 FLAC__bool album_mode;
\r
59 FLAC__bool hard_limit;
\r
63 FLAC__bool dither_24_to_16;
\r
67 int noise_shaping; /* value must be one of NoiseShaping enum, see plugin_common/replaygain_synthesis.h */
\r
72 FLAC__bool stop_err;
\r
80 FLAC__bool FLAC_plugin__decoder_init(FLAC__StreamDecoder *decoder, const char *filename, FLAC__int64 filesize, stream_data_struct *stream_data, output_config_t *config);
\r
81 void FLAC_plugin__decoder_finish(FLAC__StreamDecoder *decoder);
\r
82 void FLAC_plugin__decoder_delete(FLAC__StreamDecoder *decoder);
\r
84 int FLAC_plugin__seek(FLAC__StreamDecoder *decoder, stream_data_struct *stream_data);
\r
85 unsigned FLAC_plugin__decode(FLAC__StreamDecoder *decoder, stream_data_struct *stream_data, char *sample_buffer);
\r
86 int FLAC_plugin__get_rate(unsigned written_time, unsigned output_time, stream_data_struct *stream_data);
\r
89 * these should be defined in plug-in
\r
92 extern void FLAC_plugin__show_error(const char *message,...);
\r