Parcourir la source

Added mostplayed counter

Kenneth van Ewijk il y a 10 ans
Parent
commit
3f22402bc4
1 fichiers modifiés avec 10 ajouts et 0 suppressions
  1. 10 0
      audio/Song.java

+ 10 - 0
audio/Song.java

@@ -155,4 +155,14 @@ public class Song implements Comparable<Song>{
 	public int compareTo(Song s) {
 		return getTitle().compareTo(s.getTitle());
 	}
+	
+	public int getTimesPlayed()
+	{
+		int timesPlayed = 0;
+		for(SongInstance s : songs)
+		{
+			timesPlayed += s.getTimesPlayed();
+		}
+		return timesPlayed;
+	}
 }