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 @@ ...@@ -4,7 +4,7 @@
* Copyright (C) 2005-2012 VLC authors and VideoLAN * Copyright (C) 2005-2012 VLC authors and VideoLAN
* $Id$ * $Id$
* *
* Authors: Felix Paul Khne <fkuehne at videolan dot org>, * Authors: Felix hne <fkuehne at videolan dot org>,
* Brendon Justin <brendonjustin at gmail.com> * Brendon Justin <brendonjustin at gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -487,8 +487,7 @@ static VLCWizard *_o_sharedInstance = nil; ...@@ -487,8 +487,7 @@ static VLCWizard *_o_sharedInstance = nil;
- (IBAction)nextTab:(id)sender - (IBAction)nextTab:(id)sender
{ {
NSString * selectedTabViewItemLabel = [[o_tab_pageHolder selectedTabViewItem] label]; if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString: @"Hello"])
if ([selectedTabViewItemLabel isEqualToString: @"Hello"])
{ {
/* check whether the user wants to stream or just to transcode; /* check whether the user wants to stream or just to transcode;
* store information for later usage */ * store information for later usage */
...@@ -511,7 +510,7 @@ static VLCWizard *_o_sharedInstance = nil; ...@@ -511,7 +510,7 @@ static VLCWizard *_o_sharedInstance = nil;
[o_playlist_wizard reloadOutlineView]; [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 */ /* check whether partialExtract is enabled and store the values, if needed */
if ([o_t2_ckb_enblPartExtrct state] == NSOnState) if ([o_t2_ckb_enblPartExtrct state] == NSOnState)
...@@ -550,12 +549,15 @@ static VLCWizard *_o_sharedInstance = nil; ...@@ -550,12 +549,15 @@ static VLCWizard *_o_sharedInstance = nil;
{ {
if ([o_t2_tbl_plst numberOfSelectedRows] > 0) if ([o_t2_tbl_plst numberOfSelectedRows] > 0)
{ {
NSIndexSet * selectedIndexes = [o_t2_tbl_plst selectedRowIndexes]; int x = 0;
NSUInteger count = [selectedIndexes count]; int y = [[o_t2_tbl_plst selectedRowIndexes] count];
NSMutableArray * tempArray = [[NSMutableArray alloc] init]; 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 ) if( p_item->i_children <= 0 )
{ {
...@@ -566,8 +568,10 @@ static VLCWizard *_o_sharedInstance = nil; ...@@ -566,8 +568,10 @@ static VLCWizard *_o_sharedInstance = nil;
} }
else else
stop = YES; stop = YES;
x += 1;
} }
[o_userSelections setObject:[NSArray arrayWithArray: tempArray] forKey:@"pathToStrm"]; [o_userSelections setObject:[NSArray arrayWithArray: tempArray]
forKey:@"pathToStrm"];
[tempArray release]; [tempArray release];
} }
else else
...@@ -601,7 +605,8 @@ static VLCWizard *_o_sharedInstance = nil; ...@@ -601,7 +605,8 @@ static VLCWizard *_o_sharedInstance = nil;
"Choose one before going to the next page.")); "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 */ /* rebuild the menues for the codec-selections */
[self rebuildCodecMenus]; [self rebuildCodecMenus];
...@@ -678,7 +683,8 @@ static VLCWizard *_o_sharedInstance = nil; ...@@ -678,7 +683,8 @@ static VLCWizard *_o_sharedInstance = nil;
[o_tab_pageHolder selectTabViewItemAtIndex:3]; [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 /* check whether the user wants to transcode the video-track and store
* the related options */ * the related options */
...@@ -730,80 +736,95 @@ static VLCWizard *_o_sharedInstance = nil; ...@@ -730,80 +736,95 @@ static VLCWizard *_o_sharedInstance = nil;
if ([[o_userSelections objectForKey:@"trnscdAudio"] isEqualTo: @"YES"]) if ([[o_userSelections objectForKey:@"trnscdAudio"] isEqualTo: @"YES"])
{ {
NSInteger i_selectedAudioCodec = [[o_userSelections objectForKey:@"trnscdAudioCodec"] intValue];
if ([[o_userSelections objectForKey:@"trnscdVideo"] isEqualTo: @"YES"]) 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 */ /* 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 cellAtRow:0 column:0] setEnabled:YES];
[o_t5_matrix_encap selectCellAtRow:0 column:0]; [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 cellAtRow:1 column:0] setEnabled:YES];
[o_t5_matrix_encap selectCellAtRow:1 column:0]; [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 cellAtRow:2 column:0] setEnabled:YES];
[o_t5_matrix_encap selectCellAtRow:2 column:0]; [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 cellAtRow:3 column:0] setEnabled:YES];
[o_t5_matrix_encap selectCellAtRow:3 column:0]; [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 cellAtRow:4 column:0] setEnabled:YES];
[o_t5_matrix_encap selectCellAtRow:4 column:0]; [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 cellAtRow:5 column:0] setEnabled:YES];
[o_t5_matrix_encap selectCellAtRow:5 column:0]; [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 cellAtRow:6 column:0] setEnabled:YES];
[o_t5_matrix_encap selectCellAtRow:6 column:0]; [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 cellAtRow:7 column:0] setEnabled:YES];
[o_t5_matrix_encap selectCellAtRow:7 column:0]; [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 cellAtRow:8 column:0] setEnabled:YES];
[o_t5_matrix_encap selectCellAtRow:8 column:0]; [o_t5_matrix_encap selectCellAtRow:8 column:0];
...@@ -815,47 +836,56 @@ static VLCWizard *_o_sharedInstance = nil; ...@@ -815,47 +836,56 @@ static VLCWizard *_o_sharedInstance = nil;
/* we just transcoding the audio */ /* we just transcoding the audio */
/* select formats supported by the audio codec */ /* 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 cellAtRow:0 column:0] setEnabled:YES];
[o_t5_matrix_encap selectCellAtRow:0 column:0]; [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 cellAtRow:1 column:0] setEnabled:YES];
[o_t5_matrix_encap selectCellAtRow:1 column:0]; [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 cellAtRow:2 column:0] setEnabled:YES];
[o_t5_matrix_encap selectCellAtRow:2 column:0]; [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 cellAtRow:3 column:0] setEnabled:YES];
[o_t5_matrix_encap selectCellAtRow:3 column:0]; [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 cellAtRow:4 column:0] setEnabled:YES];
[o_t5_matrix_encap selectCellAtRow:4 column:0]; [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 cellAtRow:5 column:0] setEnabled:YES];
[o_t5_matrix_encap selectCellAtRow:5 column:0]; [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 cellAtRow:6 column:0] setEnabled:YES];
[o_t5_matrix_encap selectCellAtRow:6 column:0]; [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 cellAtRow:7 column:0] setEnabled:YES];
[o_t5_matrix_encap selectCellAtRow:7 column:0]; [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 cellAtRow:8 column:0] setEnabled:YES];
[o_t5_matrix_encap selectCellAtRow:8 column:0]; [o_t5_matrix_encap selectCellAtRow:8 column:0];
...@@ -867,49 +897,57 @@ static VLCWizard *_o_sharedInstance = nil; ...@@ -867,49 +897,57 @@ static VLCWizard *_o_sharedInstance = nil;
/* we are just transcoding the video */ /* we are just transcoding the video */
/* select formats supported by the video-codec */ /* 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 cellAtRow:0 column:0] setEnabled:YES];
[o_t5_matrix_encap selectCellAtRow:0 column:0]; [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 cellAtRow:1 column:0] setEnabled:YES];
[o_t5_matrix_encap selectCellAtRow:1 column:0]; [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 cellAtRow:2 column:0] setEnabled:YES];
[o_t5_matrix_encap selectCellAtRow:2 column:0]; [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 cellAtRow:3 column:0] setEnabled:YES];
[o_t5_matrix_encap selectCellAtRow:3 column:0]; [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 cellAtRow:4 column:0] setEnabled:YES];
[o_t5_matrix_encap selectCellAtRow:4 column:0]; [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 cellAtRow:5 column:0] setEnabled:YES];
[o_t5_matrix_encap selectCellAtRow:5 column:0]; [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 cellAtRow:6 column:0] setEnabled:YES];
[o_t5_matrix_encap selectCellAtRow:6 column:0]; [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 cellAtRow:7 column:0] setEnabled:YES];
[o_t5_matrix_encap selectCellAtRow:7 column:0]; [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 cellAtRow:8 column:0] setEnabled:YES];
[o_t5_matrix_encap selectCellAtRow:8 column:0]; [o_t5_matrix_encap selectCellAtRow:8 column:0];
...@@ -937,8 +975,7 @@ static VLCWizard *_o_sharedInstance = nil; ...@@ -937,8 +975,7 @@ static VLCWizard *_o_sharedInstance = nil;
[o_t5_matrix_encap selectCellAtRow:0 column:0]; [o_t5_matrix_encap selectCellAtRow:0 column:0];
} }
NSInteger i_streamingMethod = [[o_userSelections objectForKey:@"stmgMhd"] intValue]; if ( [o_userSelections objectForKey:@"stmgMhd"] == @"1" )
if ( i_streamingMethod == 1 )
{ {
/* if MMS is the streaming protocol, only ASFH is available */ /* 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:0 column:0] setEnabled:NO];
...@@ -953,7 +990,7 @@ static VLCWizard *_o_sharedInstance = nil; ...@@ -953,7 +990,7 @@ static VLCWizard *_o_sharedInstance = nil;
[[o_t5_matrix_encap cellAtRow:9 column:0] setEnabled:YES]; [[o_t5_matrix_encap cellAtRow:9 column:0] setEnabled:YES];
[o_t5_matrix_encap selectCellAtRow:9 column:0]; [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 /* if HTTP is the streaming protocol, disable all unsupported
* encap-formats, but don't touch the other ones selected above */ * encap-formats, but don't touch the other ones selected above */
...@@ -962,7 +999,7 @@ static VLCWizard *_o_sharedInstance = nil; ...@@ -962,7 +999,7 @@ static VLCWizard *_o_sharedInstance = nil;
[[o_t5_matrix_encap cellAtRow:8 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: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 */ /* 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:0 column:0] setEnabled:NO];
...@@ -977,16 +1014,18 @@ static VLCWizard *_o_sharedInstance = nil; ...@@ -977,16 +1014,18 @@ static VLCWizard *_o_sharedInstance = nil;
[[o_t5_matrix_encap cellAtRow:1 column:0] setEnabled:YES]; [[o_t5_matrix_encap cellAtRow:1 column:0] setEnabled:YES];
[o_t5_matrix_encap selectCellAtRow:1 column:0]; [o_t5_matrix_encap selectCellAtRow:1 column:0];
} }
int x;
BOOL anythingEnabled; BOOL anythingEnabled;
x = 0;
anythingEnabled = NO; anythingEnabled = NO;
NSUInteger count = [o_t5_matrix_encap numberOfRows]; while (x != [o_t5_matrix_encap numberOfRows])
for (NSUInteger x = 0; x < count; x++ )
{ {
if ([[o_t5_matrix_encap cellAtRow:x column:0] isEnabled]) if ([[o_t5_matrix_encap cellAtRow:x column:0] isEnabled])
{
anythingEnabled = YES; anythingEnabled = YES;
}
x += 1;
} }
if (anythingEnabled == YES) if (anythingEnabled == YES)
{ {
/* re-select the previously chosen item, if available */ /* re-select the previously chosen item, if available */
...@@ -1005,7 +1044,7 @@ static VLCWizard *_o_sharedInstance = nil; ...@@ -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 */ /* get the chosen encap format and store it */
NSNumber * theNum; NSNumber * theNum;
...@@ -1034,7 +1073,8 @@ static VLCWizard *_o_sharedInstance = nil; ...@@ -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 */ /* store the chosen TTL */
[o_userSelections setObject:[o_t6_fld_ttl stringValue] forKey:@"ttl"]; [o_userSelections setObject:[o_t6_fld_ttl stringValue] forKey:@"ttl"];
...@@ -1064,7 +1104,8 @@ static VLCWizard *_o_sharedInstance = nil; ...@@ -1064,7 +1104,8 @@ static VLCWizard *_o_sharedInstance = nil;
/* go to "Summary" */ /* go to "Summary" */
[self showSummary]; [self showSummary];
} }
else if ([selectedTabViewItemLabel isEqualToString: @"Transcode 2"]) else if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString:
@"Transcode 2"])
{ {
/* local playback? */ /* local playback? */
if ([o_t7_ckb_local state] == NSOnState) if ([o_t7_ckb_local state] == NSOnState)
...@@ -1081,17 +1122,17 @@ static VLCWizard *_o_sharedInstance = nil; ...@@ -1081,17 +1122,17 @@ static VLCWizard *_o_sharedInstance = nil;
if( [[o_userSelections objectForKey:@"pathToStrm"] count] > 1 ) if( [[o_userSelections objectForKey:@"pathToStrm"] count] > 1 )
NSBeginInformationalAlertSheet(_NS("No folder selected"), NSBeginInformationalAlertSheet(_NS("No folder selected"),
_NS("OK"), @"", @"", o_wizard_window, nil, nil, nil, nil, _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."), "where to save the files has to be selected."),
_NS("Enter either a valid path or use the \"Choose...\" " _NS("Enter either a valid path or use the \"Choose...\" "
"button to select a location.")); "button to select a location.")]);
else else
NSBeginInformationalAlertSheet(_NS("No file selected"), NSBeginInformationalAlertSheet(_NS("No file selected"),
_NS("OK"), @"", @"", o_wizard_window, nil, nil, nil, nil, _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."), "where to save the stream has to be selected."),
_NS("Enter either a valid path or use the \"Choose\" " _NS("Enter either a valid path or use the \"Choose\" "
"button to select a location.")); "button to select a location.")]);
} else { } else {
/* create a string containing the requested suffix for later usage */ /* create a string containing the requested suffix for later usage */
NSString * theEncapFormat = [[o_encapFormats objectAtIndex: NSString * theEncapFormat = [[o_encapFormats objectAtIndex:
...@@ -1193,7 +1234,8 @@ static VLCWizard *_o_sharedInstance = nil; ...@@ -1193,7 +1234,8 @@ static VLCWizard *_o_sharedInstance = nil;
[self showSummary]; [self showSummary];
} }
} }
else if ([selectedTabViewItemLabel isEqualToString: @"Summary"]) else if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString:
@"Summary"])
{ {
intf_thread_t * p_intf = VLCIntf; intf_thread_t * p_intf = VLCIntf;
...@@ -1239,9 +1281,10 @@ static VLCWizard *_o_sharedInstance = nil; ...@@ -1239,9 +1281,10 @@ static VLCWizard *_o_sharedInstance = nil;
UTF8String], UTF8String],
VLC_INPUT_OPTION_TRUSTED ); 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 */ /* play the first item and add the others afterwards */
PL_LOCK; PL_LOCK;
...@@ -1265,24 +1308,27 @@ static VLCWizard *_o_sharedInstance = nil; ...@@ -1265,24 +1308,27 @@ static VLCWizard *_o_sharedInstance = nil;
int savePreviousSel = 0; int savePreviousSel = 0;
savePreviousSel = [o_t4_pop_videoCodec indexOfSelectedItem]; savePreviousSel = [o_t4_pop_videoCodec indexOfSelectedItem];
[o_t4_pop_videoCodec removeAllItems]; [o_t4_pop_videoCodec removeAllItems];
NSUInteger count = [o_videoCodecs count]; unsigned int x;
for (NSUInteger x = 0; x < count; x++ ) x = 0;
while (x != [o_videoCodecs count])
{ {
[o_t4_pop_videoCodec addItemWithTitle:[[o_videoCodecs objectAtIndex:x] [o_t4_pop_videoCodec addItemWithTitle:[[o_videoCodecs objectAtIndex:x]
objectAtIndex:0]]; objectAtIndex:0]];
[[o_t4_pop_videoCodec lastItem] setTag:x]; [[o_t4_pop_videoCodec lastItem] setTag:x];
x += 1;
} }
if( savePreviousSel >= 0 ) if( savePreviousSel >= 0 )
[o_t4_pop_videoCodec selectItemAtIndex: savePreviousSel]; [o_t4_pop_videoCodec selectItemAtIndex: savePreviousSel];
savePreviousSel = [o_t4_pop_audioCodec indexOfSelectedItem]; savePreviousSel = [o_t4_pop_audioCodec indexOfSelectedItem];
[o_t4_pop_audioCodec removeAllItems]; [o_t4_pop_audioCodec removeAllItems];
count = [o_audioCodecs count]; x = 0;
for (NSUInteger x = 0; x < count; x++) while (x != [o_audioCodecs count])
{ {
[o_t4_pop_audioCodec addItemWithTitle:[[o_audioCodecs objectAtIndex:x] [o_t4_pop_audioCodec addItemWithTitle:[[o_audioCodecs objectAtIndex:x]
objectAtIndex:0]]; objectAtIndex:0]];
[[o_t4_pop_audioCodec lastItem] setTag:x]; [[o_t4_pop_audioCodec lastItem] setTag:x];
x += 1;
} }
if( savePreviousSel >= 0 ) if( savePreviousSel >= 0 )
[o_t4_pop_audioCodec selectItemAtIndex: savePreviousSel]; [o_t4_pop_audioCodec selectItemAtIndex: savePreviousSel];
...@@ -1376,7 +1422,7 @@ static VLCWizard *_o_sharedInstance = nil; ...@@ -1376,7 +1422,7 @@ static VLCWizard *_o_sharedInstance = nil;
/* do only show the destination of the first item and add a counter, if needed */ /* do only show the destination of the first item and add a counter, if needed */
if( [[o_userSelections objectForKey: @"trnscdFilePath"] count] > 1 ) if( [[o_userSelections objectForKey: @"trnscdFilePath"] count] > 1 )
[o_t8_fld_saveFileTo setStringValue: [o_t8_fld_saveFileTo setStringValue:
[NSString stringWithFormat: @"%@ (+%li)", [NSString stringWithFormat: @"%@ (+%i)",
[[o_userSelections objectForKey: @"trnscdFilePath"] objectAtIndex:0], [[o_userSelections objectForKey: @"trnscdFilePath"] objectAtIndex:0],
([[o_userSelections objectForKey: @"trnscdFilePath"] count] - 1)]]; ([[o_userSelections objectForKey: @"trnscdFilePath"] count] - 1)]];
else else
...@@ -1541,9 +1587,7 @@ static VLCWizard *_o_sharedInstance = nil; ...@@ -1541,9 +1587,7 @@ static VLCWizard *_o_sharedInstance = nil;
- (IBAction)prevTab:(id)sender - (IBAction)prevTab:(id)sender
{ {
NSString * selectedTabViewItemLabel = [[o_tab_pageHolder selectedTabViewItem] label]; if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString: @"Summary"])
if ([selectedTabViewItemLabel isEqualToString: @"Summary"])
{ {
/* check whether we are streaming or transcoding and go back */ /* check whether we are streaming or transcoding and go back */
if ([[o_userSelections objectForKey:@"trnscdOrStrmg"] isEqualToString:@"strmg"]) if ([[o_userSelections objectForKey:@"trnscdOrStrmg"] isEqualToString:@"strmg"])
...@@ -1557,27 +1601,32 @@ static VLCWizard *_o_sharedInstance = nil; ...@@ -1557,27 +1601,32 @@ static VLCWizard *_o_sharedInstance = nil;
/* rename the forward-button */ /* rename the forward-button */
[o_btn_forward setTitle: _NS("Next")]; [o_btn_forward setTitle: _NS("Next")];
} }
else if ([selectedTabViewItemLabel isEqualToString: @"Transcode 2"]) else if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString:
@"Transcode 2"])
{ {
/* show "Encap" */ /* show "Encap" */
[o_tab_pageHolder selectTabViewItemAtIndex:4]; [o_tab_pageHolder selectTabViewItemAtIndex:4];
} }
else if ([selectedTabViewItemLabel isEqualToString: @"Streaming 2"]) else if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString:
@"Streaming 2"])
{ {
/* show "Encap" */ /* show "Encap" */
[o_tab_pageHolder selectTabViewItemAtIndex:4]; [o_tab_pageHolder selectTabViewItemAtIndex:4];
} }
else if ([selectedTabViewItemLabel isEqualToString: @"Encap"]) else if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString:
@"Encap"])
{ {
/* show "Transcode 1" */ /* show "Transcode 1" */
[o_tab_pageHolder selectTabViewItemAtIndex:3]; [o_tab_pageHolder selectTabViewItemAtIndex:3];
} }
else if ([selectedTabViewItemLabel isEqualToString: @"Streaming 1"]) else if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString:
@"Streaming 1"])
{ {
/* show "Input" */ /* show "Input" */
[o_tab_pageHolder selectTabViewItemAtIndex:1]; [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"]) if ([[o_userSelections objectForKey:@"trnscdOrStrmg"] isEqualToString:@"strmg"])
{ {
...@@ -1588,7 +1637,8 @@ static VLCWizard *_o_sharedInstance = nil; ...@@ -1588,7 +1637,8 @@ static VLCWizard *_o_sharedInstance = nil;
[o_tab_pageHolder selectTabViewItemAtIndex:1]; [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 /* reset the wizard before going backwards. Otherwise, we might get
* unwanted behaviour in the Encap-Selection */ * 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