vlc | branch: master | Felix Paul Kühne <[email protected]> | Sat Jul 14 14:13:03 2012 +0200| [51c14c7676e64ac8acf94b173d0b55095f2473cd] | committer: Felix Paul Kühne
macosx: CAS: move pre-defined profiles to NSDefaults, so we can easily change and expand them > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=51c14c7676e64ac8acf94b173d0b55095f2473cd --- modules/gui/macosx/ConvertAndSave.m | 91 ++++++++++++++++++++--------------- 1 file changed, 52 insertions(+), 39 deletions(-) diff --git a/modules/gui/macosx/ConvertAndSave.m b/modules/gui/macosx/ConvertAndSave.m index 9f007c4..8ad1197 100644 --- a/modules/gui/macosx/ConvertAndSave.m +++ b/modules/gui/macosx/ConvertAndSave.m @@ -52,6 +52,54 @@ static VLCConvertAndSave *_o_sharedInstance = nil; #pragma mark - #pragma mark Initialization ++ (void)initialize{ + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + + /* We are using the same format as the Qt4 intf here: + * Container(string), transcode video(bool), transcode audio(bool), + * use subtitles(bool), video codec(string), video bitrate(integer), + * scale(float), fps(float), width(integer, height(integer), + * audio codec(string), audio bitrate(integer), channels(integer), + * samplerate(integer), subtitle codec(string), subtitle overlay(bool) */ + NSArray * defaultProfiles = [[NSArray alloc] initWithObjects: + @"mp4;1;1;0;h264;0;0;0;0;0;mpga;128;2;44100;0;1", + @"webm;1;1;0;VP80;2000;0;0;0;0;vorb;128;2;44100;0;1", + @"ts;1;1;0;h264;800;1;0;0;0;mpga;128;2;44100;0;0", + @"ts;1;1;0;drac;800;1;0;0;0;mpga;128;2;44100;0;0", + @"ogg;1;1;0;theo;800;1;0;0;0;vorb;128;2;44100;0;0", + @"ogg;1;1;0;theo;800;1;0;0;0;flac;128;2;44100;0;0", + @"ts;1;1;0;mp2v;800;1;0;0;0;mpga;128;2;44100;0;0", + @"asf;1;1;0;WMV2;800;1;0;0;0;wma2;128;2;44100;0;0", + @"asf;1;1;0;DIV3;800;1;0;0;0;mp3;128;2;44100;0;0", + @"ogg;1;1;0;none;800;1;0;0;0;vorb;128;2;44100;none;0", + @"raw;1;1;0;none;800;1;0;0;0;mp3;128;2;44100;none;0", + @"mp4;1;1;0;none;800;1;0;0;0;mpga;128;2;44100;none;0", + @"raw;1;1;0;none;800;1;0;0;0;flac;128;2;44100;none;0", + @"wav;1;1;0;none;800;1;0;0;0;s16l;128;2;44100;none;0", nil]; + + NSArray * defaultProfileNames = [[NSArray alloc] initWithObjects: + @"Video - H.264 + MP3 (MP4)", + @"Video - VP80 + Vorbis (Webm)", + @"Video - H.264 + MP3 (TS)", + @"Video - Dirac + MP3 (TS)", + @"Video - Theora + Vorbis (OGG)", + @"Video - Theora + Flac (OGG)", + @"Video - MPEG-2 + MPGA (TS)", + @"Video - WMV + WMA (ASF)", + @"Video - DIV3 + MP3 (ASF)", + @"Audio - Vorbis (OGG)", + @"Audio - MP3", + @"Audio - MP3 (MP4)", + @"Audio - FLAC", + @"Audio - CD", + nil]; + + NSDictionary *appDefaults = [NSDictionary dictionaryWithObjectsAndKeys:defaultProfiles, @"CASProfiles", defaultProfileNames, @"CASProfileNames", nil]; + + [defaults registerDefaults:appDefaults]; + [defaultProfiles release]; +} + + (VLCConvertAndSave *)sharedInstance { return _o_sharedInstance ? _o_sharedInstance : [[self alloc] init]; @@ -131,45 +179,10 @@ static VLCConvertAndSave *_o_sharedInstance = nil; [_customize_encap_matrix putCell:blankCell atRow:3 column:2]; [_customize_encap_matrix putCell:blankCell atRow:3 column:3]; - _profileNames = [[NSArray alloc] initWithObjects: - @"Video - H.264 + MP3 (MP4)", - @"Video - VP80 + Vorbis (Webm)", - @"Video - H.264 + MP3 (TS)", - @"Video - Dirac + MP3 (TS)", - @"Video - Theora + Vorbis (OGG)", - @"Video - Theora + Flac (OGG)", - @"Video - MPEG-2 + MPGA (TS)", - @"Video - WMV + WMA (ASF)", - @"Video - DIV3 + MP3 (ASF)", - @"Audio - Vorbis (OGG)", - @"Audio - MP3", - @"Audio - MP3 (MP4)", - @"Audio - FLAC", - @"Audio - CD", -// _NS("Custom"), - nil]; - - /* We are using the same format as the Qt4 intf here: - * Container(string), transcode video(bool), transcode audio(bool), - * use subtitles(bool), video codec(string), video bitrate(integer), - * scale(float), fps(float), width(integer, height(integer), - * audio codec(string), audio bitrate(integer), channels(integer), - * samplerate(integer), subtitle codec(string), subtitle overlay(bool) */ - _profileValueList = [[NSArray alloc] initWithObjects: - @"mp4;1;1;0;h264;0;0;0;0;0;mpga;128;2;44100;0;1", - @"webm;1;1;0;VP80;2000;0;0;0;0;vorb;128;2;44100;0;1", - @"ts;1;1;0;h264;800;1;0;0;0;mpga;128;2;44100;0;0", - @"ts;1;1;0;drac;800;1;0;0;0;mpga;128;2;44100;0;0", - @"ogg;1;1;0;theo;800;1;0;0;0;vorb;128;2;44100;0;0", - @"ogg;1;1;0;theo;800;1;0;0;0;flac;128;2;44100;0;0", - @"ts;1;1;0;mp2v;800;1;0;0;0;mpga;128;2;44100;0;0", - @"asf;1;1;0;WMV2;800;1;0;0;0;wma2;128;2;44100;0;0", - @"asf;1;1;0;DIV3;800;1;0;0;0;mp3;128;2;44100;0;0", - @"ogg;1;1;0;none;800;1;0;0;0;vorb;128;2;44100;none;0", - @"raw;1;1;0;none;800;1;0;0;0;mp3;128;2;44100;none;0", - @"mp4;1;1;0;none;800;1;0;0;0;mpga;128;2;44100;none;0", - @"raw;1;1;0;none;800;1;0;0;0;flac;128;2;44100;none;0", - @"wav;1;1;0;none;800;1;0;0;0;s16l;128;2;44100;none;0", nil]; + /* fetch profiles from defaults */ + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + _profileValueList = [[defaults arrayForKey:@"CASProfiles"] retain]; + _profileNames = [[defaults arrayForKey:@"CASProfileNames"] retain]; [_profile_pop removeAllItems]; [_profile_pop addItemsWithTitles: _profileNames]; _______________________________________________ vlc-commits mailing list [email protected] http://mailman.videolan.org/listinfo/vlc-commits
