Fixed double songs playing
This commit is contained in:
@@ -11,7 +11,6 @@ import audio.AudioPlayer;
|
||||
import audio.Song;
|
||||
import audio.SongInstance;
|
||||
import audio.io.DirScanner;
|
||||
import audio.sorting.SortALPHA;
|
||||
import audio.sorting.SortPLAYED;
|
||||
import data.io.SQLConnector;
|
||||
|
||||
@@ -73,7 +72,9 @@ public class SongHandler {
|
||||
{
|
||||
currentSongInstance = si;
|
||||
}
|
||||
|
||||
public boolean isPlaying(){
|
||||
return getProgress() > 0 ? true : false;
|
||||
}
|
||||
|
||||
private void updatePlayer()
|
||||
{
|
||||
|
||||
@@ -26,4 +26,5 @@ public abstract class GameState {
|
||||
public abstract void buttonPressed(ButtonEvent e);
|
||||
public abstract void buttonReleased(ButtonEvent e);
|
||||
public abstract void onJoystickMoved(JoystickEvent e);
|
||||
public void stopAudio() { sh.close(); }
|
||||
}
|
||||
|
||||
@@ -40,18 +40,20 @@ public class TitleState extends GameState {
|
||||
|
||||
public TitleState(GameStateManager gsm, SongHandler sh, SQLConnector sql){
|
||||
super(gsm, sh, sql);
|
||||
if(!sh.isPlaying())
|
||||
sh.play();
|
||||
createBackground();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
sh.play();
|
||||
if(!sh.isPlaying())
|
||||
sh.play();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(float factor) {
|
||||
|
||||
frame++;
|
||||
frame+=5;
|
||||
indexKast++;
|
||||
}
|
||||
|
||||
@@ -114,7 +116,7 @@ public class TitleState extends GameState {
|
||||
|
||||
g2.setFont(textFont);
|
||||
g2.setColor(Color.WHITE);
|
||||
g2.drawString("©2015 Team Hamtaro", 550, 1012);
|
||||
g2.drawString("�2015 Team Hamtaro", 550, 1012);
|
||||
|
||||
g2.setColor(Color.RED);
|
||||
g2.setFont(textFont2);
|
||||
|
||||
Reference in New Issue
Block a user