Mercurial > ~darius > hgwebdir.cgi > cddb-stuff
diff read_c2w.tcl @ 1:dd6e30f7eb42
Initial revision
author | darius |
---|---|
date | Wed, 09 Aug 2000 02:18:46 +0000 |
parents | |
children | c122160e07da |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/read_c2w.tcl Wed Aug 09 02:18:46 2000 +0000 @@ -0,0 +1,79 @@ +#!/usr/local/bin/tclsh8.0 +# +# This software is copyright Daniel O'Connor (darius@dons.net.au) 1998 +# +# This software is release under the GNU Public License Version 2. +# A copy of this licence must be distributed with this software. +# + +set offset_seek 0; +set offset_list ""; + +while { 1 } { + if { [ eof stdin ] } { + break; + } + + set line [ gets stdin ]; + + if { $offset_seek > 0 } { + if { $line == "\#" } { + continue; + } + + if { [ regexp {^\# ([0-9]+)} $line a offset ] == 1 } { + lappend offset_list $offset; + continue; + } + + # Change back to default state + set offset_seek 0; + } + + if { [ regexp {^\# Track frame offsets:} $line ] == 1 } { + # Change to looking for offsets state + set offset_seek 1; + } + + if { [ regexp {^\# Disc length: ([0-9]+)} $line a disclen ] == 1 } { + continue; + } + + if { [ regexp {^DISCID=(\ ?)([0-9a-f]+)} $line a spc discid ] == 1 } { + if { $spc == " " } { + set discid "0$discid"; + } + continue; + } + +} + +if { ![ info exists discid ] || ![ info exists offset_list ] || ![ info exists disclen ] } { + puts "Didn't get all information needed"; + exit 1; +} + +puts "$discid $offset_list $disclen" +#puts "Disc ID: $discid"; +#puts "Disc Length: $disclen seconds"; +#puts "Track offsets: $offset_list"; + +# # xmcd +# # +# # Track frame offsets: +# # +# # 150 +# # 147307 +# # +# # Disc length: 3860 seconds +# # +# # Revision: 0 +# # Submitted via: cdda2wav 0.95beta05 +# DISCID=160f1402 +# DTITLE= +# TTITLE0= +# TTITLE1= +# EXTD= +# EXTT0= +# EXTT1= +# PLAYORDER=