Module: CultomePlayer::StateChecker

Included in:
CultomePlayer
Defined in:
lib/cultome_player/state_checker.rb

Instance Method Summary collapse

Instance Method Details

#current_albumAlbum

Returns the current album.

Returns:

  • (Album)

    The current album or nil if any.



49
50
51
# File 'lib/cultome_player/state_checker.rb', line 49

def current_album
  current_song.album
end

#current_artistArtist

Returns the current artist.

Returns:

  • (Artist)

    The current artist or nil if any.



42
43
44
# File 'lib/cultome_player/state_checker.rb', line 42

def current_artist
  current_song.artist
end

#current_playlistPlaylist

Returns the current playlist.

Returns:

  • (Playlist)

    The current playlist or nil if any.



56
57
58
# File 'lib/cultome_player/state_checker.rb', line 56

def current_playlist
  playlists[:current]
end

#current_songSong

Returns the current song.

Returns:

  • (Song)

    The current song or nil if any.



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.

Returns:

  • (Boolean)

    True if paused, False otherwise



7
8
9
# File 'lib/cultome_player/state_checker.rb', line 7

def paused?
  @paused ||= false
end

#playback_lengthInteger

Returns the current playback length.

Returns:

  • (Integer)

    The current playback length in seconds.



70
71
72
# File 'lib/cultome_player/state_checker.rb', line 70

def playback_length
  @playback_time_length ||= 0
end

#playback_positionInteger

Returns the current playback position.

Returns:

  • (Integer)

    The current playback position in seconds.



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.

Returns:

  • (Boolean)

    True if playing, False otherwise



21
22
23
# File 'lib/cultome_player/state_checker.rb', line 21

def playing?
  @playing ||= false
end

#shuffling?Boolean

Check the status of shuffle.

Returns:

  • (Boolean)

    True if shuffling, False otherwise



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.

Returns:

  • (Boolean)

    True if stopped, False otherwise



14
15
16
# File 'lib/cultome_player/state_checker.rb', line 14

def stopped?
  @stopped ||= true
end