… | |
… | |
190 | my $self = shift; |
190 | my $self = shift; |
191 | $self->{tpf}; |
191 | $self->{tpf}; |
192 | } |
192 | } |
193 | |
193 | |
194 | for my $field (qw(title artist album year comment genre state url |
194 | for my $field (qw(title artist album year comment genre state url |
195 | type layer samplerate mode mode_extension bpf |
195 | type layer samplerate mode mode_extension bpf frame |
196 | channels copyrighted error_protected title artist album |
196 | channels copyrighted error_protected title artist album |
197 | year comment genre emphasis bitrate extension)) { |
197 | year comment genre emphasis bitrate extension)) { |
198 | *{$field} = sub { $_[0]{$field} }; |
198 | *{$field} = sub { $_[0]{$field} }; |
199 | } |
199 | } |
200 | |
200 | |
… | |
… | |
312 | |
312 | |
313 | This can be used to wait for the end of a song, for example. This function |
313 | This can be used to wait for the end of a song, for example. This function |
314 | should be called regularly, since mpg123 will stop playing when it can't |
314 | should be called regularly, since mpg123 will stop playing when it can't |
315 | write out events because the perl program is no longer listening... |
315 | write out events because the perl program is no longer listening... |
316 | |
316 | |
317 | =item title artist album year comment genre url type layer samplerate mode mode_extension bpf channels copyrighted error_protected title artist album year comment genre emphasis bitrate extension [CACHING] |
317 | =item title artist album year comment genre url type layer samplerate mode mode_extension bpf frame channels copyrighted error_protected title artist album year comment genre emphasis bitrate extension [CACHING] |
318 | |
318 | |
319 | These accessor functions return information about the loaded |
319 | These accessor functions return information about the loaded |
320 | song. Information about the C<artist>, C<album>, C<year>, C<comment> or |
320 | song. Information about the C<artist>, C<album>, C<year>, C<comment> or |
321 | C<genre> might not be available and will be returned as C<undef>. |
321 | C<genre> might not be available and will be returned as C<undef>. |
322 | |
322 | |
|
|
323 | The accessor function C<frame> returns a reference to an array containing |
|
|
324 | the frames played, frames left, seconds played, and seconds left in this |
|
|
325 | order. Seconds are returned as floating point numbers. |
|
|
326 | |
323 | =item tpf [CACHING] |
327 | =item tpf [CACHING] |
324 | |
328 | |
325 | Returns the "time per frame", i.e. the time in seconds for one frame. Useful with the C<jump>-method: |
329 | Returns the "time per frame", i.e. the time in seconds for one frame. Useful with the C<jump>-method: |
326 | |
330 | |
327 | $player->jump (60/$player->tpf); |
331 | $player->jump (60/$player->tpf); |