summaryrefslogtreecommitdiff
path: root/src/metaflac/options.c
diff options
context:
space:
mode:
authorJosh Coalson <jcoalson@users.sourceforce.net>2005-08-31 00:30:41 +0000
committerJosh Coalson <jcoalson@users.sourceforce.net>2005-08-31 00:30:41 +0000
commit83b8d28f9d807e7cf12e4441d1a03305e16e5f3a (patch)
treeea343bf071f1e390ab5caf29409fe3db94f79445 /src/metaflac/options.c
parentb047964889cac1ff2679aecd0854e59ee8e2268b (diff)
downloadflac-83b8d28f9d807e7cf12e4441d1a03305e16e5f3a.tar.gz
add shorthand option --remove-replay-gain to metaflac
Diffstat (limited to 'src/metaflac/options.c')
-rw-r--r--src/metaflac/options.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/metaflac/options.c b/src/metaflac/options.c
index dd6f3878..0f38b6f1 100644
--- a/src/metaflac/options.c
+++ b/src/metaflac/options.c
@@ -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);