class Anyplayer::ItunesMac
Public Instance Methods
album()
click to toggle source
# File lib/anyplayer/players/itunes_mac.rb, line 44 def album itunes "return album of current track" end
artist()
click to toggle source
# File lib/anyplayer/players/itunes_mac.rb, line 40 def artist itunes "return artist of current track" end
launched?()
click to toggle source
# File lib/anyplayer/players/itunes_mac.rb, line 53 def launched? %x(osascript -e 'app "iTunes" is running').rstrip == "true" end
name()
click to toggle source
# File lib/anyplayer/players/itunes_mac.rb, line 57 def name "iTunes Mac" end
next()
click to toggle source
Calls superclass method
Anyplayer::Player#next
# File lib/anyplayer/players/itunes_mac.rb, line 19 def next itunes "next track" super end
pause()
click to toggle source
# File lib/anyplayer/players/itunes_mac.rb, line 6 def pause itunes "pause" end
platforms()
click to toggle source
# File lib/anyplayer/players/itunes_mac.rb, line 61 def platforms [:mac] end
play()
click to toggle source
# File lib/anyplayer/players/itunes_mac.rb, line 2 def play itunes "play" end
playing?()
click to toggle source
# File lib/anyplayer/players/itunes_mac.rb, line 48 def playing? playing = itunes "return player state is playing" playing == "true" end
playpause()
click to toggle source
# File lib/anyplayer/players/itunes_mac.rb, line 10 def playpause itunes "playpause" end
prev()
click to toggle source
Calls superclass method
Anyplayer::Player#prev
# File lib/anyplayer/players/itunes_mac.rb, line 14 def prev itunes "previous track" super end
track()
click to toggle source
# File lib/anyplayer/players/itunes_mac.rb, line 36 def track itunes "return name of current track" end
voldown()
click to toggle source
# File lib/anyplayer/players/itunes_mac.rb, line 24 def voldown itunes "set sound volume to sound volume - 10" end
volume()
click to toggle source
# File lib/anyplayer/players/itunes_mac.rb, line 32 def volume itunes "return sound volume" end
volup()
click to toggle source
# File lib/anyplayer/players/itunes_mac.rb, line 28 def volup itunes "set sound volume to sound volume + 10" end
Private Instance Methods
itunes(command)
click to toggle source
# File lib/anyplayer/players/itunes_mac.rb, line 68 def itunes(command) %x(osascript -e 'tell app "iTunes" to #{command}').rstrip end