]> iEval git - audio-opusfile.git/blobdiff - lib/Audio/Opusfile.pm
Perlcritic compliance + bump version and update Changes
[audio-opusfile.git] / lib / Audio / Opusfile.pm
index 09fe9c7a7a49f4d89afbae6fda06debebc8daca9..bfd4a138b7b990ad8fd586394eaf13a3262c1034 100644 (file)
@@ -46,29 +46,20 @@ my @constants =
 our @EXPORT_OK = @constants;
 our @EXPORT = @constants;
 
-our $VERSION = '0.004';
-
-sub AUTOLOAD {
-    # This AUTOLOAD is used to 'autoload' constants from the constant()
-    # XS function.
-
-    my $constname;
-    our $AUTOLOAD;
-    ($constname = $AUTOLOAD) =~ s/.*:://;
-    croak "&Audio::Opusfile::constant not defined" if $constname eq 'constant';
-    my ($error, $val) = constant($constname);
-    if ($error) { croak $error; }
-    {
-       no strict 'refs';
-       # Fixed between 5.005_53 and 5.005_61
-#XXX   if ($] >= 5.00561) {
-#XXX       *$AUTOLOAD = sub () { $val };
-#XXX   }
-#XXX   else {
-           *$AUTOLOAD = sub { $val };
-#XXX   }
-    }
-    goto &$AUTOLOAD;
+our $VERSION = '1.000';
+
+sub AUTOLOAD { ## no critic (ProhibitAutoloading)
+       my $constname;
+       our $AUTOLOAD;
+       ($constname = $AUTOLOAD) =~ s/.*:://s;
+       croak '&Audio::Opusfile::constant not defined' if $constname eq 'constant';
+       my ($error, $val) = constant($constname);
+       if ($error) { croak $error; }
+       {
+               no strict 'refs'; ## no critic (ProhibitNoStrict)
+               *$AUTOLOAD = sub { $val };
+       }
+       goto &$AUTOLOAD;
 }
 
 require XSLoader;
@@ -77,8 +68,6 @@ require Audio::Opusfile::Head;
 require Audio::Opusfile::Tags;
 require Audio::Opusfile::PictureTag;
 
-# Preloaded methods go here.
-
 sub new_from_file {
        my ($class, $file) = @_;
        open_file($file)
@@ -206,6 +195,15 @@ separate function to convert this to seconds.
 The stream must be seekable to get the total. A negative value is
 returned if the stream is not seekable.
 
+=item $of->B<current_link>
+
+Retrieve the index of the current link.
+
+This is the link that produced the data most recently read by
+op_read_float() or its associated functions, or, after a seek, the
+link that the seek target landed in. Reading more data may advance the
+link index (even on the first read after a seek).
+
 =item $of->B<bitrate>([I<$link_index>])
 
 Computes the bitrate of the stream (with no arguments), or of an
@@ -372,7 +370,7 @@ Marius Gavrilescu, E<lt>marius@ieval.roE<gt>
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright (C) 2016 by Marius Gavrilescu
+Copyright (C) 2016-2017 by Marius Gavrilescu
 
 This library is free software; you can redistribute it and/or modify
 it under the same terms as Perl itself, either Perl version 5.24.0 or,
This page took 0.029372 seconds and 4 git commands to generate.