Waves_xVP_TCP.js 626 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. function play()
  2. {
  3. sendCommand("pl_play");
  4. }
  5. function pause()
  6. {
  7. sendCommand("pl_pause");
  8. }
  9. function stop()
  10. {
  11. sendCommand("pl_stop");
  12. }
  13. function playFile(file)
  14. {
  15. file = "file:///"+file;
  16. var f = file.replace(":","%3A").replace("/","%2D").replace(" ","%20");
  17. sendCommand("in_play&input="+file);
  18. }
  19. function previous()
  20. {
  21. sendCommand("pl_previous");
  22. }
  23. function next()
  24. {
  25. sendCommand("pl_next");
  26. }
  27. function toggleLoop()
  28. {
  29. sendCommand("pl_loop");
  30. }
  31. function setVolume(value)
  32. {
  33. sendCommand("volume&val="+parseInt(value*255));
  34. }
  35. function sendCommand(command)
  36. {
  37. local.sendGET("requests/status.xml?command="+command);
  38. }