Class: Anyplayer::Xmms2
Constant Summary
Constants inherited
from Player
Player::DEFAULT_VOTES_TO_SKIP
Instance Method Summary
collapse
Methods inherited from Player
#initialize, #name, #vote, #votes
Instance Method Details
#album ⇒ Object
45
46
47
|
# File 'lib/anyplayer/players/xmms2.rb', line 45
def album
xmms2 "current -f '${album}'"
end
|
#artist ⇒ Object
41
42
43
|
# File 'lib/anyplayer/players/xmms2.rb', line 41
def artist
xmms2 "current -f '${artist}'"
end
|
#host ⇒ Object
63
64
65
|
# File 'lib/anyplayer/players/xmms2.rb', line 63
def host
ENV["XMMS_PATH"] || super
end
|
#launched? ⇒ Boolean
57
58
59
60
61
|
# File 'lib/anyplayer/players/xmms2.rb', line 57
def launched?
%x(xmms2 current 2> /dev/null)
$? == 0
end
|
#next ⇒ Object
19
20
21
22
|
# File 'lib/anyplayer/players/xmms2.rb', line 19
def next
xmms2 "next"
super
end
|
#pause ⇒ Object
10
11
12
|
# File 'lib/anyplayer/players/xmms2.rb', line 10
def pause
xmms2 "pause"
end
|
#paused? ⇒ Boolean
53
54
55
|
# File 'lib/anyplayer/players/xmms2.rb', line 53
def paused?
xmms2("current -f '${playback_status}'") == "Paused"
end
|
67
68
69
|
# File 'lib/anyplayer/players/xmms2.rb', line 67
def platforms
[:unix, :linux]
end
|
#play ⇒ Object
6
7
8
|
# File 'lib/anyplayer/players/xmms2.rb', line 6
def play
xmms2 "play"
end
|
#playing? ⇒ Boolean
49
50
51
|
# File 'lib/anyplayer/players/xmms2.rb', line 49
def playing?
xmms2("current -f '${playback_status}'") == "Playing"
end
|
#playpause ⇒ Object
2
3
4
|
# File 'lib/anyplayer/players/xmms2.rb', line 2
def playpause
xmms2 "toggle"
end
|
#prev ⇒ Object
14
15
16
17
|
# File 'lib/anyplayer/players/xmms2.rb', line 14
def prev
xmms2 "prev"
super
end
|
#track ⇒ Object
37
38
39
|
# File 'lib/anyplayer/players/xmms2.rb', line 37
def track
xmms2 "current -f '${title}'"
end
|
#voldown ⇒ Object
24
25
26
|
# File 'lib/anyplayer/players/xmms2.rb', line 24
def voldown
set_volume volume - 10
end
|
#volume ⇒ Object
32
33
34
35
|
# File 'lib/anyplayer/players/xmms2.rb', line 32
def volume
xmms2("server volume").split("\n").first.sub(/([^0-9]*)/, "").to_i
end
|
#volup ⇒ Object
28
29
30
|
# File 'lib/anyplayer/players/xmms2.rb', line 28
def volup
set_volume volume + 10
end
|