diff options
author | Alexey Yakovenko <wakeroid@gmail.com> | 2010-04-06 23:40:33 +0200 |
---|---|---|
committer | Alexey Yakovenko <wakeroid@gmail.com> | 2010-04-06 23:40:33 +0200 |
commit | 4cf0cf6185fffcd26ed4db15a832647d7409d86a (patch) | |
tree | 3d19eec29b216536ad09b2dd80b96a3dab75fc26 /plugins/wavpack | |
parent | 9c6e2108adbcedccee5a2984b1d8ffc57e6b1087 (diff) |
moved high level id3v2/apev2/id3v1 tag writer into junklib;
added tag writer to wavpack plugin
Diffstat (limited to 'plugins/wavpack')
-rw-r--r-- | plugins/wavpack/wavpack.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/plugins/wavpack/wavpack.c b/plugins/wavpack/wavpack.c index ffbd1bd1..f3205570 100644 --- a/plugins/wavpack/wavpack.c +++ b/plugins/wavpack/wavpack.c @@ -330,7 +330,31 @@ wv_read_metadata (DB_playItem_t *it) { return 0; } -static const char * exts[] = { "wv", NULL }; +int +wv_write_metadata (DB_playItem_t *it) { + int strip_apev2 = deadbeef->conf_get_int ("wv.strip_apev2", 0); + int strip_id3v1 = deadbeef->conf_get_int ("wv.strip_id3v1", 0); + int write_apev2 = deadbeef->conf_get_int ("wv.write_apev2", 1); + int write_id3v1 = deadbeef->conf_get_int ("wv.write_id3v1", 0); + + uint32_t junk_flags = 0; + if (strip_id3v1) { + junk_flags |= JUNK_STRIP_ID3V1; + } + if (strip_apev2) { + junk_flags |= JUNK_STRIP_APEV2; + } + if (write_id3v1) { + junk_flags |= JUNK_WRITE_ID3V1; + } + if (write_apev2) { + junk_flags |= JUNK_WRITE_APEV2; + } + + return deadbeef->junk_rewrite_tags (it, junk_flags, 0, NULL); +} + +static const char *exts[] = { "wv", NULL }; static const char *filetypes[] = { "wv", NULL }; // define plugin interface @@ -353,6 +377,7 @@ static DB_decoder_t plugin = { .seek_sample = wv_seek_sample, .insert = wv_insert, .read_metadata = wv_read_metadata, + .write_metadata = wv_write_metadata, .exts = exts, .filetypes = filetypes }; |