Added title reading for multi-song VGMStream files.

CQTexperiment
Christopher Snowhill 2017-09-17 18:41:04 -07:00
parent 1ef9455f9d
commit 29e548d583
2 changed files with 10 additions and 1 deletions

View File

@ -17,6 +17,8 @@
@interface VGMDecoder : NSObject <CogDecoder> {
VGMSTREAM *stream;
NSString *title;
int sampleRate;
int channels;
int bitrate;

View File

@ -30,9 +30,15 @@
framesRead = 0;
bitrate = get_vgmstream_average_bitrate(stream);
if (stream->num_streams > 1) {
title = [NSString stringWithFormat:@"%@ - %@", [[[s url] URLByDeletingPathExtension] lastPathComponent], stream->stream_name];
} else {
title = [[[s url] URLByDeletingPathExtension] lastPathComponent];
}
[self willChangeValueForKey:@"properties"];
[self didChangeValueForKey:@"properties"];
[self didChangeValueForKey:@"properties"];
return YES;
}
@ -47,6 +53,7 @@
[NSNumber numberWithBool:NO], @"floatingPoint",
[NSNumber numberWithInt:channels], @"channels",
[NSNumber numberWithBool:YES], @"seekable",
title, @"title",
@"host", @"endian",
nil];
}