SongsData

public final class SongsData

Types

Link copied to clipboard
public class Companion
Link copied to clipboard
public interface LoadListener

Functions

Link copied to clipboard
public final Unit addToQueue(Song song)

Adds a song at the end of the Queue

public final Unit addToQueue(Integer position)

Adds a song to a specific position/index to the queue

Link copied to clipboard
public final Unit deletePlaylist(Integer index)
Link copied to clipboard
public final Boolean firstInQueue()

Checks if the index is currently at the first position in the array

Link copied to clipboard
public final List<Album> getAllAlbums()
Link copied to clipboard
public final List<Playlist> getAllPlaylists()
Link copied to clipboard
public final List<Song> getAllSongs()
Link copied to clipboard
Link copied to clipboard
public final Integer getPlayingIndex()
Link copied to clipboard
public final List<Song> getPlayingQueue()
Link copied to clipboard
Link copied to clipboard
public final String getPlaylistsOfSong(Song song)
Link copied to clipboard
public final Song getSongAt(Integer position)

Returns the song at a given position/index

Link copied to clipboard
public final Song getSongFromQueueAt(Integer position)
Link copied to clipboard
public final Song getSongPlaying()
Link copied to clipboard
public final Unit insertPlaylist(Playlist newPlaylist)
Link copied to clipboard
public final Unit insertToPlaylist(Playlist playlist, Song song)
Link copied to clipboard
public final Boolean isDoneLoading()
Link copied to clipboard
public final Boolean isFavorited(Song song)
Link copied to clipboard
public final Boolean isRepeat()

Changes the repeat state of a song, sets if the song should be repeated or not

Link copied to clipboard
public final Boolean isShuffle()

Changes the shuffle mode of the player

Link copied to clipboard
public final Boolean lastInQueue()

Checks if the index is currently at the last position in the array

Link copied to clipboard
public final Thread loadFromDatabase(Context context)

Loads all songs from the internal memory of the phone and overwrites/creates the allSongs list This excludes SD-cards, USB, etc...

Link copied to clipboard
public final Thread loadFromFiles<T extends Activity, SongsData.LoadListener>(T activity)
Link copied to clipboard
public final Unit onQueueReordered(Integer from, Integer to)
Link copied to clipboard
public final Unit playAlbumFrom(Album album, Integer position)
Link copied to clipboard
public final Unit playAllFrom(Integer position)

Clears the previous Queue and creates a new one with all songs and starts playing from a specific index/position

Link copied to clipboard
public final Song playNext()

Plays the next song by grabbing the next song in the playingQueueIndex WARNING: Might cause ArrayOutOfBounds Exception!

Link copied to clipboard
public final Unit playPlaylistFrom(Playlist playlist, Integer position)
Link copied to clipboard
public final Song playPrev()

Plays the previous song by grabbing the previous song in the playingQueueIndex WARNING: Might cause ArrayOutOfBounds Exception if Index is 0

Link copied to clipboard
public final Unit removeFromPlaylist(Playlist playlist, Song song, Integer index, Boolean all)
Link copied to clipboard
public final Unit setAllAlbums(List<Album> allAlbums)
Link copied to clipboard
public final Unit setAllPlaylists(List<Playlist> allPlaylists)
Link copied to clipboard
public final Unit setDoneLoading(Boolean isDoneLoading)
Link copied to clipboard
public final Unit setPlayingIndex(Integer playingIndex)
Link copied to clipboard
public final Unit setRepeat(Boolean isRepeat)

Changes the repeat state of a song, sets if the song should be repeated or not

Link copied to clipboard
public final Unit setShuffle(Boolean isShuffle)
Link copied to clipboard
public final Boolean songExists(Integer position)

Checks if song at a given position/index exists

Link copied to clipboard
public final Integer songsCount()

Returns the amount of songs that are in the Array of songs right now

Properties

Link copied to clipboard
private List<Album> allAlbums
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
private Boolean isRepeat

Changes the repeat state of a song, sets if the song should be repeated or not

Link copied to clipboard

Changes the shuffle mode of the player

Link copied to clipboard

Sets the playingQueueIndex to a specific index

Link copied to clipboard
private final Integer playingQueueCount
Link copied to clipboard
private final Song songPlaying

Method to retrieve the song that is being played