Class: ItunesPlayer_MacOSX

Inherits:
MusicPlayer
  • Object
show all
Defined in:
lib/sonice-players/itunes_mac.rb

Instance Method Summary collapse

Instance Method Details

#current_trackObject



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

Returns:

  • (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

#nameObject



35
36
37
# File 'lib/sonice-players/itunes_mac.rb', line 35

def name
  "iTunes"
end

#nextObject



10
11
12
# File 'lib/sonice-players/itunes_mac.rb', line 10

def next
  tell_to 'next track'
end

#playpauseObject



2
3
4
# File 'lib/sonice-players/itunes_mac.rb', line 2

def playpause
  tell_to 'playpause'
end

#prevObject



6
7
8
# File 'lib/sonice-players/itunes_mac.rb', line 6

def prev
  tell_to 'previous track'
end

#voldownObject



14
15
16
# File 'lib/sonice-players/itunes_mac.rb', line 14

def voldown
  tell_to 'set sound volume to sound volume - 10'
end

#volumeObject



22
23
24
# File 'lib/sonice-players/itunes_mac.rb', line 22

def volume
  tell_to 'return sound volume'
end

#volupObject



18
19
20
# File 'lib/sonice-players/itunes_mac.rb', line 18

def volup
  tell_to 'set sound volume to sound volume + 10'
end