CueSheet processor: Support timestamps with one or two fields, as well as the standard three fields

CQTexperiment
Christopher Snowhill 2022-01-14 19:05:48 -08:00
parent dac1dfee47
commit 33f3b4f5a0
1 changed files with 11 additions and 3 deletions

View File

@ -176,11 +176,19 @@
}
NSArray *msf = [time componentsSeparatedByString:@":"];
if ([msf count] != 3) {
size_t count = [msf count];
if (count < 1 || count > 3) {
continue;
}
double seconds = (60*[[msf objectAtIndex:0] intValue]) + [[msf objectAtIndex:1] intValue] + ([[msf objectAtIndex:2] floatValue]/75);
double seconds = 0;
if (count == 1)
seconds = [[msf objectAtIndex:0] floatValue] / 75;
else if (count == 2)
seconds = [[msf objectAtIndex:0] intValue] + ([[msf objectAtIndex:1] floatValue]/75);
else if (count == 3)
seconds = (60*[[msf objectAtIndex:0] intValue]) + [[msf objectAtIndex:1] intValue] + ([[msf objectAtIndex:2] floatValue]/75);
if (track == nil) {
track = @"01";