]> git.sesse.net Git - vlc/commitdiff
* ./extras/MacOSX/vlc.pbproj/project.pbxproj
authorDerk-Jan Hartman <hartman@videolan.org>
Mon, 20 Jan 2003 03:45:06 +0000 (03:45 +0000)
committerDerk-Jan Hartman <hartman@videolan.org>
Mon, 20 Jan 2003 03:45:06 +0000 (03:45 +0000)
  - Added .cue and .ogg to the known filetypes
ALL:
  - When files are added they are not automatically played anymore. They are always queue'ed and optionally played.
  - Preliminary divx filesubtitle support.

extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib
extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib
extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib
extras/MacOSX/vlc.pbproj/project.pbxproj
modules/gui/macosx/intf.m
modules/gui/macosx/open.h
modules/gui/macosx/open.m
modules/gui/macosx/playlist.h
modules/gui/macosx/playlist.m

index 4c5bd01ffaf662051e4401417f4a5ab08321f5ce..c033888b4047b1687b4c0701f30faa46259c9fa8 100644 (file)
         }, 
         {
             ACTIONS = {
+                loadSubsChanged = id; 
                 openDisc = id; 
                 openDiscMenusChanged = id; 
                 openDiscStepperChanged = id; 
                 openNet = id; 
                 openNetModeChanged = id; 
                 openNetStepperChanged = id; 
+                openSubBrowse = id; 
                 openVTSBrowse = id; 
                 panelCancel = id; 
                 panelOk = id; 
             OUTLETS = {
                 "o_btn_cancel" = id; 
                 "o_btn_ok" = id; 
+                "o_ckbox_enqueue" = id; 
                 "o_disc_chapter" = id; 
                 "o_disc_chapter_lbl" = id; 
                 "o_disc_chapter_stp" = id; 
                 "o_file_btn_browse" = id; 
                 "o_file_path" = id; 
                 "o_file_stream" = id; 
+                "o_file_sub_btn_browse" = id; 
+                "o_file_sub_ckbox" = id; 
+                "o_file_sub_path" = id; 
                 "o_mrl" = id; 
                 "o_mrl_lbl" = id; 
                 "o_net_cs_addr" = id; 
index 3218b905563d96a4040740073ae70df4b7eb170b..dbb68018aeb5f15035ed50bc3be08d5c9ccf59ed 100644 (file)
@@ -3,17 +3,17 @@
 <plist version="1.0">
 <dict>
        <key>IBDocumentLocation</key>
-       <string>451 372 365 441 0 0 1280 1002 </string>
+       <string>642 60 365 441 0 0 1280 1002 </string>
        <key>IBEditorPositions</key>
        <dict>
                <key>29</key>
-               <string>14 602 374 44 0 0 1152 746 </string>
+               <string>16 822 374 44 0 0 1280 1002 </string>
                <key>303</key>
                <string>60 509 104 66 0 0 1280 1002 </string>
                <key>909</key>
-               <string>343 411 430 172 0 0 1152 746 </string>
+               <string>425 600 430 172 0 0 1280 1002 </string>
                <key>915</key>
-               <string>392 471 93 96 0 0 1152 746 </string>
+               <string>439 657 93 96 0 0 1280 1002 </string>
        </dict>
        <key>IBFramework Version</key>
        <string>291.0</string>
        </array>
        <key>IBOpenObjects</key>
        <array>
-               <integer>909</integer>
-               <integer>21</integer>
-               <integer>915</integer>
                <integer>636</integer>
-               <integer>29</integer>
+               <integer>21</integer>
        </array>
        <key>IBSystem Version</key>
        <string>6G30</string>
index 0f3168e55587ce1bfae5dd7fc6b9999de6b052cc..c20d9a34823e58f214e1dc42295ecd4486e893a6 100644 (file)
Binary files a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib and b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib differ
index 2bb6fa30a34f58333f84788914229477334d429f..32f5b2d1d6edd1e4c21263d441bd04987ebf0e52 100644 (file)
                        <key>CFBundleTypeRole</key>
                        <string>Viewer</string>
                </dict>
+               <dict>
+                       <key>CFBundleTypeExtensions</key>
+                       <array>
+                               <string>ogg</string>
+                       </array>
+                       <key>CFBundleTypeIconFile</key>
+                       <string>generic.icns</string>
+                       <key>CFBundleTypeName</key>
+                       <string>OGG file</string>
+                       <key>CFBundleTypeRole</key>
+                       <string>Viewer</string>
+               </dict>
                <dict>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                        <key>CFBundleTypeRole</key>
                        <string>Viewer</string>
                </dict>
+               <dict>
+                       <key>CFBundleTypeExtensions</key>
+                       <array>
+                               <string>cue</string>
+                       </array>
+                       <key>CFBundleTypeIconFile</key>
+                       <string>generic.icns</string>
+                       <key>CFBundleTypeName</key>
+                       <string>CUE file</string>
+                       <key>CFBundleTypeRole</key>
+                       <string>Viewer</string>
+               </dict>
                <dict>
                        <key>CFBundleTypeExtensions</key>
                        <array>
index 195caf4b8dab19442146dd758b24191dde422b09..f6d9b9f144fd5db656b6b26092c266b09eb6332a 100644 (file)
@@ -2,7 +2,7 @@
  * intf.m: MacOS X interface plugin
  *****************************************************************************
  * Copyright (C) 2002-2003 VideoLAN
- * $Id: intf.m,v 1.26 2003/01/16 13:49:44 hartman Exp $
+ * $Id: intf.m,v 1.27 2003/01/20 03:45:06 hartman Exp $
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *          Christophe Massiot <massiot@via.ecp.fr>
@@ -300,7 +300,7 @@ static void Run( intf_thread_t *p_intf )
 - (BOOL)application:(NSApplication *)o_app openFile:(NSString *)o_filename
 {
     [o_playlist appendArray:
-        [NSArray arrayWithObject: o_filename] atPos: -1];
+        [NSArray arrayWithObject: o_filename] atPos: -1 enqueue: NO];
 
     return( TRUE );
 }
index 42a2d3869d4027622286ea76250a6ee8000dc812..a4d1747993690c238bf7649c5b36d20b928af34f 100644 (file)
@@ -2,7 +2,7 @@
  * open.h: MacOS X plugin for vlc
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: open.h,v 1.6 2003/01/06 02:45:09 massiot Exp $
+ * $Id: open.h,v 1.7 2003/01/20 03:45:06 hartman Exp $
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net> 
  *
@@ -42,10 +42,14 @@ NSArray *GetEjectableMediaOfClass( const char *psz_class );
 
     IBOutlet id o_btn_ok;
     IBOutlet id o_btn_cancel;
+    IBOutlet id o_ckbox_enqueue;
 
     IBOutlet id o_file_path;
     IBOutlet id o_file_btn_browse;
     IBOutlet id o_file_stream;
+    IBOutlet id o_file_sub_path;
+    IBOutlet id o_file_sub_btn_browse;
+    IBOutlet id o_file_sub_ckbox;
 
     IBOutlet id o_disc_type;
     IBOutlet id o_disc_device;
@@ -98,6 +102,8 @@ NSArray *GetEjectableMediaOfClass( const char *psz_class );
 - (void)openFilePathChanged:(NSNotification *)o_notification;
 - (IBAction)openFileBrowse:(id)sender;
 - (IBAction)openFileStreamChanged:(id)sender;
+- (IBAction)loadSubsChanged:(id)sender;
+- (IBAction)openSubBrowse:(id)sender;
 
 - (IBAction)openDisc:(id)sender;
 - (IBAction)openDiscTypeChanged:(id)sender;
index 670651767acf80c4b3f2c4e185731d1e97ec89ca..0b2b6c33d21f96eda6e36b1d312c78bf02febb5f 100644 (file)
@@ -2,7 +2,7 @@
  * open.m: MacOS X plugin for vlc
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: open.m,v 1.10 2003/01/18 04:57:08 hartman Exp $
+ * $Id: open.m,v 1.11 2003/01/20 03:45:06 hartman Exp $
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net> 
  *          Christophe Massiot <massiot@via.ecp.fr>
@@ -168,6 +168,7 @@ NSArray *GetEjectableMediaOfClass( const char *psz_class )
 
     [o_panel setTitle: _NS("Open Source")];
     [o_mrl_lbl setTitle: _NS("Media Resource Locator (MRL)")];
+    [o_ckbox_enqueue setTitle: _NS("Only enqueue in playlist. Do not play.")];
 
     [o_btn_ok setTitle: _NS("OK")];
     [o_btn_cancel setTitle: _NS("Cancel")];
@@ -179,6 +180,9 @@ NSArray *GetEjectableMediaOfClass( const char *psz_class )
     [o_file_btn_browse setTitle: _NS("Browse...")];
     [o_file_stream setTitle: _NS("Treat as a pipe rather than as a file")];
 
+    [o_file_sub_btn_browse setTitle: _NS("Browse...")];
+    [o_file_sub_ckbox setTitle: _NS("Load subtitles")];
+
     [o_disc_device_lbl setStringValue: _NS("Device name")];
     [o_disc_title_lbl setStringValue: _NS("Title")];
     [o_disc_chapter_lbl setStringValue: _NS("Chapter")];
@@ -285,24 +289,34 @@ NSArray *GetEjectableMediaOfClass( const char *psz_class )
     int i_result;
 
     [o_tabview selectTabViewItemAtIndex: i_type];
-
+    [o_ckbox_enqueue setState: NSOffState];
+    [o_file_sub_path setStringValue: @""];
+    [o_file_sub_ckbox setState: NSOffState];
+    [o_file_sub_path setEnabled: NO];
+    [o_file_sub_btn_browse setEnabled: NO];
+    
     i_result = [NSApp runModalForWindow: o_panel];
     [o_panel close];
 
     if( i_result )
     {
         NSString *o_sout = [o_sout_mrl stringValue];
-
+        intf_thread_t * p_intf = [NSApp getIntf];
+        
         if ( [o_sout_cbox state] )
         {
-            intf_thread_t * p_intf = [NSApp getIntf];
             config_PutPsz( p_intf, "sout", [o_sout lossyCString] );
         }
 
         NSString *o_source = [o_mrl stringValue];
-
+        BOOL b_enq = [o_ckbox_enqueue state] == NSOnState ? YES : NO;
+        NSString *subPath = [o_file_sub_path stringValue];
+        
         [o_playlist appendArray: 
-            [NSArray arrayWithObject: o_source] atPos: -1];
+            [NSArray arrayWithObject: o_source] atPos: -1 enqueue:b_enq];
+        
+        if (([o_file_sub_ckbox state] == NSOnState) && !([subPath isEqualTo: @""]))
+            config_PutPsz( p_intf, "sub-file", strdup( [subPath cString] ) );
     }
 
     [self soutModeChanged: nil];
@@ -389,6 +403,36 @@ NSArray *GetEjectableMediaOfClass( const char *psz_class )
     [self openFilePathChanged: nil];
 }
 
+- (IBAction)loadSubsChanged:(id)sender
+{
+    if ([o_file_sub_ckbox state] == NSOnState)
+    {
+        [o_file_sub_path setEnabled:YES];
+        [o_file_sub_btn_browse setEnabled:YES];
+    }
+    else
+    {
+        [o_file_sub_path setEnabled:NO];
+        [o_file_sub_btn_browse setEnabled:NO];
+    }
+}
+
+- (IBAction)openSubBrowse:(id)sender
+{
+    NSOpenPanel *o_open_panel = [NSOpenPanel openPanel];
+    
+    [o_open_panel setAllowsMultipleSelection: NO];
+    [o_open_panel setTitle: _NS("Open File")];
+    [o_open_panel setPrompt: _NS("Open")];
+
+    if( [o_open_panel runModalForDirectory: nil 
+            file: nil types: nil] == NSOKButton )
+    {
+        NSString *o_filename = [[o_open_panel filenames] objectAtIndex: 0];
+        [o_file_sub_path setStringValue: o_filename];
+    }
+}
+
 - (IBAction)openDiscTypeChanged:(id)sender
 {
     NSString *o_type;
@@ -797,19 +841,8 @@ NSArray *GetEjectableMediaOfClass( const char *psz_class )
 
 - (IBAction)openFile:(id)sender
 {
-    NSOpenPanel *o_open_panel = [NSOpenPanel openPanel];
-
-    [o_open_panel setAllowsMultipleSelection: NO];
-    [o_open_panel setTitle: _NS("Open File")];
-    [o_open_panel setPrompt: _NS("Open")];
-
-    if( [o_open_panel runModalForDirectory: nil
-            file: nil types: nil] == NSOKButton )
-    {
-        intf_thread_t * p_intf = [NSApp getIntf];
-        config_PutPsz( p_intf, "sout", NULL );
-        [o_playlist appendArray: [o_open_panel filenames] atPos: -1];
-    }
+    [self openFilePathChanged: nil];
+    [self openTarget: 0];
 }
 
 - (IBAction)panelCancel:(id)sender
index a3cba4856afd0b12ea0d512e494183b2c81e7c80..2245ac284fb4469319cdb4f8c6d5f190a5e6ca98 100644 (file)
@@ -2,7 +2,7 @@
  * playlist.h: MacOS X interface plugin
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: playlist.h,v 1.3 2003/01/16 13:49:44 hartman Exp $
+ * $Id: playlist.h,v 1.4 2003/01/20 03:45:06 hartman Exp $
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *          Derk-Jan Hartman <thedj@users.sourceforge.net>
@@ -55,7 +55,7 @@
 - (IBAction)deleteItems:(id)sender;
 - (IBAction)selectAll:(id)sender;
 
-- (void)appendArray:(NSArray*)o_array atPos:(int)i_pos;
+- (void)appendArray:(NSArray*)o_array atPos:(int)i_pos enqueue:(BOOL)b_enqueue;
 - (void)playlistUpdated;
 
 @end
index 9e8b360f73227f33270399823b64a8c9773f9b30..390766725659c1b56df5ea4a5d99b04dd16f8dfa 100644 (file)
@@ -2,7 +2,7 @@
  * playlist.m: MacOS X interface plugin
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: playlist.m,v 1.3 2003/01/05 03:21:50 jlj Exp $
+ * $Id: playlist.m,v 1.4 2003/01/20 03:45:06 hartman Exp $
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *
@@ -98,7 +98,7 @@
     {
         o_values = [o_pasteboard propertyListForType: NSFilenamesPboardType];
 
-        [self appendArray: o_values atPos: i_row];
+        [self appendArray: o_values atPos: i_row enqueue:YES];
 
         return( YES );
     }
     [o_table_view selectAll: nil];
 }
 
-- (void)appendArray:(NSArray*)o_array atPos:(int)i_pos
+- (void)appendArray:(NSArray*)o_array atPos:(int)i_pos enqueue:(BOOL)b_enqueue
 {
     int i_items;
     NSString * o_value;
     {
         NSURL * o_url;
 
-        int i_mode = i_items == 0 ? PLAYLIST_INSERT | PLAYLIST_GO :
-                                                   PLAYLIST_INSERT;
+        int i_mode = PLAYLIST_INSERT;
+        
+        if (i_items == 0 && !b_enqueue)
+            i_mode |= PLAYLIST_GO;
 
         playlist_Add( p_playlist, [o_value fileSystemRepresentation],
             i_mode, i_pos == -1 ? PLAYLIST_END : i_pos + i_items );