Mercurial > ~darius > hgwebdir.cgi > cddb-stuff
view read_c2w.tcl @ 4:3a7a8d8a070a
Added tag CDDB-STUFF_1_0 for changeset 74031379d3cb
author | darius@midget.dons.net.au |
---|---|
date | Tue, 23 Oct 2007 10:08:25 +0930 |
parents | dd6e30f7eb42 |
children | c122160e07da |
line wrap: on
line source
#!/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=