- 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_btn_backward setEnabled:YES];
- [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];
- }
+ 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")] )
+ {
+ /* we will be streaming */
+ [o_userSelections setObject:@"strmg" forKey:@"trnscdOrStrmg"];
+ }
+ else
+ {
+ /* we will just do some transcoding */
+ [o_userSelections setObject:@"trnscd" forKey:@"trnscdOrStrmg"];
+ }
+ [o_btn_backward setEnabled:YES];
+ [o_tab_pageHolder selectTabViewItemAtIndex:1];
+
+ /* Fill the playlist with current playlist items */
+ [o_playlist_wizard reloadOutlineView];
+
+ }
+ 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;
+ BOOL stop;
+ stop = NO;
+ 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: @""])
+ {
+ /* set a flag that no file is selected */
+ stop = YES;
+ }
+ else
+ {
+ [o_userSelections setObject:[NSArray arrayWithObject:
+ [o_t2_fld_pathToNewStrm stringValue]] forKey:@"pathToStrm"];
+ }
+ }
+ else
+ {
+ if ([o_t2_tbl_plst numberOfSelectedRows] > 0)
+ {
+ int x = 0;
+ int y = [[o_t2_tbl_plst selectedRowIndexes] count];
+ NSMutableArray * tempArray = [[NSMutableArray alloc] init];
+ while( x != y )
+ {
+ playlist_item_t *p_item =
+ [[o_t2_tbl_plst itemAtRow:
+ [[o_t2_tbl_plst selectedRowIndexes]
+ indexGreaterThanOrEqualToIndex: x]] pointerValue];
+
+ if( p_item->i_children <= 0 )
+ {
+ char *psz_uri = input_item_GetURI( p_item->p_input );
+ [tempArray addObject: [NSString stringWithUTF8String:
+ psz_uri]];
+ free( psz_uri );
+ stop = NO;
+ }
+ else
+ stop = YES;
+ x += 1;
+ }
+ [o_userSelections setObject:[NSArray arrayWithArray: tempArray]
+ forKey:@"pathToStrm"];
+ [tempArray release];
+ }
+ else
+ {
+ /* set a flag that no item is selected */
+ stop = YES;
+ }
+ }
+
+ /* show either "Streaming 1" or "Transcode 1" to the user */
+ if (stop == NO)
+ {
+ if ([[o_userSelections objectForKey:@"trnscdOrStrmg"]
+ isEqualToString:@"strmg"])
+ {
+ /* we are streaming */
+ [o_tab_pageHolder selectTabViewItemAtIndex:2];
+ }else{
+ /* we are just transcoding */
+
+ /* rebuild the menues for the codec-selections */
+ [self rebuildCodecMenus];
+
+ [o_tab_pageHolder selectTabViewItemAtIndex:3];
+ }
+ } else {
+ /* show a sheet that the user didn't select a file */
+ NSBeginInformationalAlertSheet(_NS("No input selected"),
+ _NS("OK"), @"", @"", o_wizard_window, nil, nil, nil, nil,
+ _NS("No new stream or valid playlist item has been selected.\n\n"
+ "Choose one before going to the next page."));
+ }
+ }
+ else if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString:
+ @"Streaming 1"])
+ {
+ /* rebuild the menues for the codec-selections */
+ [self rebuildCodecMenus];
+
+ /* check which streaming method is selected and store it */
+ int mode;
+ mode = [[o_t3_matrix_stmgMhd selectedCell] tag];
+ if( mode == 0 )
+ {
+ /* HTTP Streaming */
+ [o_userSelections setObject:@"0" forKey:@"stmgMhd"];
+
+ /* disable all codecs which don't support MPEG PS, MPEG TS, MPEG 1,
+ * OGG, RAW or ASF */
+ [o_t4_pop_audioCodec removeItemWithTitle:@"Uncompressed, integer"];
+ [o_t4_pop_audioCodec removeItemWithTitle:@"Uncompressed, floating point"];
+
+ } else if ( mode == 1 )
+ {
+ /* MMS Streaming */
+ [o_userSelections setObject:@"1" forKey:@"stmgMhd"];
+
+ /* disable all codecs which don't support ASF / ASFH */
+ [o_t4_pop_audioCodec removeItemWithTitle:@"MPEG 4 Audio"];
+ [o_t4_pop_audioCodec removeItemWithTitle:@"Vorbis"];
+ [o_t4_pop_audioCodec removeItemWithTitle:@"FLAC"];
+ [o_t4_pop_audioCodec removeItemWithTitle:@"Speex"];
+ [o_t4_pop_audioCodec removeItemWithTitle:@"Uncompressed, integer"];
+ [o_t4_pop_audioCodec removeItemWithTitle:@"Uncompressed, floating point"];
+
+ [o_t4_pop_videoCodec removeItemWithTitle:@"MPEG-1 Video"];
+ [o_t4_pop_videoCodec removeItemWithTitle:@"MPEG-2 Video"];
+ [o_t4_pop_videoCodec removeItemWithTitle:@"H.263"];
+ [o_t4_pop_videoCodec removeItemWithTitle:@"H.264"];
+ [o_t4_pop_videoCodec removeItemWithTitle:@"MJPEG"];
+ [o_t4_pop_videoCodec removeItemWithTitle:@"Theora"];
+ } else {
+ /* RTP/UDP Unicast/Multicast Streaming */
+ [o_userSelections setObject: [[NSNumber numberWithInt: mode]
+ stringValue] forKey:@"stmgMhd"];
+
+ /* disable all codecs which don't support MPEG-TS */
+ [o_t4_pop_audioCodec removeItemWithTitle:@"Vorbis"];
+ [o_t4_pop_audioCodec removeItemWithTitle:@"FLAC"];
+ [o_t4_pop_audioCodec removeItemWithTitle:@"Speex"];
+ [o_t4_pop_audioCodec removeItemWithTitle:@"Uncompressed, integer"];
+ [o_t4_pop_audioCodec removeItemWithTitle:@"Uncompressed, floating point"];
+ }
+
+ /* store the destination and check whether is it empty */
+ if([[o_userSelections objectForKey:@"stmgMhd"] intValue] >=2 )
+ {
+ /* empty field is valid for HTTP and MMS */
+ if( [[o_t3_fld_address stringValue] isEqualToString: @""] )
+ {
+ /* complain to the user that "" is no valid dest. */
+ NSBeginInformationalAlertSheet(_NS("No valid destination"),
+ _NS("OK"), @"", @"", o_wizard_window, nil, nil, nil, nil,
+ _NS("A valid destination has to be selected "
+ "Enter either a Unicast-IP or a Multicast-IP."
+ "\n\nIf you don't know what this means, have a look at "
+ "the VLC Streaming HOWTO and the help texts in this "
+ "window."));
+ } else {
+ /* FIXME: check whether the entered IP is really valid */
+ [o_userSelections setObject:[o_t3_fld_address stringValue]
+ forKey:@"stmgDest"];
+ /* let's go to the transcode-1-tab */
+ [o_tab_pageHolder selectTabViewItemAtIndex:3];
+ }
+ } else {
+ [o_userSelections setObject:[o_t3_fld_address stringValue]
+ forKey:@"stmgDest"];
+ /* let's go to the transcode-1-tab */
+ [o_tab_pageHolder selectTabViewItemAtIndex:3];
+ }
+ }
+ 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"];
+ }
+
+ /* disable all encap-formats */
+ [[o_t5_matrix_encap cellAtRow:0 column:0] setEnabled:NO];
+ [[o_t5_matrix_encap cellAtRow:1 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:9 column:0] setEnabled:NO];
+ [[o_t5_matrix_encap cellAtRow:10 column:0] setEnabled:NO];
+
+ /* re-enable the encap-formats supported by the chosen codecs */
+ /* FIXME: the following is a really bad coding-style. feel free to mail
+ me ideas how to make this nicer, if you want to -- FK, 7/11/05 */
+
+ if ([[o_userSelections objectForKey:@"trnscdAudio"] isEqualTo: @"YES"])
+ {
+ if ([[o_userSelections objectForKey:@"trnscdVideo"] isEqualTo: @"YES"])
+ {
+ /* we are transcoding both audio and video, so we need to check both deps */
+ if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:
+ @"trnscdVideoCodec"] intValue]] containsObject: @"MUX_PS"])
+ {
+ if ([[o_audioCodecs objectAtIndex:[[o_userSelections
+ objectForKey:@"trnscdAudioCodec"] intValue]]
+ containsObject: @"MUX_PS"])
+ {
+ [[o_t5_matrix_encap cellAtRow:0 column:0] setEnabled:YES];
+ [o_t5_matrix_encap selectCellAtRow:0 column:0];
+ }
+ }
+ if ([[o_videoCodecs objectAtIndex:[[o_userSelections
+ objectForKey:@"trnscdVideoCodec"] intValue]] containsObject: @"MUX_TS"])
+ {
+ if ([[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey:
+ @"trnscdAudioCodec"] intValue]] containsObject: @"MUX_TS"])
+ {
+ [[o_t5_matrix_encap cellAtRow:1 column:0] setEnabled:YES];
+ [o_t5_matrix_encap selectCellAtRow:1 column:0];
+ }
+ }
+ if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:
+ @"trnscdVideoCodec"] intValue]] containsObject: @"MUX_MPEG"])
+ {
+ if ([[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey:
+ @"trnscdAudioCodec"] intValue]] containsObject: @"MUX_MPEG"])
+ {
+ [[o_t5_matrix_encap cellAtRow:2 column:0] setEnabled:YES];
+ [o_t5_matrix_encap selectCellAtRow:2 column:0];
+ }
+ }
+ if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:
+ @"trnscdVideoCodec"] intValue]] containsObject: @"MUX_OGG"])
+ {
+ if ([[o_audioCodecs objectAtIndex:[[o_userSelections
+ objectForKey:@"trnscdAudioCodec"] intValue]] containsObject: @"MUX_OGG"])
+ {
+ [[o_t5_matrix_encap cellAtRow:3 column:0] setEnabled:YES];
+ [o_t5_matrix_encap selectCellAtRow:3 column:0];
+ }
+ }
+ if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:
+ @"trnscdVideoCodec"] intValue]] containsObject: @"MUX_RAW"])
+ {
+ if ([[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey:
+ @"trnscdAudioCodec"] intValue]] containsObject: @"MUX_RAW"])
+ {
+ [[o_t5_matrix_encap cellAtRow:4 column:0] setEnabled:YES];
+ [o_t5_matrix_encap selectCellAtRow:4 column:0];
+ }
+ }
+ if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:
+ @"trnscdVideoCodec"] intValue]] containsObject: @"MUX_ASF"])
+ {
+ if ([[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey:
+ @"trnscdAudioCodec"] intValue]] containsObject: @"MUX_ASF"])
+ {
+ [[o_t5_matrix_encap cellAtRow:5 column:0] setEnabled:YES];
+ [o_t5_matrix_encap selectCellAtRow:5 column:0];
+ }
+ }
+ if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:
+ @"trnscdVideoCodec"] intValue]] containsObject: @"MUX_AVI"])
+ {
+ if ([[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey:
+ @"trnscdAudioCodec"] intValue]] containsObject: @"MUX_AVI"])
+ {
+ [[o_t5_matrix_encap cellAtRow:6 column:0] setEnabled:YES];
+ [o_t5_matrix_encap selectCellAtRow:6 column:0];
+ }
+ }
+ if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:
+ @"trnscdVideoCodec"] intValue]] containsObject: @"MUX_MP4"])
+ {
+ if ([[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey:
+ @"trnscdAudioCodec"] intValue]] containsObject: @"MUX_MP4"])
+ {
+ [[o_t5_matrix_encap cellAtRow:7 column:0] setEnabled:YES];
+ [o_t5_matrix_encap selectCellAtRow:7 column:0];
+ }
+ }
+ if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:
+ @"trnscdVideoCodec"] intValue]] containsObject: @"MUX_MOV"])
+ {
+ if ([[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey:
+ @"trnscdAudioCodec"] intValue]] containsObject: @"MUX_MOV"])
+ {
+ [[o_t5_matrix_encap cellAtRow:8 column:0] setEnabled:YES];
+ [o_t5_matrix_encap selectCellAtRow:8 column:0];
+ }
+ }
+ if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:
+ @"trnscdVideoCodec"] intValue]] containsObject: @"MUX_WAV"])
+ {
+ if ([[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey:
+ @"trnscdAudioCodec"] intValue]] containsObject: @"MUX_WAV"])
+ {
+ [[o_t5_matrix_encap cellAtRow:9 column:0] setEnabled:YES];
+ [o_t5_matrix_encap selectCellAtRow:9 column:0];
+ }
+ }
+
+ } else {
+
+ /* we just transcoding the audio */
+
+ /* select formats supported by the audio codec */
+ if ([[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey:
+ @"trnscdAudioCodec"] intValue]] containsObject: @"MUX_PS"])
+ {
+ [[o_t5_matrix_encap cellAtRow:0 column:0] setEnabled:YES];
+ [o_t5_matrix_encap selectCellAtRow:0 column:0];
+ }
+ if ([[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey:
+ @"trnscdAudioCodec"] intValue]] containsObject: @"MUX_TS"])
+ {
+ [[o_t5_matrix_encap cellAtRow:1 column:0] setEnabled:YES];
+ [o_t5_matrix_encap selectCellAtRow:1 column:0];
+ }
+ if ([[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey:
+ @"trnscdAudioCodec"] intValue]] containsObject: @"MUX_MPEG"])
+ {
+ [[o_t5_matrix_encap cellAtRow:2 column:0] setEnabled:YES];
+ [o_t5_matrix_encap selectCellAtRow:2 column:0];
+ }
+ if ([[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey:
+ @"trnscdAudioCodec"] intValue]] containsObject: @"MUX_OGG"])
+ {
+ [[o_t5_matrix_encap cellAtRow:3 column:0] setEnabled:YES];
+ [o_t5_matrix_encap selectCellAtRow:3 column:0];
+ }
+ if ([[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey:
+ @"trnscdAudioCodec"] intValue]] containsObject: @"MUX_RAW"])
+ {
+ [[o_t5_matrix_encap cellAtRow:4 column:0] setEnabled:YES];
+ [o_t5_matrix_encap selectCellAtRow:4 column:0];
+ }
+ if ([[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey:
+ @"trnscdAudioCodec"] intValue]] containsObject: @"MUX_ASF"])
+ {
+ [[o_t5_matrix_encap cellAtRow:5 column:0] setEnabled:YES];
+ [o_t5_matrix_encap selectCellAtRow:5 column:0];
+ }
+ if ([[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey:
+ @"trnscdAudioCodec"] intValue]] containsObject: @"MUX_AVI"])
+ {
+ [[o_t5_matrix_encap cellAtRow:6 column:0] setEnabled:YES];
+ [o_t5_matrix_encap selectCellAtRow:6 column:0];
+ }
+ if ([[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey:
+ @"trnscdAudioCodec"] intValue]] containsObject: @"MUX_MP4"])
+ {
+ [[o_t5_matrix_encap cellAtRow:7 column:0] setEnabled:YES];
+ [o_t5_matrix_encap selectCellAtRow:7 column:0];
+ }
+ if ([[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey:
+ @"trnscdAudioCodec"] intValue]] containsObject: @"MUX_MOV"])
+ {
+ [[o_t5_matrix_encap cellAtRow:8 column:0] setEnabled:YES];
+ [o_t5_matrix_encap selectCellAtRow:8 column:0];
+ }
+ if ([[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey:
+ @"trnscdAudioCodec"] intValue]] containsObject: @"MUX_WAV"])
+ {
+ [[o_t5_matrix_encap cellAtRow:9 column:0] setEnabled:YES];
+ [o_t5_matrix_encap selectCellAtRow:9 column:0];
+ }
+ }
+ }
+ else if ([[o_userSelections objectForKey:@"trnscdVideo"] isEqualTo: @"YES"])
+ {
+ /* we are just transcoding the video */
+
+ /* select formats supported by the video-codec */
+
+ if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:
+ @"trnscdVideoCodec"] intValue]] containsObject: @"MUX_PS"])
+ {
+ [[o_t5_matrix_encap cellAtRow:0 column:0] setEnabled:YES];
+ [o_t5_matrix_encap selectCellAtRow:0 column:0];
+ }
+ if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:
+ @"trnscdVideoCodec"] intValue]] containsObject: @"MUX_TS"])
+ {
+ [[o_t5_matrix_encap cellAtRow:1 column:0] setEnabled:YES];
+ [o_t5_matrix_encap selectCellAtRow:1 column:0];
+ }
+ if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:
+ @"trnscdVideoCodec"] intValue]] containsObject: @"MUX_MPEG"])
+ {
+ [[o_t5_matrix_encap cellAtRow:2 column:0] setEnabled:YES];
+ [o_t5_matrix_encap selectCellAtRow:2 column:0];
+ }
+ if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:
+ @"trnscdVideoCodec"] intValue]] containsObject: @"MUX_OGG"])
+ {
+ [[o_t5_matrix_encap cellAtRow:3 column:0] setEnabled:YES];
+ [o_t5_matrix_encap selectCellAtRow:3 column:0];
+ }
+ if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:
+ @"trnscdVideoCodec"] intValue]] containsObject: @"MUX_RAW"])
+ {
+ [[o_t5_matrix_encap cellAtRow:4 column:0] setEnabled:YES];
+ [o_t5_matrix_encap selectCellAtRow:4 column:0];
+ }
+ if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:
+ @"trnscdVideoCodec"] intValue]] containsObject: @"MUX_ASF"])
+ {
+ [[o_t5_matrix_encap cellAtRow:5 column:0] setEnabled:YES];
+ [o_t5_matrix_encap selectCellAtRow:5 column:0];
+ }
+ if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:
+ @"trnscdVideoCodec"] intValue]] containsObject: @"MUX_AVI"])
+ {
+ [[o_t5_matrix_encap cellAtRow:6 column:0] setEnabled:YES];
+ [o_t5_matrix_encap selectCellAtRow:6 column:0];
+ }
+ if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:
+ @"trnscdVideoCodec"] intValue]] containsObject: @"MUX_MP4"])
+ {
+ [[o_t5_matrix_encap cellAtRow:7 column:0] setEnabled:YES];
+ [o_t5_matrix_encap selectCellAtRow:7 column:0];
+ }
+ if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:
+ @"trnscdVideoCodec"] intValue]] containsObject: @"MUX_MOV"])
+ {
+ [[o_t5_matrix_encap cellAtRow:8 column:0] setEnabled:YES];
+ [o_t5_matrix_encap selectCellAtRow:8 column:0];
+ }
+ if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:
+ @"trnscdVideoCodec"] intValue]] containsObject: @"MUX_WAV"])
+ {
+ [[o_t5_matrix_encap cellAtRow:9 column:0] setEnabled:YES];
+ [o_t5_matrix_encap selectCellAtRow:9 column:0];
+ }
+ } else {
+ /* we don't do any transcoding
+ * -> enabled the encap-formats allowed when streaming content via
+ * http plus MP4 since this should work fine in most cases */
+
+ /* FIXME: choose a selection of encap-formats based upon the
+ * actually used codecs */
+
+ /* enable MPEG PS, MPEG TS, MPEG 1, OGG, RAW, ASF, MP4 and MOV
+ * 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:YES];
+ [[o_t5_matrix_encap cellAtRow:8 column:0] setEnabled:YES];
+ [[o_t5_matrix_encap cellAtRow:9 column:0] setEnabled:NO];
+ [[o_t5_matrix_encap cellAtRow:10 column:0] setEnabled:NO];
+ [o_t5_matrix_encap selectCellAtRow:0 column:0];
+ }
+
+ if ( [o_userSelections objectForKey:@"stmgMhd"] == @"1" )
+ {
+ /* if MMS is the streaming protocol, only ASFH is available */
+ [[o_t5_matrix_encap cellAtRow:0 column:0] setEnabled:NO];
+ [[o_t5_matrix_encap cellAtRow:1 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:9 column:0] setEnabled:NO];
+ [[o_t5_matrix_encap cellAtRow:10 column:0] setEnabled:YES];
+ [o_t5_matrix_encap selectCellAtRow:10 column:0];
+ }
+ else if ( [o_userSelections objectForKey:@"stmgMhd"] == @"0" )
+ {
+ /* if HTTP is the streaming protocol, disable all unsupported
+ * encap-formats, but don't touch the other ones selected above */
+ [[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:9 column:0] setEnabled:NO];
+ [[o_t5_matrix_encap cellAtRow:10 column:0] setEnabled:NO];
+ }
+ else if ( [[o_userSelections objectForKey:@"stmgMhd"] intValue] >= 2 )
+ {
+ /* if UDP/RTP is the streaming protocol, only MPEG-TS is available */
+ [[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:9 column:0] setEnabled:NO];
+ [[o_t5_matrix_encap cellAtRow:10 column:0] setEnabled:NO];
+ [[o_t5_matrix_encap cellAtRow:1 column:0] setEnabled:YES];
+ [o_t5_matrix_encap selectCellAtRow:1 column:0];
+ }
+ int x;
+ BOOL anythingEnabled;
+ x = 0;
+ anythingEnabled = NO;
+ while (x != [o_t5_matrix_encap numberOfRows])
+ {
+ if ([[o_t5_matrix_encap cellAtRow:x column:0] isEnabled])
+ {
+ anythingEnabled = YES;
+ }
+ x += 1;
+ }
+ if (anythingEnabled == YES)
+ {
+ /* go the encap-tab */
+ [o_tab_pageHolder selectTabViewItemAtIndex:4];
+ } else {
+ /* show a sheet that the selected codecs are not compatible */
+ NSBeginInformationalAlertSheet(_NS("Invalid selection"), _NS("OK"),
+ @"", @"", o_wizard_window, nil, nil, nil, nil, _NS("The "
+ "chosen codecs are not compatible with each other. For example: "
+ "It is impossibleto mix uncompressed audio with any video codec.\n\n"
+ "Correct your selection and try again."));
+ }
+
+ }
+ else if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString: @"Encap"])
+ {
+ /* get the chosen encap format and store it */
+ NSNumber * theNum;
+ theNum = [NSNumber numberWithInt:[[o_t5_matrix_encap selectedCell] tag]];
+ [o_userSelections setObject:[theNum stringValue] 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];
+ /* in case that we are processing multiple items, let the user
+ * select a folder instead of a localtion for a single item */
+ if( [[o_userSelections objectForKey:@"pathToStrm"] count] > 1 )
+ {
+ [o_t7_txt_saveFileTo setStringValue:
+ _NS("Select the directory to save to")];
+ }
+ else
+ {
+ [o_t7_txt_saveFileTo setStringValue:
+ _NS("Select the file to save to")];
+ }
+ }
+ }
+ 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"];
+ }
+
+ /* local playback? */
+ if ([o_t6_ckb_local state] == NSOnState)
+ {
+ [o_userSelections setObject:@"YES" forKey:@"localPb"];
+ } else {
+ [o_userSelections setObject:@"NO" forKey:@"localPb"];
+ }
+
+ /* include subtitles? */
+ [o_userSelections setObject:
+ [[NSNumber numberWithInt:[o_t6_ckb_soverlay state]] stringValue]
+ forKey: @"soverlay"];
+
+ /* go to "Summary" */
+ [self showSummary];
+ }
+ else if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString:
+ @"Transcode 2"])
+ {
+ /* local playback? */
+ if ([o_t7_ckb_local state] == NSOnState)
+ {
+ [o_userSelections setObject:@"YES" forKey:@"localPb"];
+ } else {
+ [o_userSelections setObject:@"NO" forKey:@"localPb"];
+ }
+
+ /* check whether the path != "" and store it */
+ if( [[o_t7_fld_filePath stringValue] isEqualToString: @""] )
+ {
+ /* complain to the user that "" is no valid path for a folder/file */
+ if( [[o_userSelections objectForKey:@"pathToStrm"] count] > 1 )
+ NSBeginInformationalAlertSheet(_NS("No folder selected"),
+ _NS("OK"), @"", @"", o_wizard_window, nil, nil, nil, nil,
+ [NSString stringWithFormat: @"%@\n\n%@", _NS("A directory "
+ "where to save the files has to be selected."),
+ _NS("Enter either a valid path or use the \"Choose...\" "
+ "button to select a location.")]);
+ else
+ NSBeginInformationalAlertSheet(_NS("No file selected"),
+ _NS("OK"), @"", @"", o_wizard_window, nil, nil, nil, nil,
+ [NSString stringWithFormat: @"%@\n\n%@", _NS("A file "
+ "where to save the stream has to be selected."),
+ _NS("Enter either a valid path or use the \"Choose\" "
+ "button to select a location.")]);
+ } else {
+ /* create a string containing the requested suffix for later usage */
+ NSString * theEncapFormat = [[o_encapFormats objectAtIndex:
+ [[o_userSelections objectForKey:@"encapFormat"] intValue]]
+ objectAtIndex:0];
+ if( theEncapFormat == @"ps" )
+ theEncapFormat = @"mpg";
+
+ /* look whether we need to process multiple items or not.
+ * choose a faster variant if we just want a single item */
+ if( [[o_userSelections objectForKey:@"pathToStrm"] count] > 1 )
+ {
+ NSMutableArray * tempArray = [[NSMutableArray alloc] init];
+ int x = 0;
+ int y = [[o_userSelections objectForKey:@"pathToStrm"] count];
+ NSMutableString * tempString = [[NSMutableString alloc] init];
+ while( x != y )
+ {
+ NSString * fileNameToUse;
+ /* check whether the extension is hidden or not.
+ * if not, remove it
+ * we need the casting to make GCC4 happy */
+ if( [[[NSFileManager defaultManager] fileAttributesAtPath:
+ [[o_userSelections objectForKey:@"pathToStrm"]
+ objectAtIndex: x] traverseLink: NO] objectForKey:
+ NSFileExtensionHidden] )
+ fileNameToUse = [NSString stringWithString:
+ [[NSFileManager defaultManager] displayNameAtPath:
+ [[o_userSelections objectForKey:@"pathToStrm"]
+ objectAtIndex: x]]];
+ else
+ {
+ int z = 0;
+ int count = [[[[NSFileManager defaultManager]
+ displayNameAtPath:
+ [[o_userSelections objectForKey:@"pathToStrm"]
+ objectAtIndex: x]]
+ componentsSeparatedByString: @"."] count];
+ fileNameToUse = @"";
+ while( z < (count - 1) )
+ {
+ fileNameToUse = [fileNameToUse stringByAppendingString:
+ [[[[NSFileManager defaultManager]
+ displayNameAtPath:
+ [[o_userSelections objectForKey:@"pathToStrm"]
+ objectAtIndex: x]]
+ componentsSeparatedByString: @"."]
+ objectAtIndex: z]];
+ z += 1;
+ }
+ }
+ tempString = [NSString stringWithFormat: @"%@%@.%@",
+ [o_t7_fld_filePath stringValue],
+ fileNameToUse, theEncapFormat];
+ if( [[NSFileManager defaultManager] fileExistsAtPath:
+ tempString] )
+ {
+ /* we don't wanna overwrite existing files, so add an
+ * int to the file-name */
+ int additionalInt = 1;
+ while( additionalInt < 100 )
+ {
+ tempString = [NSString stringWithFormat:@"%@%@ %i.%@",
+ [o_t7_fld_filePath stringValue],
+ fileNameToUse, additionalInt, theEncapFormat];
+ if(! [[NSFileManager defaultManager]
+ fileExistsAtPath: tempString] )
+ break;
+ additionalInt += 1;
+ }
+ if( additionalInt >= 100 )
+ msg_Err( VLCIntf, "Files with the same name are "
+ "already present in the destination directory. "
+ "Delete these files or choose a different directory." );
+ }
+ [tempArray addObject: [tempString retain]];
+ x += 1;
+ }
+ [o_userSelections setObject: [NSArray arrayWithArray:tempArray]
+ forKey: @"trnscdFilePath"];
+ [tempArray release];
+ [tempString release];
+ }
+ else
+ {
+ /* we don't need to check for existing items because Cocoa
+ * does that already when we are asking the user for a location
+ * to save her file */
+ [o_userSelections setObject: [NSArray arrayWithObject:
+ [o_t7_fld_filePath stringValue]] forKey: @"trnscdFilePath"];
+ }
+
+ /* include subtitles ? */
+ [o_userSelections setObject:
+ [[NSNumber numberWithInt:[o_t7_ckb_soverlay state]] stringValue]
+ forKey: @"soverlay"];
+
+ /* go to "Summary" */
+ [self showSummary];
+ }
+ }
+ else if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString:
+ @"Summary"])
+ {
+ intf_thread_t * p_intf = VLCIntf;
+
+ playlist_t * p_playlist = pl_Yield( p_intf );
+
+ int x = 0;
+ int y = [[o_userSelections objectForKey:@"pathToStrm"] count];
+ while( x != y )
+ {
+ /* we need a temp. variable here to work-around a GCC4-bug */
+ NSString *tempString = [NSString stringWithFormat:
+ @"%@ (%i/%i)", _NS("Streaming/Transcoding Wizard"),
+ ( x + 1 ), y];
+ input_item_t *p_input = input_ItemNew( p_playlist,
+ [[[o_userSelections objectForKey:@"pathToStrm"]
+ objectAtIndex:x] UTF8String],
+ [tempString UTF8String] );
+ input_ItemAddOption( p_input, [[[o_userSelections
+ objectForKey:@"opts"] objectAtIndex: x] UTF8String]);
+
+ if(! [[o_userSelections objectForKey:@"partExtractFrom"]
+ isEqualToString:@""] )
+ {
+ input_ItemAddOption( p_input, [[NSString
+ stringWithFormat: @"start-time=%@", [o_userSelections
+ objectForKey: @"partExtractFrom"]] UTF8String] );
+ }
+
+ if(! [[o_userSelections objectForKey:@"partExtractTo"]
+ isEqualToString:@""] )
+ {
+ input_ItemAddOption( p_input, [[NSString
+ stringWithFormat: @"stop-time=%@", [o_userSelections
+ objectForKey: @"partExtractTo"]] UTF8String] );
+ }
+
+ input_ItemAddOption( p_input, [[NSString stringWithFormat:
+ @"ttl=%@", [o_userSelections objectForKey:@"ttl"]]
+ UTF8String] );
+
+ /* FIXME: playlist_AddInput() can fail */
+ playlist_AddInput( p_playlist, p_input, PLAYLIST_STOP,
+ PLAYLIST_END, true, pl_Unlocked );
+
+ if( x == 0 )
+ {
+ /* play the first item and add the others afterwards */
+ playlist_item_t *p_item = playlist_ItemGetByInput( p_playlist, p_input, pl_Locked );
+ playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, true, NULL,
+ p_item );
+ }
+
+ vlc_gc_decref( p_input );
+ x += 1;
+ }
+
+ vlc_object_release( p_playlist );
+
+ /* close the window, since we are done */
+ [o_wizard_window close];
+ }
+}
+
+- (void)rebuildCodecMenus
+{
+ int savePreviousSel = 0;
+ savePreviousSel = [o_t4_pop_videoCodec indexOfSelectedItem];
+ [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 += 1;
+ }
+ if( savePreviousSel >= 0 )
+ [o_t4_pop_videoCodec selectItemAtIndex: savePreviousSel];
+
+ savePreviousSel = [o_t4_pop_audioCodec indexOfSelectedItem];
+ [o_t4_pop_audioCodec removeAllItems];
+ x = 0;
+ while (x != [o_audioCodecs count])
+ {
+ [o_t4_pop_audioCodec addItemWithTitle:[[o_audioCodecs objectAtIndex:x]
+ objectAtIndex:0]];
+ x += 1;
+ }
+ if( savePreviousSel >= 0 )
+ [o_t4_pop_audioCodec selectItemAtIndex: savePreviousSel];