⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wizard.m

📁 VLC Player Source Code
💻 M
📖 第 1 页 / 共 5 页
字号:
                {                    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];                    }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -