Package gui.model
Class GUIPlayerModel
java.lang.Object
gui.model.GUIPlayerModel
Use case class that changes the view of a GUIAudio based on how the user interacts with it
-
Constructor Summary
ConstructorDescriptionGUIPlayerModel
(Playable associatedPlayer, javafx.util.Duration totalDuration) -
Method Summary
Modifier and TypeMethodDescriptionvoid
changePlaybackSlider
(double value) void
changePlayRate
(double value) 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 slidervoid
changeVolume
(double value) void
firedPlayButton
(String currentText) Defines what occurs when the play button is pressed.formatTime
(javafx.util.Duration time) Formats a duration into a more readable time formatvoid
setTotalDuration
(javafx.util.Duration totalDuration) void
updatePlaybackText
(javafx.util.Duration newDuration)
-
Constructor Details
-
GUIPlayerModel
-
-
Method Details
-
firedPlayButton
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 sliderPrecondition: 0 <= value <= 1
- Parameters:
value
- what % of the full duration of associated audio to play frommediaStatus
- current status of the associated GUIAudio
-
changePlaybackSlider
public void changePlaybackSlider(double value) -
updatePlaybackText
public void updatePlaybackText(javafx.util.Duration newDuration) -
formatTime
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)
-