Class: Song

Inherits:
Object
  • Object
show all
Defined in:
lib/r2d/song.rb

Overview

song.rb

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Song

Returns a new instance of Song.



5
6
7
# File 'lib/r2d/song.rb', line 5

def initialize(path)
  @song = R2D::Adapters.song(path)
end

Instance Method Details

#loopObject



13
14
15
# File 'lib/r2d/song.rb', line 13

def loop
  @song.play(true)
end

#pauseObject



17
18
19
# File 'lib/r2d/song.rb', line 17

def pause
  @song.pause
end

#paused?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/r2d/song.rb', line 25

def paused?
  @song.paused?
end

#playObject



9
10
11
# File 'lib/r2d/song.rb', line 9

def play
  @song.play
end

#playing?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/r2d/song.rb', line 21

def playing?
  @song.playing?
end

#stopObject



29
30
31
# File 'lib/r2d/song.rb', line 29

def stop
  @song.stop
end

#volumeObject



33
34
35
# File 'lib/r2d/song.rb', line 33

def volume
  @song.volume
end