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

16
LINES

< > BotCompany Repo | #1024609 // parseTimestampRanges

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (3104L/18K).

1  
/* e.g. [[
2  
1:23-2:34
3  
1:10:00-1:11:00
4  
]] */
5  
static L<DoubleRange> parseTimestampRanges(S s) {
6  
  new L<DoubleRange> l;
7  
  for (S line : tlft(s)) {
8  
    int i = indexOf(s, '-');
9  
    LS x = trimAll(splitAt_withEmptyLast(line, "-"));
10  
    if (l(x) != 2) continue with print("parseTimestampRanges unknown line: " + line);
11  
    l.add(doubleRange(
12  
      ffmpeg_parseTimestamp(first(x)),
13  
      ffmpeg_parseTimestamp(second(x))));
14  
  }
15  
  ret l;
16  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1024609
Snippet name: parseTimestampRanges
Eternal ID of this version: #1024609/2
Text MD5: 7550dc97a54d3498dddf2e728a243689
Transpilation MD5: c7f197ee9555fb98610b32661e8fbdf0
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-03-03 23:26:42
Source code size: 446 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 201 / 285
Version history: 1 change(s)
Referenced in: [show references]