1 /* metaflac - Command-line FLAC metadata editor
2 * Copyright (C) 2001,2002,2003,2004,2005,2006,2007,2008,2009 Josh Coalson
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 #ifndef metaflac__options_h
20 #define metaflac__options_h
22 #include "FLAC/format.h"
25 /*[JEC] was:#if HAVE_GETOPT_LONG*/
26 /*[JEC] see flac/include/share/getopt.h as to why the change */
29 # include "share/getopt.h"
32 extern struct share__option long_options_[];
36 OP__SHOW_MIN_BLOCKSIZE,
37 OP__SHOW_MAX_BLOCKSIZE,
38 OP__SHOW_MIN_FRAMESIZE,
39 OP__SHOW_MAX_FRAMESIZE,
43 OP__SHOW_TOTAL_SAMPLES,
45 OP__SET_MIN_BLOCKSIZE,
46 OP__SET_MAX_BLOCKSIZE,
47 OP__SET_MIN_FRAMESIZE,
48 OP__SET_MAX_FRAMESIZE,
52 OP__SET_TOTAL_SAMPLES,
57 OP__REMOVE_VC_FIRSTFIELD,
61 OP__IMPORT_CUESHEET_FROM,
62 OP__EXPORT_CUESHEET_TO,
63 OP__IMPORT_PICTURE_FROM,
64 OP__EXPORT_PICTURE_TO,
79 ARG__EXCEPT_BLOCK_TYPE,
86 } Argument_StreaminfoMD5;
90 } Argument_StreaminfoUInt32;
94 } Argument_StreaminfoUInt64;
98 } Argument_VcFieldName;
101 char *field; /* the whole field as passed on the command line, i.e. "NAME=VALUE" */
103 /* according to the vorbis spec, field values can contain \0 so simple C strings are not enough here */
104 unsigned field_value_length;
106 FLAC__bool field_value_from_file; /* true if field_value holds a filename for the value, false for plain value */
114 unsigned num_entries;
116 } Argument_BlockNumber;
119 FLAC__MetadataType type;
120 char application_id[4]; /* only relevant if type == FLAC__STREAM_METADATA_TYPE_APPLICATION */
121 FLAC__bool filter_application_by_id;
122 } Argument_BlockTypeEntry;
125 unsigned num_entries;
126 Argument_BlockTypeEntry *entries;
127 } Argument_BlockType;
130 FLAC__bool is_binary;
131 } Argument_DataFormat;
139 } Argument_AddSeekpoint;
143 Argument_AddSeekpoint *add_seekpoint_link;
144 } Argument_ImportCuesheetFrom;
148 const Argument_BlockNumber *block_number_link; /* may be NULL to mean 'first PICTURE block' */
149 } Argument_ExportPictureTo;
153 } Argument_AddPadding;
158 Argument_StreaminfoMD5 streaminfo_md5;
159 Argument_StreaminfoUInt32 streaminfo_uint32;
160 Argument_StreaminfoUInt64 streaminfo_uint64;
161 Argument_VcFieldName vc_field_name;
162 Argument_VcField vc_field;
163 Argument_String filename;
164 Argument_String specification;
165 Argument_ImportCuesheetFrom import_cuesheet_from;
166 Argument_ExportPictureTo export_picture_to;
167 Argument_AddSeekpoint add_seekpoint;
168 Argument_AddPadding add_padding;
175 Argument_BlockNumber block_number;
176 Argument_BlockType block_type;
177 Argument_DataFormat data_format;
178 Argument_FromFile from_file;
183 FLAC__bool preserve_modtime;
184 FLAC__bool prefix_with_filename;
185 FLAC__bool utf8_convert;
186 FLAC__bool use_padding;
187 FLAC__bool cued_seekpoints;
188 FLAC__bool show_long_help;
189 FLAC__bool show_version;
190 FLAC__bool application_data_format_is_hexdump;
192 Operation *operations;
193 unsigned num_operations;
198 unsigned num_shorthand_ops;
199 unsigned num_major_ops;
200 FLAC__bool has_block_type;
201 FLAC__bool has_except_block_type;
204 unsigned num_arguments;
209 } CommandLineOptions;
211 void init_options(CommandLineOptions *options);
212 FLAC__bool parse_options(int argc, char *argv[], CommandLineOptions *options);
213 void free_options(CommandLineOptions *options);