Class: MMPlayer::Player::State
- Inherits:
-
Object
- Object
- MMPlayer::Player::State
- Defined in:
- lib/mmplayer/player/state.rb
Instance Attribute Summary collapse
-
#eof ⇒ Object
(also: #eof?)
Returns the value of attribute eof.
-
#pause ⇒ Object
(also: #pause?, #paused?)
Returns the value of attribute pause.
-
#play ⇒ Object
(also: #play?, #playing?)
Returns the value of attribute play.
Instance Method Summary collapse
- #eof_reached? ⇒ Boolean
- #handle_eof ⇒ Object
- #handle_start ⇒ Object
-
#initialize ⇒ State
constructor
A new instance of State.
- #progressing? ⇒ Boolean
- #toggle_pause ⇒ Object
Constructor Details
#initialize ⇒ State
Returns a new instance of State.
14 15 16 17 18 |
# File 'lib/mmplayer/player/state.rb', line 14 def initialize @eof = false @play = false @pause = false end |
Instance Attribute Details
#eof ⇒ Object Also known as: eof?
Returns the value of attribute eof.
7 8 9 |
# File 'lib/mmplayer/player/state.rb', line 7 def eof @eof end |
#pause ⇒ Object Also known as: pause?, paused?
Returns the value of attribute pause.
7 8 9 |
# File 'lib/mmplayer/player/state.rb', line 7 def pause @pause end |
#play ⇒ Object Also known as: play?, playing?
Returns the value of attribute play.
7 8 9 |
# File 'lib/mmplayer/player/state.rb', line 7 def play @play end |
Instance Method Details
#eof_reached? ⇒ Boolean
28 29 30 |
# File 'lib/mmplayer/player/state.rb', line 28 def eof_reached? @play && !@eof && !@pause end |
#handle_eof ⇒ Object
32 33 34 35 |
# File 'lib/mmplayer/player/state.rb', line 32 def handle_eof @eof = true @play = false end |
#handle_start ⇒ Object
37 38 39 40 |
# File 'lib/mmplayer/player/state.rb', line 37 def handle_start @play = true @eof = false end |
#progressing? ⇒ Boolean
24 25 26 |
# File 'lib/mmplayer/player/state.rb', line 24 def progressing? @play && !@pause end |
#toggle_pause ⇒ Object
20 21 22 |
# File 'lib/mmplayer/player/state.rb', line 20 def toggle_pause @pause = !@pause end |