Class: Anyplayer::ItunesMac
- Inherits:
-
Player
- Object
- Player
- Anyplayer::ItunesMac
show all
- Defined in:
- lib/anyplayer/players/itunes_mac.rb
Constant Summary
Constants inherited
from Player
Player::DEFAULT_VOTES_TO_SKIP
Instance Method Summary
collapse
Methods inherited from Player
#initialize, #paused?, #vote, #votes
Instance Method Details
#album ⇒ Object
44
45
46
|
# File 'lib/anyplayer/players/itunes_mac.rb', line 44
def album
itunes "return album of current track"
end
|
#artist ⇒ Object
40
41
42
|
# File 'lib/anyplayer/players/itunes_mac.rb', line 40
def artist
itunes "return artist of current track"
end
|
#launched? ⇒ Boolean
53
54
55
|
# File 'lib/anyplayer/players/itunes_mac.rb', line 53
def launched?
%x(osascript -e 'app "iTunes" is running').rstrip == "true"
end
|
#name ⇒ Object
57
58
59
|
# File 'lib/anyplayer/players/itunes_mac.rb', line 57
def name
"iTunes Mac"
end
|
#next ⇒ Object
19
20
21
22
|
# File 'lib/anyplayer/players/itunes_mac.rb', line 19
def next
itunes "next track"
super
end
|
#pause ⇒ Object
6
7
8
|
# File 'lib/anyplayer/players/itunes_mac.rb', line 6
def pause
itunes "pause"
end
|
61
62
63
|
# File 'lib/anyplayer/players/itunes_mac.rb', line 61
def platforms
[:mac]
end
|
#play ⇒ Object
2
3
4
|
# File 'lib/anyplayer/players/itunes_mac.rb', line 2
def play
itunes "play"
end
|
#playing? ⇒ Boolean
48
49
50
51
|
# File 'lib/anyplayer/players/itunes_mac.rb', line 48
def playing?
playing = itunes "return player state is playing"
playing == "true"
end
|
#playpause ⇒ Object
10
11
12
|
# File 'lib/anyplayer/players/itunes_mac.rb', line 10
def playpause
itunes "playpause"
end
|
#prev ⇒ Object
14
15
16
17
|
# File 'lib/anyplayer/players/itunes_mac.rb', line 14
def prev
itunes "previous track"
super
end
|
#track ⇒ Object
36
37
38
|
# File 'lib/anyplayer/players/itunes_mac.rb', line 36
def track
itunes "return name of current track"
end
|
#voldown ⇒ Object
24
25
26
|
# File 'lib/anyplayer/players/itunes_mac.rb', line 24
def voldown
itunes "set sound volume to sound volume - 10"
end
|
#volume ⇒ Object
32
33
34
|
# File 'lib/anyplayer/players/itunes_mac.rb', line 32
def volume
itunes "return sound volume"
end
|
#volup ⇒ Object
28
29
30
|
# File 'lib/anyplayer/players/itunes_mac.rb', line 28
def volup
itunes "set sound volume to sound volume + 10"
end
|