Audio-CD-0.05/0040700000175000017500000000000007417037654013224 5ustar jvhemertjvhemertAudio-CD-0.05/README0100600000175000017500000000214207417037132014071 0ustar jvhemertjvhemertREADME - part of the Audio-Cd package. Copyright (C) 1999-2002 by Doug MacEachern When included as part of the Standard Version of Perl or as part of its complete documentation whether printed or otherwise, this work may be distributed only under the terms of Perl's Artistic License as included in the file COPYING. Any distribution of this file or derivatives thereof outside of that package requires that special arrangements be made with copyright holder. Perl interface to libcdaudio (cd + cddb): http://cdcd.undergrid.net/ This module was created for adding CDDB support to I and cd tray I. I added methods for a good chunk of other I functions while I was at it, but the docs and glue is not complete. I do not have interest in completing the interface and docs, because xmms/Xmms::shell provides everything I need (at the moment) for audio. If you have an interesting reason for needing the missing pieces, I'll probably be interested in adding them. see also CDDB.pm: http://www.perl.com/CPAN/authors/id/R/RC/RCAPUTO/ yaret: http://lorien.intranet-team.it/~mnencia/yaret/ Audio-CD-0.05/eg/0040700000175000017500000000000007110425315013600 5ustar jvhemertjvhemertAudio-CD-0.05/eg/cddb_lookup.pl0100600000175000017500000000064407031715262016432 0ustar jvhemertjvhemertuse strict; use ExtUtils::testlib; use Audio::CD (); my $id = Audio::CD->init; my $cddb = $id->cddb; my $info = $id->stat; $cddb->verbose(1); printf "cddb id = %lx, total tracks = %d\n", $cddb->discid, $info->total_tracks; my $data = $cddb->lookup; printf "%s / %s [%s]\n", $data->artist, $data->title, $data->genre; my $tracks = $data->tracks($info); for my $track (@$tracks) { print $track->name, "\n"; } Audio-CD-0.05/CD.pm0100600000175000017500000001056707417037245014054 0ustar jvhemertjvhemert# # CD.pm - part of the Audio-Cd package. # Copyright (C) 1999-2002 by Doug MacEachern # # When included as part of the Standard Version of Perl or as # part of its complete documentation whether printed or # otherwise, this work may be distributed only under the terms # of Perl's Artistic License as included in the file COPYING. # Any distribution of this file or derivatives thereof outside # of that package requires that special arrangements be made # with copyright holder. # package Audio::CD; use strict; use DynaLoader (); { no strict; $VERSION = '0.05'; @ISA = qw(DynaLoader); __PACKAGE__->bootstrap($VERSION); } 1; __END__ =head1 NAME Audio::CD - Perl interface to libcdaudio (cd + cddb) =head1 SYNOPSIS use Audio::CD (); my $cd = Audio::CD->init; =head1 DESCRIPTION Audio::CD provides a Perl interface to libcdaudio by Tony Arcieri, available from http://cdcd.undergrid.net/ Several classes provide glue for the libcdaudio functions and data structures. =head1 Audio::CD Class =over 4 =item init Initialize the Audio::CD object: my $cd = Audio::CD->init; =item stat Stat the I object, returns an I object. my $info = $cd->stat; =item cddb Returns an I object. my $cddb = $cd->cddb; =item play Play the given cd track (defaults to 1). $cd->play(1); =item stop Stop the cd. $cd->stop; =item pause Pause the cd. $cd->pause; =item resume Resume the cd. $cd->resume; =item eject Eject the cd. $cd->eject; =item close Close the cd tray. $cd->close; =item play_frames $cd->play_frames($startframe, $endframe); =item play_track_pos $cd->play_track_pos($strarttrack, $endtrack, $startpos); =item play_track $cd->play_track($strarttrack, $endtrack); =item track_advance $cd->track_advance($endtrack, $minutes, $seconds); =item advance $cd->advance($minutes, $seconds); =item get_volume Returns an I object. my $vol = $cd->get_volume; =item set_volume $cd->set_volume($vol); =back =head1 Audio::CDDB Class =over 4 =item discid my $id = $cddb->discid; =item lookup Does a cddb lookup and returns an I object. my $data = $cddb->lookup; =back =item Audio::CD::Data Class =over 4 =item artist my $artist = $data->artist; =item title my $title = $data->title; =item genre my $genre = $data->genre; =item tracks Returns an array reference of I objects. my $foo = $data->tracks($info); my @tracks = @$foo; =back =head1 Audio::CD::Track Class =over 4 =item name my $name = $track->name; =back =head1 Audio::CD::Info Class =over 4 =item mode Returns the CD mode, one of PLAYING, PAUSED, COMPLETED, NOSTATUS; my $track = $info->mode; print "playing" if $info->mode == Audio::CD::PLAYING; =item present Returns true if a disc is present. $cd->play if $info->present; =item current_track Returns the current track number being played or paused. my $track = $info->current_track; =item first_track Returns the number of the first track on the CD. my $track = $info->first_track; =item total_tracks Returns the total number of tracks on the cd. my $track = $info->total_tracks; =item track_time Returns the current track play time: my($minutes, $seconds) = $info->track_time; =item time Returns the current disc play time: my($minutes, $seconds) = $info->time; =item length Returns the disc length time: my($minutes, $seconds) = $info->length; =item tracks Returns an array reference of I objects. my $foo = $info->tracks; my @tracks = @$foo; =back =head1 Audio::CD::Info::Track Class =over 4 =item length Returns the track length time: my($minutes, $seconds) = $tinfo->length; =item pos Returns the track position on the CD: my($minutes, $seconds) = $tinfo->pos; =item type Returns the track type (either TRACK_AUDIO or TRACK_DATA): if ($tinfo->type == Audio::CD::TRACK_AUDIO) { print "audio track\n"; } elsif ($tinfo->type == Audio::CD::TRACK_DATA) { print "data track\n"; } =item is_audio Returns true if the track is an audio track; equivalent to the test: $tinfo->type == Audio::CD::TRACK_AUDIO ? 1 : 0 =item is_data Returns true if the track is a data track; equivalent to the test: $tinfo->type == Audio::CD::TRACK_DATA ? 1 : 0 =back =head1 SEE ALSO Xmms(3) =head1 AUTHOR Perl interface by Doug MacEachern libcdaudio and cddb_lookup.c by Tony Arcieri Audio-CD-0.05/cddb_lookup.c0100600000175000017500000002220107417037476015653 0ustar jvhemertjvhemert/* cdcd - Command Driven CD player Copyright (C)1998-99 Tony Arcieri This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* modified for Audio::CD by dougm */ #include "cdaudio.h" #include "cddb_lookup.h" #include "stdio.h" #define PACKAGE "Audio::CD" static int verbosity = 0; static int timestamp = 0; /* Timestamped discid */ static int timestamped_discid = 0; void cddb_verbose(void *h, int flag) { verbosity = flag; } static cddb_inexact_selection_func_t ixs_func = NULL; void cddb_inexact_selection_set(cddb_inexact_selection_func_t func) { ixs_func = func; } static int inexact_selection(void) { if (ixs_func) { return (*ixs_func)(); } else { char inbuffer[256]; fgets(inbuffer, sizeof(inbuffer), stdin); return strtol(inbuffer, NULL, 10); } } int cdcd_cd_stat(int cd_desc, struct disc_info *disc) { cd_stat(cd_desc, disc); if(!disc->disc_present) { cd_close(cd_desc); cd_stat(cd_desc, disc); if(!disc->disc_present) { if (verbosity) puts("No disc in drive"); return -1; } } return 0; } void cddb_lookup(int cd_desc, struct disc_data *data) { int index, serverindex, selection, sock = -1; struct disc_info disc; struct cddb_conf conf; struct cddb_serverlist list; struct cddb_server *proxy; struct cddb_entry entry; struct cddb_hello hello; struct cddb_query query; char http_string[512], discid[CDINDEX_ID_SIZE]; if(cdcd_cd_stat(cd_desc, &disc) < 0) return; if(0) cddb_read_disc_data(cd_desc, data); else { cddb_stat_disc_data(cd_desc, &entry); if(entry.entry_present) { if(entry.entry_timestamp == timestamp && entry.entry_id == timestamped_discid) return; cddb_read_disc_data(cd_desc, data); timestamp = entry.entry_timestamp; timestamped_discid = entry.entry_id; } else { proxy = (struct cddb_server *)malloc(sizeof(struct cddb_server)); cddb_read_serverlist(&conf, &list, proxy); if(conf.conf_access == CDDB_ACCESS_LOCAL) { free(proxy); cddb_generate_unknown_entry(cd_desc, data); return; } if(!conf.conf_proxy) { free(proxy); proxy = NULL; } else if (verbosity) printf("Using proxy http://%s:%d/\n", proxy->server_name, proxy->server_port); strncpy(hello.hello_program, PACKAGE, 256); strncpy(hello.hello_version, VERSION, 256); serverindex = 0; do { switch(list.list_host[serverindex].host_protocol) { case CDDB_MODE_CDDBP: if (verbosity) printf("Trying CDDB server cddbp://%s:%d/\n", list.list_host[serverindex].host_server.server_name, list.list_host[serverindex].host_server.server_port); sock = cddb_connect_server(list.list_host[serverindex++], proxy, hello); break; case CDDB_MODE_HTTP: if (verbosity) printf("Trying CDDB server http://%s:%d/%s\n", list.list_host[serverindex].host_server.server_name, list.list_host[serverindex].host_server.server_port, list.list_host[serverindex].host_addressing); sock = cddb_connect_server(list.list_host[serverindex++], proxy, hello, http_string, 512); break; case CDINDEX_MODE_HTTP: if (verbosity) printf("Trying CD Index server http://%s:%d/%s\n", list.list_host[serverindex].host_server.server_name, list.list_host[serverindex].host_server.server_port, list.list_host[serverindex].host_addressing); sock = cdindex_connect_server(list.list_host[serverindex++], proxy, http_string, 512); break; default: if (verbosity) puts("Invalid protocol selected!"); return; } if(sock == -1) fprintf(stderr, "Connection error: %s\n", cddb_message); } while(serverindex < list.list_len && sock == -1); if(sock == -1) { if (verbosity) puts("Could not establish connection with any CDDB servers!"); if(conf.conf_proxy) free(proxy); cddb_generate_unknown_entry(cd_desc, data); return; } serverindex--; if (verbosity) puts("Connection established."); switch(list.list_host[serverindex].host_protocol) { case CDDB_MODE_CDDBP: if (verbosity) printf("Retrieving information on %02lx.\n", cddb_discid(cd_desc)); if(cddb_query(cd_desc, sock, CDDB_MODE_CDDBP, &query) < 0) { fprintf(stderr, "CDDB query error: %s", cddb_message); if(conf.conf_proxy) free(proxy); cddb_generate_unknown_entry(cd_desc, data); return; } break; case CDDB_MODE_HTTP: if (verbosity) printf("Retrieving information on %02lx.\n", cddb_discid(cd_desc)); if(cddb_query(cd_desc, sock, CDDB_MODE_HTTP, &query, http_string) < 0) { fprintf(stderr, "CDDB query error: %s", cddb_message); if(conf.conf_proxy) free(proxy); cddb_generate_unknown_entry(cd_desc, data); return; } shutdown(sock, 2); close(sock); if((sock = cddb_connect_server(list.list_host[serverindex], proxy, hello, http_string, 512)) < 0) { perror("HTTP server reconnection error"); if(conf.conf_proxy) free(proxy); cddb_generate_unknown_entry(cd_desc, data); return; } break; case CDINDEX_MODE_HTTP: cdindex_discid(cd_desc, discid, CDINDEX_ID_SIZE); if (verbosity) printf("Retrieving information on %s.\n", discid); if(cdindex_read(cd_desc, sock, data, http_string) < 0) { if (verbosity) printf("No match for %s.\n", discid); if(conf.conf_proxy) free(proxy); cddb_generate_unknown_entry(cd_desc, data); return; } if (verbosity) printf("Match for %s: %s / %s\nDownloading data...\n", discid, data->data_artist, data->data_title); cddb_write_data(cd_desc, data); return; } if(conf.conf_proxy) free(proxy); if(list.list_host[serverindex].host_protocol == CDINDEX_MODE_HTTP); switch(query.query_match) { case QUERY_EXACT: if(strlen(query.query_list[0].list_artist) > 0) if (verbosity) printf("Match for %02lx: %s / %s\nDownloading data...\n", cddb_discid(cd_desc), query.query_list[0].list_artist, query.query_list[0].list_title); else if (verbosity) printf("Match for %02lx: %s\nDownloading data...\n", cddb_discid(cd_desc), query.query_list[0].list_title); entry.entry_genre = query.query_list[0].list_genre; entry.entry_id = query.query_list[0].list_id; switch(list.list_host[serverindex].host_protocol) { case CDDB_MODE_CDDBP: if(cddb_read(cd_desc, sock, CDDB_MODE_CDDBP, entry, data) < 0) { perror("CDDB read error"); cddb_generate_unknown_entry(cd_desc, data); return; } cddb_quit(sock); break; case CDDB_MODE_HTTP: if(cddb_read(cd_desc, sock, CDDB_MODE_HTTP, entry, data, http_string) < 0) { perror("CDDB read error"); cddb_generate_unknown_entry(cd_desc, data); return; } shutdown(sock, 2); close(sock); break; } break; case QUERY_INEXACT: if (verbosity) printf("Inexact match for %02lx.\n", cddb_discid(cd_desc)); if (verbosity) puts("Please choose from the following inexact matches:"); for(index = 0; index < query.query_matches; index++) if(strlen(query.query_list[index].list_artist) < 1) if (verbosity) printf("%d: %s\n", index + 1, query.query_list[index].list_title); else if (verbosity) printf("%d: %s / %s\n", index + 1, query.query_list[index].list_artist, query.query_list[index].list_title); if (verbosity) printf("%d: None of the above.\n", index + 1); if (verbosity) printf("> "); selection = inexact_selection(); if(selection > 0 && selection <= query.query_matches) { entry.entry_genre = query.query_list[selection - 1].list_genre; entry.entry_id = query.query_list[selection - 1].list_id; if (verbosity) puts("Downloading data..."); switch(list.list_host[serverindex].host_protocol) { case CDDB_MODE_CDDBP: if(cddb_read(cd_desc, sock, CDDB_MODE_CDDBP, entry, data) < 0) { perror("CDDB read error"); cddb_generate_unknown_entry(cd_desc, data); return; } cddb_quit(sock); break; case CDDB_MODE_HTTP: if(cddb_read(cd_desc, sock, CDDB_MODE_HTTP, entry, data, http_string) < 0) { perror("CDDB read error"); cddb_generate_unknown_entry(cd_desc, data); return; } shutdown(sock, 2); close(sock); break; } break; } case QUERY_NOMATCH: if (verbosity) printf("No match for %02lx.\n", cddb_discid(cd_desc)); cddb_generate_unknown_entry(cd_desc, data); } close(sock); cddb_write_data(cd_desc, data); } } return; } Audio-CD-0.05/MANIFEST0100600000175000017500000000014607417035617014352 0ustar jvhemertjvhemertCOPYING README MANIFEST Makefile.PL CD.pm CD.xs cddb_lookup.c cddb_lookup.h typemap eg/cddb_lookup.pl Audio-CD-0.05/typemap0100600000175000017500000000032007074432326014612 0ustar jvhemertjvhemertAudio::CD::Info T_PTROBJ Audio::CD::Info::Track T_PTROBJ Audio::CD::Data T_PTROBJ Audio::CD::Track T_PTROBJ Audio::CD T_PTROBJ Audio::CDDB T_PTROBJ Audio::CD::Volume T_PTROBJ Audio::CD::VolumeRL T_PTROBJAudio-CD-0.05/cddb_lookup.h0100600000175000017500000000173407417035525015661 0ustar jvhemertjvhemert/* cdcd - Command Driven CD player Copyright (C)1998-99 Tony Arcieri This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* modified for Audio::CD by dougm */ typedef int (*cddb_inexact_selection_func_t)(void); void cddb_lookup(int cd_desc, struct disc_data *data); void cddb_verbose(void *h, int flag); void cddb_inexact_selection_set(cddb_inexact_selection_func_t func); Audio-CD-0.05/Makefile.PL0100600000175000017500000000063107110425124015154 0ustar jvhemertjvhemertuse 5.005; use ExtUtils::MakeMaker; WriteMakefile( 'NAME' => 'Audio::CD', 'VERSION_FROM' => 'CD.pm', 'macro' => { CVSROOT => 'modperl.com:/local/cvs_repository', }, 'LIBS' => ["-lcdaudio"], DEFINE => '-g', OBJECT => 'cddb_lookup.o CD.o', ); sub MY::postamble { return <<'EOF'; cvs_tag : cvs -d $(CVSROOT) tag v$(VERSION_SYM) . @echo update CD.pm VERSION now EOF } Audio-CD-0.05/CD.xs0100600000175000017500000002156107417037147014067 0ustar jvhemertjvhemert/* * CD.xs - part of the Audio-Cd package. * Copyright (C) 1999-2002 by Doug MacEachern * * When included as part of the Standard Version of Perl or as * part of its complete documentation whether printed or * otherwise, this work may be distributed only under the terms * of Perl's Artistic License as included in the file COPYING. * Any distribution of this file or derivatives thereof outside * of that package requires that special arrangements be made * with copyright holder. * */ #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "cdaudio.h" #include "cddb_lookup.h" typedef struct disc_info * Audio__CD__Info; typedef struct track_info * Audio__CD__Info__Track; typedef struct disc_data * Audio__CD__Data; typedef struct track_data * Audio__CD__Track; typedef struct disc_volume * Audio__CD__Volume; typedef struct __volume * Audio__CD__VolumeRL; typedef int Audio__CD; typedef int Audio__CDDB; #define CD_Info_present(info) info->disc_present #define CD_Info_mode(info) info->disc_mode #define CD_Info_current_frame(info) info->disc_current_frame #define CD_Info_current_track(info) info->disc_current_track #define CD_Info_first_track(info) info->disc_first_track #define CD_Info_total_tracks(info) info->disc_total_tracks #define CD_Info_timeval(timeval) \ SP -= items; \ XPUSHs(sv_2mortal(newSViv(timeval.minutes))); \ XPUSHs(sv_2mortal(newSViv(timeval.seconds))); \ PUTBACK; return #define CD_Info_track_time(info) \ CD_Info_timeval(info->disc_track_time) #define CD_Info_time(info) \ CD_Info_timeval(info->disc_time) #define CD_Info_length(info) \ CD_Info_timeval(info->disc_length) #define CD_Info_Track_length(tinfo) CD_Info_timeval(tinfo->track_length) #define CD_Info_Track_pos(tinfo) CD_Info_timeval(tinfo->track_pos) #define CD_Info_Track_type(tinfo) tinfo->track_type #define CD_Info_Track_is_audio(tinfo) \ (tinfo->track_type == CDAUDIO_TRACK_AUDIO) #define CD_Info_Track_is_data(tinfo) \ (tinfo->track_type == CDAUDIO_TRACK_DATA) #define CD_Data_title(data) data->data_title #define CD_Data_artist(data) data->data_artist #define CD_Data_extended(data) data->data_extended #define CD_Data_genre(data) cddb_genre(data->data_genre) #define CD_Track_name(track) track->track_name #define CD_Track_artist(track) track->track_artist #define CD_Track_extended(track) track->track_extended #define CD_Volume_front(vol) &vol->vol_front #define CD_Volume_back(vol) &vol->vol_back #define CD_VolumeRL_right(volrl, val) \ (val >= 0 ? volrl->right = val : volrl->right) #define CD_VolumeRL_left(volrl, val) \ (val >= 0 ? volrl->left = val : volrl->left) static Audio__CD cd_init(SV *sv_class, char *device) { int id = cd_init_device(device); if (id < 0) { return 0; } return id; } static SV *CD_Data_track_new(struct track_data *td) { SV *sv = newSV(0); #if 0 struct track_data *new_td = (struct track_data *)safemalloc(sizeof(*new_td)); Copy(td, new_td, 1, struct track_data); #endif sv_setref_pv(sv, "Audio::CD::Track", (void*)td); return sv; } static SV *CD_Info_track_new(struct track_info *ti) { SV *sv = newSV(0); sv_setref_pv(sv, "Audio::CD::Info::Track", (void*)ti); return sv; } static void boot_Audio__CD_constants(void) { HV *stash = gv_stashpv("Audio::CD", TRUE); newCONSTSUB(stash, "PLAYING", newSViv(CDAUDIO_PLAYING)); newCONSTSUB(stash, "PAUSED", newSViv(CDAUDIO_PAUSED)); newCONSTSUB(stash, "COMPLETED", newSViv(CDAUDIO_COMPLETED)); newCONSTSUB(stash, "NOSTATUS", newSViv(CDAUDIO_NOSTATUS)); newCONSTSUB(stash, "TRACK_AUDIO", newSViv(CDAUDIO_TRACK_AUDIO)); newCONSTSUB(stash, "TRACK_DATA", newSViv(CDAUDIO_TRACK_DATA)); } /* XXX */ static int inexact_select_func(void) { return 1; } MODULE = Audio::CD PACKAGE = Audio::CD PREFIX = cd_ BOOT: boot_Audio__CD_constants(); cddb_inexact_selection_set(inexact_select_func); Audio::CD cd_init(sv_class, device="/dev/cdrom") SV *sv_class char *device void DESTROY(cd_desc) Audio::CD cd_desc CODE: close(cd_desc); Audio::CDDB cddb(cd_desc) Audio::CD cd_desc CODE: RETVAL = cd_desc; OUTPUT: RETVAL int cd_play(cd_desc, track=1) Audio::CD cd_desc int track int cd_stop(cd_desc) Audio::CD cd_desc int cd_pause(cd_desc) Audio::CD cd_desc int cd_resume(cd_desc) Audio::CD cd_desc int cd_eject(cd_desc) Audio::CD cd_desc int cd_close(cd_desc) Audio::CD cd_desc Audio::CD::Info cd_stat(cd_desc) Audio::CD cd_desc CODE: RETVAL = (Audio__CD__Info)safemalloc(sizeof(*RETVAL)); cd_stat(cd_desc, RETVAL); OUTPUT: RETVAL int cd_play_frames(cd_desc, startframe, endframe) Audio::CD cd_desc int startframe int endframe int cd_play_track_pos(cd_desc, starttrack, endtrack, startpos) Audio::CD cd_desc int starttrack int endtrack int startpos int cd_play_track(cd_desc, starttrack, endtrack) Audio::CD cd_desc int starttrack int endtrack int cd_play_pos(cd_desc, track, startpos) Audio::CD cd_desc int track int startpos int cd_track_advance(cd_desc, endtrack, minutes, seconds=0) Audio::CD cd_desc int endtrack int minutes int seconds PREINIT: struct disc_timeval time; CODE: time.minutes = minutes; time.seconds = seconds; RETVAL = cd_track_advance(cd_desc, endtrack, time); OUTPUT: RETVAL int cd_advance(cd_desc, minutes, seconds=0) Audio::CD cd_desc int minutes int seconds PREINIT: struct disc_timeval time; CODE: time.minutes = minutes; time.seconds = seconds; RETVAL = cd_advance(cd_desc, time); OUTPUT: RETVAL Audio::CD::Volume cd_get_volume(cd_desc) Audio::CD cd_desc CODE: RETVAL = (struct disc_volume *)safemalloc(sizeof(*RETVAL)); cd_get_volume(cd_desc, RETVAL); OUTPUT: RETVAL int cd_set_volume(cd_desc, vol) Audio::CD cd_desc Audio::CD::Volume vol CODE: RETVAL = cd_set_volume(cd_desc, *vol); OUTPUT: RETVAL MODULE = Audio::CD PACKAGE = Audio::CD::Info PREFIX = CD_Info_ int CD_Info_present(info) Audio::CD::Info info int CD_Info_mode(info) Audio::CD::Info info int CD_Info_current_track(info) Audio::CD::Info info int CD_Info_first_track(info) Audio::CD::Info info int CD_Info_total_tracks(info) Audio::CD::Info info void CD_Info_track_time(info) Audio::CD::Info info void CD_Info_time(info) Audio::CD::Info info void CD_Info_length(info) Audio::CD::Info info AV * CD_Info_tracks(info) Audio::CD::Info info PREINIT: int track; CODE: RETVAL = newAV(); for(track = 0; track < info->disc_total_tracks; track++) { av_push(RETVAL, CD_Info_track_new(&info->disc_track[track])); } OUTPUT: RETVAL void DESTROY(info) Audio::CD::Info info CODE: safefree(info); MODULE = Audio::CD PACKAGE = Audio::CD::Info::Track PREFIX = CD_Info_Track_ void CD_Info_Track_length(tinfo) Audio::CD::Info::Track tinfo void CD_Info_Track_pos(tinfo) Audio::CD::Info::Track tinfo int CD_Info_Track_type(tinfo) Audio::CD::Info::Track tinfo int CD_Info_Track_is_audio(tinfo) Audio::CD::Info::Track tinfo int CD_Info_Track_is_data(tinfo) Audio::CD::Info::Track tinfo MODULE = Audio::CD PACKAGE = Audio::CD::Data PREFIX = CD_Data_ char * CD_Data_title(data) Audio::CD::Data data char * CD_Data_artist(data) Audio::CD::Data data char * CD_Data_extended(data) Audio::CD::Data data char * CD_Data_genre(data) Audio::CD::Data data AV * CD_Data_tracks(data, disc) Audio::CD::Data data Audio::CD::Info disc PREINIT: int track; CODE: RETVAL = newAV(); for(track = 0; track < disc->disc_total_tracks; track++) { av_push(RETVAL, CD_Data_track_new(&data->data_track[track])); } OUTPUT: RETVAL void DESTROY(data) Audio::CD::Data data CODE: safefree(data); MODULE = Audio::CD PACKAGE = Audio::CD::Track PREFIX = CD_Track_ char * CD_Track_name(track) Audio::CD::Track track char * CD_Track_artist(track) Audio::CD::Track track char * CD_Track_extended(track) Audio::CD::Track track MODULE = Audio::CD PACKAGE = Audio::CDDB PREFIX = cddb_ PROTOTYPES: disable void cddb_verbose(sv, flag) SV *sv int flag unsigned long cddb_discid(h) Audio::CDDB h Audio::CD::Data cddb_lookup(cd_desc) Audio::CDDB cd_desc CODE: RETVAL = (Audio__CD__Data)safemalloc(sizeof(*RETVAL)); cddb_lookup(cd_desc, RETVAL); OUTPUT: RETVAL MODULE = Audio::CD PACKAGE = Audio::CD::Volume PREFIX = CD_Volume_ void DESTROY(vol) Audio::CD::Volume vol CODE: safefree(vol); Audio::CD::VolumeRL CD_Volume_front(vol) Audio::CD::Volume vol Audio::CD::VolumeRL CD_Volume_back(vol) Audio::CD::Volume vol MODULE = Audio::CD PACKAGE = Audio::CD::VolumeRL PREFIX = CD_VolumeRL_ int CD_VolumeRL_left(volrl, val=-1) Audio::CD::VolumeRL volrl int val int CD_VolumeRL_right(volrl, val=-1) Audio::CD::VolumeRL volrl int val Audio-CD-0.05/perl-Audio-CD.spec0100600000175000017500000000630707217546554016374 0ustar jvhemertjvhemert# Spec file for the Audio::CD perl package # %define vers 0.05 # Summary: perl Audio::CD module Name: perl-Audio-CD Version: %{vers} Requires: perl >= 5.003, libcdaudio >= 0.99.4 Release: 1s Copyright: Perl Group: Development/Libraries Source: http://chinstrap.cylant.com/~stephen/Audio-CD-0.04-stephen.tar.gz URL: http://search.cpan.org/search?module=Audio::CD BuildArchitectures: i386 Buildroot: /tmp/perl-audio-cd %description Perl Audio::CD is a perl interface to libcdaudio (cd + cddb) %prep %setup -q -n Audio-CD-0.04-stephen %build #get perl's version eval "perl_`perl '-V:version'`" eval "perl_`perl '-V:installman1dir'`" eval "perl_`perl '-V:installman3dir'`" eval "perl_`perl '-V:man1ext'`" eval "perl_`perl '-V:man3ext'`" if test $perl_version = '5.00503' ; then perl_prefix='' perl_pollute='' elif test $perl_version = '5.6.0' ; then perl_prefix=$RPM_BUILD_ROOT perl_pollute="POLLUTE=1" else perl_perfix=$RPM_BUILD_ROOT perl_pollute="POLLUTE=1" fi #Some modules require POLLUTE=1 in the next line CFLAGS="$RPM_OPT_FLAGS" perl Makefile.PL \ INSTALLMAN1DIR=$perl_prefix$perl_installman1dir \ INSTALLMAN3DIR=$perl_prefix$perl_installman3dir \ #$perl_pollute make OPTIMIZE="${RPM_OPT_FLAGS}" make test %install rm -rf $RPM_BUILD_ROOT eval `perl '-V:installarchlib'` eval "perl_`perl '-V:version'`" eval "perl_`perl '-V:installman1dir'`" eval "perl_`perl '-V:installman3dir'`" eval "perl_`perl '-V:man1ext'`" eval "perl_`perl '-V:man3ext'`" mkdir -p $RPM_BUILD_ROOT$installarchlib mkdir -p $RPM_BUILD_ROOT/usr/doc/%{name}-%{version} mkdir -p $perl_installman1dir mkdir -p $perl_installman3dir make PREFIX=$RPM_BUILD_ROOT/usr install #Get the file "perllocal.pod" location find $RPM_BUILD_ROOT/usr -type f -print | grep perllocal.pod > podfile_full.lst #Correct the data inside the file mv `cat podfile_full.lst` `cat podfile_full.lst`.tmp cat `cat podfile_full.lst`.tmp | sed -e "s@$RPM_BUILD_ROOT@@g" > `cat podfile_full.lst` rm `cat podfile_full.lst`.tmp #move it to docs mv `cat podfile_full.lst` $RPM_BUILD_DIR/%{buildsubdir} #strips cp podfile_full.lst podfile_full2.lst cat podfile_full2.lst | sed -e "s@^$RPM_BUILD_ROOT@@" > podfile_full.lst #Get the filelist \ #Add gz to man pages find $RPM_BUILD_ROOT/usr -type f -print |\ sed -e "s@^$RPM_BUILD_ROOT@@g" |\ sed -e "s@\($perl_installman1dir/.*\.$perl_man1ext\)\$@\1\.gz@" |\ sed -e "s@\($perl_installman3dir/.*\.$perl_man3ext\)\$@\1\.gz@" |\ grep -v perllocal.pod > file-list.lst mkdir -p $RPM_BUILD_ROOT/usr/lib/perl5/perllocal cp perllocal.pod $RPM_BUILD_ROOT/usr/lib/perl5/perllocal/%{name}-perllocal.pod cp podfile_full.lst $RPM_BUILD_ROOT/usr/lib/perl5/perllocal/%{name}-podfile_full.lst %clean rm -rf $RPM_BUILD_DIR/Audio-CD-0.04-stephen rm -rf $RPM_BUILD_ROOT rm -f file-list.lst rm -f podfile_full.lst %files -f file-list.lst %defattr(-,root,root) %docdir /usr/doc/%{name}-%{version} %doc README %doc MANIFEST %doc eg/ /usr/lib/perl5/perllocal/%{name}-perllocal.pod /usr/lib/perl5/perllocal/%{name}-podfile_full.lst %post #Adjusts the date too cat /usr/lib/perl5/perllocal/%{name}-perllocal.pod |\ sed -e "s@\(^=head2 \).*\(:.*\)@\1`date`\2@" >> `cat /usr/lib/perl5/perllocal/%{name}-podfile_full.lst` Audio-CD-0.05/COPYING0100600000175000017500000001373707417036364014266 0ustar jvhemertjvhemert The "Artistic License" Preamble The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Definitions: "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder as specified below. "Copyright Holder" is whoever is named in the copyright or copyrights for the package. "You" is you, if you're thinking about copying or distributing this Package. "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following: a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as uunet.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package. b) use the modified Package only within your corporation or organization. c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version. d) make other distribution arrangements with the Copyright Holder. 4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following: a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version. b) accompany the distribution with the machine-readable source of the Package with your modifications. c) give non-standard executables non-standard names, and clearly document the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. d) make other distribution arrangements with the Copyright Holder. 5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. You may embed this Package's interpreter within an executable of yours (by linking); this shall be construed as a mere form of aggregation, provided that the complete Standard Version of the interpreter is so embedded. 6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whoever generated them, and may be sold commercially, and may be aggregated with this Package. If such scripts or library files are aggregated with this Package via the so-called "undump" or "unexec" methods of producing a binary executable image, then distribution of such an image shall neither be construed as a distribution of this Package nor shall it fall under the restrictions of Paragraphs 3 and 4, provided that you do not represent such an executable image as a Standard Version of this Package. 7. C subroutines (or comparably compiled subroutines in other languages) supplied by you and linked into this Package in order to emulate subroutines and variables of the language defined by this Package shall not be considered part of this Package, but are the equivalent of input as in Paragraph 6, provided these subroutines do not change the language in any way that would cause it to fail the regression tests for the language. 8. Aggregation of this Package with a commercial distribution is always permitted provided that the use of this Package is embedded; that is, when no overt attempt is made to make this Package's interfaces visible to the end user of the commercial distribution. Such use shall not be construed as a distribution of this Package. 9. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 10. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End