Class: ItunesPlayer_MacOSX
- Inherits:
-
MusicPlayer
- Object
- MusicPlayer
- ItunesPlayer_MacOSX
- Defined in:
- lib/sonice-players/itunes_mac.rb
Instance Method Summary collapse
- #current_track ⇒ Object
- #launched? ⇒ Boolean
- #name ⇒ Object
- #next ⇒ Object
- #playpause ⇒ Object
- #prev ⇒ Object
- #voldown ⇒ Object
- #volume ⇒ Object
- #volup ⇒ Object
Instance Method Details
#current_track ⇒ Object
26 27 28 |
# File 'lib/sonice-players/itunes_mac.rb', line 26 def current_track tell_to 'return (artist of current track) & " - " & (name of current track)' end |
#launched? ⇒ Boolean
30 31 32 33 |
# File 'lib/sonice-players/itunes_mac.rb', line 30 def launched? %x(osascript -e 'tell app "Itunes" to return name of current track' 2>/dev/null) $? == 0 end |
#name ⇒ Object
35 36 37 |
# File 'lib/sonice-players/itunes_mac.rb', line 35 def name "iTunes" end |
#next ⇒ Object
10 11 12 |
# File 'lib/sonice-players/itunes_mac.rb', line 10 def next tell_to 'next track' end |
#playpause ⇒ Object
2 3 4 |
# File 'lib/sonice-players/itunes_mac.rb', line 2 def playpause tell_to 'playpause' end |
#prev ⇒ Object
6 7 8 |
# File 'lib/sonice-players/itunes_mac.rb', line 6 def prev tell_to 'previous track' end |
#voldown ⇒ Object
14 15 16 |
# File 'lib/sonice-players/itunes_mac.rb', line 14 def voldown tell_to 'set sound volume to sound volume - 10' end |
#volume ⇒ Object
22 23 24 |
# File 'lib/sonice-players/itunes_mac.rb', line 22 def volume tell_to 'return sound volume' end |
#volup ⇒ Object
18 19 20 |
# File 'lib/sonice-players/itunes_mac.rb', line 18 def volup tell_to 'set sound volume to sound volume + 10' end |