=head1 NAME Convert::CD::Cue - import/export .bin/.cue files. =head1 SYNOPSIS use Convert::CD::Cue; # to be done =head1 DESCRIPTION Parse/Write .cue files. =head2 Convert:CD::Cue METHODS This class represents a .bin/.cue file combination. =over 4 =cut package Convert::CD::Cue; $VERSION = 0.01; use Carp; use base Convert::CD::TOCFile; =item new param => value... Create a new Convert::CD::Cue object. Parameters: path the base image filename tocpath the (optional) path of the tocfile =cut sub new { my $class = shift; my $self = bless { @_, }, $class; exists $self->{tocpath} or $self->{tocpath} = $self->find_tocfile ("cue", "CUE", "Cue"); $self; } sub _read { my ($self, $cd) = @_; defined $self->{tocpath} or croak "no tocpath specified and/or no .cue found"; open my $cue, "<", $self->{tocpath} or croak "$self->{tocpath}: $!"; # assumption #1: these thingies are line-based while (<$cue>) { s/[\015\012]+$//; # assumption #2, whitespace don't matter much # assumption #3, case? what case? if (/\S*FILE \"?(.*?)\"? (\S+)$/) { warn "DEBUG FILE: ($1) ($2)"; } elsif (/\S*TRACK (\d+) (\S+)/) { warn "DEBUG TRACK: ($1) ($2)\n"; } elsif (/\S*INDEX (\d+) ([0-9:]+)/) { warn "DEBUG INDEX ($1) ($2)\n"; } elsif (/\S*PREGAP ([0-9:]+)/) { warn "DEBUG PREGAP ($1)\n"; } elsif (/\S*POSTGAP ([0-9:]+)/) { warn "DEBUG POSTGAP ($1)\n"; } else { warn "unknown .cue directive skipped: $_"; } } } #sub _write { # my ($self, $cd) = @_; #} 1; =back =head1 AUTHOR Marc Lehmann =cut