Commit 2a67c7a4 authored by Felix Paul Kühne's avatar Felix Paul Kühne
Browse files

* added a summary-tab at the end of the wizard (mostly for debug-reasons, but...

* added a summary-tab at the end of the wizard (mostly for debug-reasons, but perhaps we want to keep that for the user as well?)
* implemented the entire logic (except encap-formats while transcoding)
* added data collection of all values
* fixed some l10n issues

The wizard is still not useable for streaming, since it does not communicate the settings to the core yet. Additionally, various things still need to be done (see TODO at the beginning of the file).
parent 6febcbfe
......@@ -30,8 +30,7 @@
"o_btn_forward" = id;
"o_t1_btn_mrInfo_strmg" = id;
"o_t1_btn_mrInfo_trnscd" = id;
"o_t1_rdo_streaming" = id;
"o_t1_rdo_transcode" = id;
"o_t1_matrix_strmgOrTrnscd" = id;
"o_t1_txt_notice" = id;
"o_t1_txt_text" = id;
"o_t1_txt_title" = id;
......@@ -41,8 +40,7 @@
"o_t2_fld_pathToNewStrm" = id;
"o_t2_fld_prtExtrctFrom" = id;
"o_t2_fld_prtExtrctTo" = id;
"o_t2_rdo_exstPlstItm" = id;
"o_t2_rdo_newStrm" = id;
"o_t2_matrix_inputSourceType" = id;
"o_t2_tbl_plst" = id;
"o_t2_text" = id;
"o_t2_title" = id;
......@@ -87,6 +85,28 @@
"o_t7_text" = id;
"o_t7_title" = id;
"o_t7_txt_saveFileTo" = id;
"o_t8_fld_destination" = id;
"o_t8_fld_encapFormat" = id;
"o_t8_fld_inptStream" = id;
"o_t8_fld_partExtract" = id;
"o_t8_fld_sap" = id;
"o_t8_fld_saveFileTo" = id;
"o_t8_fld_strmgMthd" = id;
"o_t8_fld_trnscdAudio" = id;
"o_t8_fld_trnscdVideo" = id;
"o_t8_fld_ttl" = id;
"o_t8_txt_destination" = id;
"o_t8_txt_encapFormat" = id;
"o_t8_txt_inputStream" = id;
"o_t8_txt_partExtract" = id;
"o_t8_txt_sap" = id;
"o_t8_txt_saveFileTo" = id;
"o_t8_txt_strmgMthd" = id;
"o_t8_txt_text" = id;
"o_t8_txt_title" = id;
"o_t8_txt_trnscdAudio" = id;
"o_t8_txt_trnscdVideo" = id;
"o_t8_txt_ttl" = id;
"o_tab_pageHolder" = id;
"o_wh_btn_okay" = id;
"o_wh_txt_text" = id;
......
......@@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
<string>62 303 356 241 0 0 800 578 </string>
<string>397 577 356 241 0 0 1440 878 </string>
<key>IBFramework Version</key>
<string>437.0</string>
<key>IBLockedObjects</key>
......@@ -11,13 +11,13 @@
<integer>6</integer>
<integer>14</integer>
<integer>10</integer>
<integer>270</integer>
</array>
<key>IBOpenObjects</key>
<array>
<integer>268</integer>
<integer>6</integer>
</array>
<key>IBSystem Version</key>
<string>8B15</string>
<string>8C40</string>
</dict>
</plist>
......@@ -29,29 +29,40 @@
@interface VLCWizard : NSObject
{
IBOutlet id o_btn_backward;
/* general items */
IBOutlet id o_btn_backward;
IBOutlet id o_btn_cancel;
IBOutlet id o_btn_forward;
IBOutlet id o_tab_pageHolder;
IBOutlet id o_wizard_window;
IBOutlet id o_wizardhelp_window;
IBOutlet id o_wh_txt_title;
IBOutlet id o_wh_txt_text;
IBOutlet id o_wh_btn_okay;
/* page one ("Hello") */
IBOutlet id o_t1_btn_mrInfo_strmg;
IBOutlet id o_t1_btn_mrInfo_trnscd;
IBOutlet id o_t1_rdo_streaming;
IBOutlet id o_t1_rdo_transcode;
IBOutlet id o_t1_matrix_strmgOrTrnscd;
IBOutlet id o_t1_txt_notice;
IBOutlet id o_t1_txt_text;
IBOutlet id o_t1_txt_title;
/* page two ("Input") */
IBOutlet id o_t2_box_prtExtrct;
IBOutlet id o_t2_ckb_enblPartExtrct;
IBOutlet id o_t2_btn_chooseFile;
IBOutlet id o_t2_fld_pathToNewStrm;
IBOutlet id o_t2_fld_prtExtrctFrom;
IBOutlet id o_t2_fld_prtExtrctTo;
IBOutlet id o_t2_rdo_exstPlstItm;
IBOutlet id o_t2_rdo_newStrm;
IBOutlet id o_t2_matrix_inputSourceType;
IBOutlet id o_t2_tbl_plst;
IBOutlet id o_t2_text;
IBOutlet id o_t2_title;
IBOutlet id o_t2_txt_prtExtrctFrom;
IBOutlet id o_t2_txt_prtExtrctTo;
/* page one ("Streaming 1") */
IBOutlet id o_t3_box_dest;
IBOutlet id o_t3_box_strmgMthd;
IBOutlet id o_t3_fld_address;
......@@ -59,6 +70,8 @@
IBOutlet id o_t3_txt_destInfo;
IBOutlet id o_t3_txt_text;
IBOutlet id o_t3_txt_title;
/* page four ("Transcode 1") */
IBOutlet id o_t4_box_audio;
IBOutlet id o_t4_box_video;
IBOutlet id o_t4_ckb_audio;
......@@ -75,9 +88,13 @@
IBOutlet id o_t4_txt_videoCodec;
IBOutlet id o_t4_txt_hintAudio;
IBOutlet id o_t4_txt_hintVideo;
/* page five ("Encap") */
IBOutlet id o_t5_matrix_encap;
IBOutlet id o_t5_text;
IBOutlet id o_t5_title;
/* page six ("Streaming 2") */
IBOutlet id o_t6_ckb_sap;
IBOutlet id o_t6_fld_sap;
IBOutlet id o_t6_fld_ttl;
......@@ -86,17 +103,41 @@
IBOutlet id o_t6_txt_ttl;
IBOutlet id o_t6_btn_mrInfo_ttl;
IBOutlet id o_t6_btn_mrInfo_sap;
/* page seven ("Transcode 2") */
IBOutlet id o_t7_btn_chooseFile;
IBOutlet id o_t7_fld_filePath;
IBOutlet id o_t7_text;
IBOutlet id o_t7_title;
IBOutlet id o_t7_txt_saveFileTo;
IBOutlet id o_tab_pageHolder;
IBOutlet id o_wizard_window;
IBOutlet id o_wizardhelp_window;
IBOutlet id o_wh_txt_title;
IBOutlet id o_wh_txt_text;
IBOutlet id o_wh_btn_okay;
/* page eight ("Summary") */
IBOutlet id o_t8_fld_destination;
IBOutlet id o_t8_fld_encapFormat;
IBOutlet id o_t8_fld_inptStream;
IBOutlet id o_t8_fld_partExtract;
IBOutlet id o_t8_fld_sap;
IBOutlet id o_t8_fld_saveFileTo;
IBOutlet id o_t8_fld_strmgMthd;
IBOutlet id o_t8_fld_trnscdAudio;
IBOutlet id o_t8_fld_trnscdVideo;
IBOutlet id o_t8_fld_ttl;
IBOutlet id o_t8_txt_destination;
IBOutlet id o_t8_txt_encapFormat;
IBOutlet id o_t8_txt_inputStream;
IBOutlet id o_t8_txt_partExtract;
IBOutlet id o_t8_txt_sap;
IBOutlet id o_t8_txt_saveFileTo;
IBOutlet id o_t8_txt_strmgMthd;
IBOutlet id o_t8_txt_text;
IBOutlet id o_t8_txt_title;
IBOutlet id o_t8_txt_trnscdAudio;
IBOutlet id o_t8_txt_trnscdVideo;
IBOutlet id o_t8_txt_ttl;
NSMutableDictionary * o_userSelections;
NSArray * o_videoCodecs;
NSArray * o_audioCodecs;
}
- (IBAction)cancelRun:(id)sender;
- (IBAction)nextTab:(id)sender;
......@@ -119,4 +160,5 @@
+ (VLCWizard *)sharedInstance;
- (void)showWizard;
- (void)showSummary;
@end
......@@ -23,15 +23,20 @@
/*****************************************************************************
* Note: this code is based upon ../wxwindows/wizard.cpp,
* written by Clment Stenac.
* Note: this code is based upon ../wxwindows/wizard.cpp and
* ../wxwindows/streamdata.h; both written by Clment Stenac.
*****************************************************************************/
/* TODO:
- implementation of the logic, i.e. handling of the collected values, respective manipulation of the GUI, start of the stream
- move some arrays to an external header file
- some GUI things (e.g. radio buttons on page 2, etc. - see FIXMEs)
- l10n string fixes (both in OSX and WX) */
- start of the streaming/transcoding
- some GUI things
- l10n string fixes (both in OSX and WX)
- implementation of correct encap-selection for transcoding
- fill the playlist-table on t2
- implement l10n on t8?
- implement prevTab
- see FIXME's
*/
/*****************************************************************************
......@@ -70,31 +75,96 @@ static VLCWizard *_o_sharedInstance = nil;
/* some minor cleanup */
[o_t2_tbl_plst setEnabled:NO];
[o_wizardhelp_window setExcludedFromWindowsMenu:YES];
/* FIXME: make the both arrays global */
o_userSelections = [[NSMutableDictionary alloc] init];
/* add audio-codecs for transcoding */
/* add audio-bitrates for transcoding */
NSArray * audioBitratesArray;
audioBitratesArray = [NSArray arrayWithObjects: @"512", @"256", @"192", @"128", @"64", @"32", @"16", nil ];
[o_t4_pop_audioBitrate removeAllItems];
[o_t4_pop_audioBitrate addItemsWithTitles: audioBitratesArray];
[o_t4_pop_audioBitrate selectItemWithTitle: @"192"];
/* add video-codecs for transcoding */
/* add video-bitrates for transcoding */
NSArray * videoBitratesArray;
videoBitratesArray = [NSArray arrayWithObjects: @"3072", @"2048", @"1024", @"768", @"512", @"256", @"192", @"128", @"64", @"32", @"16", nil ];
[o_t4_pop_videoBitrate removeAllItems];
[o_t4_pop_videoBitrate addItemsWithTitles: videoBitratesArray];
[o_t4_pop_videoBitrate selectItemWithTitle: @"1024"];
/* FIXME: fill the codec-popups as well */
/* fill 2 global arrays with arrays containing all codec-related information
* - one array per codec named by its short name to define the encap-compability,
* cmd-names, real names, more info in the order: realName, shortName,
* moreInfo, encaps */
NSArray * o_mp1v;
NSArray * o_mp2v;
NSArray * o_mp4v;
NSArray * o_div1;
NSArray * o_div2;
NSArray * o_div3;
NSArray * o_h263;
NSArray * o_h264;
NSArray * o_wmv1;
NSArray * o_wmv2;
NSArray * o_mjpg;
NSArray * o_theo;
NSArray * o_dummyVid;
o_mp1v = [NSArray arrayWithObjects: @"MPEG-1 Video", @"mp1v", _NS("MPEG-1 Video codec"), @"MUX_PS", @"MUX_TS", @"MUX_MPEG", @"MUX_OGG", @"MUX_RAW", @"NO", @"NO", @"NO", @"NO", nil];
o_mp2v = [NSArray arrayWithObjects: @"MPEG-2 Video", @"mp2v", _NS("MPEG-2 Video codec"), @"MUX_PS", @"MUX_TS", @"MUX_MPEG", @"MUX_OGG", @"MUX_RAW", @"NO", @"NO", @"NO", @"NO", nil];
o_mp4v = [NSArray arrayWithObjects: @"MPEG-4 Video", @"mp4v", _NS("MPEG-4 Video codec"), @"MUX_PS", @"MUX_TS", @"MUX_MPEG", @"MUX_ASF", @"MUX_MP4", @"MUX_OGG", @"MUX_RAW", @"NO", @"NO", nil];
o_div1 = [NSArray arrayWithObjects: @"DIVX 1", @"DIV1", _NS("DivX first version"), @"MUX_TS", @"MUX_MPEG", @"MUX_ASF", @"MUX_OGG", @"NO", @"NO", @"NO", @"NO", @"NO", nil];
o_div2 = [NSArray arrayWithObjects: @"DIVX 2", @"DIV2", _NS("DivX second version"), @"MUX_TS", @"MUX_MPEG", @"MUX_ASF", @"MUX_OGG", @"NO", @"NO", @"NO", @"NO", @"NO", nil];
o_div3 = [NSArray arrayWithObjects: @"DIVX 3", @"DIV3", _NS("DivX third version"), @"MUX_TS", @"MUX_MPEG", @"MUX_ASF", @"MUX_OGG", @"NO", @"NO", @"NO", @"NO", @"NO", nil];
o_h263 = [NSArray arrayWithObjects: @"H 263", @"H263", _NS("H263 is a video codec optimized for videoconference (low rates)"), @"MUX_TS", @"MUX_AVI", @"NO", @"NO", @"NO", @"NO", @"NO", @"NO", @"NO", nil];
o_h264 = [NSArray arrayWithObjects: @"H 264", @"H264", _NS("H264 is a new video codec"), @"MUX_TS", @"MUX_AVI", @"NO", @"NO", @"NO", @"NO", @"NO", @"NO", @"NO", nil];
o_wmv1 = [NSArray arrayWithObjects: @"WMV 1", @"WMV1", _NS("WMV (Windows Media Video) 1"), @"MUX_TS", @"MUX_MPEG", @"MUX_ASF", @"MUX_OGG", @"NO", @"NO", @"NO", @"NO", @"NO", nil];
o_wmv2 = [NSArray arrayWithObjects: @"WMV 2", @"WMV2", _NS("WMV (Windows Media Video) 2"), @"MUX_TS", @"MUX_MPEG", @"MUX_ASF", @"MUX_OGG", @"NO", @"NO", @"NO", @"NO", @"NO", nil];
o_mjpg = [NSArray arrayWithObjects: @"MJPEG", @"MJPG", _NS("MJPEG consists of a series of JPEG pictures"), @"MUX_TS", @"MUX_MPEG", @"MUX_ASF", @"MUX_OGG", @"NO", @"NO", @"NO", @"NO", @"NO", nil];
o_theo = [NSArray arrayWithObjects: @"Theora", @"theo", _NS("Theora is a free general-purpose codec"), @"MUX_TS", @"NO", @"NO", @"NO", @"NO", @"NO", @"NO", @"NO", @"NO", nil];
o_dummyVid = [NSArray arrayWithObjects: @"Dummy", @"dummy", _NS("Dummy codec (do not transcode)"), @"MUX_PS", @"MUX_TS", @"MUX_MPEG", @"MUX_ASF", @"MUX_MP4", @"MUX_OGG", @"MUX_WAV", @"MUX_RAW", @"MUX_MOV", nil];
o_videoCodecs = [[NSArray alloc] initWithObjects: o_mp1v, o_mp2v, o_mp4v, o_div1, o_div2, o_div3, o_h263, o_h264, o_wmv1, o_wmv2, o_mjpg, o_theo, o_dummyVid, nil];
[o_t4_pop_videoCodec removeAllItems];
unsigned int x;
x = 0;
while (x != [o_videoCodecs count])
{
[o_t4_pop_videoCodec addItemWithTitle:[[o_videoCodecs objectAtIndex:x] objectAtIndex:0]];
x = (x + 1);
}
NSArray * o_mpga;
NSArray * o_mp3;
NSArray * o_mp4a;
NSArray * o_a52;
NSArray * o_vorb;
NSArray * o_flac;
NSArray * o_spx;
NSArray * o_s16l;
NSArray * o_fl32;
NSArray * o_dummyAud;
o_mpga = [NSArray arrayWithObjects: @"MPEG Audio", @"mpga", _NS("The standard MPEG audio (1/2) format"), @"MUX_PS", @"MUX_TS", @"MUX_MPEG", @"MUX_ASF", @"MUX_OGG", @"MUX_RAW", @"-1", @"-1", @"-1", nil];
o_mp3 = [NSArray arrayWithObjects: @"MP3", @"mp3", _NS("MPEG Audio Layer 3"), @"MUX_PS", @"MUX_TS", @"MUX_MPEG", @"MUX_ASF", @"MUX_OGG", @"MUX_RAW", @"-1", @"-1", @"-1", nil];
o_mp4a = [NSArray arrayWithObjects: @"MPEG 4 Audio", @"mp4a", _NS("Audio format for MPEG4"), @"MUX_TS", @"MUX_MP4", @"-1", @"-1", @"-1", @"-1", @"-1", @"-1", @"-1", nil];
o_a52 = [NSArray arrayWithObjects: @"A/52", @"a52", _NS("DVD audio format"), @"MUX_PS", @"MUX_TS", @"MUX_MPEG", @"MUX_ASF", @"MUX_OGG", @"MUX_RAW", @"-1", @"-1", @"-1", nil];
o_vorb = [NSArray arrayWithObjects: @"Vorbis", @"vorb", _NS("Vorbis is a free audio codec"), @"MUX_OGG", @"-1", @"-1", @"-1", @"-1", @"-1", @"-1", @"-1", @"-1", nil];
o_flac = [NSArray arrayWithObjects: @"FLAC", @"flac", _NS("FLAC is a lossless audio codec"), @"MUX_OGG", @"MUX_RAW", @"-1", @"-1", @"-1", @"-1", @"-1", @"-1", @"-1", nil];
o_spx = [NSArray arrayWithObjects: @"Speex", @"spx", _NS("A free audio codec dedicated to compression of voice"), @"MUX_OGG", @"-1", @"-1", @"-1", @"-1", @"-1", @"-1", @"-1", @"-1", nil];
o_s16l = [NSArray arrayWithObjects: @"Uncompressed, integer", @"s16l", _NS("Uncompressed audio samples"), @"MUX_WAV", @"-1", @"-1", @"-1", @"-1", @"-1", @"-1", @"-1", @"-1", nil];
o_fl32 = [NSArray arrayWithObjects: @"Uncompressed, floating", @"fl32", _NS("Uncompressed audio samples"), @"MUX_WAV", @"-1", @"-1", @"-1", @"-1", @"-1", @"-1", @"-1", @"-1", nil];
o_dummyAud = [NSArray arrayWithObjects: @"Dummy", @"dummy", _NS("Dummy codec (do not transcode)"), @"MUX_PS", @"MUX_TS", @"MUX_MPEG", @"MUX_ASF", @"MUX_MP4", @"MUX_OGG", @"MUX_RAW", @"MUX_MOV", @"MUX_WAV", nil];
o_audioCodecs = [[NSArray alloc] initWithObjects: o_mpga, o_mp3, o_mp4a, o_a52, o_vorb, o_flac, o_spx, o_s16l, o_fl32, o_dummyAud, nil];
[o_t4_pop_audioCodec removeAllItems];
x = 0;
while (x != [o_audioCodecs count])
{
[o_t4_pop_audioCodec addItemWithTitle:[[o_audioCodecs objectAtIndex:x] objectAtIndex:0]];
x = (x + 1);
}
}
- (void)showWizard
{
/* just present the window to the user */
/* we might need a method to reset the window first */
/* FIXME: we need a method to reset the window first */
[o_tab_pageHolder selectFirstTabViewItem:self];
[o_wizard_window center];
......@@ -108,9 +178,9 @@ static VLCWizard *_o_sharedInstance = nil;
/* method is called from intf.m (in method openWizard) */
/* general items */
[o_btn_backward setTitle: _NS("< Back")];
[o_btn_backward setTitle: [@"< " stringByAppendingString: _NS("Back")]];
[o_btn_cancel setTitle: _NS("Cancel")];
[o_btn_forward setTitle: _NS("Next >")];
[o_btn_forward setTitle: [_NS("Next") stringByAppendingString:@" >"]];
[o_wizard_window setTitle: _NS("Streaming/Transcoding Wizard")];
/* page one ("Hello") */
......@@ -119,16 +189,17 @@ static VLCWizard *_o_sharedInstance = nil;
[o_t1_btn_mrInfo_strmg setTitle: _NS("More Info")];
[o_t1_btn_mrInfo_trnscd setTitle: _NS("More Info")];
[o_t1_txt_notice setStringValue: _NS("This wizard only gives access to a small subset of VLC's streaming and transcoding capabilities. Use the Open and Stream Output dialogs to get all of them")];
[o_t1_rdo_streaming setTitle: _NS("Stream to network")];
[o_t1_rdo_transcode setTitle: _NS("Transcode/Save to file")];
[[o_t1_matrix_strmgOrTrnscd cellAtRow:0 column:0] setTitle: _NS("Stream to network")];
[[o_t1_matrix_strmgOrTrnscd cellAtRow:1 column:0] setTitle: _NS("Transcode/Save to file")];
/* page two ("Input") */
[o_t2_title setStringValue: _NS("Choose input")];
[o_t2_text setStringValue: _NS("Choose here your input stream")];
[o_t2_rdo_newStrm setTitle: _NS("Select a stream")];
[o_t2_rdo_exstPlstItm setTitle: _NS("Existing playlist item")];
[[o_t2_matrix_inputSourceType cellAtRow:0 column:0] setTitle: _NS("Select a stream")];
[[o_t2_matrix_inputSourceType cellAtRow:1 column:0] setTitle: _NS("Existing playlist item")];
[o_t2_btn_chooseFile setTitle: _NS("Choose...")];
[[[o_t2_tbl_plst tableColumnWithIdentifier:@"name"] headerCell] setStringValue: _NS("Name")];
[[[o_t2_tbl_plst tableColumnWithIdentifier:@"uri"] headerCell] setStringValue: _NS("URI")];
[o_t2_box_prtExtrct setTitle: _NS("Partial Extract")];
[o_t2_ckb_enblPartExtrct setTitle: _NS("Enable")];
[o_t2_txt_prtExtrctFrom setStringValue: _NS("From")];
......@@ -179,6 +250,10 @@ static VLCWizard *_o_sharedInstance = nil;
[o_t7_txt_saveFileTo setStringValue: _NS("Select the file to save to")];
[o_t7_btn_chooseFile setTitle: _NS("Choose...")];
/* page eight ("Summary") */
/* FIXME: currently not implemented as it unsure whether we show this tab
* to the public or use it for debugging only */
/* wizard help window */
[o_wh_btn_okay setTitle: _NS("OK")];
}
......@@ -190,8 +265,239 @@ static VLCWizard *_o_sharedInstance = nil;
- (IBAction)nextTab:(id)sender
{
/* only a stub atm; needs to be implemented correctly later on */
[o_tab_pageHolder selectNextTabViewItem:self];
if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString: @"Hello"])
{
/* check whether the user wants to stream or just to transcode;
* store information for later usage */
NSString *o_mode;
o_mode = [[o_t1_matrix_strmgOrTrnscd selectedCell] title];
if( [o_mode isEqualToString: _NS("Stream to network")] )
{
[o_userSelections setObject:@"strmg" forKey:@"trnscdOrStrmg"];
}else{
[o_userSelections setObject:@"trnscd" forKey:@"trnscdOrStrmg"];
}
[o_tab_pageHolder selectTabViewItemAtIndex:1];
}
else if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString: @"Input"])
{
/* check whether partialExtract is enabled and store the values, if needed */
if ([o_t2_ckb_enblPartExtrct state] == NSOnState)
{
[o_userSelections setObject:@"YES" forKey:@"partExtract"];
[o_userSelections setObject:[o_t2_fld_prtExtrctFrom stringValue] forKey:@"partExtractFrom"];
[o_userSelections setObject:[o_t2_fld_prtExtrctTo stringValue] forKey:@"partExtractTo"];
}else{
[o_userSelections setObject:@"NO" forKey:@"partExtract"];
}
/* check whether we use an existing pl-item or add an new one;
* store the path or the index and set a flag.
* complain to the user if s/he didn't provide a path */
NSString *o_mode;
o_mode = [[o_t2_matrix_inputSourceType selectedCell] title];
if( [o_mode isEqualToString: _NS("Select a stream")] )
{
[o_userSelections setObject:@"YES" forKey:@"newStrm"];
if ([[o_t2_fld_pathToNewStrm stringValue] isEqualToString: @""])
{
/* FIXME: we should complain to the user that s/he didn't provide a path */
}else{
[o_userSelections setObject:[o_t2_fld_pathToNewStrm stringValue] forKey:@"pathToNewStrm"];
}
}else{
[o_userSelections setObject:@"NO" forKey:@"newStrm"];
NSNumber * myNumber = [[NSNumber alloc] initWithInt:[o_t2_tbl_plst selectedRow]];
[o_userSelections setObject:myNumber forKey:@"plItemIndex"];
}
/* show either "Streaming 1" or "Transcode 1" to the user */
if ([[o_userSelections objectForKey:@"trnscdOrStrmg"] isEqualToString:@"strmg"])
{
/* we are streaming */
[o_tab_pageHolder selectTabViewItemAtIndex:2];
}else{
/* we are just transcoding */
[o_tab_pageHolder selectTabViewItemAtIndex:3];
}
}
else if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString: @"Streaming 1"])
{
/* check which streaming method is selected and store it */
NSString *o_mode;
o_mode = [[o_t3_matrix_stmgMhd selectedCell] title];
if( [o_mode isEqualToString: _NS("HTTP")] )
{
[o_userSelections setObject:@"HTTP" forKey:@"stmgMhd"];
/* enable MPEG PS, MPEG TS, MPEG 1, OGG, RAW and ASF; select MPEG PS */
[[o_t5_matrix_encap cellAtRow:0 column:0] setEnabled:YES];
[[o_t5_matrix_encap cellAtRow:1 column:0] setEnabled:YES];
[[o_t5_matrix_encap cellAtRow:2 column:0] setEnabled:YES];
[[o_t5_matrix_encap cellAtRow:3 column:0] setEnabled:YES];
[[o_t5_matrix_encap cellAtRow:4 column:0] setEnabled:YES];
[[o_t5_matrix_encap cellAtRow:5 column:0] setEnabled:YES];
[[o_t5_matrix_encap cellAtRow:6 column:0] setEnabled:NO];
[[o_t5_matrix_encap cellAtRow:7 column:0] setEnabled:NO];
[[o_t5_matrix_encap cellAtRow:8 column:0] setEnabled:NO];
[o_t5_matrix_encap selectCellAtRow:0 column:0];
} else {
if( [o_mode isEqualToString: _NS("UDP Unicast")] )
{
[o_userSelections setObject:@"UDP-Unicast" forKey:@"stmgMhd"];
} else {
[o_userSelections setObject:@"UDP-Multicast" forKey:@"stmgMhd"];
}
/* disable all encap-formats but MPEG-TS and select it */
[[o_t5_matrix_encap cellAtRow:0 column:0] setEnabled:NO];
[[o_t5_matrix_encap cellAtRow:2 column:0] setEnabled:NO];
[[o_t5_matrix_encap cellAtRow:3 column:0] setEnabled:NO];
[[o_t5_matrix_encap cellAtRow:4 column:0] setEnabled:NO];
[[o_t5_matrix_encap cellAtRow:5 column:0] setEnabled:NO];
[[o_t5_matrix_encap cellAtRow:6 column:0] setEnabled:NO];
[[o_t5_matrix_encap cellAtRow:7 column:0] setEnabled:NO];
[[o_t5_matrix_encap cellAtRow:8 column:0] setEnabled:NO];
[[o_t5_matrix_encap cellAtRow:1 column:0] setEnabled:YES];
[o_t5_matrix_encap selectCellAtRow:1 column:0];
}
/* store the destination and check whether is it empty */
if( [[o_t3_fld_address stringValue] isEqualToString: @""] )
{ /* FIXME: complain to the user that "" is no valid dest. */
} else {
[o_userSelections setObject:[o_t3_fld_address stringValue] forKey:@"stmgDest"];
}
/* let's go to the encap-tab */
[o_tab_pageHolder selectTabViewItemAtIndex:4];
}
else if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString: @"Transcode 1"])
{
/* check whether the user wants to transcode the video-track and store the related options */
if ([o_t4_ckb_video state] == NSOnState)
{
NSNumber * theNum;
theNum = [NSNumber numberWithInt:[o_t4_pop_videoCodec indexOfSelectedItem]];
[o_userSelections setObject:@"YES" forKey:@"trnscdVideo"];
[o_userSelections setObject:[o_t4_pop_videoBitrate titleOfSelectedItem] forKey:@"trnscdVideoBitrate"];
[o_userSelections setObject:theNum forKey:@"trnscdVideoCodec"];
} else {
[o_userSelections setObject:@"NO" forKey:@"trnscdVideo"];
}
/* check whether the user wants to transcode the audio-track and store the related options */
if ([o_t4_ckb_audio state] == NSOnState)
{
NSNumber * theNum;
theNum = [NSNumber numberWithInt:[o_t4_pop_audioCodec indexOfSelectedItem]];
[o_userSelections setObject:@"YES" forKey:@"trnscdAudio"];
[o_userSelections setObject:[o_t4_pop_audioBitrate titleOfSelectedItem] forKey:@"trnscdAudioBitrate"];
[o_userSelections setObject:theNum forKey:@"trnscdAudioCodec"];
} else {
[o_userSelections setObject:@"NO" forKey:@"trnscdAudio"];
}
/* FIXME: re-enable the "Encap"-tab depending on the chosen codecs */
[o_tab_pageHolder selectTabViewItemAtIndex:4];
}
else if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString: @"Encap"])
{
/* get the chosen encap format and store it */
[o_userSelections setObject:[[o_t5_matrix_encap selectedCell] title] forKey:@"encapFormat"];
/* show either "Streaming 2" or "Transcode 2" to the user */
if ([[o_userSelections objectForKey:@"trnscdOrStrmg"] isEqualToString:@"strmg"])
{
/* we are streaming */
[o_tab_pageHolder selectTabViewItemAtIndex:5];
}else{
/* we are just transcoding */
[o_tab_pageHolder selectTabViewItemAtIndex:6];
}
}
else if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString: @"Streaming 2"])
{
/* store the chosen TTL */
[o_userSelections setObject:[o_t6_fld_ttl stringValue] forKey:@"ttl"];
/* check whether SAP is enabled and store the announce, if needed */
if ([o_t6_ckb_sap state] == NSOnState)
{
[o_userSelections setObject:@"YES" forKey:@"sap"];
[o_userSelections setObject:[o_t6_fld_sap stringValue] forKey:@"sapText"];
} else {
[o_userSelections setObject:@"NO" forKey:@"sap"];
}
/* go to "Summary" */
[self showSummary];
}
else if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString: @"Transcode 2"])
{
/* check whether the path != "" and store it */
if( [[o_t7_fld_filePath stringValue] isEqualToString: @""] )
{ /* FIXME: complain to the user that "" is no valid path */
} else {
[o_userSelections setObject:[o_t7_fld_filePath stringValue] forKey:@"trnscdFilePath"];
}
/* go to "Summary" */
[self showSummary];
}
}
- (void)showSummary
{
[o_btn_forward setTitle: _NS("Finish")];
if ([[o_userSelections objectForKey:@"newStrm"] isEqualToString: @"YES"])
{
[o_t8_fld_inptStream setStringValue:[o_userSelections objectForKey:@"pathToNewStrm"]];
} else {
[o_t8_fld_inptStream setStringValue:[[o_userSelections objectForKey:@"plItemIndex"] stringValue]];
}
if ([[o_userSelections objectForKey:@"partExtract"] isEqualToString: @"YES"])
{
[o_t8_fld_partExtract setStringValue: [[[[[_NS("yes") stringByAppendingString:@" - "] stringByAppendingString: _NS("from ")] stringByAppendingString: [o_userSelections objectForKey:@"partExtractFrom"]] stringByAppendingString: _NS(" to ")] stringByAppendingString: [o_userSelections objectForKey:@"partExtractTo"]]];
} else {
[o_t8_fld_partExtract setStringValue: _NS("no")];
}
if ([[o_userSelections objectForKey:@"trnscdOrStrmg"] isEqualToString:@"strmg"])
{
/* we are streaming; no transcoding allowed atm */
[o_t8_fld_saveFileTo setStringValue: @"-"];
[o_t8_fld_trnscdAudio setStringValue: @"-"];
[o_t8_fld_trnscdVideo setStringValue: @"-"];
[o_t8_fld_strmgMthd setStringValue: [o_userSelections objectForKey:@"stmgMhd"]];
[o_t8_fld_destination setStringValue: [o_userSelections objectForKey:@"stmgDest"]];
[o_t8_fld_ttl setStringValue: [o_userSelections objectForKey:@"ttl"]];
if ([[o_userSelections objectForKey:@"sap"] isEqualToString: @"YES"])
{
[o_t8_fld_sap setStringValue: [[_NS("yes") stringByAppendingString:@": "] stringByAppendingString:[o_userSelections objectForKey:@"sapText"]]];
}else{
[o_t8_fld_sap setStringValue: _NS("no")];
}
} else {
/* we are transcoding */
[o_t8_fld_strmgMthd setStringValue: @"-"];
[o_t8_fld_destination setStringValue: @"-"];
[o_t8_fld_ttl setStringValue: @"-"];
[o_t8_fld_sap setStringValue: @"-"];
if ([[o_userSelections objectForKey:@"trnscdVideo"] isEqualToString:@"YES"])
{
[o_t8_fld_trnscdVideo setStringValue: [[[[[_NS("yes") stringByAppendingString:@": "] stringByAppendingString: [[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdVideoCodec"] intValue]] objectAtIndex:0]] stringByAppendingString:@" @ "] stringByAppendingString: [o_userSelections objectForKey:@"trnscdVideoBitrate"]] stringByAppendingString:@" kb/s"]];
}else{