Class: ItunesPlayer_Win

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

Instance Method Summary collapse

Instance Method Details

#current_trackObject



26
27
28
29
30
31
32
# File 'lib/sonice-players/itunes_win.rb', line 26

def current_track
  curTrack=@itunes.CurrentTrack
  if(curTrack)
    return (curTrack.Artist + " - " + curTrack.name)
  end
  ""
end

#launched?Boolean

Returns:

  • (Boolean)


34
35
36
37
38
39
40
41
42
# File 'lib/sonice-players/itunes_win.rb', line 34

def launched?
  begin
    require 'win32ole'
    @itunes = WIN32OLE.new("iTunes.Application")
    return true
  rescue LoadError
    return false
  end
end

#nameObject



44
45
46
# File 'lib/sonice-players/itunes_win.rb', line 44

def name
  "iTunes"
end

#nextObject



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

def next
  @itunes.NextTrack()
end

#playpauseObject



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

def playpause
  @itunes.PlayPause()
end

#prevObject



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

def prev
  @itunes.PreviousTrack()
end

#voldownObject



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

def voldown
  @itunes.SoundVolume=@itunes.SoundVolume - 10
end

#volumeObject



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

def volume
  @itunes.SoundVolume
end

#volupObject



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

def volup
  @itunes.SoundVolume=@itunes.SoundVolume + 10
end