ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent-MPV/MPV.pm
(Generate patch)

Comparing AnyEvent-MPV/MPV.pm (file contents):
Revision 1.6 by root, Sun Mar 19 23:24:20 2023 UTC vs.
Revision 1.7 by root, Sun Mar 19 23:37:46 2023 UTC

409 if ($reply->{args}[1] eq "key") { 409 if ($reply->{args}[1] eq "key") {
410 (my $key = $reply->{args}[2]) =~ s/\\x(..)/chr hex $1/ge; 410 (my $key = $reply->{args}[2]) =~ s/\\x(..)/chr hex $1/ge;
411 $self->on_key ($key); 411 $self->on_key ($key);
412 } 412 }
413 } else { 413 } else {
414 $self->on_event ($reply->{event}, $reply); 414 $self->on_event (delete $reply->{event}, $reply);
415 } 415 }
416 } elsif (exists $reply->{request_id}) { 416 } elsif (exists $reply->{request_id}) {
417 my $cv = delete $self->{cmd_cv}{$reply->{request_id}}; 417 my $cv = delete $self->{cmd_cv}{$reply->{request_id}};
418 418
419 unless ($cv) { 419 unless ($cv) {
504 504
505This method is called when F<mpv> sends an asynchronous event. The default 505This method is called when F<mpv> sends an asynchronous event. The default
506implementation will call the C<on_event> code reference specified in the 506implementation will call the C<on_event> code reference specified in the
507constructor, or do nothing if none was given. 507constructor, or do nothing if none was given.
508 508
509The first/implicit argument is the C<$mpv> object, the second is the event 509The first/implicit argument is the C<$mpv> object, the second is the
510name (same as C<< $data->{event} >>, purely for convenience), and the 510event name (same as C<< $data->{event} >>, purely for convenience), and
511third argument is the full event object as sent by F<mpv>. See L<List of 511the third argument is the event object as sent by F<mpv> (sans C<event>
512events|https://mpv.io/manual/stable/#list-of-events> in its documentation. 512key). See L<List of events|https://mpv.io/manual/stable/#list-of-events>
513in its documentation.
513 514
514For subclassing, see I<SUBCLASSING>, below. 515For subclassing, see I<SUBCLASSING>, below.
515 516
516=cut 517=cut
517 518

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines