Module: CultomePlayer::StateChecker
- Included in:
- CultomePlayer
- Defined in:
- lib/cultome_player/state_checker.rb
Instance Method Summary collapse
-
#current_album ⇒ Album
Returns the current album.
-
#current_artist ⇒ Artist
Returns the current artist.
-
#current_playlist ⇒ Playlist
Returns the current playlist.
-
#current_song ⇒ Song
Returns the current song.
-
#paused? ⇒ Boolean
Check the status of pause.
-
#playback_length ⇒ Integer
Returns the current playback length.
-
#playback_position ⇒ Integer
Returns the current playback position.
-
#playing? ⇒ Boolean
Check the status of play.
-
#shuffling? ⇒ Boolean
Check the status of shuffle.
-
#stopped? ⇒ Boolean
Check the status of stop.
Instance Method Details
#current_album ⇒ Album
Returns the current album.
49 50 51 |
# File 'lib/cultome_player/state_checker.rb', line 49 def current_album current_song.album end |
#current_artist ⇒ Artist
Returns the current artist.
42 43 44 |
# File 'lib/cultome_player/state_checker.rb', line 42 def current_artist current_song.artist end |
#current_playlist ⇒ Playlist
Returns the current playlist.
56 57 58 |
# File 'lib/cultome_player/state_checker.rb', line 56 def current_playlist playlists[:current] end |
#current_song ⇒ Song
Returns the current song.
35 36 37 |
# File 'lib/cultome_player/state_checker.rb', line 35 def current_song @current_song end |
#paused? ⇒ Boolean
Check the status of pause.
7 8 9 |
# File 'lib/cultome_player/state_checker.rb', line 7 def paused? @paused ||= false end |
#playback_length ⇒ Integer
Returns the current playback length.
70 71 72 |
# File 'lib/cultome_player/state_checker.rb', line 70 def playback_length @playback_time_length ||= 0 end |
#playback_position ⇒ Integer
Returns the current playback position.
63 64 65 |
# File 'lib/cultome_player/state_checker.rb', line 63 def playback_position @playback_time_position ||= 0 end |
#playing? ⇒ Boolean
Check the status of play.
21 22 23 |
# File 'lib/cultome_player/state_checker.rb', line 21 def @playing ||= false end |
#shuffling? ⇒ Boolean
Check the status of shuffle.
28 29 30 |
# File 'lib/cultome_player/state_checker.rb', line 28 def shuffling? playlists[:current].shuffling? end |
#stopped? ⇒ Boolean
Check the status of stop.
14 15 16 |
# File 'lib/cultome_player/state_checker.rb', line 14 def stopped? @stopped ||= true end |