Package: vorbis-tools
Version: 1.2.0-5
Severity: wishlist
File: /usr/bin/vorbistagedit
Tags: patch
Vorbistagedit currently (0.5) allows to set Vorbis tags on a per file
basis only. The attached patch extends vorbistagedit's functionality by
introducing additional global tags that are applied to all edited files.
This provides a convenient way to set tags common to all files in a
global scope ("ARTIST", "ALBUM", "GENRE", ...), while individual tags
are still specified in a per file scope ("TITLE", "TRACKNUMBER", ...).
As suggested by Martin F. Krafft, the patch also increases
vorbistagedit's version number to 0.6.
Kind regards,
Alex
-- System Information:
Debian Release: lenny/sid
APT prefers testing
APT policy: (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.6.26-1-686 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages vorbis-tools depends on:
ii libao2 0.8.8-4 Cross Platform Audio Output Librar
ii libc6 2.7-16 GNU C Library: Shared libraries
ii libcurl3-gnutls 7.18.2-5 Multi-protocol file transfer libra
ii libflac8 1.2.1-1.2 Free Lossless Audio Codec - runtim
ii libogg0 1.1.3-4 Ogg Bitstream Library
ii libspeex1 1.2~rc1-1 The Speex codec runtime library
ii libvorbis0a 1.2.0.dfsg-3.1 The Vorbis General Audio Compressi
ii libvorbisenc2 1.2.0.dfsg-3.1 The Vorbis General Audio Compressi
ii libvorbisfile3 1.2.0.dfsg-3.1 The Vorbis General Audio Compressi
vorbis-tools recommends no packages.
vorbis-tools suggests no packages.
-- no debconf information
--- vorbistagedit.orig 2008-11-28 09:06:04.051540085 +0100
+++ vorbistagedit 2008-11-29 04:39:39.489074586 +0100
@@ -6,7 +6,7 @@
# Released under the terms of the Artistic Licence 2.0
#
-VERSION=0.5
+VERSION=0.6
ME=${0##*/}
versioninfo() {
@@ -68,6 +68,9 @@
#
# We are in directory:
# $(pwd)
+#
+# Tags that should be applied to all files can be specified
+# before the first per-file tag definiton starts.
_eof
@@ -127,7 +130,8 @@
write_tags() {
echo -n "I: processing $file... " >&2
local file="$1"; shift
- for tag; do echo "$tag"; done | vorbiscomment -w "$file"
+ for tag; do [ -n "${tag:-}" ] && echo "$tag"; done | \
+ vorbiscomment -w "$file"
if [ -n "${filename_new:-}" ] && [ "${filename_new:-}" != "$file" ]; then
echo; echo -n "I: renaming to $filename_new... " >&2
mv "$file" "$filename_new"
@@ -136,17 +140,18 @@
}
filename_new=
+global_tags=
while read line; do
case "$line" in
': EOF')
- write_tags "$file" "$tags"
+ write_tags "$file" "$global_tags" "$tags"
echo "done." >&2
;;
:*)
if [ -n "${file:-}" ]; then
- write_tags "$file" "$tags"
+ write_tags "$file" "$global_tags" "$tags"
echo "done." >&2
tags=''
fi
@@ -157,8 +162,14 @@
filename_new="${line#* }";;
*=*)
- tags="${tags:+$tags
-}$line";;
+ if [ -z "${file:-}" ]; then # global scope
+ global_tags="${global_tags:+$global_tags
+}$line"
+ else # file scope
+ tags="${tags:+$tags
+}$line"
+ fi
+ ;;
*|'#*') :;;
esac