Bladeren bron

重复10次11

TitanWong 1 jaar geleden
bovenliggende
commit
97c936abc3
1 gewijzigde bestanden met toevoegingen van 3 en 2 verwijderingen
  1. 3 2
      src/main/java/com/zhili/stationcontrol/tts/service/impl/MusicServiceImpl.java

+ 3 - 2
src/main/java/com/zhili/stationcontrol/tts/service/impl/MusicServiceImpl.java

@@ -34,7 +34,7 @@ public class MusicServiceImpl implements MusicService {
     @Override
     public Integer start(String path, Integer vol) {
         synchronized (this) {
-            log.info("start music cmd:{}",cmd);
+            log.info("start music cmd:{}", cmd);
             cmd = "play -v " + Float.valueOf(new Integer(vol).toString()) / 100 + " " + path;
             startCmd = true;
             repeat = true;
@@ -80,7 +80,8 @@ public class MusicServiceImpl implements MusicService {
     @Scheduled(fixedRate = 500)
     public void repeat() {
         synchronized (this) {
-            if (p == null && cmd != null) {
+            if (repeat && p == null && cmd != null) {
+                log.info("repeat:{}", cmd);
                 try {
                     p = Runtime.getRuntime().exec(cmd);
                 } catch (IOException e) {