コード例 #1
0
ファイル: MusicController.java プロジェクト: huimiao638/opsu
 /**
  * Plays the current track at the given position.
  *
  * @param position the track position (in ms)
  * @param loop whether or not to loop the track
  */
 public static void playAt(final int position, final boolean loop) {
   if (trackExists()) {
     setVolume(Options.getMusicVolume() * Options.getMasterVolume());
     trackEnded = false;
     pauseTime = 0f;
     if (loop) player.loop();
     else player.play();
     if (position >= 0) player.setPosition(position / 1000f);
   }
 }
コード例 #2
0
ファイル: MusicController.java プロジェクト: huimiao638/opsu
 /**
  * Toggles the volume dim state of the current track.
  *
  * @param multiplier the volume multiplier when the track is dimmed
  */
 public static void toggleTrackDimmed(float multiplier) {
   float volume = Options.getMusicVolume() * Options.getMasterVolume();
   dimLevel = (isTrackDimmed()) ? 1f : multiplier;
   trackDimmed = !trackDimmed;
   setVolume(volume);
 }