forked from AUT-AP-2020/workshop-1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMusicPlayer.java
38 lines (34 loc) · 873 Bytes
/
MusicPlayer.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/**
* Provide basic playing of MP3 files via the javazoom library.
* See http://www.javazoom.net/
*
* @author David J. Barnes and Michael K�lling.
* @version 2011.07.31
*/
public class MusicPlayer
{
// The current player. It might be null.
private boolean isPlaying;
/**
* Constructor for objects of class MusicFilePlayer
*/
public MusicPlayer()
{
isPlaying = false;
}
/**
* Start playing the given audio file.
* The method returns once the playing has been started.
* @param filename The file to be played.
*/
public void startPlaying(String filename)
{
System.out.println(filename + " is playing...");
isPlaying = true;
}
public void stop()
{
System.out.println("player is stopped!");
isPlaying = false;
}
}