X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fgui%2Fmacosx%2Fwizard.m;h=95d6795824bdb9d52de32904746515adeda2a618;hb=dce84f16eff36ca70cbb431f0654569eb02ca458;hp=a57cceab28ab5d0b5232bdbd9ffe53ca00556695;hpb=d5845675317c95d4bbd67445d26bc946ab68c075;p=vlc diff --git a/modules/gui/macosx/wizard.m b/modules/gui/macosx/wizard.m index a57cceab28..95d6795824 100644 --- a/modules/gui/macosx/wizard.m +++ b/modules/gui/macosx/wizard.m @@ -1,10 +1,10 @@ /***************************************************************************** * wizard.m: MacOS X Streaming Wizard ***************************************************************************** - * Copyright (C) 2005-2007 the VideoLAN team + * Copyright (C) 2005-2009 the VideoLAN team * $Id$ * - * Authors: Felix Kühne + * Authors: Felix Kühne * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -344,10 +344,12 @@ static VLCWizard *_o_sharedInstance = nil; [[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:@"1"] headerCell] + [[[o_t2_tbl_plst tableColumnWithIdentifier:@"name"] headerCell] setStringValue: _NS("Title")]; - [[[o_t2_tbl_plst tableColumnWithIdentifier:@"2"] headerCell] + [[[o_t2_tbl_plst tableColumnWithIdentifier:@"artist"] headerCell] setStringValue: _NS("Author")]; + [[[o_t2_tbl_plst tableColumnWithIdentifier:@"duration"] headerCell] + setStringValue: _NS("Duration")]; [o_t2_box_prtExtrct setTitle: _NS("Partial Extract")]; [o_t2_ckb_enblPartExtrct setTitle: _NS("Enable")]; [o_t2_ckb_enblPartExtrct setToolTip: _NS("This can be used to read only a " @@ -475,7 +477,7 @@ static VLCWizard *_o_sharedInstance = nil; [o_wizard_window close]; } -- (id)getPlaylistWizard +- (id)playlistWizard { return o_playlist_wizard; } @@ -557,8 +559,7 @@ static VLCWizard *_o_sharedInstance = nil; if( p_item->i_children <= 0 ) { char *psz_uri = input_item_GetURI( p_item->p_input ); - [tempArray addObject: [NSString stringWithUTF8String: - psz_uri]]; + [tempArray addObject: [NSString stringWithUTF8String: psz_uri]]; free( psz_uri ); stop = NO; } @@ -626,7 +627,6 @@ static VLCWizard *_o_sharedInstance = nil; [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"]; @@ -711,6 +711,9 @@ static VLCWizard *_o_sharedInstance = nil; [o_userSelections setObject:@"NO" forKey:@"trnscdAudio"]; } + /* store the currently selected item for further reference */ + int i_temp = [[o_t5_matrix_encap selectedCell] tag]; + /* disable all encap-formats */ [[o_t5_matrix_encap cellAtRow:0 column:0] setEnabled:NO]; [[o_t5_matrix_encap cellAtRow:1 column:0] setEnabled:NO]; @@ -1048,6 +1051,10 @@ static VLCWizard *_o_sharedInstance = nil; } if (anythingEnabled == YES) { + /* re-select the previously chosen item, if available */ + if( [[o_t5_matrix_encap cellWithTag: i_temp] isEnabled] ) + [o_t5_matrix_encap selectCellWithTag: i_temp]; + /* go the encap-tab */ [o_tab_pageHolder selectTabViewItemAtIndex:4]; } else { @@ -1255,7 +1262,7 @@ static VLCWizard *_o_sharedInstance = nil; { intf_thread_t * p_intf = VLCIntf; - playlist_t * p_playlist = pl_Yield( p_intf ); + playlist_t * p_playlist = pl_Get( p_intf ); int x = 0; int y = [[o_userSelections objectForKey:@"pathToStrm"] count]; @@ -1270,14 +1277,16 @@ static VLCWizard *_o_sharedInstance = nil; objectAtIndex:x] UTF8String], [tempString UTF8String] ); input_item_AddOption( p_input, [[[o_userSelections - objectForKey:@"opts"] objectAtIndex: x] UTF8String]); + objectForKey:@"opts"] objectAtIndex: x] UTF8String], + VLC_INPUT_OPTION_TRUSTED ); if(! [[o_userSelections objectForKey:@"partExtractFrom"] isEqualToString:@""] ) { input_item_AddOption( p_input, [[NSString stringWithFormat: @"start-time=%@", [o_userSelections - objectForKey: @"partExtractFrom"]] UTF8String] ); + objectForKey: @"partExtractFrom"]] UTF8String], + VLC_INPUT_OPTION_TRUSTED ); } if(! [[o_userSelections objectForKey:@"partExtractTo"] @@ -1285,12 +1294,14 @@ static VLCWizard *_o_sharedInstance = nil; { input_item_AddOption( p_input, [[NSString stringWithFormat: @"stop-time=%@", [o_userSelections - objectForKey: @"partExtractTo"]] UTF8String] ); + objectForKey: @"partExtractTo"]] UTF8String], + VLC_INPUT_OPTION_TRUSTED ); } input_item_AddOption( p_input, [[NSString stringWithFormat: @"ttl=%@", [o_userSelections objectForKey:@"ttl"]] - UTF8String] ); + UTF8String], + VLC_INPUT_OPTION_TRUSTED ); /* FIXME: playlist_AddInput() can fail */ playlist_AddInput( p_playlist, p_input, PLAYLIST_STOP, @@ -1300,7 +1311,7 @@ static VLCWizard *_o_sharedInstance = nil; { /* play the first item and add the others afterwards */ PL_LOCK; - playlist_item_t *p_item = playlist_ItemGetByInput( p_playlist, p_input, pl_Locked ); + playlist_item_t *p_item = playlist_ItemGetByInput( p_playlist, p_input ); playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, pl_Locked, NULL, p_item ); PL_UNLOCK; @@ -1310,8 +1321,6 @@ static VLCWizard *_o_sharedInstance = nil; x += 1; } - vlc_object_release( p_playlist ); - /* close the window, since we are done */ [o_wizard_window close]; } @@ -1468,10 +1477,9 @@ static VLCWizard *_o_sharedInstance = nil; if ([[o_userSelections objectForKey:@"trnscdVideo"] isEqualToString:@"YES"]) { [o_trnscdCmd appendString: @"transcode{"]; - [o_trnscdCmd appendFormat: @"vcodec=%s,vb=%i", [[[o_videoCodecs - objectAtIndex:[[o_userSelections objectForKey:@"trnscdVideoCodec"] - intValue]] objectAtIndex:1] UTF8String], [[o_userSelections - objectForKey:@"trnscdVideoBitrate"] intValue]]; + [o_trnscdCmd appendFormat: @"vcodec=%@,vb=%i", + [[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdVideoCodec"] intValue]] objectAtIndex:1], + [[o_userSelections objectForKey:@"trnscdVideoBitrate"] intValue]]; if ([[o_userSelections objectForKey:@"trnscdAudio"] isEqualToString:@"YES"]) { [o_trnscdCmd appendString: @","]; @@ -1496,21 +1504,20 @@ static VLCWizard *_o_sharedInstance = nil; /* in case we transcode the audio only, add this */ [o_trnscdCmd appendString: @"transcode{"]; } - [o_trnscdCmd appendFormat: @"acodec=%s,ab=%i}:", [[[o_audioCodecs - objectAtIndex:[[o_userSelections objectForKey:@"trnscdAudioCodec"] - intValue]] objectAtIndex:1] UTF8String], [[o_userSelections - objectForKey:@"trnscdAudioBitrate"] intValue]]; + [o_trnscdCmd appendFormat: @"acodec=%@,ab=%i}:", + [[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdAudioCodec"] intValue]] objectAtIndex:1], + [[o_userSelections objectForKey:@"trnscdAudioBitrate"] intValue]]; } if ([[o_userSelections objectForKey:@"trnscdOrStrmg"] isEqualToString:@"trnscd"]) { /* we are just transcoding and dumping the stuff to a file */ [o_opts_string appendFormat: - @":sout=#%s%sstandard{mux=%s,dst=%s,access=file}", [o_duplicateCmd - UTF8String], [o_trnscdCmd UTF8String], [[[o_encapFormats - objectAtIndex: [[o_userSelections objectForKey:@"encapFormat"] - intValue]] objectAtIndex:0] UTF8String], [[[o_userSelections - objectForKey: @"trnscdFilePath"] objectAtIndex: x] UTF8String]]; + @":sout=#%@%@standard{mux=%@,dst=%@,access=file}", + o_duplicateCmd, + o_trnscdCmd, + [[o_encapFormats objectAtIndex: [[o_userSelections objectForKey:@"encapFormat"] intValue]] objectAtIndex:0], + [[o_userSelections objectForKey: @"trnscdFilePath"] objectAtIndex: x]]; } else { @@ -1526,31 +1533,28 @@ static VLCWizard *_o_sharedInstance = nil; } else { - [o_sap_option appendFormat: @"sap,name=\"%s\"", - [[o_userSelections objectForKey:@"sapText"] UTF8String]]; + [o_sap_option appendFormat: @"sap,name=\"%@\"", + [o_userSelections objectForKey:@"sapText"]]; } if( [[o_strmgMthds objectAtIndex: [[o_userSelections objectForKey: @"stmgMhd"] intValue]] objectAtIndex:0] == @"rtp" ) { /* RTP is no access out, but a stream out module */ [o_opts_string appendFormat: - @":sout=#%s%srtp{mux=%s,dst=%s,%s}", - [o_duplicateCmd UTF8String], [o_trnscdCmd UTF8String], - [[[o_encapFormats objectAtIndex: [[o_userSelections objectForKey: @"encapFormat"] intValue]] objectAtIndex:0] - UTF8String], - [[o_userSelections objectForKey: @"stmgDest"] UTF8String], - [o_sap_option UTF8String]]; + @":sout=#%@%@rtp{mux=%@,dst=%@,%@}", + o_duplicateCmd, o_trnscdCmd, + [[o_encapFormats objectAtIndex: [[o_userSelections objectForKey: @"encapFormat"] intValue]] objectAtIndex:0], + [o_userSelections objectForKey: @"stmgDest"], + o_sap_option]; } else { [o_opts_string appendFormat: - @":sout=#%s%sstandard{mux=%s,dst=%s,access=%s,%s}", - [o_duplicateCmd UTF8String], [o_trnscdCmd UTF8String], - [[[o_encapFormats objectAtIndex: [[o_userSelections objectForKey: @"encapFormat"] intValue]] objectAtIndex:0] - UTF8String], - [[o_userSelections objectForKey: @"stmgDest"] UTF8String], - [[[o_strmgMthds objectAtIndex: [[o_userSelections objectForKey: @"stmgMhd"] intValue]] objectAtIndex:0] - UTF8String], - [o_sap_option UTF8String]]; + @":sout=#%@%@standard{mux=%@,dst=%@,access=%@,%@}", + o_duplicateCmd, o_trnscdCmd, + [[o_encapFormats objectAtIndex: [[o_userSelections objectForKey: @"encapFormat"] intValue]] objectAtIndex:0], + [o_userSelections objectForKey: @"stmgDest"], + [[o_strmgMthds objectAtIndex: [[o_userSelections objectForKey: @"stmgMhd"] intValue]] objectAtIndex:0], + o_sap_option]; } } else @@ -1560,24 +1564,22 @@ static VLCWizard *_o_sharedInstance = nil; { /* RTP is different from the other protocols, as it isn't provided through an access out module anymore */ [o_opts_string appendFormat: - @":sout=#%s%srtp{mux=%s,dst=%s}", - [o_duplicateCmd UTF8String], - [o_trnscdCmd UTF8String], - [[[o_encapFormats objectAtIndex: [[o_userSelections objectForKey: @"encapFormat"] intValue]] objectAtIndex:0] - UTF8String], - [[o_userSelections objectForKey: @"stmgDest"] UTF8String]]; + @":sout=#%@%@rtp{mux=%@,dst=%@}", + o_duplicateCmd, + o_trnscdCmd, + [[o_encapFormats objectAtIndex: [[o_userSelections objectForKey: @"encapFormat"] intValue]] objectAtIndex:0], + [o_userSelections objectForKey: @"stmgDest"]]; } else { /* all other protocols are cool */ [o_opts_string appendFormat: - @":sout=#%s%sstandard{mux=%s,dst=%s,access=%s}", - [o_duplicateCmd UTF8String], - [o_trnscdCmd UTF8String], - [[[o_encapFormats objectAtIndex: [[o_userSelections objectForKey: @"encapFormat"] intValue]] objectAtIndex:0] - UTF8String], - [[o_userSelections objectForKey: @"stmgDest"] UTF8String], - [[[o_strmgMthds objectAtIndex: [[o_userSelections objectForKey: @"stmgMhd"] intValue]] objectAtIndex:0] UTF8String]]; + @":sout=#%@%@standard{mux=%@,dst=%@,access=%@}", + o_duplicateCmd, + o_trnscdCmd, + [[o_encapFormats objectAtIndex: [[o_userSelections objectForKey: @"encapFormat"] intValue]] objectAtIndex:0], + [o_userSelections objectForKey: @"stmgDest"], + [[o_strmgMthds objectAtIndex: [[o_userSelections objectForKey: @"stmgMhd"] intValue]] objectAtIndex:0]]; } } } @@ -1660,7 +1662,7 @@ static VLCWizard *_o_sharedInstance = nil; @"Input"]) { /* reset the wizard before going backwards. Otherwise, we might get - * unwanted behaviours in the Encap-Selection */ + * unwanted behaviour in the Encap-Selection */ [self resetWizard]; /* show "Hello" */ [o_tab_pageHolder selectTabViewItemAtIndex:0];