.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "CD 3pm" .TH CD 3pm "2018-11-01" "perl v5.28.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Audio::CD \- Perl interface to libcdaudio (cd + cddb) .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& use Audio::CD (); \& my $cd = Audio::CD\->init; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Audio::CD provides a Perl interface to libcdaudio by Tony Arcieri, available from http://cdcd.undergrid.net/ .PP Several classes provide glue for the libcdaudio functions and data structures. .SH "Audio::CD Class" .IX Header "Audio::CD Class" .IP "init" 4 .IX Item "init" Initialize the Audio::CD object: .Sp .Vb 1 \& my $cd = Audio::CD\->init; .Ve .IP "stat" 4 .IX Item "stat" Stat the \fIAudio::CD\fR object, returns an \fIAudio::CD::Info\fR object. .Sp .Vb 1 \& my $info = $cd\->stat; .Ve .IP "cddb" 4 .IX Item "cddb" Returns an \fIAudio::CDDB\fR object. .Sp .Vb 1 \& my $cddb = $cd\->cddb; .Ve .IP "play" 4 .IX Item "play" Play the given cd track (defaults to 1). .Sp .Vb 1 \& $cd\->play(1); .Ve .IP "stop" 4 .IX Item "stop" Stop the cd. .Sp .Vb 1 \& $cd\->stop; .Ve .IP "pause" 4 .IX Item "pause" Pause the cd. .Sp .Vb 1 \& $cd\->pause; .Ve .IP "resume" 4 .IX Item "resume" Resume the cd. .Sp .Vb 1 \& $cd\->resume; .Ve .IP "eject" 4 .IX Item "eject" Eject the cd. .Sp .Vb 1 \& $cd\->eject; .Ve .IP "close" 4 .IX Item "close" Close the cd tray. .Sp .Vb 1 \& $cd\->close; .Ve .IP "play_frames" 4 .IX Item "play_frames" .Vb 1 \& $cd\->play_frames($startframe, $endframe); .Ve .IP "play_track_pos" 4 .IX Item "play_track_pos" .Vb 1 \& $cd\->play_track_pos($strarttrack, $endtrack, $startpos); .Ve .IP "play_track" 4 .IX Item "play_track" .Vb 1 \& $cd\->play_track($strarttrack, $endtrack); .Ve .IP "track_advance" 4 .IX Item "track_advance" .Vb 1 \& $cd\->track_advance($endtrack, $minutes, $seconds); .Ve .IP "advance" 4 .IX Item "advance" .Vb 1 \& $cd\->advance($minutes, $seconds); .Ve .IP "get_volume" 4 .IX Item "get_volume" Returns an \fIAudio::CD::Volume\fR object. .Sp .Vb 1 \& my $vol = $cd\->get_volume; .Ve .IP "set_volume" 4 .IX Item "set_volume" .Vb 1 \& $cd\->set_volume($vol); .Ve .SH "Audio::CDDB Class" .IX Header "Audio::CDDB Class" .IP "discid" 4 .IX Item "discid" .Vb 1 \& my $id = $cddb\->discid; .Ve .IP "lookup" 4 .IX Item "lookup" Does a cddb lookup and returns an \fIAudio::CD::Data\fR object. .Sp .Vb 1 \& my $data = $cddb\->lookup; .Ve .SH "Audio::CD::Data Class" .IX Header "Audio::CD::Data Class" .IP "artist" 4 .IX Item "artist" .Vb 1 \& my $artist = $data\->artist; .Ve .IP "title" 4 .IX Item "title" .Vb 1 \& my $title = $data\->title; .Ve .IP "genre" 4 .IX Item "genre" .Vb 1 \& my $genre = $data\->genre; .Ve .IP "tracks" 4 .IX Item "tracks" Returns an array reference of \fIAudio::CD::Track\fR objects. .Sp .Vb 2 \& my $foo = $data\->tracks($info); \& my @tracks = @$foo; .Ve .SH "Audio::CD::Track Class" .IX Header "Audio::CD::Track Class" .IP "name" 4 .IX Item "name" .Vb 1 \& my $name = $track\->name; .Ve .SH "Audio::CD::Info Class" .IX Header "Audio::CD::Info Class" .IP "mode" 4 .IX Item "mode" Returns the \s-1CD\s0 mode, one of \s-1PLAYING, PAUSED, COMPLETED, NOSTATUS\s0; .Sp .Vb 2 \& my $track = $info\->mode; \& print "playing" if $info\->mode == Audio::CD::PLAYING; .Ve .IP "present" 4 .IX Item "present" Returns true if a disc is present. .Sp .Vb 1 \& $cd\->play if $info\->present; .Ve .IP "current_track" 4 .IX Item "current_track" Returns the current track number being played or paused. .Sp .Vb 1 \& my $track = $info\->current_track; .Ve .IP "first_track" 4 .IX Item "first_track" Returns the number of the first track on the \s-1CD.\s0 .Sp .Vb 1 \& my $track = $info\->first_track; .Ve .IP "total_tracks" 4 .IX Item "total_tracks" Returns the total number of tracks on the cd. .Sp .Vb 1 \& my $track = $info\->total_tracks; .Ve .IP "track_time" 4 .IX Item "track_time" Returns the current track play time: .Sp .Vb 1 \& my($minutes, $seconds) = $info\->track_time; .Ve .IP "time" 4 .IX Item "time" Returns the current disc play time: .Sp .Vb 1 \& my($minutes, $seconds) = $info\->time; .Ve .IP "length" 4 .IX Item "length" Returns the disc length time: .Sp .Vb 1 \& my($minutes, $seconds) = $info\->length; .Ve .IP "tracks" 4 .IX Item "tracks" Returns an array reference of \fIAudio::CD::Info::Track\fR objects. .Sp .Vb 2 \& my $foo = $info\->tracks; \& my @tracks = @$foo; .Ve .SH "Audio::CD::Info::Track Class" .IX Header "Audio::CD::Info::Track Class" .IP "length" 4 .IX Item "length" Returns the track length time: .Sp .Vb 1 \& my($minutes, $seconds) = $tinfo\->length; .Ve .IP "pos" 4 .IX Item "pos" Returns the track position on the \s-1CD:\s0 .Sp .Vb 1 \& my($minutes, $seconds) = $tinfo\->pos; .Ve .IP "type" 4 .IX Item "type" Returns the track type (either \s-1TRACK_AUDIO\s0 or \s-1TRACK_DATA\s0): .Sp .Vb 5 \& if ($tinfo\->type == Audio::CD::TRACK_AUDIO) { \& print "audio track\en"; \& } elsif ($tinfo\->type == Audio::CD::TRACK_DATA) { \& print "data track\en"; \& } .Ve .IP "is_audio" 4 .IX Item "is_audio" Returns true if the track is an audio track; equivalent to the test: .Sp .Vb 1 \& $tinfo\->type == Audio::CD::TRACK_AUDIO ? 1 : 0 .Ve .IP "is_data" 4 .IX Item "is_data" Returns true if the track is a data track; equivalent to the test: .Sp .Vb 1 \& $tinfo\->type == Audio::CD::TRACK_DATA ? 1 : 0 .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBXmms\fR\|(3) .SH "AUTHOR" .IX Header "AUTHOR" Perl interface by Doug MacEachern .PP libcdaudio and cddb_lookup.c by Tony Arcieri