Class: Metro::Audio::Song
- Inherits:
-
Model
- Object
- Model
- Metro::Audio::Song
show all
- Defined in:
- lib/metro/models/audio/song.rb
Overview
A song represents an audio representation.
Constant Summary
Constants included
from Units
Units::Bounds
Instance Attribute Summary
Attributes inherited from Model
#scene, #window
Instance Method Summary
collapse
Methods inherited from Model
#_load, #_save, #after_initialize, #bounds, #completed?, #create, #draw, hierarchy, inherited, #initialize, metro_name, #model, model_name, models, #name, #notification, #saveable_to_view, #to_hash, #update
Methods included from HasEvents
included
#get, #set
included, #properties
Constructor Details
This class inherits a constructor from Metro::Model
Instance Method Details
#pause ⇒ Object
26
27
28
|
# File 'lib/metro/models/audio/song.rb', line 26
def pause
song.playing? ? song.pause : song.play
end
|
#play ⇒ Object
22
23
24
|
# File 'lib/metro/models/audio/song.rb', line 22
def play
song.play if not song.playing? and not song.paused?
end
|
#show ⇒ Object
13
14
15
16
|
# File 'lib/metro/models/audio/song.rb', line 13
def show
song.volume = self.volume
play if state == "play"
end
|
#stop ⇒ Object
18
19
20
|
# File 'lib/metro/models/audio/song.rb', line 18
def stop
song.stop
end
|