Commit 6189b30c authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: revert recent wizard optimizations, since these led to undefined...

macosx: revert recent wizard optimizations, since these led to undefined results with this unmaintanable code (close #7334)

This commit is part of the stable branch only, since the wizard will be removed for 2.1.
parent 92df5c7d
......@@ -4,7 +4,7 @@
* Copyright (C) 2005-2012 VLC authors and VideoLAN
* $Id$
*
* Authors: Felix Paul Khne <fkuehne at videolan dot org>,
* Authors: Felix hne <fkuehne at videolan dot org>,
* Brendon Justin <brendonjustin at gmail.com>
*
* This program is free software; you can redistribute it and/or modify
......@@ -487,8 +487,7 @@ static VLCWizard *_o_sharedInstance = nil;
- (IBAction)nextTab:(id)sender
{
NSString * selectedTabViewItemLabel = [[o_tab_pageHolder selectedTabViewItem] label];
if ([selectedTabViewItemLabel isEqualToString: @"Hello"])
if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString: @"Hello"])
{
/* check whether the user wants to stream or just to transcode;
* store information for later usage */
......@@ -511,7 +510,7 @@ static VLCWizard *_o_sharedInstance = nil;
[o_playlist_wizard reloadOutlineView];
}
else if ([selectedTabViewItemLabel isEqualToString: @"Input"])
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)
......@@ -550,12 +549,15 @@ static VLCWizard *_o_sharedInstance = nil;
{
if ([o_t2_tbl_plst numberOfSelectedRows] > 0)
{
NSIndexSet * selectedIndexes = [o_t2_tbl_plst selectedRowIndexes];
NSUInteger count = [selectedIndexes count];
int x = 0;
int y = [[o_t2_tbl_plst selectedRowIndexes] count];
NSMutableArray * tempArray = [[NSMutableArray alloc] init];
for( NSUInteger x = 0; x < count; x++ )
while( x != y )
{
playlist_item_t *p_item = [[o_t2_tbl_plst itemAtRow: [selectedIndexes indexGreaterThanOrEqualToIndex: x]] pointerValue];
playlist_item_t *p_item =
[[o_t2_tbl_plst itemAtRow:
[[o_t2_tbl_plst selectedRowIndexes]
indexGreaterThanOrEqualToIndex: x]] pointerValue];
if( p_item->i_children <= 0 )
{
......@@ -566,8 +568,10 @@ static VLCWizard *_o_sharedInstance = nil;
}
else
stop = YES;
x += 1;
}
[o_userSelections setObject:[NSArray arrayWithArray: tempArray] forKey:@"pathToStrm"];
[o_userSelections setObject:[NSArray arrayWithArray: tempArray]
forKey:@"pathToStrm"];
[tempArray release];
}
else
......@@ -601,7 +605,8 @@ static VLCWizard *_o_sharedInstance = nil;
"Choose one before going to the next page."));
}
}
else if ([selectedTabViewItemLabel isEqualToString: @"Streaming 1"])
else if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString:
@"Streaming 1"])
{
/* rebuild the menues for the codec-selections */
[self rebuildCodecMenus];
......@@ -678,7 +683,8 @@ static VLCWizard *_o_sharedInstance = nil;
[o_tab_pageHolder selectTabViewItemAtIndex:3];
}
}
else if ([selectedTabViewItemLabel isEqualToString: @"Transcode 1"])
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 */
......@@ -730,80 +736,95 @@ static VLCWizard *_o_sharedInstance = nil;
if ([[o_userSelections objectForKey:@"trnscdAudio"] isEqualTo: @"YES"])
{
NSInteger i_selectedAudioCodec = [[o_userSelections objectForKey:@"trnscdAudioCodec"] intValue];
if ([[o_userSelections objectForKey:@"trnscdVideo"] isEqualTo: @"YES"])
{
NSInteger i_selectedVideoCodec = [[o_userSelections objectForKey:@"trnscdVideoCodec"] intValue];
/* we are transcoding both audio and video, so we need to check both deps */
if ([[o_videoCodecs objectAtIndex:i_selectedVideoCodec] containsObject: @"MUX_PS"])
if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:
@"trnscdVideoCodec"] intValue]] containsObject: @"MUX_PS"])
{
if ([[o_audioCodecs objectAtIndex:i_selectedAudioCodec] 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:i_selectedVideoCodec] containsObject: @"MUX_TS"])
if ([[o_videoCodecs objectAtIndex:[[o_userSelections
objectForKey:@"trnscdVideoCodec"] intValue]] containsObject: @"MUX_TS"])
{
if ([[o_audioCodecs objectAtIndex:i_selectedAudioCodec] 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:i_selectedVideoCodec] containsObject: @"MUX_MPEG"])
if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:
@"trnscdVideoCodec"] intValue]] containsObject: @"MUX_MPEG"])
{
if ([[o_audioCodecs objectAtIndex:i_selectedAudioCodec] 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:i_selectedVideoCodec] containsObject: @"MUX_OGG"])
if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:
@"trnscdVideoCodec"] intValue]] containsObject: @"MUX_OGG"])
{
if ([[o_audioCodecs objectAtIndex:i_selectedAudioCodec] 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:i_selectedVideoCodec] containsObject: @"MUX_RAW"])
if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:
@"trnscdVideoCodec"] intValue]] containsObject: @"MUX_RAW"])
{
if ([[o_audioCodecs objectAtIndex:i_selectedAudioCodec] 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:i_selectedVideoCodec] containsObject: @"MUX_ASF"])
if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:
@"trnscdVideoCodec"] intValue]] containsObject: @"MUX_ASF"])
{
if ([[o_audioCodecs objectAtIndex:i_selectedAudioCodec] 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:i_selectedVideoCodec] containsObject: @"MUX_MP4"])
if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:
@"trnscdVideoCodec"] intValue]] containsObject: @"MUX_MP4"])
{
if ([[o_audioCodecs objectAtIndex:i_selectedAudioCodec] containsObject: @"MUX_MP4"])
if ([[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey:
@"trnscdAudioCodec"] intValue]] containsObject: @"MUX_MP4"])
{
[[o_t5_matrix_encap cellAtRow:6 column:0] setEnabled:YES];
[o_t5_matrix_encap selectCellAtRow:6 column:0];
}
}
if ([[o_videoCodecs objectAtIndex:i_selectedVideoCodec] containsObject: @"MUX_MOV"])
if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:
@"trnscdVideoCodec"] intValue]] containsObject: @"MUX_MOV"])
{
if ([[o_audioCodecs objectAtIndex:i_selectedAudioCodec] containsObject: @"MUX_MOV"])
if ([[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey:
@"trnscdAudioCodec"] intValue]] containsObject: @"MUX_MOV"])
{
[[o_t5_matrix_encap cellAtRow:7 column:0] setEnabled:YES];
[o_t5_matrix_encap selectCellAtRow:7 column:0];
}
}
if ([[o_videoCodecs objectAtIndex:i_selectedVideoCodec] containsObject: @"MUX_WAV"])
if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:
@"trnscdVideoCodec"] intValue]] containsObject: @"MUX_WAV"])
{
if ([[o_audioCodecs objectAtIndex:i_selectedAudioCodec] containsObject: @"MUX_WAV"])
if ([[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey:
@"trnscdAudioCodec"] intValue]] containsObject: @"MUX_WAV"])
{
[[o_t5_matrix_encap cellAtRow:8 column:0] setEnabled:YES];
[o_t5_matrix_encap selectCellAtRow:8 column:0];
......@@ -815,47 +836,56 @@ static VLCWizard *_o_sharedInstance = nil;
/* we just transcoding the audio */
/* select formats supported by the audio codec */
if ([[o_audioCodecs objectAtIndex:i_selectedAudioCodec] 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_audioCodecs objectAtIndex:i_selectedAudioCodec] 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_audioCodecs objectAtIndex:i_selectedAudioCodec] 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_audioCodecs objectAtIndex:i_selectedAudioCodec] 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_audioCodecs objectAtIndex:i_selectedAudioCodec] 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_audioCodecs objectAtIndex:i_selectedAudioCodec] 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_audioCodecs objectAtIndex:i_selectedAudioCodec] containsObject: @"MUX_MP4"])
if ([[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey:
@"trnscdAudioCodec"] intValue]] containsObject: @"MUX_MP4"])
{
[[o_t5_matrix_encap cellAtRow:6 column:0] setEnabled:YES];
[o_t5_matrix_encap selectCellAtRow:6 column:0];
}
if ([[o_audioCodecs objectAtIndex:i_selectedAudioCodec] containsObject: @"MUX_MOV"])
if ([[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey:
@"trnscdAudioCodec"] intValue]] containsObject: @"MUX_MOV"])
{
[[o_t5_matrix_encap cellAtRow:7 column:0] setEnabled:YES];
[o_t5_matrix_encap selectCellAtRow:7 column:0];
}
if ([[o_audioCodecs objectAtIndex:i_selectedAudioCodec] containsObject: @"MUX_WAV"])
if ([[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey:
@"trnscdAudioCodec"] intValue]] containsObject: @"MUX_WAV"])
{
[[o_t5_matrix_encap cellAtRow:8 column:0] setEnabled:YES];
[o_t5_matrix_encap selectCellAtRow:8 column:0];
......@@ -867,49 +897,57 @@ static VLCWizard *_o_sharedInstance = nil;
/* we are just transcoding the video */
/* select formats supported by the video-codec */
NSInteger i_selectedVideoCodec = [[o_userSelections objectForKey:@"trnscdVideoCodec"] intValue];
if ([[o_videoCodecs objectAtIndex:i_selectedVideoCodec] containsObject: @"MUX_PS"])
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:i_selectedVideoCodec] containsObject: @"MUX_TS"])
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:i_selectedVideoCodec] containsObject: @"MUX_MPEG"])
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:i_selectedVideoCodec] containsObject: @"MUX_OGG"])
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:i_selectedVideoCodec] containsObject: @"MUX_RAW"])
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:i_selectedVideoCodec] containsObject: @"MUX_ASF"])
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:i_selectedVideoCodec] containsObject: @"MUX_MP4"])
if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:
@"trnscdVideoCodec"] intValue]] containsObject: @"MUX_MP4"])
{
[[o_t5_matrix_encap cellAtRow:6 column:0] setEnabled:YES];
[o_t5_matrix_encap selectCellAtRow:6 column:0];
}
if ([[o_videoCodecs objectAtIndex:i_selectedVideoCodec] containsObject: @"MUX_MOV"])
if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:
@"trnscdVideoCodec"] intValue]] containsObject: @"MUX_MOV"])
{
[[o_t5_matrix_encap cellAtRow:7 column:0] setEnabled:YES];
[o_t5_matrix_encap selectCellAtRow:7 column:0];
}
if ([[o_videoCodecs objectAtIndex:i_selectedVideoCodec] containsObject: @"MUX_WAV"])
if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:
@"trnscdVideoCodec"] intValue]] containsObject: @"MUX_WAV"])
{
[[o_t5_matrix_encap cellAtRow:8 column:0] setEnabled:YES];
[o_t5_matrix_encap selectCellAtRow:8 column:0];
......@@ -937,8 +975,7 @@ static VLCWizard *_o_sharedInstance = nil;
[o_t5_matrix_encap selectCellAtRow:0 column:0];
}
NSInteger i_streamingMethod = [[o_userSelections objectForKey:@"stmgMhd"] intValue];
if ( i_streamingMethod == 1 )
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];
......@@ -953,7 +990,7 @@ static VLCWizard *_o_sharedInstance = nil;
[[o_t5_matrix_encap cellAtRow:9 column:0] setEnabled:YES];
[o_t5_matrix_encap selectCellAtRow:9 column:0];
}
else if ( i_streamingMethod == 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 */
......@@ -962,7 +999,7 @@ static VLCWizard *_o_sharedInstance = nil;
[[o_t5_matrix_encap cellAtRow:8 column:0] setEnabled:NO];
[[o_t5_matrix_encap cellAtRow:9 column:0] setEnabled:NO];
}
else if ( i_streamingMethod >= 2 )
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];
......@@ -977,16 +1014,18 @@ static VLCWizard *_o_sharedInstance = nil;
[[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;
NSUInteger count = [o_t5_matrix_encap numberOfRows];
for (NSUInteger x = 0; x < count; x++ )
while (x != [o_t5_matrix_encap numberOfRows])
{
if ([[o_t5_matrix_encap cellAtRow:x column:0] isEnabled])
{
anythingEnabled = YES;
}
x += 1;
}
if (anythingEnabled == YES)
{
/* re-select the previously chosen item, if available */
......@@ -1005,7 +1044,7 @@ static VLCWizard *_o_sharedInstance = nil;
}
}
else if ([selectedTabViewItemLabel isEqualToString: @"Encap"])
else if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString: @"Encap"])
{
/* get the chosen encap format and store it */
NSNumber * theNum;
......@@ -1034,7 +1073,8 @@ static VLCWizard *_o_sharedInstance = nil;
}
}
}
else if ([selectedTabViewItemLabel isEqualToString: @"Streaming 2"])
else if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString:
@"Streaming 2"])
{
/* store the chosen TTL */
[o_userSelections setObject:[o_t6_fld_ttl stringValue] forKey:@"ttl"];
......@@ -1064,7 +1104,8 @@ static VLCWizard *_o_sharedInstance = nil;
/* go to "Summary" */
[self showSummary];
}
else if ([selectedTabViewItemLabel isEqualToString: @"Transcode 2"])
else if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString:
@"Transcode 2"])
{
/* local playback? */
if ([o_t7_ckb_local state] == NSOnState)
......@@ -1081,17 +1122,17 @@ static VLCWizard *_o_sharedInstance = nil;
if( [[o_userSelections objectForKey:@"pathToStrm"] count] > 1 )
NSBeginInformationalAlertSheet(_NS("No folder selected"),
_NS("OK"), @"", @"", o_wizard_window, nil, nil, nil, nil,
@"%@\n\n%@", _NS("A directory "
[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."));
"button to select a location.")]);
else
NSBeginInformationalAlertSheet(_NS("No file selected"),
_NS("OK"), @"", @"", o_wizard_window, nil, nil, nil, nil,
@"%@\n\n%@", _NS("A file "
[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."));
"button to select a location.")]);
} else {
/* create a string containing the requested suffix for later usage */
NSString * theEncapFormat = [[o_encapFormats objectAtIndex:
......@@ -1193,7 +1234,8 @@ static VLCWizard *_o_sharedInstance = nil;
[self showSummary];
}
}
else if ([selectedTabViewItemLabel isEqualToString: @"Summary"])
else if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString:
@"Summary"])
{
intf_thread_t * p_intf = VLCIntf;
......@@ -1239,9 +1281,10 @@ static VLCWizard *_o_sharedInstance = nil;
UTF8String],
VLC_INPUT_OPTION_TRUSTED );
int returnValue = playlist_AddInput( p_playlist, p_input, PLAYLIST_STOP, PLAYLIST_END, true, pl_Unlocked );
int returnValue = playlist_AddInput( p_playlist, p_input, PLAYLIST_STOP,
PLAYLIST_END, true, pl_Unlocked );
if( x == 0 && returnValue != VLC_SUCCESS)
if( x == 0 && returnValue == VLC_SUCCESS)
{
/* play the first item and add the others afterwards */
PL_LOCK;
......@@ -1265,24 +1308,27 @@ static VLCWizard *_o_sharedInstance = nil;
int savePreviousSel = 0;
savePreviousSel = [o_t4_pop_videoCodec indexOfSelectedItem];
[o_t4_pop_videoCodec removeAllItems];
NSUInteger count = [o_videoCodecs count];
for (NSUInteger x = 0; x < count; x++ )
unsigned int x;
x = 0;
while (x != [o_videoCodecs count])
{
[o_t4_pop_videoCodec addItemWithTitle:[[o_videoCodecs objectAtIndex:x]
objectAtIndex:0]];
[[o_t4_pop_videoCodec lastItem] setTag:x];
x += 1;
}
if( savePreviousSel >= 0 )
[o_t4_pop_videoCodec selectItemAtIndex: savePreviousSel];
savePreviousSel = [o_t4_pop_audioCodec indexOfSelectedItem];
[o_t4_pop_audioCodec removeAllItems];
count = [o_audioCodecs count];
for (NSUInteger x = 0; x < count; x++)
x = 0;
while (x != [o_audioCodecs count])
{
[o_t4_pop_audioCodec addItemWithTitle:[[o_audioCodecs objectAtIndex:x]
objectAtIndex:0]];
[[o_t4_pop_audioCodec lastItem] setTag:x];
x += 1;
}
if( savePreviousSel >= 0 )
[o_t4_pop_audioCodec selectItemAtIndex: savePreviousSel];
......@@ -1376,7 +1422,7 @@ static VLCWizard *_o_sharedInstance = nil;
/* do only show the destination of the first item and add a counter, if needed */
if( [[o_userSelections objectForKey: @"trnscdFilePath"] count] > 1 )
[o_t8_fld_saveFileTo setStringValue:
[NSString stringWithFormat: @"%@ (+%li)",
[NSString stringWithFormat: @"%@ (+%i)",
[[o_userSelections objectForKey: @"trnscdFilePath"] objectAtIndex:0],
([[o_userSelections objectForKey: @"trnscdFilePath"] count] - 1)]];
else
......@@ -1541,9 +1587,7 @@ static VLCWizard *_o_sharedInstance = nil;
- (IBAction)prevTab:(id)sender
{
NSString * selectedTabViewItemLabel = [[o_tab_pageHolder selectedTabViewItem] label];
if ([selectedTabViewItemLabel isEqualToString: @"Summary"])
if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString: @"Summary"])
{
/* check whether we are streaming or transcoding and go back */
if ([[o_userSelections objectForKey:@"trnscdOrStrmg"] isEqualToString:@"strmg"])
......@@ -1557,27 +1601,32 @@ static VLCWizard *_o_sharedInstance = nil;
/* rename the forward-button */
[o_btn_forward setTitle: _NS("Next")];
}
else if ([selectedTabViewItemLabel isEqualToString: @"Transcode 2"])
else if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString:
@"Transcode 2"])
{
/* show "Encap" */
[o_tab_pageHolder selectTabViewItemAtIndex:4];
}
else if ([selectedTabViewItemLabel isEqualToString: @"Streaming 2"])
else if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString:
@"Streaming 2"])
{
/* show "Encap" */
[o_tab_pageHolder selectTabViewItemAtIndex:4];
}
else if ([selectedTabViewItemLabel isEqualToString: @"Encap"])
else if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString:
@"Encap"])
{
/* show "Transcode 1" */
[o_tab_pageHolder selectTabViewItemAtIndex:3];
}
else if ([selectedTabViewItemLabel isEqualToString: @"Streaming 1"])
else if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString:
@"Streaming 1"])
{
/* show "Input" */
[o_tab_pageHolder selectTabViewItemAtIndex:1];
}
else if ([selectedTabViewItemLabel isEqualToString: @"Transcode 1"])
else if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString:
@"Transcode 1"])
{
if ([[o_userSelections objectForKey:@"trnscdOrStrmg"] isEqualToString:@"strmg"])
{
......@@ -1588,7 +1637,8 @@ static VLCWizard *_o_sharedInstance = nil;
[o_tab_pageHolder selectTabViewItemAtIndex:1];
}
}
else if ([selectedTabViewItemLabel isEqualToString: @"Input"])
else if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString:
@"Input"])
{
/* reset the wizard before going backwards. Otherwise, we might get
* unwanted behaviour in the Encap-Selection */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment