Added title reading for multi-song VGMStream files.
parent
1ef9455f9d
commit
29e548d583
|
@ -17,6 +17,8 @@
|
||||||
@interface VGMDecoder : NSObject <CogDecoder> {
|
@interface VGMDecoder : NSObject <CogDecoder> {
|
||||||
VGMSTREAM *stream;
|
VGMSTREAM *stream;
|
||||||
|
|
||||||
|
NSString *title;
|
||||||
|
|
||||||
int sampleRate;
|
int sampleRate;
|
||||||
int channels;
|
int channels;
|
||||||
int bitrate;
|
int bitrate;
|
||||||
|
|
|
@ -30,9 +30,15 @@
|
||||||
framesRead = 0;
|
framesRead = 0;
|
||||||
|
|
||||||
bitrate = get_vgmstream_average_bitrate(stream);
|
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 willChangeValueForKey:@"properties"];
|
||||||
[self didChangeValueForKey:@"properties"];
|
[self didChangeValueForKey:@"properties"];
|
||||||
|
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
@ -47,6 +53,7 @@
|
||||||
[NSNumber numberWithBool:NO], @"floatingPoint",
|
[NSNumber numberWithBool:NO], @"floatingPoint",
|
||||||
[NSNumber numberWithInt:channels], @"channels",
|
[NSNumber numberWithInt:channels], @"channels",
|
||||||
[NSNumber numberWithBool:YES], @"seekable",
|
[NSNumber numberWithBool:YES], @"seekable",
|
||||||
|
title, @"title",
|
||||||
@"host", @"endian",
|
@"host", @"endian",
|
||||||
nil];
|
nil];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue