1 /* metaflac - Command-line FLAC metadata editor
2 * Copyright (C) 2001-2009 Josh Coalson
3 * Copyright (C) 2011-2013 Xiph.Org Foundation
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #ifndef metaflac__options_h
21 #define metaflac__options_h
23 #include "FLAC/format.h"
26 /*[JEC] was:#if HAVE_GETOPT_LONG*/
27 /*[JEC] see flac/include/share/getopt.h as to why the change */
30 # include "share/getopt.h"
33 extern struct share__option long_options_[];
37 OP__SHOW_MIN_BLOCKSIZE,
38 OP__SHOW_MAX_BLOCKSIZE,
39 OP__SHOW_MIN_FRAMESIZE,
40 OP__SHOW_MAX_FRAMESIZE,
44 OP__SHOW_TOTAL_SAMPLES,
46 OP__SET_MIN_BLOCKSIZE,
47 OP__SET_MAX_BLOCKSIZE,
48 OP__SET_MIN_FRAMESIZE,
49 OP__SET_MAX_FRAMESIZE,
53 OP__SET_TOTAL_SAMPLES,
58 OP__REMOVE_VC_FIRSTFIELD,
62 OP__IMPORT_CUESHEET_FROM,
63 OP__EXPORT_CUESHEET_TO,
64 OP__IMPORT_PICTURE_FROM,
65 OP__EXPORT_PICTURE_TO,
80 ARG__EXCEPT_BLOCK_TYPE,
87 } Argument_StreaminfoMD5;
91 } Argument_StreaminfoUInt32;
95 } Argument_StreaminfoUInt64;
99 } Argument_VcFieldName;
102 char *field; /* the whole field as passed on the command line, i.e. "NAME=VALUE" */
104 /* according to the vorbis spec, field values can contain \0 so simple C strings are not enough here */
105 unsigned field_value_length;
107 FLAC__bool field_value_from_file; /* true if field_value holds a filename for the value, false for plain value */
115 unsigned num_entries;
117 } Argument_BlockNumber;
120 FLAC__MetadataType type;
121 char application_id[4]; /* only relevant if type == FLAC__STREAM_METADATA_TYPE_APPLICATION */
122 FLAC__bool filter_application_by_id;
123 } Argument_BlockTypeEntry;
126 unsigned num_entries;
127 Argument_BlockTypeEntry *entries;
128 } Argument_BlockType;
131 FLAC__bool is_binary;
132 } Argument_DataFormat;
140 } Argument_AddSeekpoint;
144 Argument_AddSeekpoint *add_seekpoint_link;
145 } Argument_ImportCuesheetFrom;
149 const Argument_BlockNumber *block_number_link; /* may be NULL to mean 'first PICTURE block' */
150 } Argument_ExportPictureTo;
154 } Argument_AddPadding;
159 Argument_StreaminfoMD5 streaminfo_md5;
160 Argument_StreaminfoUInt32 streaminfo_uint32;
161 Argument_StreaminfoUInt64 streaminfo_uint64;
162 Argument_VcFieldName vc_field_name;
163 Argument_VcField vc_field;
164 Argument_String filename;
165 Argument_String specification;
166 Argument_ImportCuesheetFrom import_cuesheet_from;
167 Argument_ExportPictureTo export_picture_to;
168 Argument_AddSeekpoint add_seekpoint;
169 Argument_AddPadding add_padding;
176 Argument_BlockNumber block_number;
177 Argument_BlockType block_type;
178 Argument_DataFormat data_format;
179 Argument_FromFile from_file;
184 FLAC__bool preserve_modtime;
185 FLAC__bool prefix_with_filename;
186 FLAC__bool utf8_convert;
187 FLAC__bool use_padding;
188 FLAC__bool cued_seekpoints;
189 FLAC__bool show_long_help;
190 FLAC__bool show_version;
191 FLAC__bool application_data_format_is_hexdump;
193 Operation *operations;
194 unsigned num_operations;
199 unsigned num_shorthand_ops;
200 unsigned num_major_ops;
201 FLAC__bool has_block_type;
202 FLAC__bool has_except_block_type;
205 unsigned num_arguments;
210 } CommandLineOptions;
212 void init_options(CommandLineOptions *options);
213 FLAC__bool parse_options(int argc, char *argv[], CommandLineOptions *options);
214 void free_options(CommandLineOptions *options);