3 # This file is part of POE::Component::Client::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 terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or (at
9 # your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 use POE qw[ Component::Client::MPD::Message ];
28 plan skip_all => 'need some mpd commands';
34 # [ 'event', [ $arg1, $arg2, ... ], $answer_back, \&check_results ]
36 [ 'volume', [10], $DISCARD, undef ], # init to sthg we know
37 [ 'volume', [42], $DISCARD, undef ],
38 #[ 'status', [], $SEND, \&check_volume_absolute ],
40 [ 'volume', ['+9'], $DISCARD, undef ],
41 #[ 'status', [], $SEND, \&check_volume_relative_pos ],
43 [ 'volume', ['-4'], $DISCARD, undef ],
44 #[ 'status', [], $SEND, \&check_volume_relative_neg ],
48 # are we able to test module?
49 eval 'use POE::Component::Client::MPD::Test';
50 plan skip_all => $@ if $@ =~ s/\n+BEGIN failed--compilation aborted.*//s;
54 sub check_volume_absolute {
55 #is( $mpd->status->volume, 42, 'setting volume' );
57 sub check_volume_telative_pos {
58 #is( $mpd->status->volume, 51, 'setting volume' );
61 sub check_volume_telative_neg {
62 #is( $mpd->status->volume, 47, 'decreasing volume' );
70 # testing disable_output.
71 $mpd->playlist->add( 'title.ogg' );
72 $mpd->playlist->add( 'dir1/title-artist-album.ogg' );
73 $mpd->playlist->add( 'dir1/title-artist.ogg' );
75 $mpd->output_disable(0);
77 like( $mpd->status->error, qr/^problems/, 'disabling output' );
80 # testing enable_output.
81 $mpd->output_enable(0);
83 $mpd->play; $mpd->pause;
84 is( $mpd->status->error, undef, 'enabling output' );