module CultomePlayer::StateChecker
Public Instance Methods
Returns the current album.
@return [Album] The current album or nil if any.
# File lib/cultome_player/state_checker.rb, line 49 def current_album current_song.album end
Returns the current artist.
@return [Artist] The current artist or nil if any.
# File lib/cultome_player/state_checker.rb, line 42 def current_artist current_song.artist end
Returns the current playlist.
@return [Playlist] The current playlist or nil if any.
# File lib/cultome_player/state_checker.rb, line 56 def current_playlist playlists[:current] end
Returns the current song.
@return [Song] The current song or nil if any.
# File lib/cultome_player/state_checker.rb, line 35 def current_song @current_song end
Check the status of pause.
@return [Boolean] True if paused, False otherwise
# File lib/cultome_player/state_checker.rb, line 7 def paused? @paused ||= false end
Returns the current playback length.
@return [Integer] The current playback length in seconds.
# File lib/cultome_player/state_checker.rb, line 70 def playback_length @playback_time_length ||= 0 end
Returns the current playback position.
@return [Integer] The current playback position in seconds.
# File lib/cultome_player/state_checker.rb, line 63 def playback_position @playback_time_position ||= 0 end
Check the status of play.
@return [Boolean] True if playing, False otherwise
# File lib/cultome_player/state_checker.rb, line 21 def playing? @playing ||= false end
Check the status of shuffle.
@return [Boolean] True if shuffling, False otherwise
# File lib/cultome_player/state_checker.rb, line 28 def shuffling? playlists[:current].shuffling? end
Check the status of stop.
@return [Boolean] True if stopped, False otherwise
# File lib/cultome_player/state_checker.rb, line 14 def stopped? @stopped ||= true end