diff --git a/Application/PlaybackController.m b/Application/PlaybackController.m index 8dffb7f19..a62d41a4f 100644 --- a/Application/PlaybackController.m +++ b/Application/PlaybackController.m @@ -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]; } diff --git a/Playlist/PlaylistLoader.m b/Playlist/PlaylistLoader.m index e3046da46..b158735ae 100644 --- a/Playlist/PlaylistLoader.m +++ b/Playlist/PlaylistLoader.m @@ -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; diff --git a/Plugins/AdPlug/AdPlug/AdPlugDecoder.mm b/Plugins/AdPlug/AdPlug/AdPlugDecoder.mm index 6f0b1716a..ab1a65acb 100644 --- a/Plugins/AdPlug/AdPlug/AdPlugDecoder.mm +++ b/Plugins/AdPlug/AdPlug/AdPlugDecoder.mm @@ -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 { diff --git a/Plugins/AdPlug/AdPlug/AdPlugMetadataReader.mm b/Plugins/AdPlug/AdPlug/AdPlugMetadataReader.mm index 5e2285032..8a04753a5 100644 --- a/Plugins/AdPlug/AdPlug/AdPlugMetadataReader.mm +++ b/Plugins/AdPlug/AdPlug/AdPlugMetadataReader.mm @@ -67,7 +67,7 @@ delete p_player; delete p_emu; - return [NSDictionary dictionaryWithObjectsAndKeys:title, @"title", artist, @"artist", nil]; + return @{@"title": title, @"artist": artist}; } @end diff --git a/Plugins/CoreAudio/CoreAudioDecoder.m b/Plugins/CoreAudio/CoreAudioDecoder.m index 3fc5e9908..3ea2c37fc 100644 --- a/Plugins/CoreAudio/CoreAudioDecoder.m +++ b/Plugins/CoreAudio/CoreAudioDecoder.m @@ -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 diff --git a/Plugins/CueSheet/CueSheetMetadataReader.m b/Plugins/CueSheet/CueSheetMetadataReader.m index 3b20afa30..1a136a265 100644 --- a/Plugins/CueSheet/CueSheetMetadataReader.m +++ b/Plugins/CueSheet/CueSheetMetadataReader.m @@ -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]; } diff --git a/Plugins/FFMPEG/FFMPEGDecoder.m b/Plugins/FFMPEG/FFMPEGDecoder.m index b23e67a79..9fcc09be3 100644 --- a/Plugins/FFMPEG/FFMPEGDecoder.m +++ b/Plugins/FFMPEG/FFMPEGDecoder.m @@ -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 { diff --git a/Plugins/Flac/FlacDecoder.m b/Plugins/Flac/FlacDecoder.m index 1ce584ead..53d29bca1 100644 --- a/Plugins/Flac/FlacDecoder.m +++ b/Plugins/Flac/FlacDecoder.m @@ -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 { diff --git a/Plugins/GME/GameDecoder.m b/Plugins/GME/GameDecoder.m index 379ad0fde..d98773653 100644 --- a/Plugins/GME/GameDecoder.m +++ b/Plugins/GME/GameDecoder.m @@ -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 { diff --git a/Plugins/GME/GameMetadataReader.m b/Plugins/GME/GameMetadataReader.m index 93ab45a10..99bd1faa6 100644 --- a/Plugins/GME/GameMetadataReader.m +++ b/Plugins/GME/GameMetadataReader.m @@ -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); diff --git a/Plugins/HighlyComplete/HighlyComplete/HCDecoder.mm b/Plugins/HighlyComplete/HighlyComplete/HCDecoder.mm index aeb995001..d804735de 100644 --- a/Plugins/HighlyComplete/HighlyComplete/HCDecoder.mm +++ b/Plugins/HighlyComplete/HighlyComplete/HCDecoder.mm @@ -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 { diff --git a/Plugins/Hively/Hively/HVLDecoder.m b/Plugins/Hively/Hively/HVLDecoder.m index 6b064a385..2d45a339a 100644 --- a/Plugins/Hively/Hively/HVLDecoder.m +++ b/Plugins/Hively/Hively/HVLDecoder.m @@ -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 { diff --git a/Plugins/Hively/Hively/HVLMetadataReader.m b/Plugins/Hively/Hively/HVLMetadataReader.m index bdf127549..610504d1c 100644 --- a/Plugins/Hively/Hively/HVLMetadataReader.m +++ b/Plugins/Hively/Hively/HVLMetadataReader.m @@ -56,7 +56,7 @@ title = @""; } - return [NSDictionary dictionaryWithObject:title forKey:@"title"]; + return @{@"title": title}; } @end diff --git a/Plugins/MIDI/MIDI/MIDIDecoder.mm b/Plugins/MIDI/MIDI/MIDIDecoder.mm index 9fb4fa21e..787f612d8 100644 --- a/Plugins/MIDI/MIDI/MIDIDecoder.mm +++ b/Plugins/MIDI/MIDI/MIDIDecoder.mm @@ -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 { diff --git a/Plugins/Musepack/MusepackDecoder.m b/Plugins/Musepack/MusepackDecoder.m index b842a6329..56d895a8e 100644 --- a/Plugins/Musepack/MusepackDecoder.m +++ b/Plugins/Musepack/MusepackDecoder.m @@ -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 { diff --git a/Plugins/OpenMPT.old/OpenMPT/OMPTDecoder.mm b/Plugins/OpenMPT.old/OpenMPT/OMPTDecoder.mm index 5a3c615ce..0bd1234ce 100644 --- a/Plugins/OpenMPT.old/OpenMPT/OMPTDecoder.mm +++ b/Plugins/OpenMPT.old/OpenMPT/OMPTDecoder.mm @@ -93,17 +93,15 @@ static void g_push_archive_extensions(std::vector &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 { diff --git a/Plugins/OpenMPT.old/OpenMPT/OMPTMetadataReader.mm b/Plugins/OpenMPT.old/OpenMPT/OMPTMetadataReader.mm index 056960772..a593b79c8 100644 --- a/Plugins/OpenMPT.old/OpenMPT/OMPTMetadataReader.mm +++ b/Plugins/OpenMPT.old/OpenMPT/OMPTMetadataReader.mm @@ -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; } diff --git a/Plugins/OpenMPT/OpenMPT/OMPTDecoder.mm b/Plugins/OpenMPT/OpenMPT/OMPTDecoder.mm index 1c3599c7d..d17c1d4bf 100644 --- a/Plugins/OpenMPT/OpenMPT/OMPTDecoder.mm +++ b/Plugins/OpenMPT/OpenMPT/OMPTDecoder.mm @@ -90,17 +90,15 @@ static void g_push_archive_extensions(std::vector &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 { diff --git a/Plugins/OpenMPT/OpenMPT/OMPTMetadataReader.mm b/Plugins/OpenMPT/OpenMPT/OMPTMetadataReader.mm index 31d3a4be7..4f5d6193d 100644 --- a/Plugins/OpenMPT/OpenMPT/OMPTMetadataReader.mm +++ b/Plugins/OpenMPT/OpenMPT/OMPTMetadataReader.mm @@ -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; } diff --git a/Plugins/Opus/Opus/OpusDecoder.m b/Plugins/Opus/Opus/OpusDecoder.m index 9ef44cfb4..6978d7b60 100644 --- a/Plugins/Opus/Opus/OpusDecoder.m +++ b/Plugins/Opus/Opus/OpusDecoder.m @@ -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 { diff --git a/Plugins/Shorten/ShortenDecoder.mm b/Plugins/Shorten/ShortenDecoder.mm index 30819732e..c3ae63aa1 100644 --- a/Plugins/Shorten/ShortenDecoder.mm +++ b/Plugins/Shorten/ShortenDecoder.mm @@ -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 { diff --git a/Plugins/SilenceDecoder/SilenceDecoder/SilenceDecoder.m b/Plugins/SilenceDecoder/SilenceDecoder/SilenceDecoder.m index e8c44a72e..28ae9d307 100644 --- a/Plugins/SilenceDecoder/SilenceDecoder/SilenceDecoder.m +++ b/Plugins/SilenceDecoder/SilenceDecoder/SilenceDecoder.m @@ -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 { diff --git a/Plugins/Vorbis/VorbisDecoder.m b/Plugins/Vorbis/VorbisDecoder.m index b0cbd7742..582a11dc2 100644 --- a/Plugins/Vorbis/VorbisDecoder.m +++ b/Plugins/Vorbis/VorbisDecoder.m @@ -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 { diff --git a/Plugins/WavPack/WavPackDecoder.m b/Plugins/WavPack/WavPackDecoder.m index a1791e7fb..fb2e02590 100644 --- a/Plugins/WavPack/WavPackDecoder.m +++ b/Plugins/WavPack/WavPackDecoder.m @@ -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 { diff --git a/Plugins/libvgmPlayer/libvgmDecoder.mm b/Plugins/libvgmPlayer/libvgmDecoder.mm index bd00b5840..401d31969 100644 --- a/Plugins/libvgmPlayer/libvgmDecoder.mm +++ b/Plugins/libvgmPlayer/libvgmDecoder.mm @@ -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 { diff --git a/Plugins/libvgmPlayer/libvgmMetadataReader.mm b/Plugins/libvgmPlayer/libvgmMetadataReader.mm index 8c144ae06..4dfbc183d 100644 --- a/Plugins/libvgmPlayer/libvgmMetadataReader.mm +++ b/Plugins/libvgmPlayer/libvgmMetadataReader.mm @@ -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; } diff --git a/Plugins/sidplay/SidDecoder.mm b/Plugins/sidplay/SidDecoder.mm index 85525f1b9..461fa2754 100644 --- a/Plugins/sidplay/SidDecoder.mm +++ b/Plugins/sidplay/SidDecoder.mm @@ -188,17 +188,15 @@ static void sidTuneLoader(const char *fileName, std::vector &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 { diff --git a/Plugins/sidplay/SidMetadataReader.mm b/Plugins/sidplay/SidMetadataReader.mm index bd96f0b6d..9764aaffd 100644 --- a/Plugins/sidplay/SidMetadataReader.mm +++ b/Plugins/sidplay/SidMetadataReader.mm @@ -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 diff --git a/Plugins/vgmstream/vgmstream/VGMDecoder.m b/Plugins/vgmstream/vgmstream/VGMDecoder.m index 7b1d24020..929627f9f 100644 --- a/Plugins/vgmstream/vgmstream/VGMDecoder.m +++ b/Plugins/vgmstream/vgmstream/VGMDecoder.m @@ -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 { diff --git a/Preferences/Preferences/AppcastArrayController.m b/Preferences/Preferences/AppcastArrayController.m index 340ccf5e4..48d0e1b6a 100644 --- a/Preferences/Preferences/AppcastArrayController.m +++ b/Preferences/Preferences/AppcastArrayController.m @@ -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 diff --git a/Preferences/Preferences/MIDIFlavorBehaviorArrayController.m b/Preferences/Preferences/MIDIFlavorBehaviorArrayController.m index e3f1d434b..bcc5071a2 100644 --- a/Preferences/Preferences/MIDIFlavorBehaviorArrayController.m +++ b/Preferences/Preferences/MIDIFlavorBehaviorArrayController.m @@ -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 diff --git a/Preferences/Preferences/MIDIPluginBehaviorArrayController.m b/Preferences/Preferences/MIDIPluginBehaviorArrayController.m index 391b98735..cfd0e9cd0 100644 --- a/Preferences/Preferences/MIDIPluginBehaviorArrayController.m +++ b/Preferences/Preferences/MIDIPluginBehaviorArrayController.m @@ -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)); } diff --git a/Preferences/Preferences/PlaylistBehaviorArrayController.m b/Preferences/Preferences/PlaylistBehaviorArrayController.m index 414202f67..d7cc81dfa 100644 --- a/Preferences/Preferences/PlaylistBehaviorArrayController.m +++ b/Preferences/Preferences/PlaylistBehaviorArrayController.m @@ -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 diff --git a/Preferences/Preferences/ResamplerBehaviorArrayController.m b/Preferences/Preferences/ResamplerBehaviorArrayController.m index e845ef080..586015703 100644 --- a/Preferences/Preferences/ResamplerBehaviorArrayController.m +++ b/Preferences/Preferences/ResamplerBehaviorArrayController.m @@ -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 diff --git a/Preferences/Preferences/VolumeBehaviorArrayController.m b/Preferences/Preferences/VolumeBehaviorArrayController.m index 8cf95bc72..a5ea10d8c 100644 --- a/Preferences/Preferences/VolumeBehaviorArrayController.m +++ b/Preferences/Preferences/VolumeBehaviorArrayController.m @@ -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 diff --git a/Spotlight/SpotlightPlaylistEntry.m b/Spotlight/SpotlightPlaylistEntry.m index 4586fd851..08fc84d19 100644 --- a/Spotlight/SpotlightPlaylistEntry.m +++ b/Spotlight/SpotlightPlaylistEntry.m @@ -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 { diff --git a/Spotlight/SpotlightWindowController.m b/Spotlight/SpotlightWindowController.m index 7b0191846..10f56dac6 100644 --- a/Spotlight/SpotlightWindowController.m +++ b/Spotlight/SpotlightWindowController.m @@ -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]; } diff --git a/Utils/TrackingSlider.m b/Utils/TrackingSlider.m index b96e26daf..f14b01f55 100644 --- a/Utils/TrackingSlider.m +++ b/Utils/TrackingSlider.m @@ -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 {