Mercurial > ~darius > hgwebdir.cgi > cddb-stuff
comparison read_c2w.tcl @ 1:dd6e30f7eb42
Initial revision
author | darius |
---|---|
date | Wed, 09 Aug 2000 02:18:46 +0000 |
parents | |
children | c122160e07da |
comparison
equal
deleted
inserted
replaced
0:4a73fc4d9c78 | 1:dd6e30f7eb42 |
---|---|
1 #!/usr/local/bin/tclsh8.0 | |
2 # | |
3 # This software is copyright Daniel O'Connor (darius@dons.net.au) 1998 | |
4 # | |
5 # This software is release under the GNU Public License Version 2. | |
6 # A copy of this licence must be distributed with this software. | |
7 # | |
8 | |
9 set offset_seek 0; | |
10 set offset_list ""; | |
11 | |
12 while { 1 } { | |
13 if { [ eof stdin ] } { | |
14 break; | |
15 } | |
16 | |
17 set line [ gets stdin ]; | |
18 | |
19 if { $offset_seek > 0 } { | |
20 if { $line == "\#" } { | |
21 continue; | |
22 } | |
23 | |
24 if { [ regexp {^\# ([0-9]+)} $line a offset ] == 1 } { | |
25 lappend offset_list $offset; | |
26 continue; | |
27 } | |
28 | |
29 # Change back to default state | |
30 set offset_seek 0; | |
31 } | |
32 | |
33 if { [ regexp {^\# Track frame offsets:} $line ] == 1 } { | |
34 # Change to looking for offsets state | |
35 set offset_seek 1; | |
36 } | |
37 | |
38 if { [ regexp {^\# Disc length: ([0-9]+)} $line a disclen ] == 1 } { | |
39 continue; | |
40 } | |
41 | |
42 if { [ regexp {^DISCID=(\ ?)([0-9a-f]+)} $line a spc discid ] == 1 } { | |
43 if { $spc == " " } { | |
44 set discid "0$discid"; | |
45 } | |
46 continue; | |
47 } | |
48 | |
49 } | |
50 | |
51 if { ![ info exists discid ] || ![ info exists offset_list ] || ![ info exists disclen ] } { | |
52 puts "Didn't get all information needed"; | |
53 exit 1; | |
54 } | |
55 | |
56 puts "$discid $offset_list $disclen" | |
57 #puts "Disc ID: $discid"; | |
58 #puts "Disc Length: $disclen seconds"; | |
59 #puts "Track offsets: $offset_list"; | |
60 | |
61 # # xmcd | |
62 # # | |
63 # # Track frame offsets: | |
64 # # | |
65 # # 150 | |
66 # # 147307 | |
67 # # | |
68 # # Disc length: 3860 seconds | |
69 # # | |
70 # # Revision: 0 | |
71 # # Submitted via: cdda2wav 0.95beta05 | |
72 # DISCID=160f1402 | |
73 # DTITLE= | |
74 # TTITLE0= | |
75 # TTITLE1= | |
76 # EXTD= | |
77 # EXTT0= | |
78 # EXTT1= | |
79 # PLAYORDER= |