Skip to content

Commit

Permalink
device.swg: minor space issues
Browse files Browse the repository at this point in the history
Cdio.pm: alphabetize better
Cdio.pm, Track.pm: set track moved from Device to Track
Util.pm: set version number same as Device::Cdio
  • Loading branch information
rocky committed Feb 13, 2006
1 parent 222e118 commit 30b9c40
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 79 deletions.
18 changes: 18 additions & 0 deletions ChangeLog
Expand Up @@ -2,6 +2,24 @@
## autogenerated ChangeLog -- don't edit
##

2006-02-13 Monday 02:20 Rocky Bernstein <rocky@panix.com>

* Build.PL, Changes, MANIFEST, MANIFEST.SKIP, META.yml, device.swg,
lib/Device/Cdio.pm, lib/Device/Cdio/Device.pm,
lib/Device/Cdio/Track.pm, t/06.bincue.t: Build.PL: we no longer
require SWIG to be installed. We'll use our own perlcdio_wrap.c
if not.

device.swg: guard against using a libcdio's get_hwinfo which can
store outside of the array. It's only a problem in theory as
release revision numbers are not more than 4 bytes long and the
current CVS (where the revsion number is 7 bytes long, e.g
0.77cvs) now truncates.

*.pm: Synchronize version numbers.

Device.pm: a more useful get_device routine.

2006-02-12 Sunday 09:36 Rocky Bernstein <rocky@panix.com>

* t/.gdb_history: Tolerate gdb debugging
Expand Down
2 changes: 1 addition & 1 deletion META.yml
@@ -1,6 +1,6 @@
---
name: Device-Cdio
version: v0.0.1
version: v0.0.2
author:
- Rocky Bernstein <rocky@cpan.org>
abstract: CD Input and control library
Expand Down
4 changes: 2 additions & 2 deletions device.swg
Expand Up @@ -221,10 +221,10 @@ DeviceList_t cdio_get_devices (driver_id_t driver_id);
*/

DeviceList_t get_devices_ret (driver_id_t driver_id,
driver_id_t *p_out_driver_id);
driver_id_t *p_out_driver_id);
%inline %{
DeviceList_t get_devices_ret (driver_id_t driver_id,
driver_id_t *p_out_driver_id) {
driver_id_t *p_out_driver_id) {
*p_out_driver_id = driver_id;
return cdio_get_devices_ret (p_out_driver_id);
}
Expand Down
8 changes: 8 additions & 0 deletions examples/device.pl
Expand Up @@ -177,3 +177,11 @@ ($$$)
print_drive_capabilities($i_read_cap, $i_write_cap, $i_misc_cap);


print "\nDriver Availabiliity...\n";

foreach my $driver_name (sort keys(%Device::Cdio::drivers)) {
print "Driver $driver_name is installed.\n"
if Device::Cdio::have_driver($driver_name) and
$driver_name !~ m{device|Unknown};
}
$d->close();
35 changes: 18 additions & 17 deletions lib/Device/Cdio.pm
Expand Up @@ -435,30 +435,15 @@ sub is_cuefile {
return perlcdio::is_cuefile($file_name);
}

=pod
=head2 is_nrg
is_nrg(nrgfile)->bool
Determine if nrgfile is a Nero NRG file disc image.
=cut

sub is_nrg {
my (@p) = @_;
my($file_name) = _rearrange(['NRGFILE'], @p);
return perlcdio::is_nrg($file_name);
}

=pod
=pod
=head2 is_device
is_device(source, driver_id=$perlcdio::DRIVER_UNKNOWN)->bool
Return True if source refers to a real hardware CD-ROM.
=cut

sub is_device {

my (@p) = @_;
Expand All @@ -470,6 +455,22 @@ sub is_device {

=pod
=head2 is_nrg
is_nrg(nrgfile)->bool
Determine if nrgfile is a Nero NRG file disc image.
=cut

sub is_nrg {
my (@p) = @_;
my($file_name) = _rearrange(['NRGFILE'], @p);
return perlcdio::is_nrg($file_name);
}

=pod
=head2 is_tocfile
is_tocfile(tocfile_name)->bool
Expand Down
72 changes: 16 additions & 56 deletions lib/Device/Cdio/Device.pm
Expand Up @@ -206,28 +206,6 @@ sub get_arg {

=pod
=head2 get_default_device_driver
get_default_device_driver( driver_id=$perlcdio::DRIVER_DEVICE)->str
Get the default CD device. If we haven't initialized a specific
device driver, then find a suitable one and return the default device
for that. In some situations of drivers or OS's we can't find a CD
device if there is no media in it and it is possible for this routine
to return undef even though there may be a hardware CD-ROM.
=cut

sub get_default_device_driver {
my($self,@p) = @_;
my($driver_id, @args) = _rearrange(['DRIVER_ID'], @p);
return undef if _extra_args(@args);
$driver_id = $perlcdio::DRIVER_DEVICE if !defined($driver_id);
return perlcdio::get_default_device_driver($driver_id);
}

=pod
=head2 get_device
get_device()->str
Expand Down Expand Up @@ -435,22 +413,6 @@ sub get_joliet_level {

=pod
=head2 get_mcn
get_mcn()->str
Get the media catalog number (MCN) from the CD.
=cut

sub get_mcn {
my($self,@p) = @_;
return $perlcdio::BAD_PARAMETER if !_check_arg_count($#_, 0);
return perlcdio::get_mcn($self->{cd});
}

=pod
=head2 get_last_session
get_last_session(self) -> (track_lsn, drc)
Expand Down Expand Up @@ -485,6 +447,22 @@ sub get_last_track {

=pod
=head2 get_mcn
get_mcn()->str
Get the media catalog number (MCN) from the CD.
=cut

sub get_mcn {
my($self,@p) = @_;
return $perlcdio::BAD_PARAMETER if !_check_arg_count($#_, 0);
return perlcdio::get_mcn($self->{cd});
}

=pod
=head2 get_media_changed
get_media_changed() -> int
Expand Down Expand Up @@ -781,24 +759,6 @@ sub set_speed {
return perlcdio::set_speed($self->{cd}, $speed);
}

=pod
=head2 set_track
set_track(track_num)
Set a new track number for the given track number.
=cut

sub set_track {
my($self,@p) = @_;
my($track_num, @args) = _rearrange(['TRACK'], @p);
return undef if _extra_args(@args);
$self->{track} = $track_num;
return $self;
}

1; # Magic true value required at the end of a module

__END__
Expand Down
22 changes: 20 additions & 2 deletions lib/Device/Cdio/Track.pm
Expand Up @@ -129,9 +129,9 @@ sub get_copy_permit {
=head2 get_format
get_format()->format
get_format()->$format
Get the format (audio, mode2, mode1) of track.
Get the format (e.g. 'audio', 'mode2', 'mode1') of track.
=cut

Expand Down Expand Up @@ -257,6 +257,24 @@ sub is_track_green {
return perlcdio::is_track_green($self->{device}, $self->{track});
}

=pod
=head2 set_track
set_track(track_num)
Set a new track number.
=cut

sub set_track {
my($self,@p) = @_;
my($track_num, @args) = _rearrange(['TRACK'], @p);
return undef if _extra_args(@args);
$self->{track} = $track_num;
return $self;
}

1; # Magic true value required at the end of a module

__END__
Expand Down
2 changes: 1 addition & 1 deletion lib/Device/Cdio/Util.pm
Expand Up @@ -27,7 +27,7 @@ require Exporter;
@ISA = qw(Exporter);
@EXPORT_OK = qw(_rearrange _make_attributes _check_arg_count _extra_args);

$VERSION = '0.01';
$VERSION = $Device::Cdio::VERSION;

# Check that we $count (the argument count of arguments passed has
# between $min and $max arguments.
Expand Down

0 comments on commit 30b9c40

Please sign in to comment.