3 # This file is part of Audio::MPD
4 # Copyright (c) 2007 Jerome Quelin, all rights reserved.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the same terms as Perl itself.
17 # are we able to test module?
18 eval 'use Audio::MPD::Test';
19 plan skip_all => $@ if $@ =~ s/\n+Compilation failed.*//s;
22 my $mpd = Audio::MPD->new;
26 # testing absolute volume.
27 $mpd->volume(10); # init to sthg that we know
29 is( $mpd->status->volume, 42, 'setting volume' );
32 # testing positive relative volume.
34 is( $mpd->status->volume, 51, 'increasing volume' );
37 # testing negative relative volume.
39 is( $mpd->status->volume, 47, 'decreasing volume' );
43 # testing disable_output.
44 $mpd->playlist->add( 'title.ogg' );
45 $mpd->playlist->add( 'dir1/title-artist-album.ogg' );
46 $mpd->playlist->add( 'dir1/title-artist.ogg' );
48 $mpd->output_disable(0);
50 like( $mpd->status->error, qr/^problems/, 'disabling output' );
53 # testing enable_output.
54 $mpd->output_enable(0);
56 $mpd->play; $mpd->pause;
57 is( $mpd->status->error, undef, 'enabling output' );