fixing mpd (again and again)

edited game, if time is >60 song will not change
This commit is contained in:
Lucas Pleß 2012-06-26 18:33:27 +02:00
parent e300e2325c
commit f35fc861c7
2 changed files with 29 additions and 23 deletions

View File

@ -90,7 +90,9 @@ public class TheGame implements StatemachineListener, GuiEventListener, IRCEvent
break;
case TABLE_GAME_WRONG:
extraSoundControl.playJingle("block");
if(!startedHurrySound) {
mpdController.playSong("crashtest", "table_game_one");
}
bunti.setLampel(true,false,false);
sproing = true;
break;
@ -100,8 +102,10 @@ public class TheGame implements StatemachineListener, GuiEventListener, IRCEvent
extraSoundControl.playJingle("jump");
if(machine.getLastState() != Statemachine.state.TABLE_GAME_WRONG) {
if(!startedHurrySound) {
mpdController.playSong("crashtest", "table_game_one");
}
}
bunti.setLampel(false, true, false);
bunti.setPar56(20,0,100);
@ -128,7 +132,9 @@ public class TheGame implements StatemachineListener, GuiEventListener, IRCEvent
guiControl.showCountDown(true);
break;
case TABLE_GAME_FOUR:
if(!startedHurrySound) {
mpdController.playSong("crashtest", "table_game_four");
}
extraSoundControl.playJingle("jump");

View File

@ -43,10 +43,10 @@ public class MPDController implements IMPDController {
System.out.println("playSong: " + artist + " - " + title);
if(mpd != null) {
Runnable r = new Runnable() {
/*Runnable r = new Runnable() {
@Override
public void run() {
synchronized (mpd) {
synchronized (mpd) { */
addToPlayListIfNeeded(artist, title);
try {
@ -76,11 +76,11 @@ public class MPDController implements IMPDController {
} catch (InterruptedException e) {
Logger.sLog("MPD error: " + e.getMessage());
}
}
/*}
}
};
new Thread(r).start();
new Thread(r).start(); */
}
}
@ -92,10 +92,10 @@ public class MPDController implements IMPDController {
@Override
public void addToPlayList(final String artist, final String title) {
if(mpd != null) {
Runnable r = new Runnable() {
/*Runnable r = new Runnable() {
@Override
public void run() {
synchronized (mpd) {
synchronized (mpd) { */
MPDDatabase db = mpd.getMPDDatabase();
MPDPlaylist playlist = mpd.getMPDPlaylist();
@ -115,21 +115,21 @@ public class MPDController implements IMPDController {
} catch (MPDPlaylistException e) {
Logger.sLog("MPD error: " + e.getMessage());
}
}
/*}
}
};
new Thread(r).start();
new Thread(r).start(); */
}
}
@Override
public void skipRandomStart() {
if(mpd != null) {
Runnable r = new Runnable() {
/*Runnable r = new Runnable() {
@Override
public void run() {
synchronized (mpd) {
synchronized (mpd) {*/
MPDPlayer player = mpd.getMPDPlayer();
try {
@ -148,11 +148,11 @@ public class MPDController implements IMPDController {
e.printStackTrace();
} catch (InterruptedException ignored) {
}
}
/*}
}
};
new Thread(r).start();
new Thread(r).start(); */
}
}
@ -163,10 +163,10 @@ public class MPDController implements IMPDController {
@Override
public void setVolume(final int volume) {
if(mpd != null) {
Runnable r = new Runnable() {
/*Runnable r = new Runnable() {
@Override
public void run() {
synchronized (mpd) {
synchronized (mpd) {*/
try {
mpd.getMPDPlayer().setVolume(volume);
} catch (MPDConnectionException e) {
@ -174,11 +174,11 @@ public class MPDController implements IMPDController {
} catch (MPDPlayerException e) {
Logger.sLog("MPD error: " + e.getMessage());
}
}
/*}
}
};
new Thread(r).start();
new Thread(r).start();*/
}
}
@ -188,10 +188,10 @@ public class MPDController implements IMPDController {
@Override
public void clearPlaylist() {
if(mpd != null) {
Runnable r = new Runnable() {
/*Runnable r = new Runnable() {
@Override
public void run() {
synchronized (mpd) {
synchronized (mpd) {*/
try {
MPDPlaylist playlist = mpd.getMPDPlaylist();
playlist.clearPlaylist();
@ -204,11 +204,11 @@ public class MPDController implements IMPDController {
} catch (MPDPlayerException e) {
Logger.sLog("MPD error: " + e.getMessage());
}
}
/*}
}
};
new Thread(r).start();
new Thread(r).start(); */
}
}