Commit f2f9b875 authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: CAS: added profiles and implemented profile switcher

parent 3fb41a93
...@@ -26,9 +26,15 @@ ...@@ -26,9 +26,15 @@
#import <vlc_common.h> #import <vlc_common.h>
#import <vlc_url.h> #import <vlc_url.h>
@interface VLCConvertAndSave ()
@property (readwrite, retain) NSArray * profileNames;
@property (readwrite, retain) NSArray * profileValueList;
@property (readwrite, retain) NSMutableArray * currentProfile;
@end
@implementation VLCConvertAndSave @implementation VLCConvertAndSave
@synthesize MRL=_MRL, outputDestination=_outputDestination; @synthesize MRL=_MRL, outputDestination=_outputDestination, profileNames=_profileNames, profileValueList=_profileValueList, currentProfile=_currentProfile;
static VLCConvertAndSave *_o_sharedInstance = nil; static VLCConvertAndSave *_o_sharedInstance = nil;
...@@ -48,6 +54,22 @@ static VLCConvertAndSave *_o_sharedInstance = nil; ...@@ -48,6 +54,22 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
return _o_sharedInstance; return _o_sharedInstance;
} }
- (void)dealloc
{
if (_MRL)
[_MRL release];
if (_outputDestination)
[_outputDestination release];
if (_profileNames)
[_profileNames release];
if (_profileValueList)
[_profileValueList release];
if (_currentProfile)
[_currentProfile release];
[super dealloc];
}
- (void)awakeFromNib - (void)awakeFromNib
{ {
[_window setTitle: _NS("Convert & Save")]; [_window setTitle: _NS("Convert & Save")];
...@@ -60,6 +82,49 @@ static VLCConvertAndSave *_o_sharedInstance = nil; ...@@ -60,6 +82,49 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
[_destination_lbl setStringValue: _NS("Choose Destination")]; [_destination_lbl setStringValue: _NS("Choose Destination")];
[_destination_filename_stub_lbl setStringValue: _NS("Choose an output location")]; [_destination_filename_stub_lbl setStringValue: _NS("Choose an output location")];
[_destination_filename_lbl setHidden: YES]; [_destination_filename_lbl setHidden: YES];
_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];
[_profile_pop removeAllItems];
[_profile_pop addItemsWithTitles: _profileNames];
} }
- (void)toggleWindow - (void)toggleWindow
...@@ -77,6 +142,13 @@ static VLCConvertAndSave *_o_sharedInstance = nil; ...@@ -77,6 +142,13 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
- (IBAction)profileSelection:(id)sender - (IBAction)profileSelection:(id)sender
{ {
NSInteger index = [sender indexOfSelectedItem];
if (index != ([sender numberOfItems] - 1))
{
if (_currentProfile)
[_currentProfile release];
_currentProfile = [[NSMutableArray alloc] initWithArray: [[_profileValueList objectAtIndex:index] componentsSeparatedByString:@";"]];
}
} }
- (IBAction)customizeProfile:(id)sender - (IBAction)customizeProfile:(id)sender
...@@ -150,7 +222,6 @@ static VLCConvertAndSave *_o_sharedInstance = nil; ...@@ -150,7 +222,6 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
return NO; return NO;
} }
@end @end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment