mirror of
https://github.com/claunia/flac.git
synced 2025-12-16 18:54:26 +00:00
add shorthand option --remove-replay-gain to metaflac
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
#include "usage.h"
|
||||
#include "utils.h"
|
||||
#include "FLAC/assert.h"
|
||||
#include "share/grabbag/replaygain.h"
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -76,6 +77,7 @@ struct share__option long_options_[] = {
|
||||
{ "export-cuesheet-to", 1, 0, 0 },
|
||||
{ "add-seekpoint", 1, 0, 0 },
|
||||
{ "add-replay-gain", 0, 0, 0 },
|
||||
{ "remove-replay-gain", 0, 0, 0 },
|
||||
{ "add-padding", 1, 0, 0 },
|
||||
/* major operations */
|
||||
{ "help", 0, 0, 0 },
|
||||
@@ -568,6 +570,19 @@ FLAC__bool parse_option(int option_index, const char *option_argument, CommandLi
|
||||
else if(0 == strcmp(opt, "add-replay-gain")) {
|
||||
(void) append_shorthand_operation(options, OP__ADD_REPLAY_GAIN);
|
||||
}
|
||||
else if(0 == strcmp(opt, "remove-replay-gain")) {
|
||||
const FLAC__byte * const tags[4] = {
|
||||
GRABBAG__REPLAYGAIN_TAG_TITLE_GAIN,
|
||||
GRABBAG__REPLAYGAIN_TAG_TITLE_PEAK,
|
||||
GRABBAG__REPLAYGAIN_TAG_ALBUM_GAIN,
|
||||
GRABBAG__REPLAYGAIN_TAG_ALBUM_PEAK
|
||||
};
|
||||
size_t i;
|
||||
for(i = 0; i < sizeof(tags)/sizeof(tags[0]); i++) {
|
||||
op = append_shorthand_operation(options, OP__REMOVE_VC_FIELD);
|
||||
op->argument.vc_field_name.value = local_strdup((const char *)tags[i]);
|
||||
}
|
||||
}
|
||||
else if(0 == strcmp(opt, "add-padding")) {
|
||||
op = append_shorthand_operation(options, OP__ADD_PADDING);
|
||||
FLAC__ASSERT(0 != option_argument);
|
||||
|
||||
@@ -149,6 +149,7 @@ int long_usage(const char *message, ...)
|
||||
fprintf(out, " must have the same resolution, sample rate, and number\n");
|
||||
fprintf(out, " of channels. The sample rate must be one of 8, 11.025,\n");
|
||||
fprintf(out, " 12, 16, 22.05, 24, 32, 44.1, or 48 kHz.\n");
|
||||
fprintf(out, "--remove-replay-gain Removes the ReplayGain tags.\n");
|
||||
fprintf(out, "--add-seekpoint={#|X|#x|#s} Add seek points to a SEEKTABLE block\n");
|
||||
fprintf(out, " # : a specific sample number for a seek point\n");
|
||||
fprintf(out, " X : a placeholder point (always goes at the end of the SEEKTABLE)\n");
|
||||
|
||||
Reference in New Issue
Block a user