Package gui.model

Class GUIPlayerModel

java.lang.Object
gui.model.GUIPlayerModel

public class GUIPlayerModel extends Object
Use case class that changes the view of a GUIAudio based on how the user interacts with it
  • Constructor Details

    • GUIPlayerModel

      public GUIPlayerModel(Playable associatedPlayer, javafx.util.Duration totalDuration)
  • Method Details

    • firedPlayButton

      public void firedPlayButton(String currentText)
      Defines what occurs when the play button is pressed.

      If the button currently reads "Play", then it will play the associated player. If it reads "Pause", it will pause the associated player

      Parameters:
      currentText - the current text on the GUIAudio play button
    • changePlayRate

      public void changePlayRate(double value)
    • changeVolume

      public void changeVolume(double value)
    • changePlayTime

      public void changePlayTime(double value, javafx.scene.media.MediaPlayer.Status mediaStatus)
      Adjusts where the associated GUIAudio will play from when the user interacts with the playback slider

      Precondition: 0 <= value <= 1

      Parameters:
      value - what % of the full duration of associated audio to play from
      mediaStatus - current status of the associated GUIAudio
    • changePlaybackSlider

      public void changePlaybackSlider(double value)
    • updatePlaybackText

      public void updatePlaybackText(javafx.util.Duration newDuration)
    • formatTime

      public String formatTime(javafx.util.Duration time)
      Formats a duration into a more readable time format
      Parameters:
      time - Duration value to convert to a time format
      Returns:
      A time format of Duration parameter time
    • setTotalDuration

      public void setTotalDuration(javafx.util.Duration totalDuration)