예제 #1
0
 /** Runs the thread. */
 public void run() {
   try {
     music.play();
   } catch (Exception e) {
     e.printStackTrace();
   }
 }
예제 #2
0
 /** Returns the song time. */
 public String getTime() {
   int position = music.getPosition();
   position /= 1000;
   int seconds = position / 60;
   int minutes = position / 60 / 60;
   String time = minutes + ":" + seconds;
   return time;
 }
예제 #3
0
 /** Returns whether or not music is finished. */
 public boolean isComplete() {
   return music.isComplete();
 }
예제 #4
0
 /** Stops the song. You cannot restart it afterwards. */
 public void stopSong() {
   music.close();
 }