]> git.sesse.net Git - vlc/blob - modules/gui/macosx/wizard.m
* additional GUI-fixes
[vlc] / modules / gui / macosx / wizard.m
1 /*****************************************************************************
2  * wizard.m: MacOS X Streaming Wizard
3  *****************************************************************************
4  * Copyright (C) 2005 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Felix Kühne <fkuehne@users.sf.net> 
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  * 
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
22  *****************************************************************************/
23
24  
25 /*****************************************************************************
26  * Note: this code is partially based upon ../wxwindows/wizard.cpp and 
27  *               ../wxwindows/streamdata.h; both written by Clément Stenac.
28  *****************************************************************************/ 
29
30 /* TODO:
31         - MRL composition when streaming
32     - putting the MRL and the next item to the playlist
33         - l10n string fixes (both in OSX and WX)
34         - fill the playlist-table on t2
35         - implement l10n on t8?
36         - see FIXME's
37 */
38
39  
40 /*****************************************************************************
41  * Preamble
42  *****************************************************************************/ 
43 #import "wizard.h"
44 #import "intf.h"
45
46
47 /*****************************************************************************
48  * VLCWizard implementation
49  *****************************************************************************/
50
51 @implementation VLCWizard
52
53 static VLCWizard *_o_sharedInstance = nil;
54
55 + (VLCWizard *)sharedInstance
56 {
57     return _o_sharedInstance ? _o_sharedInstance : [[self alloc] init];
58 }
59
60 - (id)init 
61 {
62     if (_o_sharedInstance) {
63         [self dealloc];
64     } else {
65         _o_sharedInstance = [super init];
66     }
67     
68     return _o_sharedInstance;
69 }
70
71 - (void)awakeFromNib
72 {
73     /* some minor cleanup */
74     [o_t2_tbl_plst setEnabled:NO];
75         [o_wizardhelp_window setExcludedFromWindowsMenu:YES];
76         o_userSelections = [[NSMutableDictionary alloc] init];
77         [o_btn_backward setEnabled:NO];
78
79     /* add audio-bitrates for transcoding */
80     NSArray * audioBitratesArray;
81     audioBitratesArray = [NSArray arrayWithObjects: @"512", @"256", @"192", @"128", @"64", @"32", @"16", nil ];
82     [o_t4_pop_audioBitrate removeAllItems];
83     [o_t4_pop_audioBitrate addItemsWithTitles: audioBitratesArray];
84     [o_t4_pop_audioBitrate selectItemWithTitle: @"192"];
85     
86     /* add video-bitrates for transcoding */
87     NSArray * videoBitratesArray;
88     videoBitratesArray = [NSArray arrayWithObjects: @"3072", @"2048", @"1024", @"768", @"512", @"256", @"192", @"128", @"64", @"32", @"16", nil ];
89     [o_t4_pop_videoBitrate removeAllItems];
90     [o_t4_pop_videoBitrate addItemsWithTitles: videoBitratesArray];
91     [o_t4_pop_videoBitrate selectItemWithTitle: @"1024"];
92     
93         /* fill 2 global arrays with arrays containing all codec-related information
94          * - one array per codec named by its short name to define the encap-compability, 
95          *       cmd-names, real names, more info in the order: realName, shortName, 
96          *       moreInfo, encaps */
97         NSArray * o_mp1v;
98         NSArray * o_mp2v;
99         NSArray * o_mp4v;
100         NSArray * o_div1;
101         NSArray * o_div2;
102         NSArray * o_div3;
103         NSArray * o_h263;
104         NSArray * o_h264;
105         NSArray * o_wmv1;
106         NSArray * o_wmv2;
107         NSArray * o_mjpg;
108         NSArray * o_theo;
109         NSArray * o_dummyVid;
110         o_mp1v = [NSArray arrayWithObjects: @"MPEG-1 Video", @"mp1v", _NS("MPEG-1 Video codec"), @"MUX_PS", @"MUX_TS", @"MUX_MPEG", @"MUX_OGG", @"MUX_RAW", @"NO", @"NO", @"NO", @"NO", nil];
111         o_mp2v = [NSArray arrayWithObjects: @"MPEG-2 Video", @"mp2v", _NS("MPEG-2 Video codec"), @"MUX_PS", @"MUX_TS", @"MUX_MPEG", @"MUX_OGG", @"MUX_RAW", @"NO", @"NO", @"NO", @"NO", nil];
112         o_mp4v = [NSArray arrayWithObjects: @"MPEG-4 Video", @"mp4v", _NS("MPEG-4 Video codec"), @"MUX_PS", @"MUX_TS", @"MUX_MPEG", @"MUX_ASF", @"MUX_MP4", @"MUX_OGG", @"MUX_RAW", @"NO", @"NO", nil];
113         o_div1 = [NSArray arrayWithObjects: @"DIVX 1", @"DIV1", _NS("DivX first version"), @"MUX_TS", @"MUX_MPEG", @"MUX_ASF", @"MUX_OGG", @"NO", @"NO", @"NO", @"NO", @"NO", nil];
114         o_div2 = [NSArray arrayWithObjects: @"DIVX 2", @"DIV2", _NS("DivX second version"), @"MUX_TS", @"MUX_MPEG", @"MUX_ASF", @"MUX_OGG", @"NO", @"NO", @"NO", @"NO", @"NO", nil];
115         o_div3 = [NSArray arrayWithObjects: @"DIVX 3", @"DIV3", _NS("DivX third version"), @"MUX_TS", @"MUX_MPEG", @"MUX_ASF", @"MUX_OGG", @"NO", @"NO", @"NO", @"NO", @"NO", nil];
116         o_h263 = [NSArray arrayWithObjects: @"H 263", @"H263", _NS("H263 is a video codec optimized for videoconference (low rates)"), @"MUX_TS", @"MUX_AVI", @"NO", @"NO", @"NO", @"NO", @"NO", @"NO", @"NO", nil];
117         o_h264 = [NSArray arrayWithObjects: @"H 264", @"H264", _NS("H264 is a new video codec"), @"MUX_TS", @"MUX_AVI", @"NO", @"NO", @"NO", @"NO", @"NO", @"NO", @"NO", nil];
118         o_wmv1 = [NSArray arrayWithObjects: @"WMV 1", @"WMV1", _NS("WMV (Windows Media Video) 1"), @"MUX_TS", @"MUX_MPEG", @"MUX_ASF", @"MUX_OGG", @"NO", @"NO", @"NO", @"NO", @"NO", nil];
119         o_wmv2 = [NSArray arrayWithObjects: @"WMV 2", @"WMV2", _NS("WMV (Windows Media Video) 2"), @"MUX_TS", @"MUX_MPEG", @"MUX_ASF", @"MUX_OGG", @"NO", @"NO", @"NO", @"NO", @"NO", nil];
120         o_mjpg = [NSArray arrayWithObjects: @"MJPEG", @"MJPG", _NS("MJPEG consists of a series of JPEG pictures"), @"MUX_TS", @"MUX_MPEG", @"MUX_ASF", @"MUX_OGG", @"NO", @"NO", @"NO", @"NO", @"NO", nil];
121         o_theo = [NSArray arrayWithObjects: @"Theora", @"theo", _NS("Theora is a free general-purpose codec"), @"MUX_TS", @"NO", @"NO", @"NO", @"NO", @"NO", @"NO", @"NO", @"NO", nil];
122         o_dummyVid = [NSArray arrayWithObjects: @"Dummy", @"dummy", _NS("Dummy codec (do not transcode)"), @"MUX_PS", @"MUX_TS", @"MUX_MPEG", @"MUX_ASF", @"MUX_MP4", @"MUX_OGG", @"MUX_WAV", @"MUX_RAW", @"MUX_MOV", nil];
123         o_videoCodecs = [[NSArray alloc] initWithObjects: o_mp1v, o_mp2v, o_mp4v, o_div1, o_div2, o_div3, o_h263, o_h264, o_wmv1, o_wmv2, o_mjpg, o_theo, o_dummyVid, nil];
124         [o_t4_pop_videoCodec removeAllItems];
125         unsigned int x;
126         x = 0;
127         while (x != [o_videoCodecs count])
128         {
129                 [o_t4_pop_videoCodec addItemWithTitle:[[o_videoCodecs objectAtIndex:x] objectAtIndex:0]];
130                 x = (x + 1);
131         }
132         
133         NSArray * o_mpga;
134         NSArray * o_mp3;
135         NSArray * o_mp4a;
136         NSArray * o_a52;
137         NSArray * o_vorb;
138         NSArray * o_flac;
139         NSArray * o_spx;
140         NSArray * o_s16l;
141         NSArray * o_fl32;
142         NSArray * o_dummyAud;
143         o_mpga = [NSArray arrayWithObjects: @"MPEG Audio", @"mpga", _NS("The standard MPEG audio (1/2) format"), @"MUX_PS", @"MUX_TS", @"MUX_MPEG", @"MUX_ASF", @"MUX_OGG", @"MUX_RAW", @"-1", @"-1", @"-1", nil];
144         o_mp3 = [NSArray arrayWithObjects: @"MP3", @"mp3", _NS("MPEG Audio Layer 3"), @"MUX_PS", @"MUX_TS", @"MUX_MPEG", @"MUX_ASF", @"MUX_OGG", @"MUX_RAW", @"-1", @"-1", @"-1", nil];
145         o_mp4a = [NSArray arrayWithObjects: @"MPEG 4 Audio", @"mp4a", _NS("Audio format for MPEG4"), @"MUX_TS", @"MUX_MP4", @"-1", @"-1", @"-1", @"-1", @"-1", @"-1", @"-1", nil];
146         o_a52 = [NSArray arrayWithObjects: @"A/52", @"a52", _NS("DVD audio format"), @"MUX_PS", @"MUX_TS", @"MUX_MPEG", @"MUX_ASF", @"MUX_OGG", @"MUX_RAW", @"-1", @"-1", @"-1", nil];
147         o_vorb = [NSArray arrayWithObjects: @"Vorbis", @"vorb", _NS("Vorbis is a free audio codec"), @"MUX_OGG", @"-1",  @"-1", @"-1", @"-1", @"-1", @"-1", @"-1", @"-1", nil];
148         o_flac = [NSArray arrayWithObjects: @"FLAC", @"flac", _NS("FLAC is a lossless audio codec"), @"MUX_OGG", @"MUX_RAW", @"-1", @"-1", @"-1", @"-1", @"-1", @"-1", @"-1", nil];
149         o_spx = [NSArray arrayWithObjects: @"Speex", @"spx", _NS("A free audio codec dedicated to compression of voice"), @"MUX_OGG", @"-1", @"-1", @"-1", @"-1", @"-1", @"-1", @"-1", @"-1", nil];
150         o_s16l = [NSArray arrayWithObjects: @"Uncompressed, integer", @"s16l", _NS("Uncompressed audio samples"), @"MUX_WAV", @"-1", @"-1", @"-1", @"-1", @"-1", @"-1", @"-1", @"-1", nil];
151         o_fl32 = [NSArray arrayWithObjects: @"Uncompressed, floating", @"fl32", _NS("Uncompressed audio samples"), @"MUX_WAV", @"-1", @"-1", @"-1", @"-1", @"-1", @"-1", @"-1", @"-1", nil];
152         o_dummyAud = [NSArray arrayWithObjects: @"Dummy", @"dummy", _NS("Dummy codec (do not transcode)"), @"MUX_PS", @"MUX_TS", @"MUX_MPEG", @"MUX_ASF", @"MUX_MP4", @"MUX_OGG", @"MUX_RAW", @"MUX_MOV", @"MUX_WAV", nil];
153         o_audioCodecs = [[NSArray alloc] initWithObjects: o_mpga, o_mp3, o_mp4a, o_a52, o_vorb, o_flac, o_spx, o_s16l, o_fl32, o_dummyAud, nil];
154         [o_t4_pop_audioCodec removeAllItems];
155         x = 0;
156         while (x != [o_audioCodecs count])
157         {
158                 [o_t4_pop_audioCodec addItemWithTitle:[[o_audioCodecs objectAtIndex:x] objectAtIndex:0]];
159                 x = (x + 1);
160         }
161         
162         
163         /* fill another global array with all information about the encap-formats 
164          * note that the order of the formats inside the g. array is the same as on
165          * the encap-tab */
166         NSArray * o_ps;
167         NSArray * o_ts;
168         NSArray * o_mpeg;
169         NSArray * o_ogg;
170         NSArray * o_raw;
171         NSArray * o_asf;
172         NSArray * o_avi;
173         NSArray * o_mp4;
174         NSArray * o_mov;
175         NSArray * o_wav;
176         o_ps = [NSArray arrayWithObjects: @"ps", @"MPEG PS", _NS("MPEG Program Stream"), nil];
177         o_ts = [NSArray arrayWithObjects: @"ts", @"MPEG TS", _NS("MPEG Transport Stream"), nil];
178         o_mpeg = [NSArray arrayWithObjects: @"ps", @"MPEG 1", _NS("MPEG 1 Format"), nil];
179         o_ogg = [NSArray arrayWithObjects: @"ogg", @"OGG", @"OGG", nil];
180         o_raw = [NSArray arrayWithObjects: @"raw", @"RAW", @"RAW", nil];
181         o_asf = [NSArray arrayWithObjects: @"asf", @"ASF", @"ASF", nil];
182         o_avi = [NSArray arrayWithObjects: @"avi", @"AVI", @"AVI", nil];
183         o_mp4 = [NSArray arrayWithObjects: @"mp4", @"MP4", @"MPEG4", nil];
184         o_mov = [NSArray arrayWithObjects: @"mov", @"MOV", @"MOV", nil];
185         o_wav = [NSArray arrayWithObjects: @"wav", @"WAV", @"WAV", nil];
186         o_encapFormats = [[NSArray alloc] initWithObjects: o_ps, o_ts, o_mpeg, o_ogg, o_raw, o_asf, o_avi, o_mp4, o_mov, o_wav, nil];
187 }
188
189 - (void)showWizard
190 {
191     /* just present the window to the user */
192     [o_tab_pageHolder selectFirstTabViewItem:self];
193     
194         [self resetWizard];
195         
196     [o_wizard_window center];
197     [o_wizard_window displayIfNeeded];
198     [o_wizard_window makeKeyAndOrderFront:nil];
199 }
200
201 - (void)resetWizard
202 {
203         /* reset the wizard-window to its default values */
204         
205         [o_userSelections removeAllObjects];
206         [o_t1_matrix_strmgOrTrnscd selectCellAtRow:0 column:0];
207         [[o_t1_matrix_strmgOrTrnscd cellAtRow:1 column:0] setState: NSOffState];
208         [o_btn_forward setTitle: [_NS("Next") stringByAppendingString:@" >"]];
209         
210         /* "Input" */
211         [o_t2_fld_pathToNewStrm setStringValue: @""];
212         [o_t2_ckb_enblPartExtrct setState: NSOffState];
213         [self t2_enableExtract:nil];
214         [o_t2_matrix_inputSourceType selectCellAtRow:0 column:0];
215         [[o_t2_matrix_inputSourceType cellAtRow:1 column:0] setState: NSOffState];
216         /* FIXME: we need to refresh the playlist-table as well */
217         [o_t2_tbl_plst setEnabled:NO];
218         [o_t2_fld_pathToNewStrm setEnabled:YES];
219         [o_t2_btn_chooseFile setEnabled:YES];
220         
221         /* "Streaming 1" */
222         [o_t3_fld_address setStringValue: @""];
223         [o_t3_matrix_stmgMhd selectCellAtRow:0 column:0];
224         [[o_t3_matrix_stmgMhd cellAtRow:1 column:1] setState: NSOffState];
225         [[o_t3_matrix_stmgMhd cellAtRow:1 column:2] setState: NSOffState];
226         
227         /* "Transcode 1" */
228         [o_t4_ckb_audio setState: NSOffState];
229         [o_t4_ckb_video setState: NSOffState];
230         [self t4_enblVidTrnscd:nil];
231         [self t4_enblAudTrnscd:nil];
232         
233         /* "Streaming 2" */
234         [o_t6_fld_ttl setStringValue: @"1"];
235         [o_t6_ckb_sap setState: NSOffState];
236         [self t6_enblSapAnnce:nil];
237         
238         /* "Transcode 2" */
239         [o_t7_fld_filePath setStringValue: @""];
240 }
241
242 - (void)initStrings
243 {
244     /* localise all strings to the users lang */
245     /* method is called from intf.m (in method openWizard) */
246     
247     /* general items */
248     [o_btn_backward setTitle: [@"< " stringByAppendingString: _NS("Back")]];
249     [o_btn_cancel setTitle: _NS("Cancel")];
250     [o_btn_forward setTitle: [_NS("Next") stringByAppendingString:@" >"]];
251     [o_wizard_window setTitle: _NS("Streaming/Transcoding Wizard")];
252     
253     /* page one ("Hello") */
254     [o_t1_txt_title setStringValue: _NS("Streaming/Transcoding Wizard")];
255     [o_t1_txt_text setStringValue: _NS("This wizard helps you to stream, transcode or save a stream")];
256     [o_t1_btn_mrInfo_strmg setTitle: _NS("More Info")];
257     [o_t1_btn_mrInfo_trnscd setTitle: _NS("More Info")];
258     [o_t1_txt_notice setStringValue: _NS("This wizard only gives access to a small subset of VLC's streaming and transcoding capabilities. Use the Open and Stream Output dialogs to get all of them")];
259         [[o_t1_matrix_strmgOrTrnscd cellAtRow:0 column:0] setTitle: _NS("Stream to network")];
260     [[o_t1_matrix_strmgOrTrnscd cellAtRow:1 column:0] setTitle: _NS("Transcode/Save to file")];
261     
262     /* page two ("Input") */
263     [o_t2_title setStringValue: _NS("Choose input")];
264     [o_t2_text setStringValue: _NS("Choose here your input stream")];
265     [[o_t2_matrix_inputSourceType cellAtRow:0 column:0] setTitle: _NS("Select a stream")];
266     [[o_t2_matrix_inputSourceType cellAtRow:1 column:0] setTitle: _NS("Existing playlist item")];
267     [o_t2_btn_chooseFile setTitle: _NS("Choose...")];
268     [[[o_t2_tbl_plst tableColumnWithIdentifier:@"name"] headerCell] setStringValue: _NS("Name")];
269     [[[o_t2_tbl_plst tableColumnWithIdentifier:@"uri"] headerCell] setStringValue: _NS("URI")];
270     [o_t2_box_prtExtrct setTitle: _NS("Partial Extract")];
271     [o_t2_ckb_enblPartExtrct setTitle: _NS("Enable")];
272     [o_t2_txt_prtExtrctFrom setStringValue: _NS("From")];
273     [o_t2_txt_prtExtrctTo setStringValue: _NS("To")];
274     
275     /* page three ("Streaming 1") */
276     [o_t3_txt_title setStringValue: _NS("Streaming")];
277     [o_t3_txt_text setStringValue: _NS("In this page, you will select how your input stream will be sent.")];
278     [o_t3_box_dest setTitle: _NS("Destination")];
279     [o_t3_box_strmgMthd setTitle: _NS("Streaming method")];
280     [o_t3_txt_destInfo setStringValue: _NS("Enter the address of the computer to stream to")];
281     [[o_t3_matrix_stmgMhd cellAtRow:1 column:0] setTitle: _NS("UDP Unicast")];
282     [[o_t3_matrix_stmgMhd cellAtRow:1 column:1] setTitle: _NS("UDP Multicast")];
283         [o_t3_txt_strgMthdInfo setStringValue: _NS("Use this to stream to a single computer")];
284     
285     /* page four ("Transcode 1") */
286     [o_t4_title setStringValue: _NS("Transcode")];
287     [o_t4_text setStringValue: _NS("If you want to change the compression format of the audio or video tracks, fill in this page. (If you only want to change the container format, proceed to next page).")];
288     [o_t4_box_audio setTitle: _NS("Audio")];
289     [o_t4_box_video setTitle: _NS("Video")];
290     [o_t4_ckb_audio setTitle: _NS("Transcode audio")];
291     [o_t4_ckb_video setTitle: _NS("Transcode video")];
292     [o_t4_txt_videoBitrate setStringValue: _NS("Bitrate (kb/s)")];
293     [o_t4_txt_videoCodec setStringValue: _NS("Codec")];
294     [o_t4_txt_hintAudio setStringValue: _NS("If your stream has audio and you want to " \
295                          "transcode it, enable this")];
296     [o_t4_txt_hintVideo setStringValue: _NS("If your stream has video and you want to " \
297                          "transcode it, enable this")];
298     
299     /* page five ("Encap") */
300     [o_t5_title setStringValue: _NS("Encapsulation format")];
301     [o_t5_text setStringValue: _NS("In this page, you will select how the stream will be "\
302                      "encapsulated. Depending on the choices you made, all "\
303                      "formats won't be available.")];
304     
305     /* page six ("Streaming 2") */
306     [o_t6_title setStringValue: _NS("Additional streaming options")];
307     [o_t6_text setStringValue: _NS("In this page, you will define a few " \
308                               "additional parameters for your stream.")];
309     [o_t6_txt_ttl setStringValue: _NS("Time-To-Live (TTL)")];
310     [o_t6_btn_mrInfo_ttl setTitle: _NS("More Info")];
311     [o_t6_ckb_sap setTitle: _NS("SAP Announce")];
312     [o_t6_btn_mrInfo_sap setTitle: _NS("More Info")];
313      
314     /* page seven ("Transcode 2") */
315     [o_t7_title setStringValue: _NS("Additional transcode options")];
316     [o_t7_text setStringValue: _NS("In this page, you will define a few " \
317                               "additionnal parameters for your transcoding.")];
318     [o_t7_txt_saveFileTo setStringValue: _NS("Select the file to save to")];
319     [o_t7_btn_chooseFile setTitle: _NS("Choose...")];
320         
321         /* page eight ("Summary") */
322         /* FIXME: currently not implemented as it unsure whether we show this tab
323          * to the public or use it for debugging only */
324         
325         /* wizard help window */
326         [o_wh_btn_okay setTitle: _NS("OK")];
327 }
328
329 - (IBAction)cancelRun:(id)sender
330 {
331     [o_wizard_window close];
332 }
333
334 - (IBAction)nextTab:(id)sender
335 {
336         if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString: @"Hello"])
337         {
338                 /* check whether the user wants to stream or just to transcode;
339                  * store information for later usage */
340                 NSString *o_mode;
341                 o_mode = [[o_t1_matrix_strmgOrTrnscd selectedCell] title];
342                 if( [o_mode isEqualToString: _NS("Stream to network")] )
343                 {
344                         [o_userSelections setObject:@"strmg" forKey:@"trnscdOrStrmg"];
345                 }else{
346                         [o_userSelections setObject:@"trnscd" forKey:@"trnscdOrStrmg"];
347                 }
348                 [o_btn_backward setEnabled:YES];
349                 [o_tab_pageHolder selectTabViewItemAtIndex:1];
350         }
351         else if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString: @"Input"])
352         {
353                 /* check whether partialExtract is enabled and store the values, if needed */
354                 if ([o_t2_ckb_enblPartExtrct state] == NSOnState)
355                 {
356                         [o_userSelections setObject:@"YES" forKey:@"partExtract"];
357                         [o_userSelections setObject:[o_t2_fld_prtExtrctFrom stringValue] forKey:@"partExtractFrom"];
358                         [o_userSelections setObject:[o_t2_fld_prtExtrctTo stringValue] forKey:@"partExtractTo"];
359                 }else{
360                         [o_userSelections setObject:@"NO" forKey:@"partExtract"];
361                 }
362                 
363                 /* check whether we use an existing pl-item or add an new one;
364                  * store the path or the index and set a flag.
365                  * complain to the user if s/he didn't provide a path */
366                 NSString *o_mode;
367                 BOOL stop;
368                 stop = NO;
369                 o_mode = [[o_t2_matrix_inputSourceType selectedCell] title];
370                 if( [o_mode isEqualToString: _NS("Select a stream")] )
371                 {
372                         [o_userSelections setObject:@"YES" forKey:@"newStrm"];
373                         if ([[o_t2_fld_pathToNewStrm stringValue] isEqualToString: @""])
374                         {
375                 /* set a flag that no file is selected */
376                                 stop = YES;
377                         }else{
378                                 [o_userSelections setObject:[o_t2_fld_pathToNewStrm stringValue] forKey:@"pathToNewStrm"];
379                         }
380                 }else{
381                         if ([o_t2_tbl_plst selectedRow] != -1)
382                         {
383                                 [o_userSelections setObject:@"NO" forKey:@"newStrm"];
384                                 NSNumber * myNumber = [[NSNumber alloc] initWithInt:[o_t2_tbl_plst selectedRow]];
385                                 [o_userSelections setObject:myNumber forKey:@"plItemIndex"];
386             } else {
387                 /* set a flag that no item is selected */
388                 stop = YES;
389                         }
390                 }
391                 
392                 /* show either "Streaming 1" or "Transcode 1" to the user */
393                 if (stop == NO)
394                 {
395             if ([[o_userSelections objectForKey:@"trnscdOrStrmg"] isEqualToString:@"strmg"])
396             {
397                 /* we are streaming */
398                 [o_tab_pageHolder selectTabViewItemAtIndex:2];
399             }else{
400                 /* we are just transcoding */
401                 [o_tab_pageHolder selectTabViewItemAtIndex:3];
402             }
403         } else {
404             /* show a sheet that the user didn't select a file */
405                         [o_wh_txt_title setStringValue: _NS("No input selected")];
406                         [o_wh_txt_text setStringValue: _NS("You selected neither " \
407                                 "a new stream nor an existing playlist item. VLC is unable to " \
408                                 "guess, which input you want use. \n\n Choose one " \
409                                 "before going to the next page.")];
410                         [NSApp beginSheet: o_wizardhelp_window
411                                 modalForWindow: o_wizard_window
412                                 modalDelegate: o_wizardhelp_window
413                                 didEndSelector: nil
414                                 contextInfo: nil];
415         }
416         }
417         else if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString: @"Streaming 1"])
418         {
419                 /* check which streaming method is selected and store it */
420                 NSString *o_mode;
421                 o_mode = [[o_t3_matrix_stmgMhd selectedCell] title];
422                 if( [o_mode isEqualToString: _NS("HTTP")] )
423                 {
424                         [o_userSelections setObject:@"HTTP" forKey:@"stmgMhd"];
425                         /* enable MPEG PS, MPEG TS, MPEG 1, OGG, RAW and ASF; select MPEG PS */
426                         [[o_t5_matrix_encap cellAtRow:0 column:0] setEnabled:YES];
427                         [[o_t5_matrix_encap cellAtRow:1 column:0] setEnabled:YES];
428                         [[o_t5_matrix_encap cellAtRow:2 column:0] setEnabled:YES];
429                         [[o_t5_matrix_encap cellAtRow:3 column:0] setEnabled:YES];
430                         [[o_t5_matrix_encap cellAtRow:4 column:0] setEnabled:YES];
431                         [[o_t5_matrix_encap cellAtRow:5 column:0] setEnabled:YES];
432                         [[o_t5_matrix_encap cellAtRow:6 column:0] setEnabled:NO];
433                         [[o_t5_matrix_encap cellAtRow:7 column:0] setEnabled:NO];
434                         [[o_t5_matrix_encap cellAtRow:8 column:0] setEnabled:NO];
435                         [[o_t5_matrix_encap cellAtRow:9 column:0] setEnabled:NO];
436                         [o_t5_matrix_encap selectCellAtRow:0 column:0];
437                 } else {
438                         if( [o_mode isEqualToString: _NS("UDP Unicast")] )
439                         {
440                                 [o_userSelections setObject:@"UDP-Unicast" forKey:@"stmgMhd"];
441                         } else {
442                                 [o_userSelections setObject:@"UDP-Multicast" forKey:@"stmgMhd"];
443                         }
444                         /* disable all encap-formats but MPEG-TS and select it */
445                         [[o_t5_matrix_encap cellAtRow:0 column:0] setEnabled:NO];
446                         [[o_t5_matrix_encap cellAtRow:2 column:0] setEnabled:NO];
447                         [[o_t5_matrix_encap cellAtRow:3 column:0] setEnabled:NO];
448                         [[o_t5_matrix_encap cellAtRow:4 column:0] setEnabled:NO];
449                         [[o_t5_matrix_encap cellAtRow:5 column:0] setEnabled:NO];
450                         [[o_t5_matrix_encap cellAtRow:6 column:0] setEnabled:NO];
451                         [[o_t5_matrix_encap cellAtRow:7 column:0] setEnabled:NO];
452                         [[o_t5_matrix_encap cellAtRow:8 column:0] setEnabled:NO];
453                         [[o_t5_matrix_encap cellAtRow:9 column:0] setEnabled:NO];
454                         [[o_t5_matrix_encap cellAtRow:1 column:0] setEnabled:YES];
455                         [o_t5_matrix_encap selectCellAtRow:1 column:0];
456                 }
457                 
458                 /* store the destination and check whether is it empty */
459                 if(! [o_mode isEqualToString: _NS("HTTP")] )
460                 {       
461                         /* empty field is valid for HTTP */
462                         
463                         if( [[o_t3_fld_address stringValue] isEqualToString: @""] )
464                         {       
465                         
466                                 /* complain to the user that "" is no valid dest. */
467                                 [o_wh_txt_title setStringValue: _NS("No valid destination")];
468                                 [o_wh_txt_text setStringValue: _NS("You need to enter " \
469                                 "a valid destination you want to stream to. Enter either a " \
470                                 "Unicast-IP or a Multicast-IP.\n\n If you don't know "
471                                 "what this means, have a look at the VLC Streaming HOWTO and " \
472                                 "the help texts in this window." )];
473                                 [NSApp beginSheet: o_wizardhelp_window
474                                         modalForWindow: o_wizard_window
475                                         modalDelegate: o_wizardhelp_window
476                                         didEndSelector: nil
477                                         contextInfo: nil];
478                         } else {
479                                 /* FIXME: stupid code duplication, should be solved by a GoTo-like-thing -- FK */
480                                 [o_userSelections setObject:[o_t3_fld_address stringValue] forKey:@"stmgDest"];
481                                 /* let's go to the encap-tab */
482                                 [o_tab_pageHolder selectTabViewItemAtIndex:4];
483                         }
484                 } else {
485                         [o_userSelections setObject:[o_t3_fld_address stringValue] forKey:@"stmgDest"];
486                         /* let's go to the encap-tab */
487                         [o_tab_pageHolder selectTabViewItemAtIndex:4];
488                 }
489         }
490         else if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString: @"Transcode 1"])
491         {
492                 /* check whether the user wants to transcode the video-track and store the related options */
493                 if ([o_t4_ckb_video state] == NSOnState)
494                 {
495                         NSNumber * theNum;
496                         theNum = [NSNumber numberWithInt:[o_t4_pop_videoCodec indexOfSelectedItem]];
497                         [o_userSelections setObject:@"YES" forKey:@"trnscdVideo"];
498                         [o_userSelections setObject:[o_t4_pop_videoBitrate titleOfSelectedItem] forKey:@"trnscdVideoBitrate"];
499                         [o_userSelections setObject:theNum forKey:@"trnscdVideoCodec"];
500                 } else {
501                         [o_userSelections setObject:@"NO" forKey:@"trnscdVideo"];
502                 }
503                 
504                 /* check whether the user wants to transcode the audio-track and store the related options */
505                 if ([o_t4_ckb_audio state] == NSOnState)
506                 {
507                         NSNumber * theNum;
508                         theNum = [NSNumber numberWithInt:[o_t4_pop_audioCodec indexOfSelectedItem]];
509                         [o_userSelections setObject:@"YES" forKey:@"trnscdAudio"];
510                         [o_userSelections setObject:[o_t4_pop_audioBitrate titleOfSelectedItem] forKey:@"trnscdAudioBitrate"];
511                         [o_userSelections setObject:theNum forKey:@"trnscdAudioCodec"];
512                 } else {
513                         [o_userSelections setObject:@"NO" forKey:@"trnscdAudio"];
514                 }
515                 
516                 /* disable all encap-formats */
517                 [[o_t5_matrix_encap cellAtRow:0 column:0] setEnabled:NO];
518                 [[o_t5_matrix_encap cellAtRow:1 column:0] setEnabled:NO];
519                 [[o_t5_matrix_encap cellAtRow:2 column:0] setEnabled:NO];
520                 [[o_t5_matrix_encap cellAtRow:3 column:0] setEnabled:NO];
521                 [[o_t5_matrix_encap cellAtRow:4 column:0] setEnabled:NO];
522                 [[o_t5_matrix_encap cellAtRow:5 column:0] setEnabled:NO];
523                 [[o_t5_matrix_encap cellAtRow:6 column:0] setEnabled:NO];
524                 [[o_t5_matrix_encap cellAtRow:7 column:0] setEnabled:NO];
525                 [[o_t5_matrix_encap cellAtRow:8 column:0] setEnabled:NO];
526                 [[o_t5_matrix_encap cellAtRow:9 column:0] setEnabled:NO];
527                 
528                 /* re-enable the encap-formats supported by the chosen codecs */
529                 /* FIXME: the following is a really bad coding-style. feel free to write 
530                         me ideas how to make this nicer, if you want to -- FK, 7/11/05 */
531                 
532                 if ([[o_userSelections objectForKey:@"trnscdAudio"] isEqualTo: @"YES"])
533                 {
534                         if ([[o_userSelections objectForKey:@"trnscdVideo"] isEqualTo: @"YES"])
535                         {
536                                 /* we are transcoding both audio and video, so we need to check both deps */
537                                 if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdVideoCodec"] intValue]] containsObject: @"MUX_PS"])
538                                 {
539                                         if ([[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdAudioCodec"] intValue]] containsObject: @"MUX_PS"])
540                                         {
541                                                 [[o_t5_matrix_encap cellAtRow:0 column:0] setEnabled:YES];
542                                                 [o_t5_matrix_encap selectCellAtRow:0 column:0];
543                                         }
544                                 }
545                                 if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdVideoCodec"] intValue]] containsObject: @"MUX_TS"])
546                                 {
547                                         if ([[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdAudioCodec"] intValue]] containsObject: @"MUX_TS"])
548                                         {
549                                                 [[o_t5_matrix_encap cellAtRow:1 column:0] setEnabled:YES];
550                                                 [o_t5_matrix_encap selectCellAtRow:1 column:0];
551                                         }
552                                 }
553                                 if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdVideoCodec"] intValue]] containsObject: @"MUX_MPEG"])
554                                 {
555                                         if ([[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdAudioCodec"] intValue]] containsObject: @"MUX_MPEG"])
556                                         {
557                                                 [[o_t5_matrix_encap cellAtRow:2 column:0] setEnabled:YES];
558                                                 [o_t5_matrix_encap selectCellAtRow:2 column:0];
559                                         }
560                                 }
561                                 if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdVideoCodec"] intValue]] containsObject: @"MUX_OGG"])
562                                 {
563                                         if ([[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdAudioCodec"] intValue]] containsObject: @"MUX_OGG"])
564                                         {
565                                                 [[o_t5_matrix_encap cellAtRow:3 column:0] setEnabled:YES];
566                                                 [o_t5_matrix_encap selectCellAtRow:3 column:0];
567                                         }
568                                 }
569                                 if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdVideoCodec"] intValue]] containsObject: @"MUX_RAW"])
570                                 {
571                                         if ([[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdAudioCodec"] intValue]] containsObject: @"MUX_RAW"])
572                                         {
573                                                 [[o_t5_matrix_encap cellAtRow:4 column:0] setEnabled:YES];
574                                                 [o_t5_matrix_encap selectCellAtRow:4 column:0];
575                                         }
576                                 }
577                                 if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdVideoCodec"] intValue]] containsObject: @"MUX_ASF"])
578                                 {
579                                         if ([[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdAudioCodec"] intValue]] containsObject: @"MUX_ASF"])
580                                         {
581                                                 [[o_t5_matrix_encap cellAtRow:5 column:0] setEnabled:YES];
582                                                 [o_t5_matrix_encap selectCellAtRow:5 column:0];
583                                         }
584                                 }
585                                 if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdVideoCodec"] intValue]] containsObject: @"MUX_AVI"])
586                                 {
587                                         if ([[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdAudioCodec"] intValue]] containsObject: @"MUX_AVI"])
588                                         {
589                                                 [[o_t5_matrix_encap cellAtRow:6 column:0] setEnabled:YES];
590                                                 [o_t5_matrix_encap selectCellAtRow:6 column:0];
591                                         }
592                                 }
593                                 if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdVideoCodec"] intValue]] containsObject: @"MUX_MP4"])
594                                 {
595                                         if ([[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdAudioCodec"] intValue]] containsObject: @"MUX_MP4"])
596                                         {
597                                                 [[o_t5_matrix_encap cellAtRow:7 column:0] setEnabled:YES];
598                                                 [o_t5_matrix_encap selectCellAtRow:7 column:0];
599                                         }
600                                 }
601                                 if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdVideoCodec"] intValue]] containsObject: @"MUX_MOV"])
602                                 {
603                                         if ([[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdAudioCodec"] intValue]] containsObject: @"MUX_MOV"])
604                                         {
605                                                 [[o_t5_matrix_encap cellAtRow:8 column:0] setEnabled:YES];
606                                                 [o_t5_matrix_encap selectCellAtRow:8 column:0];
607                                         }
608                                 }
609                                 if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdVideoCodec"] intValue]] containsObject: @"MUX_WAV"])
610                                 {
611                                         if ([[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdAudioCodec"] intValue]] containsObject: @"MUX_WAV"])
612                                         {
613                                                 [[o_t5_matrix_encap cellAtRow:9 column:0] setEnabled:YES];
614                                                 [o_t5_matrix_encap selectCellAtRow:9 column:0];
615                                         }
616                                 }
617                                 
618                         } else {
619                                 
620                                 /* we just transcoding the audio */
621                                 
622                                 /* select formats supported by the audio codec */
623                                 if ([[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdAudioCodec"] intValue]] containsObject: @"MUX_PS"])
624                                 {
625                                         [[o_t5_matrix_encap cellAtRow:0 column:0] setEnabled:YES];
626                                         [o_t5_matrix_encap selectCellAtRow:0 column:0];
627                                 }
628                                 if ([[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdAudioCodec"] intValue]] containsObject: @"MUX_TS"])
629                                 {
630                                         [[o_t5_matrix_encap cellAtRow:1 column:0] setEnabled:YES];
631                                         [o_t5_matrix_encap selectCellAtRow:1 column:0];
632                                 }
633                                 if ([[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdAudioCodec"] intValue]] containsObject: @"MUX_MPEG"])
634                                 {
635                                         [[o_t5_matrix_encap cellAtRow:2 column:0] setEnabled:YES];
636                                         [o_t5_matrix_encap selectCellAtRow:2 column:0];
637                                 }
638                                 if ([[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdAudioCodec"] intValue]] containsObject: @"MUX_OGG"])
639                                 {
640                                         [[o_t5_matrix_encap cellAtRow:3 column:0] setEnabled:YES];
641                                         [o_t5_matrix_encap selectCellAtRow:3 column:0];
642                                 }
643                                 if ([[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdAudioCodec"] intValue]] containsObject: @"MUX_RAW"])
644                                 {
645                                         [[o_t5_matrix_encap cellAtRow:4 column:0] setEnabled:YES];
646                                         [o_t5_matrix_encap selectCellAtRow:4 column:0];
647                                 }
648                                 if ([[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdAudioCodec"] intValue]] containsObject: @"MUX_ASF"])
649                                 {
650                                         [[o_t5_matrix_encap cellAtRow:5 column:0] setEnabled:YES];
651                                         [o_t5_matrix_encap selectCellAtRow:5 column:0];
652                                 }
653                                 if ([[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdAudioCodec"] intValue]] containsObject: @"MUX_AVI"])
654                                 {
655                                         [[o_t5_matrix_encap cellAtRow:6 column:0] setEnabled:YES];
656                                         [o_t5_matrix_encap selectCellAtRow:6 column:0];
657                                 }
658                                 if ([[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdAudioCodec"] intValue]] containsObject: @"MUX_MP4"])
659                                 {
660                                         [[o_t5_matrix_encap cellAtRow:7 column:0] setEnabled:YES];
661                                         [o_t5_matrix_encap selectCellAtRow:7 column:0];
662                                 }
663                                 if ([[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdAudioCodec"] intValue]] containsObject: @"MUX_MOV"])
664                                 {
665                                         [[o_t5_matrix_encap cellAtRow:8 column:0] setEnabled:YES];
666                                         [o_t5_matrix_encap selectCellAtRow:8 column:0];
667                                 }
668                                 if ([[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdAudioCodec"] intValue]] containsObject: @"MUX_WAV"])
669                                 {
670                                         [[o_t5_matrix_encap cellAtRow:9 column:0] setEnabled:YES];
671                                         [o_t5_matrix_encap selectCellAtRow:9 column:0];
672                                 }
673                         }
674                 }
675                 else if ([[o_userSelections objectForKey:@"trnscdVideo"] isEqualTo: @"YES"])
676                 {
677                         /* we are just transcoding the video */
678                         
679                         /* select formats supported by the video-codec */ 
680                 
681                         if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdVideoCodec"] intValue]] containsObject: @"MUX_PS"])
682                         {
683                                 [[o_t5_matrix_encap cellAtRow:0 column:0] setEnabled:YES];
684                                 [o_t5_matrix_encap selectCellAtRow:0 column:0];
685                         }
686                         if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdVideoCodec"] intValue]] containsObject: @"MUX_TS"])
687                         {
688                                 [[o_t5_matrix_encap cellAtRow:1 column:0] setEnabled:YES];
689                                 [o_t5_matrix_encap selectCellAtRow:1 column:0];
690                         }
691                         if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdVideoCodec"] intValue]] containsObject: @"MUX_MPEG"])
692                         {
693                                 [[o_t5_matrix_encap cellAtRow:2 column:0] setEnabled:YES];
694                                 [o_t5_matrix_encap selectCellAtRow:2 column:0];
695                         }
696                         if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdVideoCodec"] intValue]] containsObject: @"MUX_OGG"])
697                         {
698                                 [[o_t5_matrix_encap cellAtRow:3 column:0] setEnabled:YES];
699                                 [o_t5_matrix_encap selectCellAtRow:3 column:0];
700                         }
701                         if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdVideoCodec"] intValue]] containsObject: @"MUX_RAW"])
702                         {
703                                 [[o_t5_matrix_encap cellAtRow:4 column:0] setEnabled:YES];
704                                 [o_t5_matrix_encap selectCellAtRow:4 column:0];
705                         }
706                         if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdVideoCodec"] intValue]] containsObject: @"MUX_ASF"])
707                         {
708                                 [[o_t5_matrix_encap cellAtRow:5 column:0] setEnabled:YES];
709                                 [o_t5_matrix_encap selectCellAtRow:5 column:0];
710                         }
711                         if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdVideoCodec"] intValue]] containsObject: @"MUX_AVI"])
712                         {
713                                 [[o_t5_matrix_encap cellAtRow:6 column:0] setEnabled:YES];
714                                 [o_t5_matrix_encap selectCellAtRow:6 column:0];
715                         }
716                         if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdVideoCodec"] intValue]] containsObject: @"MUX_MP4"])
717                         {
718                                 [[o_t5_matrix_encap cellAtRow:7 column:0] setEnabled:YES];
719                                 [o_t5_matrix_encap selectCellAtRow:7 column:0];
720                         }
721                         if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdVideoCodec"] intValue]] containsObject: @"MUX_MOV"])
722                         {
723                                 [[o_t5_matrix_encap cellAtRow:8 column:0] setEnabled:YES];
724                                 [o_t5_matrix_encap selectCellAtRow:8 column:0];
725                         }
726                         if ([[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdVideoCodec"] intValue]] containsObject: @"MUX_WAV"])
727                         {
728                                 [[o_t5_matrix_encap cellAtRow:9 column:0] setEnabled:YES];
729                                 [o_t5_matrix_encap selectCellAtRow:9 column:0];
730                         }
731                 } else {
732                         /* we don't do any transcoding 
733                          * -> enabled the encap-formats allowed when streaming content via http
734                          * since this should work fine in most cases */
735                         /* FIXME: choose a selection of encap-formats based upon the actually used codecs */
736                                                 
737                         /* enable MPEG PS, MPEG TS, MPEG 1, OGG, RAW and ASF; select MPEG PS */
738                         [[o_t5_matrix_encap cellAtRow:0 column:0] setEnabled:YES];
739                         [[o_t5_matrix_encap cellAtRow:1 column:0] setEnabled:YES];
740                         [[o_t5_matrix_encap cellAtRow:2 column:0] setEnabled:YES];
741                         [[o_t5_matrix_encap cellAtRow:3 column:0] setEnabled:YES];
742                         [[o_t5_matrix_encap cellAtRow:4 column:0] setEnabled:YES];
743                         [[o_t5_matrix_encap cellAtRow:5 column:0] setEnabled:YES];
744                         [[o_t5_matrix_encap cellAtRow:6 column:0] setEnabled:NO];
745                         [[o_t5_matrix_encap cellAtRow:7 column:0] setEnabled:NO];
746                         [[o_t5_matrix_encap cellAtRow:8 column:0] setEnabled:NO];
747                         [[o_t5_matrix_encap cellAtRow:9 column:0] setEnabled:NO];
748                         [o_t5_matrix_encap selectCellAtRow:0 column:0];
749                 }
750                 int x;
751                 BOOL anythingEnabled;
752                 x = 0;
753                 anythingEnabled = NO;
754                 while (x != [o_t5_matrix_encap numberOfRows])
755                 {
756                         if ([[o_t5_matrix_encap cellAtRow:x column:0] isEnabled])
757                         {       
758                                 anythingEnabled = YES;
759                         }       
760                         x = (x + 1);
761                 }
762                 if (anythingEnabled == YES)
763                 {
764                 [o_tab_pageHolder selectTabViewItemAtIndex:4];
765                 } else {
766                     /* show a sheet that the selected codecs are not compatible */
767                         [o_wh_txt_title setStringValue: _NS("Invalid selection")];
768                         [o_wh_txt_text setStringValue: _NS("Your chosen codecs are " \
769                                 "not compatible with each other. For example: you cannot " \
770                                 "mix uncompressed audio with any video codec.\n\n" \
771                                 "Correct your selection and try again.")];
772                         [NSApp beginSheet: o_wizardhelp_window
773                                 modalForWindow: o_wizard_window
774                                 modalDelegate: o_wizardhelp_window
775                                 didEndSelector: nil
776                                 contextInfo: nil];
777                 }
778                 
779         }
780         else if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString: @"Encap"])
781         {
782                 /* get the chosen encap format and store it */
783                 NSNumber * theNum;
784                 theNum = [NSNumber numberWithInt:[[o_t5_matrix_encap selectedCell] tag]];
785                 [o_userSelections setObject:[theNum stringValue] forKey:@"encapFormat"];
786                 
787                 /* show either "Streaming 2" or "Transcode 2" to the user */
788                 if ([[o_userSelections objectForKey:@"trnscdOrStrmg"] isEqualToString:@"strmg"])
789                 {
790                         /* we are streaming */
791                         [o_tab_pageHolder selectTabViewItemAtIndex:5];
792                 }else{
793                         /* we are just transcoding */
794                         [o_tab_pageHolder selectTabViewItemAtIndex:6];
795                 }
796         }
797         else if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString: @"Streaming 2"])
798         {
799                 /* store the chosen TTL */
800                 [o_userSelections setObject:[o_t6_fld_ttl stringValue] forKey:@"ttl"];
801                 
802                 /* check whether SAP is enabled and store the announce, if needed */
803                 if ([o_t6_ckb_sap state] == NSOnState)
804                 {
805                         [o_userSelections setObject:@"YES" forKey:@"sap"];
806                         [o_userSelections setObject:[o_t6_fld_sap stringValue] forKey:@"sapText"];
807                 } else {
808                         [o_userSelections setObject:@"NO" forKey:@"sap"];
809                 }
810                 
811                 /* go to "Summary" */
812                 [self showSummary];
813         }
814         else if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString: @"Transcode 2"])
815         {
816                 /* check whether the path != "" and store it */
817                 if( [[o_t7_fld_filePath stringValue] isEqualToString: @""] )
818                 {       /* complain to the user that "" is no valid path */
819                         [o_wh_txt_title setStringValue: _NS("No file selected")];
820                         [o_wh_txt_text setStringValue: _NS("You you need to select " \
821                         "a file, you want to save to. \n\n Enter either a valid path or " \
822                         "choose a location through the button's dialog-box.")];
823                         [NSApp beginSheet: o_wizardhelp_window
824                                 modalForWindow: o_wizard_window
825                                 modalDelegate: o_wizardhelp_window
826                                 didEndSelector: nil
827                                 contextInfo: nil];
828                 } else {
829                         [o_userSelections setObject:[o_t7_fld_filePath stringValue] forKey:@"trnscdFilePath"];
830                         
831                         /* go to "Summary" */
832                         [self showSummary];
833                 }
834         }
835 }
836
837 - (void)showSummary
838 {
839         [o_btn_forward setTitle: _NS("Finish")];
840         if ([[o_userSelections objectForKey:@"newStrm"] isEqualToString: @"YES"])
841         {
842                 [o_t8_fld_inptStream setStringValue:[o_userSelections objectForKey:@"pathToNewStrm"]];
843         } else {
844                 [o_t8_fld_inptStream setStringValue:[[o_userSelections objectForKey:@"plItemIndex"] stringValue]];
845         }
846         if ([[o_userSelections objectForKey:@"partExtract"] isEqualToString: @"YES"])
847         {
848                 [o_t8_fld_partExtract setStringValue: [[[[[_NS("yes") stringByAppendingString:@" - "] stringByAppendingString: _NS("from ")] stringByAppendingString: [o_userSelections objectForKey:@"partExtractFrom"]] stringByAppendingString: _NS(" to ")] stringByAppendingString: [o_userSelections objectForKey:@"partExtractTo"]]];
849         } else {
850                 [o_t8_fld_partExtract setStringValue: _NS("no")];
851         }
852         
853         if ([[o_userSelections objectForKey:@"trnscdOrStrmg"] isEqualToString:@"strmg"])
854         {
855                 /* we are streaming; no transcoding allowed atm */
856                 [o_t8_fld_saveFileTo setStringValue: @"-"];
857                 [o_t8_fld_trnscdAudio setStringValue: @"-"];
858                 [o_t8_fld_trnscdVideo setStringValue: @"-"];
859                 [o_t8_fld_strmgMthd setStringValue: [o_userSelections objectForKey:@"stmgMhd"]];
860                 [o_t8_fld_destination setStringValue: [o_userSelections objectForKey:@"stmgDest"]];
861                 [o_t8_fld_ttl setStringValue: [o_userSelections objectForKey:@"ttl"]];
862                 if ([[o_userSelections objectForKey:@"sap"] isEqualToString: @"YES"])
863                 {
864                         [o_t8_fld_sap setStringValue: [[_NS("yes") stringByAppendingString:@": "] stringByAppendingString:[o_userSelections objectForKey:@"sapText"]]];
865                 }else{
866                         [o_t8_fld_sap setStringValue: _NS("no")];
867                 }
868         } else {
869                 /* we are transcoding */
870                 [o_t8_fld_strmgMthd setStringValue: @"-"];
871                 [o_t8_fld_destination setStringValue: @"-"];
872                 [o_t8_fld_ttl setStringValue: @"-"];
873                 [o_t8_fld_sap setStringValue: @"-"];
874                 if ([[o_userSelections objectForKey:@"trnscdVideo"] isEqualToString:@"YES"])
875                 {
876                         [o_t8_fld_trnscdVideo setStringValue: [[[[[_NS("yes") stringByAppendingString:@": "] stringByAppendingString: [[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdVideoCodec"] intValue]] objectAtIndex:0]] stringByAppendingString:@" @ "] stringByAppendingString: [o_userSelections objectForKey:@"trnscdVideoBitrate"]] stringByAppendingString:@" kb/s"]];
877                 }else{
878                         [o_t8_fld_trnscdVideo setStringValue: _NS("no")];
879                 }
880                 if ([[o_userSelections objectForKey:@"trnscdAudio"] isEqualToString:@"YES"])
881                 {
882                         [o_t8_fld_trnscdAudio setStringValue: [[[[[_NS("yes") stringByAppendingString:@": "] stringByAppendingString: [[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdAudioCodec"] intValue]] objectAtIndex:0]] stringByAppendingString:@" @ "] stringByAppendingString: [o_userSelections objectForKey:@"trnscdAudioBitrate"]] stringByAppendingString:@" kb/s"]];
883                 }else{
884                         [o_t8_fld_trnscdAudio setStringValue: _NS("no")];
885                 }
886                 [o_t8_fld_saveFileTo setStringValue: [o_userSelections objectForKey:@"trnscdFilePath"]];
887         }
888         [o_t8_fld_encapFormat setStringValue: [[o_encapFormats objectAtIndex:[[o_userSelections objectForKey:@"encapFormat"] intValue]] objectAtIndex:1]];
889         
890         [self createMrl];
891         [o_t8_fld_mrl setStringValue: o_mrl];
892         
893         [o_tab_pageHolder selectTabViewItemAtIndex:7];
894 }
895
896 - (void) createMrl
897 {
898         NSMutableString * o_mrl_string = [NSMutableString stringWithString:@""];
899         if ([[o_userSelections objectForKey:@"trnscdOrStrmg"] isEqualToString:@"strmg"])
900                 {
901                         /* we are streaming, no transcoding allowed atm */
902                         /* FIXME: implementation missing */
903                 } else {
904                         /* we are just transcoding and dumping the stuff to a file */
905                         NSMutableString *o_trnscdCmd = [NSMutableString stringWithString:@""];
906                         if ([[o_userSelections objectForKey:@"trnscdVideo"] isEqualToString:@"YES"])
907                         {
908                                 [o_trnscdCmd appendString: @"transcode{"];
909                                 [o_trnscdCmd appendFormat: @"vcodec=%s,vb=%i", [[[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdVideoCodec"] intValue]] objectAtIndex:1] UTF8String],  [[o_userSelections objectForKey:@"trnscdVideoBitrate"] intValue]];
910                                 if ([[o_userSelections objectForKey:@"trnscdAudio"] isEqualToString:@"YES"])
911                                 {
912                                         [o_trnscdCmd appendString: @","];
913                                 } else
914                                 {
915                                         [o_trnscdCmd appendString: @"}:"];
916                                 }
917                         }
918                         if ([[o_userSelections objectForKey:@"trnscdAudio"] isEqualToString:@"YES"])
919                         {
920                                 if ([[o_userSelections objectForKey:@"trnscdVideo"] isEqualToString:@"NO"])
921                                 {
922                                         /* in case we transcode the audio only, add this */
923                                         [o_trnscdCmd appendString: @"transcode{"];
924                                 }
925                                 [o_trnscdCmd appendFormat: @"acodec=%s,ab=%i}:", [[[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdAudioCodec"] intValue]] objectAtIndex:1] UTF8String],  [[o_userSelections objectForKey:@"trnscdAudioBitrate"] intValue]];
926                         }
927                         [o_mrl_string appendFormat:
928                         @":sout=#%sstandard{mux=%s,url=%s,access=file}", [o_trnscdCmd UTF8String],
929                         [[[o_encapFormats objectAtIndex:[[o_userSelections objectForKey:@"encapFormat"] intValue]] objectAtIndex:0] UTF8String], [[o_userSelections objectForKey:@"trnscdFilePath"] UTF8String]];
930                 }
931                 
932         o_mrl = [[NSString alloc] initWithString: o_mrl_string];
933 }
934
935 - (IBAction)prevTab:(id)sender
936 {
937     if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString: @"Summary"])
938         {       
939                 /* check whether we are streaming or transcoding and go back */
940                 if ([[o_userSelections objectForKey:@"trnscdOrStrmg"] isEqualToString:@"strmg"])
941                 {
942                         /* show "Streaming 2" */
943                         [o_tab_pageHolder selectTabViewItemAtIndex:5];
944                 }else{
945                         /* show "Transcode 2" */
946                         [o_tab_pageHolder selectTabViewItemAtIndex:6];
947                 }
948                 /* rename the forward-button */
949                 [o_btn_forward setTitle: [_NS("Next") stringByAppendingString:@" >"]];
950         }
951         else if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString: @"Transcode 2"])
952         {
953                 /* show "Encap" */
954                 [o_tab_pageHolder selectTabViewItemAtIndex:4];
955         }
956         else if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString: @"Streaming 2"])
957         {
958                 /* show "Encap" */
959                 [o_tab_pageHolder selectTabViewItemAtIndex:4];
960         }
961         else if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString: @"Encap"])
962         {
963                 /* check whether we are streaming or transcoding and go back */
964                 if ([[o_userSelections objectForKey:@"trnscdOrStrmg"] isEqualToString:@"strmg"])
965                 {
966                         /* show "Streaming 1" */
967                         [o_tab_pageHolder selectTabViewItemAtIndex:2];
968                 }else{
969                         /* show "Transcode 2" */
970                         [o_tab_pageHolder selectTabViewItemAtIndex:3];
971                 }
972         }
973         else if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString: @"Streaming 1"])
974         {
975                 /* show "Input" */
976                 [o_tab_pageHolder selectTabViewItemAtIndex:1];
977         }
978         else if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString: @"Transcode 1"])
979         {
980                 /* show "Input" */
981                 [o_tab_pageHolder selectTabViewItemAtIndex:1];
982         }
983         else if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString: @"Input"])
984         {
985                 /* show "Hello" */
986                 [o_tab_pageHolder selectTabViewItemAtIndex:0];
987                 /* disable backwards-btn */
988                 [o_btn_backward setEnabled:NO];
989         }
990 }
991
992 - (IBAction)t1_mrInfo_streaming:(id)sender
993 {
994     /* show a sheet for the help */
995         /* since NSAlert does not exist on OSX < 10.3, we use our own implementation */
996         [o_wh_txt_title setStringValue: _NS("Stream to network")];
997         [o_wh_txt_text setStringValue: _NS("Use this to stream on a network.")];
998         [NSApp beginSheet: o_wizardhelp_window
999             modalForWindow: o_wizard_window
1000             modalDelegate: o_wizardhelp_window
1001             didEndSelector: nil
1002             contextInfo: nil];
1003 }
1004
1005 - (IBAction)t1_mrInfo_transcode:(id)sender
1006 {
1007     /* show a sheet for the help */
1008         [o_wh_txt_title setStringValue: _NS("Transcode/Save to file")];
1009         [o_wh_txt_text setStringValue: _NS("Use this to save a stream to a file. You "\
1010                 "have the possibility to reencode the stream. You can save whatever "\
1011                 "VLC can read.\nPlease notice that VLC is not very suited " \
1012                 "for file to file transcoding. You should use its transcoding " \
1013         "features to save network streams, for example.")];
1014         [NSApp beginSheet: o_wizardhelp_window
1015             modalForWindow: o_wizard_window
1016             modalDelegate: o_wizardhelp_window
1017             didEndSelector: nil
1018             contextInfo: nil];
1019 }
1020
1021 - (IBAction)t2_addNewStream:(id)sender
1022 {
1023     NSOpenPanel * openPanel = [NSOpenPanel openPanel];
1024     SEL sel = @selector(t2_getNewStreamFromDialog:returnCode:contextInfo:);
1025     [openPanel beginSheetForDirectory:nil file:nil types:nil modalForWindow:o_wizard_window modalDelegate:self didEndSelector:sel contextInfo:nil];
1026 }
1027
1028 - (void)t2_getNewStreamFromDialog: (NSOpenPanel *)sheet returnCode: (int)returnCode contextInfo: (void *)contextInfo
1029 {
1030     if (returnCode == NSOKButton)
1031     {
1032         [o_t2_fld_pathToNewStrm setStringValue:[sheet filename]];
1033     }
1034 }
1035
1036 - (IBAction)t2_chooseStreamOrPlst:(id)sender
1037 {
1038     /* enable and disable the respective items depending on user's choice */
1039     NSString *o_mode;
1040     o_mode = [[o_t2_matrix_inputSourceType selectedCell] title];
1041         
1042         if( [o_mode isEqualToString: _NS("Select a stream")] )
1043     {
1044                 [o_t2_btn_chooseFile setEnabled:YES];
1045                 [o_t2_fld_pathToNewStrm setEnabled:YES];
1046                 [o_t2_tbl_plst setEnabled:NO];
1047         } else {
1048                 [o_t2_btn_chooseFile setEnabled:NO];
1049                 [o_t2_fld_pathToNewStrm setEnabled:NO];
1050                 [o_t2_tbl_plst setEnabled:YES];
1051         }
1052 }
1053
1054 - (IBAction)t2_enableExtract:(id)sender
1055 {
1056     /* enable/disable the respective items */
1057     if([o_t2_ckb_enblPartExtrct state] == NSOnState)
1058     {
1059         [o_t2_fld_prtExtrctFrom setEnabled:YES];
1060         [o_t2_fld_prtExtrctTo setEnabled:YES];
1061     } else {
1062         [o_t2_fld_prtExtrctFrom setEnabled:NO];
1063         [o_t2_fld_prtExtrctTo setEnabled:NO];
1064                 [o_t2_fld_prtExtrctFrom setStringValue:@""];
1065                 [o_t2_fld_prtExtrctTo setStringValue:@""];
1066     }
1067 }
1068
1069 - (IBAction)t3_addressEntered:(id)sender
1070 {
1071     /* check whether the entered address is valid */
1072 }
1073
1074 - (IBAction)t3_strmMthdChanged:(id)sender
1075 {
1076         /* change the captions of o_t3_txt_destInfo according to the chosen
1077          * streaming method */
1078         NSNumber * o_mode;
1079         o_mode = [[NSNumber alloc] initWithInt:[[o_t3_matrix_stmgMhd selectedCell] tag]];
1080         if( [o_mode intValue] == 2 )
1081         {
1082                 [o_t3_txt_destInfo setStringValue: _NS("Enter the local addresses you " \
1083                         "want to listen to. Do not enter anything if you want to listen " \
1084                         "to all adresses or if you don't understand. This is generally " \
1085                         "the best thing to do. Other computers can then access the stream " \
1086                         "at http://yourip:8080 by default") ];
1087                 [o_t3_txt_strgMthdInfo setStringValue: _NS("Use this to stream to " \
1088                         "several computers. This method is less efficient, as the server " \
1089                         "needs to send several times the stream.")];
1090         }
1091         else if( [o_mode intValue] == 1 )
1092         {
1093                 [o_t3_txt_destInfo setStringValue: _NS("Enter the multicast address " \
1094                         "to stream to in this field.  This must be an IP address between " \
1095                         "224.0.0.0 an 239.255.255.255  For a private use, enter an " \
1096                         "address beginning with 239.255")];
1097                 [o_t3_txt_strgMthdInfo setStringValue: _NS("Use this to stream to a " \
1098                         "dynamic group of computers on a multicast-enabled network. This " \
1099                         "is the most efficient method to stream to several computers, but " \
1100                         "it does not work over Internet.")];
1101         }
1102         else if( [o_mode intValue] == 0 ) 
1103         {
1104                 [o_t3_txt_destInfo setStringValue: _NS("Enter the address of the " \
1105                         "computer to stream to")];
1106                 [o_t3_txt_strgMthdInfo setStringValue: _NS("Use this to stream to a " \
1107                         "single computer")];
1108         }
1109         [o_mode release];
1110 }
1111
1112 - (IBAction)t4_AudCdcChanged:(id)sender
1113 {
1114     /* update codec info */
1115         [o_t4_txt_hintAudio setStringValue:[[o_audioCodecs objectAtIndex:[o_t4_pop_audioCodec indexOfSelectedItem]] objectAtIndex:2]];
1116 }
1117
1118 - (IBAction)t4_enblAudTrnscd:(id)sender
1119 {
1120     /* enable/disable the respective items */
1121     if([o_t4_ckb_audio state] == NSOnState)
1122     {
1123         [o_t4_pop_audioCodec setEnabled:YES];
1124         [o_t4_pop_audioBitrate setEnabled:YES];
1125                 [o_t4_txt_hintAudio setStringValue: _NS("Select your audio codec. "\
1126                 "Click one to get more information.")];
1127     } else {
1128         [o_t4_pop_audioCodec setEnabled:NO];
1129         [o_t4_pop_audioBitrate setEnabled:NO];
1130                 [o_t4_txt_hintAudio setStringValue: _NS("If your stream has audio " \
1131                 "and you want to transcode it, enable this.")];
1132     }
1133 }
1134
1135 - (IBAction)t4_enblVidTrnscd:(id)sender
1136 {
1137     /* enable/disable the respective items */
1138     if([o_t4_ckb_video state] == NSOnState)
1139     {
1140         [o_t4_pop_videoCodec setEnabled:YES];
1141         [o_t4_pop_videoBitrate setEnabled:YES];
1142                 [o_t4_txt_hintVideo setStringValue: _NS("Select your video codec. "\
1143                 "Click one to get more information.")];
1144     } else {
1145         [o_t4_pop_videoCodec setEnabled:NO];
1146         [o_t4_pop_videoBitrate setEnabled:NO];
1147                 [o_t4_txt_hintVideo setStringValue: _NS("If your stream has video " \
1148                 "and you want to transcode it, enable this.")];
1149     }
1150 }
1151
1152 - (IBAction)t4_VidCdcChanged:(id)sender
1153 {
1154     /* update codec info */
1155         [o_t4_txt_hintVideo setStringValue:[[o_videoCodecs objectAtIndex:[o_t4_pop_videoCodec indexOfSelectedItem]] objectAtIndex:2]];
1156 }
1157
1158 - (IBAction)t6_enblSapAnnce:(id)sender
1159 {
1160     /* enable/disable input fld */
1161     if([o_t6_ckb_sap state] == NSOnState)
1162     {
1163         [o_t6_fld_sap setEnabled:YES];
1164     } else {
1165         [o_t6_fld_sap setEnabled:NO];
1166         [o_t6_fld_sap setStringValue:@""];
1167     }
1168 }
1169
1170 - (IBAction)t6_mrInfo_ttl:(id)sender
1171 {
1172     /* show a sheet for the help */
1173         [o_wh_txt_title setStringValue: _NS("Time-To-Live (TTL)")];
1174         [o_wh_txt_text setStringValue: _NS("Define the TTL (Time-To-Live) of the stream. "\
1175                         "This parameter is the maximum number of routers your stream can go "
1176                         "through. If you don't know what it means, or if you want to stream on " \
1177                         "your local network only, leave this setting to 1.")];
1178         [NSApp beginSheet: o_wizardhelp_window
1179             modalForWindow: o_wizard_window
1180             modalDelegate: o_wizardhelp_window
1181             didEndSelector: nil
1182             contextInfo: nil];
1183 }
1184
1185 - (IBAction)t6_mrInfo_sap:(id)sender
1186 {
1187     /* show a sheet for the help */
1188         [o_wh_txt_title setStringValue: _NS("SAP Announce")];
1189         [o_wh_txt_text setStringValue: _NS("When streaming using UDP, you can " \
1190                 "announce your streams using the SAP/SDP announcing protocol. This " \
1191                 "way, the clients won't have to type in the multicast address, it " \
1192                 "will appear in their playlist if they enable the SAP extra interface.\n" \
1193                 "If you want to give a name to your stream, enter it here, " \
1194                 "else, a default name will be used.")];
1195         [NSApp beginSheet: o_wizardhelp_window
1196             modalForWindow: o_wizard_window
1197             modalDelegate: o_wizardhelp_window
1198             didEndSelector: nil
1199             contextInfo: nil];
1200 }
1201
1202 - (IBAction)t7_selectTrnscdDestFile:(id)sender
1203 {
1204     /* provide a save-to-dialogue, so the user can choose a location for his/her new file */
1205     NSSavePanel * savePanel = [NSSavePanel savePanel];
1206     SEL sel = @selector(t7_getTrnscdDestFile:returnCode:contextInfo:);
1207         [savePanel setRequiredFileType:[[o_encapFormats objectAtIndex:[[o_userSelections objectForKey:@"encapFormat"] intValue]] objectAtIndex:0]];
1208         [savePanel setCanSelectHiddenExtension:YES];
1209     [savePanel beginSheetForDirectory:nil file:nil modalForWindow:o_wizard_window modalDelegate:self didEndSelector:sel contextInfo:nil];
1210 }
1211
1212 - (void)t7_getTrnscdDestFile: (NSSavePanel *)sheet returnCode: (int)returnCode contextInfo: (void *)contextInfo
1213 {
1214     if (returnCode == NSOKButton)
1215     {
1216                 /* add a suffix depending on the chosen encap-format and output path to text-field*/
1217         [o_t7_fld_filePath setStringValue:[sheet filename]];
1218     }
1219 }
1220
1221 - (IBAction)wh_closeSheet:(id)sender
1222 {
1223         /* close the help sheet */
1224         [NSApp endSheet:o_wizardhelp_window];
1225         [o_wizardhelp_window close];
1226 }
1227
1228 - (void)dealloc
1229 {
1230         [o_userSelections release];
1231         [o_videoCodecs release];
1232         [o_audioCodecs release];
1233         [o_encapFormats release];
1234         [super dealloc];
1235 }
1236
1237 @end