|
@@ -25,17 +25,17 @@ public class MusicServiceImpl implements MusicService {
|
|
|
Process p;
|
|
|
String cmd;
|
|
|
//1:开始命令到达,0:无开始命令
|
|
|
- Boolean startCmd=false;
|
|
|
+ Boolean startCmd = false;
|
|
|
//1:结束命令到达,0:无结束命令
|
|
|
- Boolean endCmd=false;
|
|
|
+ Boolean endCmd = false;
|
|
|
//1:重复播放,0:不重复
|
|
|
- Boolean repeat=false;
|
|
|
+ Boolean repeat = false;
|
|
|
|
|
|
@Override
|
|
|
public Integer start(String path, Integer vol) {
|
|
|
synchronized (this) {
|
|
|
- log.info("start music cmd:{}", cmd);
|
|
|
cmd = "play -v " + Float.valueOf(new Integer(vol).toString()) / 100 + " " + path;
|
|
|
+ log.info("start music cmd:{}", cmd);
|
|
|
startCmd = true;
|
|
|
repeat = true;
|
|
|
return 0;
|
|
@@ -54,6 +54,8 @@ public class MusicServiceImpl implements MusicService {
|
|
|
@Scheduled(fixedRate = 500)
|
|
|
public void play() {
|
|
|
synchronized (this) {
|
|
|
+ log.info("startCmd:{}, endCmd:{}, repeat:{}", startCmd, endCmd, repeat);
|
|
|
+ log.info("p:{}, p.isAlive:{}", p, p.isAlive());
|
|
|
if (startCmd) {
|
|
|
startCmd = false;
|
|
|
if (p != null) {
|