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.9 by root, Mon Mar 20 12:23:21 2023 UTC vs.
Revision 1.10 by root, Mon Mar 20 12:31:03 2023 UTC

209use Scalar::Util (); 209use Scalar::Util ();
210 210
211use AnyEvent (); 211use AnyEvent ();
212use AnyEvent::Util (); 212use AnyEvent::Util ();
213 213
214our $VERSION = '0.1'; 214our $VERSION = '0.2';
215 215
216sub OBSID() { 0x10000000000000 } # 2**52 216sub OBSID() { 0x10000000000000 } # 2**52
217 217
218our $JSON = eval { require JSON::XS; JSON::XS:: } 218our $JSON = eval { require JSON::XS; JSON::XS:: }
219 || do { require JSON::PP; JSON::PP:: }; 219 || do { require JSON::PP; JSON::PP:: };
691When called in void context, the observer stays in place until F<mpv> 691When called in void context, the observer stays in place until F<mpv>
692is stopped. In any otrher context, these methods return a guard 692is stopped. In any otrher context, these methods return a guard
693object that, when it goes out of scope, unregisters the observe using 693object that, when it goes out of scope, unregisters the observe using
694C<unobserve_property>. 694C<unobserve_property>.
695 695
696Internally, this method uses observer ids of 2**52 (0x10000000000000) or
697higher - it will not interfere with lower ovserver ids, so it is possible
698to completely ignore this system and execute C<observe_property> commands
699yourself, whilst listening to C<property-change> events - as long as your
700ids stay below 2**52.
701
696Example: register observers for changtes in C<aid> and C<sid>. Note that 702Example: register observers for changtes in C<aid> and C<sid>. Note that
697a dummy statement is added to make sure the method is called in void 703a dummy statement is added to make sure the method is called in void
698context. 704context.
699 705
700 sub register_observers { 706 sub register_observers {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines