]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/wizard.m
* fixed a bug which prevented the fspanel to show up in some circumstances. Patch...
[vlc] / modules / gui / macosx / wizard.m
index 5b1eb2d2a4c61a67642ec38f83406608886dfb27..c2f3845f758bcad8fc0000244789ef86ead607e6 100644 (file)
@@ -33,9 +33,8 @@
  *****************************************************************************/
 #import "wizard.h"
 #import "intf.h"
-#import "network.h"
 #import "playlist.h"
-#import <vlc/intf.h>
+#import <vlc_interface.h>
 
 /*****************************************************************************
  * VLCWizard implementation
@@ -306,7 +305,7 @@ static VLCWizard *_o_sharedInstance = nil;
 - (void)resetWizard
 {
     /* get the current state of our setting to keep the selections or not */
-    keepSettingsOrNot = (BOOL *)config_GetInt( VLCIntf, "macosx-wizard-keep" );
+    b_keepSettingsOrNot = (BOOL)config_GetInt( VLCIntf, "macosx-wizard-keep" );
 
     /* go to the front page and clean up a bit */
     [o_userSelections removeAllObjects];
@@ -314,7 +313,7 @@ static VLCWizard *_o_sharedInstance = nil;
     [o_tab_pageHolder selectFirstTabViewItem:self];
 
     
-    if( keepSettingsOrNot )
+    if( b_keepSettingsOrNot )
         return;
     
     /* reset the wizard-window to its default values if wanted */
@@ -583,7 +582,7 @@ static VLCWizard *_o_sharedInstance = nil;
                 NSMutableArray * tempArray = [[NSMutableArray alloc] init];
                 while( x != y )
                 {
-                    playlist_item_t *p_item = 
+                    playlist_item_t *p_item =
                         [[o_t2_tbl_plst itemAtRow: 
                             [[o_t2_tbl_plst selectedRowIndexes] 
                             indexGreaterThanOrEqualToIndex: x]] pointerValue];
@@ -591,7 +590,7 @@ static VLCWizard *_o_sharedInstance = nil;
                     if( p_item->i_children <= 0 )
                     {
                         [tempArray addObject: [NSString stringWithUTF8String:
-                        p_item->input.psz_uri]];
+                        p_item->p_input->psz_uri]];
                         stop = NO;
                     }
                     else
@@ -650,7 +649,7 @@ static VLCWizard *_o_sharedInstance = nil;
             /* disable all codecs which don't support MPEG PS, MPEG TS, MPEG 1,
              * OGG, RAW or ASF */
             [o_t4_pop_audioCodec removeItemWithTitle:@"Uncompressed, integer"];
-            [o_t4_pop_audioCodec removeItemWithTitle:@"Uncompressed, floating"];
+            [o_t4_pop_audioCodec removeItemWithTitle:@"Uncompressed, floating point"];
             
         } else if ( mode == 1 )
         {
@@ -663,7 +662,7 @@ static VLCWizard *_o_sharedInstance = nil;
             [o_t4_pop_audioCodec removeItemWithTitle:@"FLAC"];
             [o_t4_pop_audioCodec removeItemWithTitle:@"Speex"];
             [o_t4_pop_audioCodec removeItemWithTitle:@"Uncompressed, integer"];
-            [o_t4_pop_audioCodec removeItemWithTitle:@"Uncompressed, floating"];
+            [o_t4_pop_audioCodec removeItemWithTitle:@"Uncompressed, floating point"];
             
             [o_t4_pop_videoCodec removeItemWithTitle:@"MPEG-1 Video"];
             [o_t4_pop_videoCodec removeItemWithTitle:@"MPEG-2 Video"];
@@ -673,7 +672,6 @@ static VLCWizard *_o_sharedInstance = nil;
             [o_t4_pop_videoCodec removeItemWithTitle:@"Theora"];
         } else {
             /* RTP/UDP Unicast/Multicast Streaming */
-            
             [o_userSelections setObject: [[NSNumber numberWithInt: mode] \
                 stringValue] forKey:@"stmgMhd"];
             
@@ -682,7 +680,7 @@ static VLCWizard *_o_sharedInstance = nil;
             [o_t4_pop_audioCodec removeItemWithTitle:@"FLAC"];
             [o_t4_pop_audioCodec removeItemWithTitle:@"Speex"];
             [o_t4_pop_audioCodec removeItemWithTitle:@"Uncompressed, integer"];
-            [o_t4_pop_audioCodec removeItemWithTitle:@"Uncompressed, floating"];
+            [o_t4_pop_audioCodec removeItemWithTitle:@"Uncompressed, floating point"];
         }
 
         /* store the destination and check whether is it empty */
@@ -1199,10 +1197,10 @@ static VLCWizard *_o_sharedInstance = nil;
                     /* check whether the extension is hidden or not. 
                      * if not, remove it
                      * we need the casting to make GCC4 happy */
-                    if( (int)[[[NSFileManager defaultManager] fileAttributesAtPath: \
+                    if( [[[NSFileManager defaultManager] fileAttributesAtPath: \
                         [[o_userSelections objectForKey:@"pathToStrm"] \
                         objectAtIndex: x] traverseLink: NO] objectForKey: \
-                        NSFileExtensionHidden] == YES )
+                        NSFileExtensionHidden] )
                         fileNameToUse = [NSString stringWithString:
                             [[NSFileManager defaultManager] displayNameAtPath:
                             [[o_userSelections objectForKey:@"pathToStrm"]
@@ -1278,61 +1276,59 @@ static VLCWizard *_o_sharedInstance = nil;
     {
         intf_thread_t * p_intf = VLCIntf;
 
-        playlist_t * p_playlist = (playlist_t *)vlc_object_find( p_intf,
-                            VLC_OBJECT_PLAYLIST, FIND_ANYWHERE);
-        if( p_playlist )
+        playlist_t * p_playlist = pl_Yield( p_intf );
+
+        int x = 0;
+        int y = [[o_userSelections objectForKey:@"pathToStrm"] count];
+        while( x != y )
         {
-            int x = 0;
-            int y = [[o_userSelections objectForKey:@"pathToStrm"] count];
-            while( x != y )
+            /* we need a temp. variable here to work-around a GCC4-bug */
+            NSString *tempString = [NSString stringWithFormat: \
+                @"%@ (%i/%i)", _NS("Streaming/Transcoding Wizard"), \
+                ( x + 1 ), y];
+            input_item_t *p_input = input_ItemNew( p_playlist, \
+                [[[o_userSelections objectForKey:@"pathToStrm"] \
+                objectAtIndex:x] UTF8String], \
+                [tempString UTF8String] );
+            input_ItemAddOption( p_input, [[[o_userSelections \
+                objectForKey:@"opts"] objectAtIndex: x] UTF8String]);
+
+            if(! [[o_userSelections objectForKey:@"partExtractFrom"] \
+                isEqualToString:@""] )
             {
-                /* we need a temp. variable here to work-around a GCC4-bug */
-                NSString *tempString = [NSString stringWithFormat: \
-                    @"%@ (%i/%i)", _NS("Streaming/Transcoding Wizard"), \
-                    ( x + 1 ), y];
-                playlist_item_t *p_item = playlist_ItemNew( p_playlist, \
-                    [[[o_userSelections objectForKey:@"pathToStrm"] \
-                    objectAtIndex:x] UTF8String], \
-                    [tempString UTF8String] );
-                playlist_ItemAddOption( p_item, [[[o_userSelections \
-                    objectForKey:@"opts"] objectAtIndex: x] UTF8String]);
-
-                if(! [[o_userSelections objectForKey:@"partExtractFrom"] \
-                    isEqualToString:@""] )
-                {
-                    playlist_ItemAddOption( p_item, [[NSString \
-                        stringWithFormat: @"start-time=%@", [o_userSelections \
-                        objectForKey: @"partExtractFrom"]] UTF8String] );
-                }
+                input_ItemAddOption( p_input, [[NSString \
+                    stringWithFormat: @"start-time=%@", [o_userSelections \
+                    objectForKey: @"partExtractFrom"]] UTF8String] );
+            }
 
-                if(! [[o_userSelections objectForKey:@"partExtractTo"] \
-                    isEqualToString:@""] )
-                {
-                    playlist_ItemAddOption( p_item, [[NSString \
-                        stringWithFormat: @"stop-time=%@", [o_userSelections \
-                        objectForKey: @"partExtractTo"]] UTF8String] );
-                }
+            if(! [[o_userSelections objectForKey:@"partExtractTo"] \
+                isEqualToString:@""] )
+            {
+                input_ItemAddOption( p_input, [[NSString \
+                    stringWithFormat: @"stop-time=%@", [o_userSelections \
+                    objectForKey: @"partExtractTo"]] UTF8String] );
+            }
 
-                playlist_ItemAddOption( p_item, [[NSString stringWithFormat: \
-                    @"ttl=%@", [o_userSelections objectForKey:@"ttl"]] \
-                    UTF8String] );
+            input_ItemAddOption( p_input, [[NSString stringWithFormat: \
+                @"ttl=%@", [o_userSelections objectForKey:@"ttl"]] \
+                UTF8String] );
 
-                playlist_AddItem( p_playlist, p_item, PLAYLIST_STOP, PLAYLIST_END );
-                
-                if( x == 0 )
-                    /* play the first item and add the others afterwards */ 
-                    playlist_Control( p_playlist, PLAYLIST_ITEMPLAY, p_item );
+            playlist_AddInput( p_playlist, p_input, PLAYLIST_STOP, 
+                       PLAYLIST_END, VLC_TRUE );
 
-                x += 1;
+            if( x == 0 )
+            {
+                /* play the first item and add the others afterwards */
+                playlist_item_t *p_item = playlist_ItemGetByInput( p_playlist, p_input, VLC_TRUE );
+                playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, VLC_TRUE, NULL,
+                          p_item );
             }
 
-            playlist_ViewUpdate( p_playlist, VIEW_CATEGORY );
-
-            vlc_object_release(p_playlist);
-        } else {
-            msg_Err( p_intf, "unable to find playlist" );
+            x += 1;
         }
 
+        vlc_object_release( p_playlist );
+
         /* close the window, since we are done */
         [o_wizard_window close];
     }
@@ -1351,7 +1347,7 @@ static VLCWizard *_o_sharedInstance = nil;
             objectAtIndex:0]];
         x += 1;
     }
-    if( keepSettingsOrNot && savePreviousSel >= 0 )
+    if( b_keepSettingsOrNot && savePreviousSel >= 0 )
         [o_t4_pop_videoCodec selectItemAtIndex: savePreviousSel];
 
     savePreviousSel = [o_t4_pop_audioCodec indexOfSelectedItem];
@@ -1363,7 +1359,7 @@ static VLCWizard *_o_sharedInstance = nil;
             objectAtIndex:0]];
         x += 1;
     }
-    if( keepSettingsOrNot && savePreviousSel >= 0 )
+    if( b_keepSettingsOrNot && savePreviousSel >= 0 )
         [o_t4_pop_audioCodec selectItemAtIndex: savePreviousSel];
 }