Class DanceInterpreter
java.lang.Object
de.klassenserver7b.danceinterpreter.songprocessing.DanceInterpreter
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.slf4j.Logger
private LinkedList<SongData>
private SongCheckThread
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addSongtoJSON
(SongData songdata, String SpotifyUri) Creates an entry in dancelist.json for a songprivate void
Recursively searches for all mp3 files in a given folder and adds them to the list of local mp3 filesgetFiles()
private String
Opens file chooser to select working directoryprivate boolean
private boolean
Lets the user select a working directory and loads all mp3 files in itboolean
startSongCheck
(AppModes appmode) Starts the song check thread in specified mode
-
Field Details
-
dancelist
-
songcheckT
-
playlistSongs
-
localMp3Files
-
log
private final org.slf4j.Logger log
-
-
Constructor Details
-
DanceInterpreter
public DanceInterpreter()
-
-
Method Details
-
startSongCheck
Starts the song check thread in specified mode- Returns:
- Whether file loading / starting was successful
-
loadWorkingDirectory
private boolean loadWorkingDirectory()Lets the user select a working directory and loads all mp3 files in it- Returns:
- Whether loading was successful
-
findAllFilesInFolder
Recursively searches for all mp3 files in a given folder and adds them to the list of local mp3 files- Parameters:
f
- Folder
-
getWorkingDirectory
Opens file chooser to select working directory- Returns:
- Path of the selected directory or null if no directory was selected
-
getDance
- Parameters:
spotifyuri
- Song's URI on Spotify- Returns:
- Name of dance or "unknown" if song was not found
-
getDance
- Parameters:
title
- Title of the song to search forartist
- Artist of the song to search for- Returns:
- Name of dance or "unknown" if song was not found
-
initialize
private boolean initialize()- Returns:
- Whether initialization was successful
-
addSongtoJSON
Creates an entry in dancelist.json for a song- Parameters:
songdata
- SongData of the songSpotifyUri
- Song's URI on Spotify
-
getDancelist
- Returns:
- The dancelist
-
getFiles
- Returns:
- List of loaded local mp3 files or an empty list if AppMode is not LocalMP3
-
getPlaylistSongs
- Returns:
- List of songs in the playlist or null if AppMode is not Playlist
-
getSongcheckT
-