module CultomePlayer::StateChecker

Public Instance Methods

current_album() click to toggle source

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
current_artist() click to toggle source

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
current_playlist() click to toggle source

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
current_song() click to toggle source

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
paused?() click to toggle source

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
playback_length() click to toggle source

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
playback_position() click to toggle source

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
playing?() click to toggle source

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
shuffling?() click to toggle source

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
stopped?() click to toggle source

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