decode.h 2.45 KB
Newer Older
Josh Coalson's avatar
Josh Coalson committed
1
/* flac - Command-line FLAC encoder/decoder
Josh Coalson's avatar
Josh Coalson committed
2
 * Copyright (C) 2000,2001,2002,2003,2004,2005,2006  Josh Coalson
Josh Coalson's avatar
Josh Coalson committed
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */

#ifndef flac__decode_h
#define flac__decode_h

Josh Coalson's avatar
Josh Coalson committed
22
#include "analyze.h"
23
#include "utils.h"
24
#include "share/replaygain_synthesis.h"
Josh Coalson's avatar
Josh Coalson committed
25

Josh Coalson's avatar
Josh Coalson committed
26 27 28 29
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

30 31 32 33 34 35 36 37
typedef struct {
	FLAC__bool apply;
	FLAC__bool use_album_gain; /* false => use track gain */
	enum { RGSS_LIMIT__NONE, RGSS_LIMIT__PEAK, RGSS_LIMIT__HARD} limiter;
	NoiseShaping noise_shaping;
	double preamp;
} replaygain_synthesis_spec_t;

38
typedef struct {
39
	FLAC__bool continue_through_decode_errors;
40
	replaygain_synthesis_spec_t replaygain_synthesis_spec;
41
#ifdef FLAC__HAS_OGG
42
	FLAC__bool is_ogg;
43 44
	FLAC__bool use_first_serial_number;
	long serial_number;
45
#endif
46
	utils__SkipUntilSpecification skip_specification;
47
	utils__SkipUntilSpecification until_specification;
48 49
	FLAC__bool has_cue_specification;
	utils__CueSpecification cue_specification;
50
	FLAC__bool channel_map_none; /* --channel-map=none specified, eventually will expand to take actual channel map */
51 52
} decode_options_t;

53
/* used for AIFF also */
54 55 56 57 58 59 60 61 62 63 64
typedef struct {
	decode_options_t common;
} wav_decode_options_t;

typedef struct {
	decode_options_t common;

	FLAC__bool is_big_endian;
	FLAC__bool is_unsigned_samples;
} raw_decode_options_t;

65
/* outfile == 0 => test only */
66
int flac__decode_aiff(const char *infilename, const char *outfilename, FLAC__bool analysis_mode, analysis_options aopts, wav_decode_options_t options);
Josh Coalson's avatar
Josh Coalson committed
67 68
int flac__decode_wav(const char *infilename, const char *outfilename, FLAC__bool analysis_mode, analysis_options aopts, wav_decode_options_t options);
int flac__decode_raw(const char *infilename, const char *outfilename, FLAC__bool analysis_mode, analysis_options aopts, raw_decode_options_t options);
Josh Coalson's avatar
Josh Coalson committed
69 70

#endif