Class: ItunesCLI::Player

Inherits:
Object
  • Object
show all
Defined in:
lib/itunes-cli/player.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePlayer

Returns a new instance of Player.



7
8
9
# File 'lib/itunes-cli/player.rb', line 7

def initialize
  @itunes = WIN32OLE.new("iTunes.Application")
end

Instance Attribute Details

#itunesObject (readonly)

Returns the value of attribute itunes.



5
6
7
# File 'lib/itunes-cli/player.rb', line 5

def itunes
  @itunes
end

Instance Method Details

#currentObject



31
32
33
# File 'lib/itunes-cli/player.rb', line 31

def current
  Track.new({:title => track, :artist => artist, :album => album})
end

#nextObject



27
28
29
# File 'lib/itunes-cli/player.rb', line 27

def next
  @itunes.NextTrack()
end

#pauseObject



15
16
17
# File 'lib/itunes-cli/player.rb', line 15

def pause
  @itunes.Pause()
end

#playObject



11
12
13
# File 'lib/itunes-cli/player.rb', line 11

def play
  @itunes.Play()
end

#prevObject



23
24
25
# File 'lib/itunes-cli/player.rb', line 23

def prev
  @itunes.PreviousTrack()
end

#stopObject



19
20
21
# File 'lib/itunes-cli/player.rb', line 19

def stop
  @itunes.Stop()
end