Class: ItunesPlayer_Win
- Inherits:
-
MusicPlayer
- Object
- MusicPlayer
- ItunesPlayer_Win
- Defined in:
- lib/sonice-players/itunes_win.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 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
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 |
#name ⇒ Object
44 45 46 |
# File 'lib/sonice-players/itunes_win.rb', line 44 def name "iTunes" end |
#next ⇒ Object
10 11 12 |
# File 'lib/sonice-players/itunes_win.rb', line 10 def next @itunes.NextTrack() end |
#playpause ⇒ Object
2 3 4 |
# File 'lib/sonice-players/itunes_win.rb', line 2 def playpause @itunes.PlayPause() end |
#prev ⇒ Object
6 7 8 |
# File 'lib/sonice-players/itunes_win.rb', line 6 def prev @itunes.PreviousTrack() end |
#voldown ⇒ Object
14 15 16 |
# File 'lib/sonice-players/itunes_win.rb', line 14 def voldown @itunes.SoundVolume=@itunes.SoundVolume - 10 end |
#volume ⇒ Object
22 23 24 |
# File 'lib/sonice-players/itunes_win.rb', line 22 def volume @itunes.SoundVolume end |
#volup ⇒ Object
18 19 20 |
# File 'lib/sonice-players/itunes_win.rb', line 18 def volup @itunes.SoundVolume=@itunes.SoundVolume + 10 end |