Replace more NSDictionary use with literals

Use literals to initialize fixed NSDictionary objects in various places.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
CQTexperiment
Christopher Snowhill 2022-02-08 19:42:03 -08:00
parent 838b31a6e8
commit b927f4c02b
38 changed files with 283 additions and 423 deletions

View File

@ -57,14 +57,12 @@ NSString *CogPlaybackDidStopNotficiation = @"CogPlaybackDidStopNotficiation";
}
- (void)initDefaults {
NSDictionary *defaultsDictionary = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithDouble:100.0], @"volume",
[NSNumber numberWithBool:NO], @"GraphicEQenable",
[NSNumber numberWithInt:-1], @"GraphicEQpreset",
[NSNumber numberWithBool:NO], @"GraphicEQtrackgenre",
[NSNumber numberWithBool:YES], @"volumeLimit",
[NSNumber numberWithBool:NO], @"headphoneVirtualization",
nil];
NSDictionary *defaultsDictionary = @{@"volume": [NSNumber numberWithDouble:100.0],
@"GraphicEQenable": [NSNumber numberWithBool:NO],
@"GraphicEQpreset": [NSNumber numberWithInt:-1],
@"GraphicEQtrackgenre": [NSNumber numberWithBool:NO],
@"volumeLimit": [NSNumber numberWithBool:YES],
@"headphoneVirtualization": [NSNumber numberWithBool:NO]};
[[NSUserDefaults standardUserDefaults] registerDefaults:defaultsDictionary];
}

View File

@ -47,9 +47,7 @@
}
- (void)initDefaults {
NSDictionary *defaultsDictionary = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithBool:YES], @"readCueSheetsInFolders",
nil];
NSDictionary *defaultsDictionary = @{@"readCueSheetsInFolders": [NSNumber numberWithBool:YES]};
[[NSUserDefaults standardUserDefaults] registerDefaults:defaultsDictionary];
}
@ -213,7 +211,7 @@ NSMutableDictionary *dictionaryWithPropertiesOfObject(id obj, NSArray *filterLis
[queueList addObject:[NSNumber numberWithInteger:pe.index]];
}
NSDictionary *dictionary = [NSDictionary dictionaryWithObjectsAndKeys:albumArtSet, @"albumArt", queueList, @"queue", topLevel, @"items", nil];
NSDictionary *dictionary = @{@"albumArt": albumArtSet, @"queue": queueList, @"items": topLevel};
NSError *err;

View File

@ -80,18 +80,16 @@ static CAdPlugDatabase *g_database = NULL;
}
- (NSDictionary *)properties {
return [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:0], @"bitrate",
[NSNumber numberWithFloat:44100], @"sampleRate",
[NSNumber numberWithDouble:length], @"totalFrames",
[NSNumber numberWithInt:16], @"bitsPerSample", // Samples are short
[NSNumber numberWithBool:NO], @"floatingPoint",
[NSNumber numberWithInt:2], @"channels", // output from gme_play is in stereo
[NSNumber numberWithBool:YES], @"seekable",
[NSString stringWithUTF8String:m_player->gettype().c_str()], @"codec",
@"synthesized", @"encoding",
@"host", @"endian",
nil];
return @{@"bitrate": [NSNumber numberWithInt:0],
@"sampleRate": [NSNumber numberWithFloat:44100],
@"totalFrames": [NSNumber numberWithDouble:length],
@"bitsPerSample": [NSNumber numberWithInt:16], // Samples are short
@"floatingPoint": [NSNumber numberWithBool:NO],
@"channels": [NSNumber numberWithInt:2], // output from gme_play is in stereo
@"seekable": [NSNumber numberWithBool:YES],
@"codec": [NSString stringWithUTF8String:m_player->gettype().c_str()],
@"encoding": @"synthesized",
@"endian": @"host"};
}
- (int)readAudio:(void *)buf frames:(UInt32)frames {

View File

@ -67,7 +67,7 @@
delete p_player;
delete p_emu;
return [NSDictionary dictionaryWithObjectsAndKeys:title, @"title", artist, @"artist", nil];
return @{@"title": title, @"artist": artist};
}
@end

View File

@ -389,19 +389,17 @@ static SInt64 getSizeProc(void *clientData) {
}
- (NSDictionary *)properties {
return [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:channels], @"channels",
[NSNumber numberWithUnsignedInt:channelConfig], @"channelConfig",
[NSNumber numberWithInt:bitsPerSample], @"bitsPerSample",
[NSNumber numberWithBool:floatingPoint], @"floatingPoint",
[NSNumber numberWithInt:bitrate], @"bitrate",
[NSNumber numberWithFloat:frequency], @"sampleRate",
[NSNumber numberWithLong:totalFrames], @"totalFrames",
[NSNumber numberWithBool:YES], @"seekable",
codec, @"codec",
floatingPoint ? @"host" : @"big", @"endian",
_audioFile_is_lossy ? @"lossy" : @"lossless", @"encoding",
nil];
return @{@"channels": [NSNumber numberWithInt:channels],
@"channelConfig": [NSNumber numberWithUnsignedInt:channelConfig],
@"bitsPerSample": [NSNumber numberWithInt:bitsPerSample],
@"floatingPoint": [NSNumber numberWithBool:floatingPoint],
@"bitrate": [NSNumber numberWithInt:bitrate],
@"sampleRate": [NSNumber numberWithFloat:frequency],
@"totalFrames": [NSNumber numberWithLong:totalFrames],
@"seekable": [NSNumber numberWithBool:YES],
@"codec": codec,
@"endian": floatingPoint ? @"host" : @"big",
@"encoding": _audioFile_is_lossy ? @"lossy" : @"lossless"};
}
@end

View File

@ -61,18 +61,16 @@
// Class supplied by CogAudio, which is guaranteed to be present
if(!embedded)
fileMetadata = [audioMetadataReader metadataForURL:[track url] skipCue:YES];
NSDictionary *cuesheetMetadata = [NSDictionary dictionaryWithObjectsAndKeys:
[track artist], @"artist",
[track album], @"album",
[track title], @"title",
[NSNumber numberWithInt:[[track track] intValue]], @"track",
[track genre], @"genre",
[NSNumber numberWithInt:[[track year] intValue]], @"year",
[NSNumber numberWithFloat:[track albumGain]], @"replayGainAlbumGain",
[NSNumber numberWithFloat:[track albumPeak]], @"replayGainAlbumPeak",
[NSNumber numberWithFloat:[track trackGain]], @"replayGainTrackGain",
[NSNumber numberWithFloat:[track trackPeak]], @"replayGainTrackPeak",
nil];
NSDictionary *cuesheetMetadata = @{@"artist": [track artist],
@"album": [track album],
@"title": [track title],
@"track": [NSNumber numberWithInt:[[track track] intValue]],
@"genre": [track genre],
@"year": [NSNumber numberWithInt:[[track year] intValue]],
@"replayGainAlbumGain": [NSNumber numberWithFloat:[track albumGain]],
@"replayGainAlbumPeak": [NSNumber numberWithFloat:[track albumPeak]],
@"replayGainTrackGain": [NSNumber numberWithFloat:[track trackGain]],
@"replayGainTrackPeak": [NSNumber numberWithFloat:[track trackPeak]]};
return [fileMetadata dictionaryByMergingWith:cuesheetMetadata];
}

View File

@ -633,20 +633,18 @@ int64_t ffmpeg_seek(void *opaque, int64_t offset, int whence) {
}
- (NSDictionary *)properties {
return [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:channels], @"channels",
[NSNumber numberWithUnsignedInt:channelConfig], @"channelConfig",
[NSNumber numberWithInt:bitsPerSample], @"bitsPerSample",
[NSNumber numberWithBool:(bitsPerSample == 8)], @"Unsigned",
[NSNumber numberWithFloat:frequency], @"sampleRate",
[NSNumber numberWithBool:floatingPoint], @"floatingPoint",
[NSNumber numberWithDouble:totalFrames], @"totalFrames",
[NSNumber numberWithInt:bitrate], @"bitrate",
[NSNumber numberWithBool:seekable], @"seekable",
[NSString stringWithUTF8String:avcodec_get_name(codecCtx->codec_id)], @"codec",
@"host", @"endian",
lossy ? @"lossy" : @"lossless", @"encoding",
nil];
return @{@"channels": [NSNumber numberWithInt:channels],
@"channelConfig": [NSNumber numberWithUnsignedInt:channelConfig],
@"bitsPerSample": [NSNumber numberWithInt:bitsPerSample],
@"Unsigned": [NSNumber numberWithBool:(bitsPerSample == 8)],
@"sampleRate": [NSNumber numberWithFloat:frequency],
@"floatingPoint": [NSNumber numberWithBool:floatingPoint],
@"totalFrames": [NSNumber numberWithDouble:totalFrames],
@"bitrate": [NSNumber numberWithInt:bitrate],
@"seekable": [NSNumber numberWithBool:seekable],
@"codec": [NSString stringWithUTF8String:avcodec_get_name(codecCtx->codec_id)],
@"endian": @"host",
@"encoding": lossy ? @"lossy" : @"lossless"};
}
+ (NSArray *)fileTypes {

View File

@ -354,18 +354,16 @@ void ErrorCallback(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorS
}
- (NSDictionary *)properties {
return [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:channels], @"channels",
[NSNumber numberWithUnsignedInt:channelConfig], @"channelConfig",
[NSNumber numberWithInt:bitsPerSample], @"bitsPerSample",
[NSNumber numberWithFloat:frequency], @"sampleRate",
[NSNumber numberWithDouble:totalFrames], @"totalFrames",
[NSNumber numberWithBool:[source seekable]], @"seekable",
[NSNumber numberWithInt:fileSize ? (fileSize * 8 / ((totalFrames + (frequency / 2)) / frequency)) / 1000 : 0], @"bitrate",
@"FLAC", @"codec",
@"big", @"endian",
@"lossless", @"encoding",
nil];
return @{@"channels": [NSNumber numberWithInt:channels],
@"channelConfig": [NSNumber numberWithUnsignedInt:channelConfig],
@"bitsPerSample": [NSNumber numberWithInt:bitsPerSample],
@"sampleRate": [NSNumber numberWithFloat:frequency],
@"totalFrames": [NSNumber numberWithDouble:totalFrames],
@"seekable": [NSNumber numberWithBool:[source seekable]],
@"bitrate": [NSNumber numberWithInt:fileSize ? (fileSize * 8 / ((totalFrames + (frequency / 2)) / frequency)) / 1000 : 0],
@"codec": @"FLAC",
@"endian": @"big",
@"encoding": @"lossless"};
}
+ (NSArray *)fileTypes {

View File

@ -141,16 +141,14 @@ gme_err_t readCallback(void *data, void *out, int count) {
}
- (NSDictionary *)properties {
return [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:0], @"bitrate",
[NSNumber numberWithFloat:(float)sampleRate], @"sampleRate",
[NSNumber numberWithLong:length * ((float)sampleRate * 0.001)], @"totalFrames",
[NSNumber numberWithInt:sizeof(short) * 8], @"bitsPerSample", // Samples are short
[NSNumber numberWithInt:2], @"channels", // output from gme_play is in stereo
[NSNumber numberWithBool:[source seekable]], @"seekable",
@"host", @"endian",
@"synthesized", @"encoding",
nil];
return @{@"bitrate": [NSNumber numberWithInt:0],
@"sampleRate": [NSNumber numberWithFloat:(float)sampleRate],
@"totalFrames": [NSNumber numberWithLong:length * ((float)sampleRate * 0.001)],
@"bitsPerSample": [NSNumber numberWithInt:sizeof(short) * 8], // Samples are short
@"channels": [NSNumber numberWithInt:2], // output from gme_play is in stereo
@"seekable": [NSNumber numberWithBool:YES],
@"endian": @"host",
@"encoding": @"synthesized"};
}
- (int)readAudio:(void *)buf frames:(UInt32)frames {

View File

@ -102,13 +102,11 @@
title = [[url lastPathComponent] stringByAppendingFormat:@" [%d]", track_num];
}
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
[NSString stringWithUTF8String:info->system], @"genre",
[NSString stringWithUTF8String:info->game], @"album",
title, @"title",
[NSString stringWithUTF8String:info->author], @"artist",
[NSNumber numberWithInt:track_num + 1], @"track",
nil];
NSDictionary *dict = @{@"genre": [NSString stringWithUTF8String:info->system],
@"album": [NSString stringWithUTF8String:info->game],
@"title": title,
@"artist": [NSString stringWithUTF8String:info->author],
@"track": [NSNumber numberWithInt:track_num + 1]};
gme_free_info(info);

View File

@ -1539,22 +1539,20 @@ static int usf_info(void *context, const char *name, const char *value) {
break;
}
return [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:2], @"channels",
[NSNumber numberWithInt:16], @"bitsPerSample",
[NSNumber numberWithFloat:sampleRate], @"sampleRate",
[NSNumber numberWithInteger:totalFrames], @"totalFrames",
[NSNumber numberWithInt:0], @"bitrate",
[NSNumber numberWithBool:YES], @"seekable",
[NSNumber numberWithFloat:replayGainAlbumGain], @"replayGainAlbumGain",
[NSNumber numberWithFloat:replayGainAlbumPeak], @"replayGainAlbumPeak",
[NSNumber numberWithFloat:replayGainTrackGain], @"replayGainTrackGain",
[NSNumber numberWithFloat:replayGainTrackPeak], @"replayGainTrackPeak",
[NSNumber numberWithFloat:volume], @"volume",
codec, @"codec",
@"host", @"endian",
@"synthesized", @"encoding",
nil];
return @{@"channels": [NSNumber numberWithInt:2],
@"bitsPerSample": [NSNumber numberWithInt:16],
@"sampleRate": [NSNumber numberWithFloat:sampleRate],
@"totalFrames": [NSNumber numberWithInteger:totalFrames],
@"bitrate": [NSNumber numberWithInt:0],
@"seekable": [NSNumber numberWithBool:YES],
@"replayGainAlbumGain": [NSNumber numberWithFloat:replayGainAlbumGain],
@"replayGainAlbumPeak": [NSNumber numberWithFloat:replayGainAlbumPeak],
@"replayGainTrackGain": [NSNumber numberWithFloat:replayGainTrackGain],
@"replayGainTrackPeak": [NSNumber numberWithFloat:replayGainTrackPeak],
@"volume": [NSNumber numberWithFloat:volume],
@"codec": codec,
@"endian": @"host",
@"encoding": @"synthesized"};
}
+ (NSDictionary *)metadataForURL:(NSURL *)url {
@ -1569,7 +1567,7 @@ static int usf_info(void *context, const char *name, const char *value) {
psf_load([decodedUrl UTF8String], &source_callbacks, 0, 0, 0, psf_info_meta, &info, 0);
return info.info;
return [NSDictionary dictionaryWithDictionary:info.info];
}
+ (NSArray *)fileTypes {

View File

@ -80,17 +80,15 @@ static void oneTimeInit(void) {
}
- (NSDictionary *)properties {
return [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:0], @"bitrate",
[NSNumber numberWithFloat:44100], @"sampleRate",
[NSNumber numberWithDouble:totalFrames], @"totalFrames",
[NSNumber numberWithInt:32], @"bitsPerSample",
[NSNumber numberWithBool:YES], @"floatingPoint",
[NSNumber numberWithInt:2], @"channels",
[NSNumber numberWithBool:YES], @"seekable",
@"host", @"endian",
@"synthesized", @"encoding",
nil];
return @{@"bitrate": [NSNumber numberWithInt:0],
@"sampleRate": [NSNumber numberWithFloat:44100],
@"totalFrames": [NSNumber numberWithDouble:totalFrames],
@"bitsPerSample": [NSNumber numberWithInt:32],
@"floatingPoint": [NSNumber numberWithBool:YES],
@"channels": [NSNumber numberWithInt:2],
@"seekable": [NSNumber numberWithBool:YES],
@"endian": @"host",
@"encoding": @"synthesized"};
}
- (int)readAudio:(void *)buf frames:(UInt32)frames {

View File

@ -56,7 +56,7 @@
title = @"";
}
return [NSDictionary dictionaryWithObject:title forKey:@"title"];
return @{@"title": title};
}
@end

View File

@ -97,18 +97,16 @@ static OSType getOSType(const char *in_) {
}
- (NSDictionary *)properties {
return [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:0], @"bitrate",
[NSNumber numberWithFloat:44100], @"sampleRate",
[NSNumber numberWithLong:totalFrames], @"totalFrames",
[NSNumber numberWithInt:32], @"bitsPerSample",
[NSNumber numberWithBool:YES], @"floatingPoint",
[NSNumber numberWithInt:2], @"channels", // output from gme_play is in stereo
[NSNumber numberWithBool:YES], @"seekable",
@"MIDI", @"codec",
@"host", @"endian",
@"synthesized", @"encoding",
nil];
return @{@"bitrate": [NSNumber numberWithInt:0],
@"sampleRate": [NSNumber numberWithFloat:44100],
@"totalFrames": [NSNumber numberWithLong:totalFrames],
@"bitsPerSample": [NSNumber numberWithInt:32],
@"floatingPoint": [NSNumber numberWithBool:YES],
@"channels": [NSNumber numberWithInt:2],
@"seekable": [NSNumber numberWithBool:YES],
@"codec": @"MIDI",
@"endian": @"host",
@"encoding": @"synthesized"};
}
- (BOOL)initDecoder {

View File

@ -179,18 +179,16 @@ mpc_bool_t CanSeekProc(mpc_reader *p_reader) {
}
- (NSDictionary *)properties {
return [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:bitrate], @"bitrate",
[NSNumber numberWithFloat:frequency], @"sampleRate",
[NSNumber numberWithDouble:totalFrames], @"totalFrames",
[NSNumber numberWithInt:32], @"bitsPerSample",
[NSNumber numberWithBool:YES], @"floatingPoint",
[NSNumber numberWithInt:2], @"channels",
[NSNumber numberWithBool:[source seekable]], @"seekable",
@"Musepack", @"codec",
@"host", @"endian",
@"lossy", @"encoding",
nil];
return @{@"bitrate": [NSNumber numberWithInt:bitrate],
@"sampleRate": [NSNumber numberWithFloat:frequency],
@"totalFrames": [NSNumber numberWithDouble:totalFrames],
@"bitsPerSample": [NSNumber numberWithInt:32],
@"floatingPoint": [NSNumber numberWithBool:YES],
@"channels": [NSNumber numberWithInt:2],
@"seekable": [NSNumber numberWithBool:[source seekable]],
@"codec": @"Musepack",
@"endian": @"host",
@"encoding": @"lossy"};
}
+ (NSArray *)fileTypes {

View File

@ -93,17 +93,15 @@ static void g_push_archive_extensions(std::vector<std::string> &list) {
}
- (NSDictionary *)properties {
return [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:0], @"bitrate",
[NSNumber numberWithFloat:44100], @"sampleRate",
[NSNumber numberWithDouble:length], @"totalFrames",
[NSNumber numberWithInt:32], @"bitsPerSample", // Samples are short
[NSNumber numberWithBool:YES], @"floatingPoint",
[NSNumber numberWithInt:2], @"channels", // output from gme_play is in stereo
[NSNumber numberWithBool:YES], @"seekable",
@"host", @"endian",
@"synthesized", @"encoding",
nil];
return @{@"bitrate": [NSNumber numberWithInt:0],
@"sampleRate": [NSNumber numberWithFloat:44100],
@"totalFrames": [NSNumber numberWithDouble:length],
@"bitsPerSample": [NSNumber numberWithInt:32],
@"floatingPoint": [NSNumber numberWithBool:YES],
@"channels": [NSNumber numberWithInt:2],
@"seekable": [NSNumber numberWithBool:YES],
@"endian": @"host",
@"encoding": @"synthesized"};
}
- (int)readAudio:(void *)buf frames:(UInt32)frames {

View File

@ -89,7 +89,7 @@
if(type == nil)
type = @"";
return [NSDictionary dictionaryWithObjectsAndKeys:title, @"title", artist, @"artist", /*comment, @"comment",*/ date, @"year", type, @"codec", nil];
return @{@"title": title, @"artist": artist,/*@"comment": comment,*/ @"year": [NSNumber numberWithInt:[date intValue]], @"codec": type};
} catch(std::exception & /*e*/) {
return 0;
}

View File

@ -90,17 +90,15 @@ static void g_push_archive_extensions(std::vector<std::string> &list) {
}
- (NSDictionary *)properties {
return [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:0], @"bitrate",
[NSNumber numberWithFloat:44100], @"sampleRate",
[NSNumber numberWithDouble:length], @"totalFrames",
[NSNumber numberWithInt:32], @"bitsPerSample", // Samples are short
[NSNumber numberWithBool:YES], @"floatingPoint",
[NSNumber numberWithInt:2], @"channels", // output from gme_play is in stereo
[NSNumber numberWithBool:YES], @"seekable",
@"host", @"endian",
@"synthesized", @"encoding",
nil];
return @{@"bitrate": [NSNumber numberWithInt:0],
@"sampleRate": [NSNumber numberWithFloat:44100],
@"totalFrames": [NSNumber numberWithDouble:length],
@"bitsPerSample": [NSNumber numberWithInt:32],
@"floatingPoint": [NSNumber numberWithBool:YES],
@"channels": [NSNumber numberWithInt:2],
@"seekable": [NSNumber numberWithBool:YES],
@"endian": @"host",
@"encoding": @"synthesized"};
}
- (int)readAudio:(void *)buf frames:(UInt32)frames {

View File

@ -89,7 +89,7 @@
if(type == nil)
type = @"";
return [NSDictionary dictionaryWithObjectsAndKeys:title, @"title", artist, @"artist", /*comment, @"comment",*/ date, @"year", type, @"codec", nil];
return @{@"title": title, @"artist": artist, /*@"comment": comment,*/ @"year": [NSNumber numberWithInt:[date intValue]], @"codec": type};
} catch(std::exception & /*e*/) {
return 0;
}

View File

@ -176,18 +176,16 @@ opus_int64 sourceTell(void *_stream) {
}
- (NSDictionary *)properties {
return [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:channels], @"channels",
[NSNumber numberWithInt:32], @"bitsPerSample",
[NSNumber numberWithBool:YES], @"floatingPoint",
[NSNumber numberWithFloat:48000], @"sampleRate",
[NSNumber numberWithDouble:totalFrames], @"totalFrames",
[NSNumber numberWithInt:bitrate], @"bitrate",
[NSNumber numberWithBool:([source seekable] && seekable)], @"seekable",
@"Opus", @"codec",
@"host", @"endian",
@"lossy", @"encoding",
nil];
return @{@"channels": [NSNumber numberWithInt:channels],
@"bitsPerSample": [NSNumber numberWithInt:32],
@"floatingPoint": [NSNumber numberWithBool:YES],
@"sampleRate": [NSNumber numberWithFloat:48000],
@"totalFrames": [NSNumber numberWithDouble:totalFrames],
@"bitrate": [NSNumber numberWithInt:bitrate],
@"seekable": [NSNumber numberWithBool:([source seekable] && seekable)],
@"codec": @"Opus",
@"endian": @"host",
@"encoding": @"lossy"};
}
+ (NSArray *)fileTypes {

View File

@ -77,16 +77,14 @@
}
- (NSDictionary *)properties {
return [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:channels], @"channels",
[NSNumber numberWithInt:bitsPerSample], @"bitsPerSample",
[NSNumber numberWithFloat:frequency], @"sampleRate",
[NSNumber numberWithDouble:totalFrames], @"totalFrames",
[NSNumber numberWithBool:seekable], @"seekable",
@"Shorten", @"codec",
@"little", @"endian",
@"lossless", @"encoding",
nil];
return @{@"channels": [NSNumber numberWithInt:channels],
@"bitsPerSample": [NSNumber numberWithInt:bitsPerSample],
@"sampleRate": [NSNumber numberWithFloat:frequency],
@"totalFrames": [NSNumber numberWithDouble:totalFrames],
@"seekable": [NSNumber numberWithBool:seekable],
@"codec": @"Shorten",
@"endian": @"little",
@"encoding": @"lossless"};
}
+ (NSArray *)fileTypes {

View File

@ -35,17 +35,15 @@ enum { channels = 2 };
}
- (NSDictionary *)properties {
return [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:0], @"bitrate",
[NSNumber numberWithFloat:sample_rate], @"sampleRate",
[NSNumber numberWithDouble:length], @"totalFrames",
[NSNumber numberWithInt:32], @"bitsPerSample",
[NSNumber numberWithBool:YES], @"floatingPoint",
[NSNumber numberWithInt:channels], @"channels",
[NSNumber numberWithBool:YES], @"seekable",
@"host", @"endian",
@"synthesized", @"encoding",
nil];
return @{@"bitrate": [NSNumber numberWithInt:0],
@"sampleRate": [NSNumber numberWithFloat:sample_rate],
@"totalFrames": [NSNumber numberWithDouble:length],
@"bitsPerSample": [NSNumber numberWithInt:32],
@"floatingPoint": [NSNumber numberWithBool:YES],
@"channels": [NSNumber numberWithInt:channels],
@"seekable": [NSNumber numberWithBool:YES],
@"endian": @"host",
@"encoding": @"synthesized"};
}
- (int)readAudio:(void *)buf frames:(UInt32)frames {

View File

@ -159,18 +159,16 @@ long sourceTell(void *datasource) {
}
- (NSDictionary *)properties {
return [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:channels], @"channels",
[NSNumber numberWithInt:32], @"bitsPerSample",
[NSNumber numberWithBool:YES], @"floatingPoint",
[NSNumber numberWithFloat:frequency], @"sampleRate",
[NSNumber numberWithDouble:totalFrames], @"totalFrames",
[NSNumber numberWithInt:bitrate], @"bitrate",
[NSNumber numberWithBool:([source seekable] && seekable)], @"seekable",
@"Vorbis", @"codec",
@"host", @"endian",
@"lossy", @"encoding",
nil];
return @{@"channels": [NSNumber numberWithInt:channels],
@"bitsPerSample": [NSNumber numberWithInt:32],
@"floatingPoint": [NSNumber numberWithBool:YES],
@"sampleRate": [NSNumber numberWithFloat:frequency],
@"totalFrames": [NSNumber numberWithDouble:totalFrames],
@"bitrate": [NSNumber numberWithInt:bitrate],
@"seekable": [NSNumber numberWithBool:([source seekable] && seekable)],
@"codec": @"Ogg Vorbis",
@"endian": @"host",
@"encoding": @"lossy"};
}
+ (NSArray *)fileTypes {

View File

@ -281,19 +281,17 @@ int32_t WriteBytesProc(void *ds, void *data, int32_t bcount) {
}
- (NSDictionary *)properties {
return [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:channels], @"channels",
[NSNumber numberWithUnsignedInt:channelConfig], @"channelConfig",
[NSNumber numberWithInt:bitsPerSample], @"bitsPerSample",
[NSNumber numberWithInt:bitrate], @"bitrate",
[NSNumber numberWithFloat:frequency], @"sampleRate",
[NSNumber numberWithBool:floatingPoint], @"floatingPoint",
[NSNumber numberWithDouble:totalFrames], @"totalFrames",
[NSNumber numberWithBool:[[wv source] seekable]], @"seekable",
@"Wavpack", @"codec",
@"little", @"endian",
isLossy ? @"lossy" : @"lossless", @"encoding",
nil];
return @{@"channels": [NSNumber numberWithInt:channels],
@"channelConfig": [NSNumber numberWithUnsignedInt:channelConfig],
@"bitsPerSample": [NSNumber numberWithInt:bitsPerSample],
@"bitrate": [NSNumber numberWithInt:bitrate],
@"sampleRate": [NSNumber numberWithFloat:frequency],
@"floatingPoint": [NSNumber numberWithBool:floatingPoint],
@"totalFrames": [NSNumber numberWithDouble:totalFrames],
@"seekable": [NSNumber numberWithBool:[[wv source] seekable]],
@"codec": @"Wavpack",
@"endian": @"little",
@"encoding": isLossy ? @"lossy" : @"lossless"};
}
+ (NSArray *)fileTypes {

View File

@ -179,16 +179,14 @@ const int masterVol = 0x10000; // Fixed point 16.16
}
- (NSDictionary*)properties {
return [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:0], @"bitrate",
[NSNumber numberWithFloat:sampleRate], @"sampleRate",
[NSNumber numberWithLong:length], @"totalFrames",
[NSNumber numberWithInt:numBitsPerSample], @"bitsPerSample", // Samples are short
[NSNumber numberWithInt:numChannels], @"channels", // output from gme_play is in stereo
[NSNumber numberWithBool:[source seekable]], @"seekable",
@"host", @"endian",
@"synthesized", @"encoding",
nil];
return @{@"bitrate": [NSNumber numberWithInt:0],
@"sampleRate": [NSNumber numberWithFloat:sampleRate],
@"totalFrames": [NSNumber numberWithLong:length],
@"bitsPerSample": [NSNumber numberWithInt:numBitsPerSample],
@"channels": [NSNumber numberWithInt:numChannels],
@"seekable": [NSNumber numberWithBool:YES],
@"endian": @"host",
@"encoding": @"synthesized"};
}
- (int)readAudio:(void*)buf frames:(UInt32)frames {

View File

@ -160,13 +160,11 @@ static std::string FCC2Str(UINT32 fcc) {
DataLoader_Deinit(dLoad);
free(fileData);
NSDictionary* dict = [NSDictionary dictionaryWithObjectsAndKeys:
system, @"codec",
album, @"album",
title, @"title",
artist, @"artist",
year, @"year",
nil];
NSDictionary* dict = @{@"codec": system,
@"album": album,
@"title": title,
@"artist": artist,
@"year": [NSNumber numberWithInt:[year intValue]]};
return dict;
}

View File

@ -188,17 +188,15 @@ static void sidTuneLoader(const char *fileName, std::vector<uint8_t> &bufferRef)
}
- (NSDictionary *)properties {
return [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:0], @"bitrate",
[NSNumber numberWithFloat:44100], @"sampleRate",
[NSNumber numberWithDouble:length], @"totalFrames",
[NSNumber numberWithInt:16], @"bitsPerSample", // Samples are short
[NSNumber numberWithBool:NO], @"floatingPoint",
[NSNumber numberWithInt:n_channels], @"channels", // output from gme_play is in stereo
[NSNumber numberWithBool:[source seekable]], @"seekable",
@"host", @"endian",
@"synthesized", @"encoding",
nil];
return @{@"bitrate": [NSNumber numberWithInt:0],
@"sampleRate": [NSNumber numberWithFloat:44100],
@"totalFrames": [NSNumber numberWithDouble:length],
@"bitsPerSample": [NSNumber numberWithInt:16],
@"floatingPoint": [NSNumber numberWithBool:NO],
@"channels": [NSNumber numberWithInt:n_channels],
@"seekable": [NSNumber numberWithBool:YES],
@"endian": @"host",
@"encoding": @"synthesized"};
}
- (int)readAudio:(void *)buf frames:(UInt32)frames {

View File

@ -54,7 +54,7 @@
NSString *titletag = info->songs() > 1 ? @"album" : @"title";
NSString *artist = count >= 2 ? [[NSString stringWithUTF8String:info->infoString(1)] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] : @"";
return [NSDictionary dictionaryWithObjectsAndKeys:title, titletag, artist, @"artist", nil];
return @{titletag: title, @"artist": artist};
}
@end

View File

@ -150,23 +150,20 @@ static NSString *get_description_tag(const char *description, const char *tag, c
close_streamfile(tagFile);
}
NSDictionary *properties =
[NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:bitrate / 1000], @"bitrate",
[NSNumber numberWithInt:sampleRate], @"sampleRate",
[NSNumber numberWithDouble:totalFrames], @"totalFrames",
[NSNumber numberWithInt:16], @"bitsPerSample",
[NSNumber numberWithBool:NO], @"floatingPoint",
[NSNumber numberWithInt:channels], @"channels",
[NSNumber numberWithBool:YES], @"seekable",
rgAlbumGain, @"replayGainAlbumGain",
rgAlbumPeak, @"replayGainAlbumPeak",
rgTrackGain, @"replayGainTrackGain",
rgTrackPeak, @"replayGainTrackPeak",
codec, @"codec",
@"host", @"endian",
@"lossy/lossless", @"encoding",
nil];
NSDictionary *properties = @{@"bitrate": [NSNumber numberWithInt:bitrate / 1000],
@"sampleRate": [NSNumber numberWithInt:sampleRate],
@"totalFrames": [NSNumber numberWithDouble:totalFrames],
@"bitsPerSample": [NSNumber numberWithInt:16],
@"floatingPoint": [NSNumber numberWithBool:NO],
@"channels": [NSNumber numberWithInt:channels],
@"seekable": [NSNumber numberWithBool:YES],
@"replayGainAlbumGain": rgAlbumGain,
@"replayGainAlbumPeak": rgAlbumPeak,
@"replayGainTrackGain": rgTrackGain,
@"replayGainTrackPeak": rgTrackPeak,
@"codec": codec,
@"endian": @"host",
@"encoding": @"lossy/lossless"};
if([title isEqualToString:@""]) {
if(stream->num_streams > 1) {
@ -179,12 +176,9 @@ static NSString *get_description_tag(const char *description, const char *tag, c
if([track isEqualToNumber:[NSNumber numberWithInt:0]])
track = [NSNumber numberWithInt:track_num];
NSMutableDictionary *mutableMetadata =
[NSMutableDictionary dictionaryWithObjectsAndKeys:
title, @"title",
track, @"track",
disc, @"disc",
nil];
NSMutableDictionary *mutableMetadata = @{@"title": title,
@"track": track,
@"disc": disc};
if(![album isEqualToString:@""])
[mutableMetadata setValue:album forKey:@"album"];
@ -195,11 +189,8 @@ static NSString *get_description_tag(const char *description, const char *tag, c
NSDictionary *metadata = mutableMetadata;
NSDictionary *package =
[NSDictionary dictionaryWithObjectsAndKeys:
properties, @"properties",
metadata, @"metadata",
nil];
NSDictionary *package = @{@"properties": properties,
@"metadata": metadata};
@synchronized(self) {
[storage setValue:package forKey:[url absoluteString]];
@ -293,17 +284,15 @@ static NSString *get_description_tag(const char *description, const char *tag, c
}
- (NSDictionary *)properties {
return [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:bitrate / 1000], @"bitrate",
[NSNumber numberWithInt:sampleRate], @"sampleRate",
[NSNumber numberWithDouble:totalFrames], @"totalFrames",
[NSNumber numberWithInt:16], @"bitsPerSample",
[NSNumber numberWithBool:NO], @"floatingPoint",
[NSNumber numberWithInt:channels], @"channels",
[NSNumber numberWithBool:YES], @"seekable",
@"host", @"endian",
@"lossy/lossless", @"encoding",
nil];
return @{@"bitrate": [NSNumber numberWithInt:bitrate / 1000],
@"sampleRate": [NSNumber numberWithInt:sampleRate],
@"totalFrames": [NSNumber numberWithDouble:totalFrames],
@"bitsPerSample": [NSNumber numberWithInt:16],
@"floatingPoint": [NSNumber numberWithBool:NO],
@"channels": [NSNumber numberWithInt:channels],
@"seekable": [NSNumber numberWithBool:YES],
@"endian": @"host",
@"encoding": @"lossy/lossless"};
}
- (int)readAudio:(void *)buf frames:(UInt32)frames {

View File

@ -26,8 +26,7 @@
// NSLocalizedStringFromTableInBundle(@"Nightly", nil, [NSBundle bundleForClass:[self class]], @"") , @"name", @"http://mamburu.net/cog/nightly.xml", @"url",nil]];
[self addObject:
[NSDictionary dictionaryWithObjectsAndKeys:
NSLocalizedStringFromTableInBundle(@"cog.losno.co wheneverly", nil, [NSBundle bundleForClass:[self class]], @""), @"name", @"https://cogcdn.cog.losno.co/mercury.xml", @"url", nil]];
@{@"name": NSLocalizedStringFromTableInBundle(@"cog.losno.co wheneverly", nil, [NSBundle bundleForClass:[self class]], @""), @"url": @"https://cogcdn.cog.losno.co/mercury.xml"}];
}
@end

View File

@ -12,37 +12,21 @@
- (void)awakeFromNib {
[self removeObjects:[self arrangedObjects]];
[self addObject:
[NSDictionary dictionaryWithObjectsAndKeys:
@"Default (auto)", @"name", @"default", @"preference", nil]];
[self addObject:@{@"name": @"Default (auto)", @"preference": @"default"}];
[self addObject:
[NSDictionary dictionaryWithObjectsAndKeys:
@"General MIDI", @"name", @"gm", @"preference", nil]];
[self addObject:@{@"name": @"General MIDI", @"preference": @"gm"}];
[self addObject:
[NSDictionary dictionaryWithObjectsAndKeys:
@"General MIDI 2", @"name", @"gm2", @"preference", nil]];
[self addObject:@{@"name": @"General MIDI 2", @"preference": @"gm2"}];
[self addObject:
[NSDictionary dictionaryWithObjectsAndKeys:
@"Roland SC-55", @"name", @"sc55", @"preference", nil]];
[self addObject:@{@"name": @"Roland SC-55", @"preference": @"sc55"}];
[self addObject:
[NSDictionary dictionaryWithObjectsAndKeys:
@"Roland SC-88", @"name", @"sc88", @"preference", nil]];
[self addObject:@{@"name": @"Roland SC-88", @"preference": @"sc88"}];
[self addObject:
[NSDictionary dictionaryWithObjectsAndKeys:
@"Roland SC-88 Pro", @"name", @"sc88pro", @"preference", nil]];
[self addObject:@{@"name": @"Roland SC-88 Pro", @"preference": @"sc88pro"}];
[self addObject:
[NSDictionary dictionaryWithObjectsAndKeys:
@"Roland SC-8850", @"name", @"sc8850", @"preference", nil]];
[self addObject:@{@"name": @"Roland SC-8850", @"preference": @"sc8850"}];
[self addObject:
[NSDictionary dictionaryWithObjectsAndKeys:
@"Yamaha XG", @"name", @"xg", @"preference", nil]];
[self addObject:@{@"name": @"Yamaha XG", @"preference": @"xg"}];
}
@end

View File

@ -66,32 +66,16 @@ static void enumCallback(void *context, OSType uSubType, OSType uManufacturer, c
- (void)awakeFromNib {
[self removeObjects:[self arrangedObjects]];
[self addObject:
[NSDictionary dictionaryWithObjectsAndKeys:
@"BASSMIDI", @"name", @"BASSMIDI", @"preference", nil]];
[self addObject:@{@"name": @"BASSMIDI", @"preference": @"BASSMIDI"}];
[self addObject:
[NSDictionary dictionaryWithObjectsAndKeys:
@"DMX Generic", @"name", @"DOOM0000", @"preference", nil]];
[self addObject:
[NSDictionary dictionaryWithObjectsAndKeys:
@"DMX Doom 1", @"name", @"DOOM0001", @"preference", nil]];
[self addObject:
[NSDictionary dictionaryWithObjectsAndKeys:
@"DMX Doom 2", @"name", @"DOOM0002", @"preference", nil]];
[self addObject:
[NSDictionary dictionaryWithObjectsAndKeys:
@"DMX Raptor", @"name", @"DOOM0003", @"preference", nil]];
[self addObject:
[NSDictionary dictionaryWithObjectsAndKeys:
@"DMX Strife", @"name", @"DOOM0004", @"preference", nil]];
[self addObject:
[NSDictionary dictionaryWithObjectsAndKeys:
@"DMXOPL", @"name", @"DOOM0005", @"preference", nil]];
[self addObject:@{@"name": @"DMX Generic", @"preference": @"DOOM0000"}];
[self addObject:@{@"name": @"DMX Doom 1", @"preference": @"DOOM0001"}];
[self addObject:@{@"name": @"DMX Doom 2", @"preference": @"DOOM0002"}];
[self addObject:@{@"name": @"DMX Raptor", @"preference": @"DOOM0003"}];
[self addObject:@{@"name": @"DMX Strife", @"preference": @"DOOM0004"}];
[self addObject:@{@"name": @"DMXOPL", @"preference": @"DOOM0005"}];
[self addObject:
[NSDictionary dictionaryWithObjectsAndKeys:
@"OPL3Windows", @"name", @"OPL3W000", @"preference", nil]];
[self addObject:@{@"name": @"OPL3Windows", @"preference": @"OPL3W000"}];
enumComponents(enumCallback, (__bridge void *)(self));
}

View File

@ -12,18 +12,9 @@
- (void)awakeFromNib {
[self removeObjects:[self arrangedObjects]];
[self addObject:
[NSDictionary dictionaryWithObjectsAndKeys:
NSLocalizedStringFromTableInBundle(@"Clear playlist and play", nil, [NSBundle bundleForClass:[self class]], @""), @"name",
@"clearAndPlay", @"preference", nil]];
[self addObject:
[NSDictionary dictionaryWithObjectsAndKeys:
NSLocalizedStringFromTableInBundle(@"Enqueue", nil, [NSBundle bundleForClass:[self class]], @""), @"name",
@"enqueue", @"preference", nil]];
[self addObject:
[NSDictionary dictionaryWithObjectsAndKeys:
NSLocalizedStringFromTableInBundle(@"Enqueue and play", nil, [NSBundle bundleForClass:[self class]], @""), @"name",
@"enqueueAndPlay", @"preference", nil]];
[self addObject:@{@"name": NSLocalizedStringFromTableInBundle(@"Clear playlist and play", nil, [NSBundle bundleForClass:[self class]], @""), @"preference": @"clearAndPlay"}];
[self addObject:@{@"name": NSLocalizedStringFromTableInBundle(@"Enqueue", nil, [NSBundle bundleForClass:[self class]], @""), @"preference": @"enqueue"}];
[self addObject:@{@"name": NSLocalizedStringFromTableInBundle(@"Enqueue and play", nil, [NSBundle bundleForClass:[self class]], @""), @"preference": @"enqueueAndPlay"}];
}
@end

View File

@ -12,35 +12,17 @@
- (void)awakeFromNib {
[self removeObjects:[self arrangedObjects]];
[self addObject:
[NSDictionary dictionaryWithObjectsAndKeys:
NSLocalizedStringFromTableInBundle(@"Zero Order Hold", nil, [NSBundle bundleForClass:[self class]], @""), @"name",
@"zoh", @"preference", nil]];
[self addObject:@{@"name": NSLocalizedStringFromTableInBundle(@"Zero Order Hold", nil, [NSBundle bundleForClass:[self class]], @""), @"preference": @"zoh"}];
[self addObject:
[NSDictionary dictionaryWithObjectsAndKeys:
NSLocalizedStringFromTableInBundle(@"Blep Synthesis", nil, [NSBundle bundleForClass:[self class]], @""), @"name",
@"blep", @"preference", nil]];
[self addObject:@{@"name": NSLocalizedStringFromTableInBundle(@"Blep Synthesis", nil, [NSBundle bundleForClass:[self class]], @""), @"preference": @"blep"}];
[self addObject:
[NSDictionary dictionaryWithObjectsAndKeys:
NSLocalizedStringFromTableInBundle(@"Linear Interpolation", nil, [NSBundle bundleForClass:[self class]], @""), @"name",
@"linear", @"preference", nil]];
[self addObject:@{@"name": NSLocalizedStringFromTableInBundle(@"Linear Interpolation", nil, [NSBundle bundleForClass:[self class]], @""), @"preference": @"linear"}];
[self addObject:
[NSDictionary dictionaryWithObjectsAndKeys:
NSLocalizedStringFromTableInBundle(@"Blam Synthesis", nil, [NSBundle bundleForClass:[self class]], @""), @"name",
@"blam", @"preference", nil]];
[self addObject:@{@"name": NSLocalizedStringFromTableInBundle(@"Blam Synthesis", nil, [NSBundle bundleForClass:[self class]], @""), @"preference": @"blam"}];
[self addObject:
[NSDictionary dictionaryWithObjectsAndKeys:
NSLocalizedStringFromTableInBundle(@"Cubic Interpolation", nil, [NSBundle bundleForClass:[self class]], @""), @"name",
@"cubic", @"preference", nil]];
[self addObject:@{@"name": NSLocalizedStringFromTableInBundle(@"Cubic Interpolation", nil, [NSBundle bundleForClass:[self class]], @""), @"preference": @"cubic"}];
[self addObject:
[NSDictionary dictionaryWithObjectsAndKeys:
NSLocalizedStringFromTableInBundle(@"Sinc Interpolation", nil, [NSBundle bundleForClass:[self class]], @""), @"name",
@"sinc", @"preference", nil]];
[self addObject:@{@"name": NSLocalizedStringFromTableInBundle(@"Sinc Interpolation", nil, [NSBundle bundleForClass:[self class]], @""), @"preference": @"sinc"}];
}
@end

View File

@ -12,35 +12,17 @@
- (void)awakeFromNib {
[self removeObjects:[self arrangedObjects]];
[self addObject:
[NSDictionary dictionaryWithObjectsAndKeys:
NSLocalizedStringFromTableInBundle(@"ReplayGain Album Gain with peak", nil, [NSBundle bundleForClass:[self class]], @""), @"name",
@"albumGainWithPeak", @"preference", nil]];
[self addObject:@{@"name": NSLocalizedStringFromTableInBundle(@"ReplayGain Album Gain with peak", nil, [NSBundle bundleForClass:[self class]], @""), @"preference": @"albumGainWithPeak"}];
[self addObject:
[NSDictionary dictionaryWithObjectsAndKeys:
NSLocalizedStringFromTableInBundle(@"ReplayGain Album Gain", nil, [NSBundle bundleForClass:[self class]], @""), @"name",
@"albumGain", @"preference", nil]];
[self addObject:@{@"name": NSLocalizedStringFromTableInBundle(@"ReplayGain Album Gain", nil, [NSBundle bundleForClass:[self class]], @""), @"preference": @"albumGain"}];
[self addObject:
[NSDictionary dictionaryWithObjectsAndKeys:
NSLocalizedStringFromTableInBundle(@"ReplayGain Track Gain with peak", nil, [NSBundle bundleForClass:[self class]], @""), @"name",
@"trackGainWithPeak", @"preference", nil]];
[self addObject:@{@"name": NSLocalizedStringFromTableInBundle(@"ReplayGain Track Gain with peak", nil, [NSBundle bundleForClass:[self class]], @""), @"preference": @"trackGainWithPeak"}];
[self addObject:
[NSDictionary dictionaryWithObjectsAndKeys:
NSLocalizedStringFromTableInBundle(@"ReplayGain Track Gain", nil, [NSBundle bundleForClass:[self class]], @""), @"name",
@"trackGain", @"preference", nil]];
[self addObject:@{@"name": NSLocalizedStringFromTableInBundle(@"ReplayGain Track Gain", nil, [NSBundle bundleForClass:[self class]], @""), @"preference": @"trackGain"}];
[self addObject:
[NSDictionary dictionaryWithObjectsAndKeys:
NSLocalizedStringFromTableInBundle(@"Volume scale tag only", nil, [NSBundle bundleForClass:[self class]], @""), @"name",
@"volumeScale", @"preference", nil]];
[self addObject:@{@"name": NSLocalizedStringFromTableInBundle(@"Volume scale tag only", nil, [NSBundle bundleForClass:[self class]], @""), @"preference": @"volumeScale"}];
[self addObject:
[NSDictionary dictionaryWithObjectsAndKeys:
NSLocalizedStringFromTableInBundle(@"No volume scaling", nil, [NSBundle bundleForClass:[self class]], @""), @"name",
@"none", @"preference", nil]];
[self addObject:@{@"name": NSLocalizedStringFromTableInBundle(@"No volume scaling", nil, [NSBundle bundleForClass:[self class]], @""), @"preference": @"none"}];
}
@end

View File

@ -28,16 +28,14 @@ static NSDictionary *importKeys;
NSArray *trackTransform =
@[@"spotlightTrack", @"NumberToStringTransformer"];
importKeys = [NSDictionary dictionaryWithObjectsAndKeys:
@"title", @"kMDItemTitle",
@"album", @"kMDItemAlbum",
trackTransform, @"kMDItemAudioTrackNumber",
@"year", @"kMDItemRecordingYear",
@"genre", @"kMDItemMusicalGenre",
@"length", @"kMDItemDurationSeconds",
URLTransform, @"kMDItemPath",
artistTransform, @"kMDItemAuthors",
nil];
importKeys = @{@"kMDItemTitle": @"title",
@"kMDItemAlbum": @"album",
@"kMDItemAudioTrackNumber": trackTransform,
@"kMDItemRecordingYear": @"year",
@"kMDItemMusicalGenre": @"genre",
@"kMDItemDurationSeconds": @"length",
@"kMDItemPath": URLTransform,
@"kMDItemAuthors": artistTransform};
}
+ (SpotlightPlaylistEntry *)playlistEntryWithMetadataItem:(NSMetadataItem *)metadataItem {

View File

@ -49,9 +49,7 @@ static NSPredicate *musicOnlyPredicate = nil;
NSString *homeDir = @"~";
homeDir = [homeDir stringByExpandingTildeInPath];
homeDir = [[NSURL fileURLWithPath:homeDir isDirectory:YES] absoluteString];
NSDictionary *searchDefault =
[NSDictionary dictionaryWithObject:homeDir
forKey:@"spotlightSearchPath"];
NSDictionary *searchDefault = @{@"spotlightSearchPath": homeDir};
[defaults registerDefaults:searchDefault];
}

View File

@ -38,10 +38,9 @@ static NSString *TrackingSliderValueObservationContext = @"TrackingSliderValueOb
if([binding isEqualToString:@"value"]) {
[observableController addObserver:self forKeyPath:keyPath options:(NSKeyValueObservingOptionNew)context:(__bridge void *_Nullable)(TrackingSliderValueObservationContext)];
NSDictionary *bindingsData = [NSDictionary dictionaryWithObjectsAndKeys:
observableController, NSObservedObjectKey,
[keyPath copy], NSObservedKeyPathKey,
[options copy], NSOptionsKey, nil];
NSDictionary *bindingsData = @{NSObservedObjectKey: observableController,
NSObservedKeyPathKey: [keyPath copy],
NSOptionsKey: options ? [options copy] : @{}};
[bindingInfo setObject:bindingsData forKey:binding];
} else {