📄 wizard.m
字号:
{ /* 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 ) { [tempArray addObject: [NSString stringWithUTF8String: p_item->input.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: \
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -