File tree Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change 49
49
# First we retrieve the config values stored in the server and print them out.
50
50
# This is a normal dict.
51
51
52
- my $result = $xmms -> configval_list ;
52
+ my $result = $xmms -> config_list_values ;
53
53
$result -> wait;
54
54
my $value = $result -> value;
55
55
64
64
$result = $xmms -> medialib_get_info( 1 );
65
65
$result -> wait;
66
66
67
- my $source_hash = $result -> value-> source_hash ;
67
+ my $propdict = $result -> value;
68
68
69
- for my $source ( keys %{ $source_hash } ) {
70
- while (my ($key , $val ) = each %{ $source_hash -> { $source } }) {
71
- print " $source : $key = $val \n " ;
69
+ while ( my ( $key , $values ) = each %{ $propdict } ) {
70
+ while (my ($source , $val ) = each %{ $values }) {
71
+ print " [ $source ] $key = $val \n " ;
72
72
}
73
73
}
Original file line number Diff line number Diff line change 18
18
# program first before returning here.
19
19
20
20
sub my_current_id {
21
- my ($result , $xmms ) = @_ ;
21
+ my ($value , $xc ) = @_ ;
22
22
23
23
# At this point the result instance is filled with the answer and we can
24
24
# now extract it as normal. The second argument is our connection object
25
25
# which was passed in as the userdata.
26
26
27
- printf " Current id is %d \n " , $result -> value;
28
- $xmms -> quit_loop;
27
+ printf " Current id is %d \n " , $value ;
28
+ $xc -> quit_loop;
29
29
}
30
30
31
31
# Let's ask for the current id in an async way instead of the sync way as we
@@ -35,7 +35,8 @@ sub my_current_id {
35
35
# my $request = $xmms->playback_current_id;
36
36
# $request->notifier_set( \&my_current_id, $xmms );
37
37
38
- $xmms -> request( playback_current_id => \&my_current_id, $xmms );
38
+ # $xmms->request( playback_current_id => \&my_current_id );
39
+ $xmms -> request( playback_current_id => sub { my_current_id (@_ , $xmms ) } );
39
40
40
41
# As you see we do it pretty much the same way that we did in tut2, but instead
41
42
# of being able to access the current id directly (as we would have if we where
You can’t perform that action at this time.
0 commit comments