Class: ITuner::ITunes
Instance Attribute Summary
Attributes inherited from Model
#app_object
Instance Method Summary
collapse
Methods inherited from Model
#==, action, belongs_to, has_many, #initialize, #inspect, property
Constructor Details
This class inherits a constructor from ITuner::Model
Instance Method Details
#current_track ⇒ Object
40
41
42
43
44
|
# File 'lib/ituner/itunes.rb', line 40
def current_track
Track.new(app.current_track.get)
rescue Appscript::CommandError
nil
end
|
#library ⇒ Object
48
49
50
|
# File 'lib/ituner/itunes.rb', line 48
def library
sources["Library"]
end
|
#music ⇒ Object
56
57
58
|
# File 'lib/ituner/itunes.rb', line 56
def music
playlists["Music"]
end
|
#paused? ⇒ Boolean
37
|
# File 'lib/ituner/itunes.rb', line 37
def paused?; state == :paused; end
|
#playing? ⇒ Boolean
36
|
# File 'lib/ituner/itunes.rb', line 36
def playing?; state == :playing; end
|
#playlists ⇒ Object
52
53
54
|
# File 'lib/ituner/itunes.rb', line 52
def playlists
library.playlists
end
|
#running? ⇒ Boolean
24
25
26
|
# File 'lib/ituner/itunes.rb', line 24
def running?
app.is_running?
end
|
#state ⇒ Object
32
33
34
|
# File 'lib/ituner/itunes.rb', line 32
def state
app.player_state.get
end
|
#stopped? ⇒ Boolean
38
|
# File 'lib/ituner/itunes.rb', line 38
def stopped?; state == :stopped; end
|