cannam@86
|
1 /* flac - Command-line FLAC encoder/decoder
|
cannam@86
|
2 * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson
|
cannam@86
|
3 *
|
cannam@86
|
4 * This program is free software; you can redistribute it and/or
|
cannam@86
|
5 * modify it under the terms of the GNU General Public License
|
cannam@86
|
6 * as published by the Free Software Foundation; either version 2
|
cannam@86
|
7 * of the License, or (at your option) any later version.
|
cannam@86
|
8 *
|
cannam@86
|
9 * This program is distributed in the hope that it will be useful,
|
cannam@86
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
cannam@86
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
cannam@86
|
12 * GNU General Public License for more details.
|
cannam@86
|
13 *
|
cannam@86
|
14 * You should have received a copy of the GNU General Public License
|
cannam@86
|
15 * along with this program; if not, write to the Free Software
|
cannam@86
|
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
cannam@86
|
17 */
|
cannam@86
|
18
|
cannam@86
|
19 #ifndef flac__utils_h
|
cannam@86
|
20 #define flac__utils_h
|
cannam@86
|
21
|
cannam@86
|
22 #if HAVE_CONFIG_H
|
cannam@86
|
23 # include <config.h>
|
cannam@86
|
24 #endif
|
cannam@86
|
25
|
cannam@86
|
26 #include "FLAC/ordinals.h"
|
cannam@86
|
27 #include "FLAC/format.h" /* for FLAC__StreamMetadata_CueSheet */
|
cannam@86
|
28 #include <stdio.h> /* for FILE */
|
cannam@86
|
29
|
cannam@86
|
30 typedef struct {
|
cannam@86
|
31 FLAC__bool is_relative; /* i.e. specification string started with + or - */
|
cannam@86
|
32 FLAC__bool value_is_samples;
|
cannam@86
|
33 union {
|
cannam@86
|
34 double seconds;
|
cannam@86
|
35 FLAC__int64 samples;
|
cannam@86
|
36 } value;
|
cannam@86
|
37 } utils__SkipUntilSpecification;
|
cannam@86
|
38
|
cannam@86
|
39 typedef struct {
|
cannam@86
|
40 FLAC__bool has_start_point, has_end_point;
|
cannam@86
|
41 unsigned start_track, start_index;
|
cannam@86
|
42 unsigned end_track, end_index;
|
cannam@86
|
43 } utils__CueSpecification;
|
cannam@86
|
44
|
cannam@86
|
45 #ifdef FLAC__VALGRIND_TESTING
|
cannam@86
|
46 size_t flac__utils_fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream);
|
cannam@86
|
47 #else
|
cannam@86
|
48 #define flac__utils_fwrite fwrite
|
cannam@86
|
49 #endif
|
cannam@86
|
50
|
cannam@86
|
51 extern int flac__utils_verbosity_;
|
cannam@86
|
52 void flac__utils_printf(FILE *stream, int level, const char *format, ...);
|
cannam@86
|
53
|
cannam@86
|
54 FLAC__bool flac__utils_parse_skip_until_specification(const char *s, utils__SkipUntilSpecification *spec);
|
cannam@86
|
55 void flac__utils_canonicalize_skip_until_specification(utils__SkipUntilSpecification *spec, unsigned sample_rate);
|
cannam@86
|
56
|
cannam@86
|
57 FLAC__bool flac__utils_parse_cue_specification(const char *s, utils__CueSpecification *spec);
|
cannam@86
|
58 void flac__utils_canonicalize_cue_specification(const utils__CueSpecification *cue_spec, const FLAC__StreamMetadata_CueSheet *cuesheet, FLAC__uint64 total_samples, utils__SkipUntilSpecification *skip_spec, utils__SkipUntilSpecification *until_spec);
|
cannam@86
|
59
|
cannam@86
|
60 FLAC__bool flac__utils_set_channel_mask_tag(FLAC__StreamMetadata *object, FLAC__uint32 channel_mask);
|
cannam@86
|
61 FLAC__bool flac__utils_get_channel_mask_tag(const FLAC__StreamMetadata *object, FLAC__uint32 *channel_mask);
|
cannam@86
|
62
|
cannam@86
|
63 #endif
|