diff --git a/Audio/Plugin.h b/Audio/Plugin.h index 4c122ea74..c246b853e 100644 --- a/Audio/Plugin.h +++ b/Audio/Plugin.h @@ -36,7 +36,6 @@ - (NSDictionary *)properties; - (BOOL)open:(id)source; -- (BOOL)seekable; - (double)seekToTime:(double)time; //time is in milleseconds, should return the time actually seeked to. - (int)fillBuffer:(void *)buf ofSize:(UInt32)size; - (void)close; diff --git a/English.lproj/MainMenu.nib/info.nib b/English.lproj/MainMenu.nib/info.nib index ffe968ffa..d2b0ed115 100644 --- a/English.lproj/MainMenu.nib/info.nib +++ b/English.lproj/MainMenu.nib/info.nib @@ -9,7 +9,7 @@ 1063 650 960 136 68 0 0 1680 1028 1156 - 866 232 241 366 0 0 1680 1028 + 719 529 241 366 0 0 1680 1028 1324 787 658 137 182 0 0 1680 1028 29 @@ -36,9 +36,9 @@ 513 21 + 1156 463 1063 - 1156 29 1324 diff --git a/English.lproj/MainMenu.nib/keyedobjects.nib b/English.lproj/MainMenu.nib/keyedobjects.nib index da8c6c90e..9ea14cb5c 100644 Binary files a/English.lproj/MainMenu.nib/keyedobjects.nib and b/English.lproj/MainMenu.nib/keyedobjects.nib differ diff --git a/Playlist/PlaylistEntry.h b/Playlist/PlaylistEntry.h index 021bdd87d..3e1a7f346 100644 --- a/Playlist/PlaylistEntry.h +++ b/Playlist/PlaylistEntry.h @@ -29,6 +29,8 @@ NSNumber *idx; NSNumber *shuffleIndex; + + NSNumber *seekable; } - (void)setIndex:(NSNumber *)i; @@ -69,6 +71,9 @@ - (void)setSampleRate:(NSNumber *)s; - (NSNumber *)sampleRate; +- (void)setSeekable:(NSNumber *)s; +- (NSNumber *)seekable; + - (void)setMetadata: (NSDictionary *)m; - (void)readMetadataThread; - (void)setProperties: (NSDictionary *)p; diff --git a/Playlist/PlaylistEntry.m b/Playlist/PlaylistEntry.m index a4bed12ed..67af0d9cb 100644 --- a/Playlist/PlaylistEntry.m +++ b/Playlist/PlaylistEntry.m @@ -202,6 +202,7 @@ [self setChannels: [dict objectForKey:@"channels" ]]; [self setBitsPerSample: [dict objectForKey:@"bitsPerSample" ]]; [self setSampleRate: [dict objectForKey:@"sampleRate" ]]; + [self setSeekable: [dict objectForKey:@"seekable" ]]; } - (void)readPropertiesThread @@ -271,6 +272,19 @@ return sampleRate; } +- (void)setSeekable:(NSNumber *)s +{ + [s retain]; + [seekable release]; + + seekable = s; +} + +- (NSNumber *)seekable +{ + return seekable; +} + - (void)setMetadata: (NSDictionary *)m { NSString *ti = [m objectForKey:@"title"]; diff --git a/Plugins/CoreAudio/CoreAudioDecoder.m b/Plugins/CoreAudio/CoreAudioDecoder.m index de2c20528..8b86974fe 100644 --- a/Plugins/CoreAudio/CoreAudioDecoder.m +++ b/Plugins/CoreAudio/CoreAudioDecoder.m @@ -186,14 +186,10 @@ [NSNumber numberWithInt:bitrate],@"bitrate", [NSNumber numberWithFloat:frequency],@"sampleRate", [NSNumber numberWithDouble:length],@"length", + [NSNumber numberWithBool:YES], @"seekable", @"big", @"endian", nil]; } -- (BOOL)seekable -{ - return YES; //Are you kidding me? it HAS to be seekable. The AudioFile API is 100% impossible to stream in any way. Even using callbacks gives problems. Sigh. -} - @end diff --git a/Plugins/Flac/FlacDecoder.m b/Plugins/Flac/FlacDecoder.m index 83efa96c7..9ff17eca8 100644 --- a/Plugins/Flac/FlacDecoder.m +++ b/Plugins/Flac/FlacDecoder.m @@ -282,11 +282,6 @@ void ErrorCallback(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorS return source; } -- (BOOL)seekable -{ - return [source seekable]; -} - - (void)setEndOfStream:(BOOL)eos { endOfStream = eos; @@ -304,6 +299,7 @@ void ErrorCallback(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorS [NSNumber numberWithInt:bitsPerSample],@"bitsPerSample", [NSNumber numberWithFloat:frequency],@"sampleRate", [NSNumber numberWithDouble:length],@"length", + [NSNumber numberWithBool:[source seekable]], @"seekable", @"big",@"endian", nil]; } diff --git a/Plugins/MAD/MADDecoder.m b/Plugins/MAD/MADDecoder.m index 311c49f38..c02d87b01 100644 --- a/Plugins/MAD/MADDecoder.m +++ b/Plugins/MAD/MADDecoder.m @@ -591,15 +591,11 @@ static inline signed int scale (mad_fixed_t sample) [NSNumber numberWithFloat:frequency],@"sampleRate", [NSNumber numberWithInt:bitrate],@"bitrate", [NSNumber numberWithDouble:length],@"length", + [NSNumber numberWithBool:[_source seekable]], @"seekable", @"big", @"endian", nil]; } -- (BOOL)seekable -{ - return [_source seekable]; -} - + (NSArray *)fileTypes { diff --git a/Plugins/MonkeysAudio/MonkeysAudioDecoder.mm b/Plugins/MonkeysAudio/MonkeysAudioDecoder.mm index 26b83c9b5..bbdc86e73 100644 --- a/Plugins/MonkeysAudio/MonkeysAudioDecoder.mm +++ b/Plugins/MonkeysAudio/MonkeysAudioDecoder.mm @@ -90,11 +90,6 @@ return source; } -- (BOOL)seekable -{ - return [source seekable]; -} - - (NSDictionary *)properties { return [NSDictionary dictionaryWithObjectsAndKeys: @@ -102,6 +97,7 @@ [NSNumber numberWithInt:bitsPerSample],@"bitsPerSample", [NSNumber numberWithFloat:frequency],@"sampleRate", [NSNumber numberWithDouble:length],@"length", + [NSNumber numberWithBool:[source seekable]], @"seekable", @"host",@"endian", nil]; } diff --git a/Plugins/Musepack/MusepackDecoder.m b/Plugins/Musepack/MusepackDecoder.m index dc2aa3be8..bdea02f1a 100644 --- a/Plugins/Musepack/MusepackDecoder.m +++ b/Plugins/Musepack/MusepackDecoder.m @@ -208,11 +208,6 @@ mpc_bool_t CanSeekProc(void *data) return source; } -- (BOOL)seekable -{ - return [source seekable]; -} - - (NSDictionary *)properties { return [NSDictionary dictionaryWithObjectsAndKeys: @@ -221,6 +216,7 @@ mpc_bool_t CanSeekProc(void *data) [NSNumber numberWithDouble:length], @"length", [NSNumber numberWithInt:16], @"bitsPerSample", [NSNumber numberWithInt:2], @"channels", + [NSNumber numberWithBool:[source seekable]], @"seekable", @"host",@"endian", nil]; } diff --git a/Plugins/Shorten/ShortenDecoder.h b/Plugins/Shorten/ShortenDecoder.h index 69de2f75d..db7083e49 100644 --- a/Plugins/Shorten/ShortenDecoder.h +++ b/Plugins/Shorten/ShortenDecoder.h @@ -22,7 +22,7 @@ int bitsPerSample; float frequency; double length; - bool seekTable; + BOOL seekable; } @end diff --git a/Plugins/Shorten/ShortenDecoder.mm b/Plugins/Shorten/ShortenDecoder.mm index 9f081b083..94e7bb880 100644 --- a/Plugins/Shorten/ShortenDecoder.mm +++ b/Plugins/Shorten/ShortenDecoder.mm @@ -29,8 +29,11 @@ bufferSize = decoder->shn_get_buffer_block_size(NUM_DEFAULT_BUFFER_BLOCKS); + bool seekTable; decoder->file_info(NULL, &channels, &frequency, NULL, &bitsPerSample, &seekTable); - NSLog(@"Seek table: %i", seekTable); + + seekable = seekTable == true ? YES : NO; + length = decoder->shn_get_song_length(); decoder->go(); @@ -100,11 +103,6 @@ shn_unload(handle);*/ } -- (BOOL)seekable -{ - return seekTable ? YES : NO; -} - - (NSDictionary *)properties { return [NSDictionary dictionaryWithObjectsAndKeys: @@ -112,6 +110,7 @@ [NSNumber numberWithInt:bitsPerSample],@"bitsPerSample", [NSNumber numberWithFloat:frequency],@"sampleRate", [NSNumber numberWithDouble:length],@"length", + [NSNumber numberWithBool:seekable ],@"seekable", @"little",@"endian", nil]; } diff --git a/Plugins/Vorbis/VorbisDecoder.m b/Plugins/Vorbis/VorbisDecoder.m index ef11a2449..8af23993b 100644 --- a/Plugins/Vorbis/VorbisDecoder.m +++ b/Plugins/Vorbis/VorbisDecoder.m @@ -125,11 +125,6 @@ long sourceTell(void *datasource) return milliseconds; } -- (BOOL) seekable -{ - return [source seekable]; -} - - (NSDictionary *)properties { return [NSDictionary dictionaryWithObjectsAndKeys: @@ -138,6 +133,7 @@ long sourceTell(void *datasource) [NSNumber numberWithFloat:frequency], @"sampleRate", [NSNumber numberWithDouble:length], @"length", [NSNumber numberWithInt:bitrate], @"bitrate", + [NSNumber numberWithBool:([source seekable] && seekable)], @"seekable", nil]; } diff --git a/Plugins/WavPack/WavPackDecoder.m b/Plugins/WavPack/WavPackDecoder.m index 1a3b8af1c..1fd6e2ed8 100644 --- a/Plugins/WavPack/WavPackDecoder.m +++ b/Plugins/WavPack/WavPackDecoder.m @@ -245,11 +245,6 @@ int32_t WriteBytesProc(void *ds, void *data, int32_t bcount) return source; } -- (BOOL)seekable -{ - return [source seekable]; -} - - (NSDictionary *)properties { return [NSDictionary dictionaryWithObjectsAndKeys: @@ -258,6 +253,7 @@ int32_t WriteBytesProc(void *ds, void *data, int32_t bcount) [NSNumber numberWithInt:bitrate],@"bitrate", [NSNumber numberWithFloat:frequency],@"sampleRate", [NSNumber numberWithDouble:length],@"length", + [NSNumber numberWithBool:[source seekable]], @"seekable", @"host",@"endian", nil]; }