test_class.declarator: mockMediaPlayer
test_class.modifier: @Mock
test_class.original_string: @Mock
      MediaPlayer mockMediaPlayer;
test_class.type: MediaPlayer
test_class.var_name: mockMediaPlayer
test_class.declarator: mockMedia
test_class.modifier: @Mock
test_class.original_string: @Mock
      Media mockMedia;
test_class.type: Media
test_class.var_name: mockMedia
test_class.declarator: musicManagerSpy
test_class.modifier: private
test_class.original_string: private BackgroundMusicManager musicManagerSpy;
test_class.type: BackgroundMusicManager
test_class.var_name: musicManagerSpy
test_class.declarator: sep = File.separator
test_class.modifier: private final
test_class.original_string: private final String sep = File.separator;
test_class.type: String
test_class.var_name: sep
test_class.declarator: localDataFolder =
          System.getProperty("user.dir") + sep
              + "src" + sep
              + "test" + sep
              + "resources" + sep
              + "data" + sep
              + "music" + sep
test_class.modifier: private final
test_class.original_string: private final String localDataFolder =
          System.getProperty("user.dir") + sep
              + "src" + sep
              + "test" + sep
              + "resources" + sep
              + "data" + sep
              + "music" + sep;
test_class.type: String
test_class.var_name: localDataFolder
test_class.declarator: mediaPlayer
test_class.modifier: private
test_class.original_string: private MediaPlayer mediaPlayer;
test_class.type: MediaPlayer
test_class.var_name: mediaPlayer
test_class.declarator: previousVolume
test_class.modifier: private
test_class.original_string: private double previousVolume;
test_class.type: double
test_class.var_name: previousVolume
test_class.declarator: volumeProperty = new SimpleDoubleProperty(0.5)
test_class.modifier: private
test_class.original_string: private SimpleDoubleProperty volumeProperty = new SimpleDoubleProperty(0.5);
test_class.type: SimpleDoubleProperty
test_class.var_name: volumeProperty
test_class.declarator: metadata = FXCollections.observableHashMap()
test_class.original_string: ObservableMap<String, Object> metadata = FXCollections.observableHashMap();
test_class.type: ObservableMap<String, Object>
test_class.var_name: metadata
test_class.file: gazeplay-commons/src/test/java/net/gazeplay/commons/utils/games/BackgroundMusicManagerTest.java
test_class.identifier: BackgroundMusicManagerTest
test_case.body: @Test
      void shouldReturnNullOnError() {
          final String uri = new File(localDataFolder + "test.properties").toURI().toString();
          mediaPlayer = musicManagerSpy.createMediaPlayer(uri);
          assertNull(mediaPlayer);
      }
test_case.class_method_signature: BackgroundMusicManagerTest.shouldReturnNullOnError()
test_case.full_signature: @Test void shouldReturnNullOnError()
test_case.identifier: shouldReturnNullOnError
test_case.invocations: toString toURI createMediaPlayer assertNull
test_case.modifiers: @Test
test_case.parameters: ()
test_case.return: void
test_case.signature: void shouldReturnNullOnError()
focal_class.declarator: SUPPORTED_FILE_EXTENSIONS = Arrays.asList(".aif", ".aiff", ".fxm", ".flv", ".m3u8",
          ".mp3", ".mp4", ".m4v", ".m4a", ".mp4", ".wav")
focal_class.modifier: private static final
focal_class.original_string: private static final List<String> SUPPORTED_FILE_EXTENSIONS = Arrays.asList(".aif", ".aiff", ".fxm", ".flv", ".m3u8",
          ".mp3", ".mp4", ".m4v", ".m4a", ".mp4", ".wav");
focal_class.type: List<String>
focal_class.var_name: SUPPORTED_FILE_EXTENSIONS
focal_class.declarator: instance = new BackgroundMusicManager()
focal_class.modifier: @Getter
      private static
focal_class.original_string: @Getter
      private static BackgroundMusicManager instance = new BackgroundMusicManager();
focal_class.type: BackgroundMusicManager
focal_class.var_name: instance
focal_class.declarator: playlist = new ArrayList<>()
focal_class.modifier: @Getter
      private final
focal_class.original_string: @Getter
      private final List<MediaPlayer> playlist = new ArrayList<>();
focal_class.type: List<MediaPlayer>
focal_class.var_name: playlist
focal_class.declarator: defaultPlayList = new ArrayList<>()
focal_class.modifier: private final
focal_class.original_string: private final List<MediaPlayer> defaultPlayList = new ArrayList<>();
focal_class.type: List<MediaPlayer>
focal_class.var_name: defaultPlayList
focal_class.declarator: backupPlaylist = new ArrayList<>()
focal_class.modifier: @Getter
      private final
focal_class.original_string: @Getter
      private final List<MediaPlayer> backupPlaylist = new ArrayList<>();
focal_class.type: List<MediaPlayer>
focal_class.var_name: backupPlaylist
focal_class.declarator: currentMusic
focal_class.modifier: @Getter
      private
focal_class.original_string: @Getter
      private MediaPlayer currentMusic;
focal_class.type: MediaPlayer
focal_class.var_name: currentMusic
focal_class.declarator: executorService = new ThreadPoolExecutor(1, 1, 3, TimeUnit.MINUTES,
          new LinkedBlockingQueue<>(), new CustomThreadFactory(this.getClass().getSimpleName(),
          new GroupingThreadFactory(this.getClass().getSimpleName())))
focal_class.modifier: private final
focal_class.original_string: private final ExecutorService executorService = new ThreadPoolExecutor(1, 1, 3, TimeUnit.MINUTES,
          new LinkedBlockingQueue<>(), new CustomThreadFactory(this.getClass().getSimpleName(),
          new GroupingThreadFactory(this.getClass().getSimpleName())));
focal_class.type: ExecutorService
focal_class.var_name: executorService
focal_class.declarator: isPlayingProperty = new SimpleBooleanProperty(this, "isPlaying", false)
focal_class.modifier: @Getter
      private final
focal_class.original_string: @Getter
      private final BooleanProperty isPlayingProperty = new SimpleBooleanProperty(this, "isPlaying", false);
focal_class.type: BooleanProperty
focal_class.var_name: isPlayingProperty
focal_class.declarator: musicIndexProperty = new SimpleIntegerProperty(this, "musicIndex", 0)
focal_class.modifier: @Getter
      private final
focal_class.original_string: @Getter
      private final IntegerProperty musicIndexProperty = new SimpleIntegerProperty(this, "musicIndex", 0);
focal_class.type: IntegerProperty
focal_class.var_name: musicIndexProperty
focal_class.declarator: isCustomMusicSet = new SimpleBooleanProperty(this, "isCustomMusicSet", false)
focal_class.modifier: @Getter
      private final
focal_class.original_string: @Getter
      private final BooleanProperty isCustomMusicSet = new SimpleBooleanProperty(this, "isCustomMusicSet", false);
focal_class.type: BooleanProperty
focal_class.var_name: isCustomMusicSet
focal_class.declarator: isMusicChanging = new ReadOnlyBooleanWrapper(this, "musicChanged", false)
focal_class.modifier: private final
focal_class.original_string: private final ReadOnlyBooleanWrapper isMusicChanging = new ReadOnlyBooleanWrapper(this, "musicChanged", false);
focal_class.type: ReadOnlyBooleanWrapper
focal_class.var_name: isMusicChanging
focal_class.file: gazeplay-commons/src/main/java/net/gazeplay/commons/utils/games/BackgroundMusicManager.java
focal_class.identifier: BackgroundMusicManager
focal_class.class_method_signature: BackgroundMusicManager.onConfigurationChanged()
focal_class.full_signature: public static void onConfigurationChanged()
focal_class.identifier: onConfigurationChanged
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void onConfigurationChanged()
focal_class.class_method_signature: BackgroundMusicManager.BackgroundMusicManager()
focal_class.full_signature: public  BackgroundMusicManager()
focal_class.identifier: BackgroundMusicManager
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  BackgroundMusicManager()
focal_class.class_method_signature: BackgroundMusicManager.onEndGame()
focal_class.full_signature: public void onEndGame()
focal_class.identifier: onEndGame
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void onEndGame()
focal_class.class_method_signature: BackgroundMusicManager.getAudioFromFolder(String folderPath)
focal_class.full_signature: public void getAudioFromFolder(String folderPath)
focal_class.identifier: getAudioFromFolder
focal_class.modifiers: public
focal_class.parameters: (String folderPath)
focal_class.return: void
focal_class.signature: void getAudioFromFolder(String folderPath)
focal_class.class_method_signature: BackgroundMusicManager.addFolderRecursively(final File folder)
focal_class.full_signature: private void addFolderRecursively(final File folder)
focal_class.identifier: addFolderRecursively
focal_class.modifiers: private
focal_class.parameters: (final File folder)
focal_class.return: void
focal_class.signature: void addFolderRecursively(final File folder)
focal_class.class_method_signature: BackgroundMusicManager.changeCurrentMusic()
focal_class.full_signature: private void changeCurrentMusic()
focal_class.identifier: changeCurrentMusic
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void changeCurrentMusic()
focal_class.class_method_signature: BackgroundMusicManager.isPlaying()
focal_class.full_signature: public boolean isPlaying()
focal_class.identifier: isPlaying
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isPlaying()
focal_class.class_method_signature: BackgroundMusicManager.changeMusic(int newMusicIndex)
focal_class.full_signature: public void changeMusic(int newMusicIndex)
focal_class.identifier: changeMusic
focal_class.modifiers: public
focal_class.parameters: (int newMusicIndex)
focal_class.return: void
focal_class.signature: void changeMusic(int newMusicIndex)
focal_class.class_method_signature: BackgroundMusicManager.emptyPlaylist()
focal_class.full_signature: public void emptyPlaylist()
focal_class.identifier: emptyPlaylist
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void emptyPlaylist()
focal_class.class_method_signature: BackgroundMusicManager.backupPlaylist()
focal_class.full_signature: public void backupPlaylist()
focal_class.identifier: backupPlaylist
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void backupPlaylist()
focal_class.class_method_signature: BackgroundMusicManager.restorePlaylist()
focal_class.full_signature: public void restorePlaylist()
focal_class.identifier: restorePlaylist
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void restorePlaylist()
focal_class.class_method_signature: BackgroundMusicManager.pause()
focal_class.full_signature: public void pause()
focal_class.identifier: pause
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void pause()
focal_class.class_method_signature: BackgroundMusicManager.play()
focal_class.full_signature: public void play()
focal_class.identifier: play
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void play()
focal_class.class_method_signature: BackgroundMusicManager.stop()
focal_class.full_signature: public void stop()
focal_class.identifier: stop
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void stop()
focal_class.class_method_signature: BackgroundMusicManager.next()
focal_class.full_signature: public void next()
focal_class.identifier: next
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void next()
focal_class.class_method_signature: BackgroundMusicManager.previous()
focal_class.full_signature: public void previous()
focal_class.identifier: previous
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void previous()
focal_class.class_method_signature: BackgroundMusicManager.setVolume(double value)
focal_class.full_signature: public void setVolume(double value)
focal_class.identifier: setVolume
focal_class.modifiers: public
focal_class.parameters: (double value)
focal_class.return: void
focal_class.signature: void setVolume(double value)
focal_class.class_method_signature: BackgroundMusicManager.playMusicAlone(String resourceUrlAsString)
focal_class.full_signature: public void playMusicAlone(String resourceUrlAsString)
focal_class.identifier: playMusicAlone
focal_class.modifiers: public
focal_class.parameters: (String resourceUrlAsString)
focal_class.return: void
focal_class.signature: void playMusicAlone(String resourceUrlAsString)
focal_class.class_method_signature: BackgroundMusicManager.downloadAndGetFromCache(URL resourceURL, String resourceUrlExternalForm)
focal_class.full_signature:  File downloadAndGetFromCache(URL resourceURL, String resourceUrlExternalForm)
focal_class.identifier: downloadAndGetFromCache
focal_class.parameters: (URL resourceURL, String resourceUrlExternalForm)
focal_class.return: File
focal_class.signature: File downloadAndGetFromCache(URL resourceURL, String resourceUrlExternalForm)
focal_class.class_method_signature: BackgroundMusicManager.makeMediaPlayer(Media media)
focal_class.full_signature:  MediaPlayer makeMediaPlayer(Media media)
focal_class.identifier: makeMediaPlayer
focal_class.parameters: (Media media)
focal_class.return: MediaPlayer
focal_class.signature: MediaPlayer makeMediaPlayer(Media media)
focal_class.class_method_signature: BackgroundMusicManager.createMediaPlayer(String source)
focal_class.full_signature:  MediaPlayer createMediaPlayer(String source)
focal_class.identifier: createMediaPlayer
focal_class.parameters: (String source)
focal_class.return: MediaPlayer
focal_class.signature: MediaPlayer createMediaPlayer(String source)
focal_class.class_method_signature: BackgroundMusicManager.getMediaPlayerFromSource(final String source)
focal_class.full_signature: private MediaPlayer getMediaPlayerFromSource(final String source)
focal_class.identifier: getMediaPlayerFromSource
focal_class.modifiers: private
focal_class.parameters: (final String source)
focal_class.return: MediaPlayer
focal_class.signature: MediaPlayer getMediaPlayerFromSource(final String source)
focal_class.class_method_signature: BackgroundMusicManager.getMusicTitle(final MediaPlayer music)
focal_class.full_signature: public static String getMusicTitle(final MediaPlayer music)
focal_class.identifier: getMusicTitle
focal_class.modifiers: public static
focal_class.parameters: (final MediaPlayer music)
focal_class.return: String
focal_class.signature: String getMusicTitle(final MediaPlayer music)
focal_class.class_method_signature: BackgroundMusicManager.getMusicTitle(final String musicPath)
focal_class.full_signature: public static String getMusicTitle(final String musicPath)
focal_class.identifier: getMusicTitle
focal_class.modifiers: public static
focal_class.parameters: (final String musicPath)
focal_class.return: String
focal_class.signature: String getMusicTitle(final String musicPath)
focal_class.class_method_signature: BackgroundMusicManager.getIsMusicChanging()
focal_class.full_signature: public ReadOnlyBooleanProperty getIsMusicChanging()
focal_class.identifier: getIsMusicChanging
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: ReadOnlyBooleanProperty
focal_class.signature: ReadOnlyBooleanProperty getIsMusicChanging()
focal_method.body: MediaPlayer createMediaPlayer(String source) {
          try {
              final Media media = new Media(source);
              final MediaPlayer player = makeMediaPlayer(media);
              player.setOnError(() -> log.error("error on audio media loading : " + player.getError()));
              player.volumeProperty().bindBidirectional(ActiveConfigurationContext.getInstance().getMusicVolumeProperty());
              player.setOnEndOfMedia(this::next);
  
              return player;
          } catch (MediaException e) {
              log.error("error while loading media {}, type : {}", source, e.getType(), e);
          }
          return null;
      }
focal_method.class_method_signature: BackgroundMusicManager.createMediaPlayer(String source)
focal_method.full_signature:  MediaPlayer createMediaPlayer(String source)
focal_method.identifier: createMediaPlayer
focal_method.invocations: makeMediaPlayer setOnError error getError bindBidirectional volumeProperty getMusicVolumeProperty getInstance setOnEndOfMedia error getType
focal_method.parameters: (String source)
focal_method.return: MediaPlayer
focal_method.signature: MediaPlayer createMediaPlayer(String source)