Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

27
LINES

< > BotCompany Repo | #1004420 // Repeat Music [see #1003779]

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (2342L/15K/52K).

1  
!752
2  
3  
static S mp = "Music Player";
4  
static double interval = 1;
5  
6  
p {
7  
  S lastFile = null;
8  
  int count = 0;
9  
  while licensed {
10  
    pcall {
11  
      if (matchStart("no", send(mp, "are you playing"))
12  
        && matchStart("no", send(mp, "are you paused")))
13  
        ++count;
14  
      if (count >= 2) {
15  
        count = 0;
16  
        S file = send(mp, "get file");
17  
        if (eq(file, lastFile)) {
18  
          //print("Playing again.");
19  
          send(mp, "play again");
20  
        } /*else
21  
          print(format("Files differ: * vs *", file, lastFile));*/
22  
        lastFile = file;
23  
      }
24  
    }
25  
    sleepSeconds(interval);
26  
  }
27  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, sawdedvomwva, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1004420
Snippet name: Repeat Music [see #1003779]
Eternal ID of this version: #1004420/1
Text MD5: 8c41ac90e3f6d96c95065ad8b9bf78fa
Transpilation MD5: 6c282ca93054b54417987059310a7fad
Author: stefan
Category: javax
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-08-16 17:33:02
Source code size: 637 bytes / 27 lines
Pitched / IR pitched: No / No
Views / Downloads: 476 / 578
Referenced in: [show references]