cdinfo2xinf.xsl
1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?xml version="1.0" encoding="ISO-8859-15"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" indent="no" encoding="ISO-8859-15" />
<xsl:template match="/">
cddb=`echo <xsl:value-of select="/cdinfo/cddb"/> | sed 's/0x\(.*\)/\1/g'`
date=`date`
<xsl:apply-templates select="/cdinfo/track"/>
</xsl:template>
<xsl:template match="track">
track="`echo <xsl:value-of select="track-number"/> | /usr/bin/awk '{printf("%02d", $0)}'`"
track="${track}-<xsl:value-of select="track-title"/>"
cat > "${track}.xinf" <<- end
#
# X-CD-Roast 0.98alpha15 - INF-File
# created: $date
# by: getcd.sh
#
file = "./${track}.wav"
track = <xsl:value-of select="track-number"/> of <xsl:value-of select="/cdinfo/cd-tracks"/>
title = "<xsl:value-of select="track-title"/>"
artist = "<xsl:value-of select="track-artist"/>"
size = <xsl:value-of select="track-length"/>
type = 1
rec_type = 0
preemp = 0
copyperm = 0
stereo = 1
# from CD:
cd_title = "<xsl:value-of select="/cdinfo/cd-title"/>"
cd_artist = "<xsl:value-of select="/cdinfo/cd-artist"/>"
cd_discid = "$cddb"
end
</xsl:template>
</xsl:stylesheet>