Class DanceInterpreter

java.lang.Object
de.klassenserver7b.danceinterpreter.songprocessing.DanceInterpreter

public class DanceInterpreter extends Object
  • Field Details

    • dancelist

      private final TreeMap<String,com.google.gson.JsonObject> dancelist
    • songcheckT

      private SongCheckThread songcheckT
    • playlistSongs

      private LinkedList<SongData> playlistSongs
    • localMp3Files

      private final List<File> localMp3Files
    • log

      private final org.slf4j.Logger log
  • Constructor Details

    • DanceInterpreter

      public DanceInterpreter()
  • Method Details

    • startSongCheck

      public boolean startSongCheck(AppModes appmode)
      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

      private void findAllFilesInFolder(File f)
      Recursively searches for all mp3 files in a given folder and adds them to the list of local mp3 files
      Parameters:
      f - Folder
    • getWorkingDirectory

      private String getWorkingDirectory()
      Opens file chooser to select working directory
      Returns:
      Path of the selected directory or null if no directory was selected
    • getDance

      public String getDance(String spotifyuri)
      Parameters:
      spotifyuri - Song's URI on Spotify
      Returns:
      Name of dance or "unknown" if song was not found
    • getDance

      public String getDance(String title, String artist)
      Parameters:
      title - Title of the song to search for
      artist - 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

      public void addSongtoJSON(SongData songdata, String SpotifyUri)
      Creates an entry in dancelist.json for a song
      Parameters:
      songdata - SongData of the song
      SpotifyUri - Song's URI on Spotify
    • getDancelist

      public TreeMap<String,com.google.gson.JsonObject> getDancelist()
      Returns:
      The dancelist
    • getFiles

      public List<File> getFiles()
      Returns:
      List of loaded local mp3 files or an empty list if AppMode is not LocalMP3
    • getPlaylistSongs

      public LinkedList<SongData> getPlaylistSongs()
      Returns:
      List of songs in the playlist or null if AppMode is not Playlist
    • getSongcheckT

      public SongCheckThread getSongcheckT()