Bugfix/everything

# Conflicts:
#	model/SongHandler.java
#	model/gameState/PlayState.java
This commit is contained in:
jancoow
2015-06-08 14:01:07 +02:00
14 changed files with 249 additions and 121 deletions
+6 -1
View File
@@ -12,7 +12,7 @@ import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.UnsupportedAudioFileException;
public class Song {
public class Song implements Comparable<Song>{
private String title;
private String subtitle;
@@ -150,4 +150,9 @@ public class Song {
public void close()
{
}
@Override
public int compareTo(Song s) {
return getTitle().compareTo(s.getTitle());
}
}
+1 -1
View File
@@ -66,7 +66,7 @@ public class SongInstance {
for(ButtonInstance i : buttons)
{
if(i.getTime() >= progress)
if(i.getTime() > progress)
{
return b;
}
+14
View File
@@ -0,0 +1,14 @@
package audio.sorting;
import java.util.Comparator;
import audio.Song;
public class SortALPHA implements Comparator<Song> {
@Override
public int compare(Song s1, Song s2) {
return s1.getTitle().compareTo(s2.getTitle());
}
}
+14
View File
@@ -0,0 +1,14 @@
package audio.sorting;
import java.util.Comparator;
import audio.Song;
public class SortPLAYED implements Comparator<Song> {
@Override
public int compare(Song s1, Song s2) {
return s1.getAuthor().compareTo(s2.getAuthor());
}
}