]> git.sesse.net Git - vlc/commitdiff
- Repeat and loop are now mutually exclusive
authorBenjamin Pracht <bigben@videolan.org>
Wed, 3 Mar 2004 11:34:19 +0000 (11:34 +0000)
committerBenjamin Pracht <bigben@videolan.org>
Wed, 3 Mar 2004 11:34:19 +0000 (11:34 +0000)
- On the playlist window, turn loop/repeat/standard play selection into a popup
- On the playlist window : if more than one group is defined, coolorize items according to the group they are belonging to. Currently, 8 colors are hard coded

Please make remarks on the new layout / the colors chosen.

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
modules/gui/macosx/controls.m
modules/gui/macosx/playlist.h
modules/gui/macosx/playlist.m

index cd25d2bcb7977dc5771eb0f71d4f04a24e11494b..65f17e6527d6563e139262381c989b8b2d60ecdd 100644 (file)
         {
             ACTIONS = {
                 deleteItems = id; 
+                handlePopUp = id; 
                 playItem = id; 
                 savePlaylist = id; 
                 searchItem = id; 
             OUTLETS = {
                 "o_btn_playlist" = id; 
                 "o_ctx_menu" = id; 
-                "o_loop_ckb" = id; 
+                "o_loop_popup" = id; 
                 "o_mi_delete" = id; 
                 "o_mi_play" = id; 
                 "o_mi_save_playlist" = id; 
                 "o_mi_selectall" = id; 
                 "o_random_ckb" = id; 
-                "o_repeat_ckb" = id; 
-                "o_search_button" = id; 
-                "o_search_keyword" = id; 
                 "o_status_field" = id; 
                 "o_table_view" = id; 
                 "o_tc_author" = id; 
         }
     ); 
     IBVersion = 1; 
-}
\ No newline at end of file
+}
index 2d598af3b29b0eeea9ab14c3cc41dbf2e84958fc..266cca191f2f896bf021bee78908d28c551e16f0 100644 (file)
@@ -3,7 +3,7 @@
 <plist version="1.0">
 <dict>
        <key>IBDocumentLocation</key>
-       <string>274 37 505 541 0 0 800 578 </string>
+       <string>512 148 505 541 0 0 1024 746 </string>
        <key>IBEditorPositions</key>
        <dict>
                <key>1617</key>
@@ -20,7 +20,6 @@
        <key>IBOpenObjects</key>
        <array>
                <integer>1647</integer>
-               <integer>636</integer>
        </array>
        <key>IBSystem Version</key>
        <string>7D24</string>
index 3956ec2c00b87ec26ae1ff02dbc75734a62f5130..e9eb0d334f48a3d9f7384673b43d052f28e03abc 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 c40da9475c4f492e1414b7a01f48ce38c546fe2d..257fd896d68714108ea8e602edfba08028d2fbee 100644 (file)
@@ -2,7 +2,7 @@
  * controls.m: MacOS X interface module
  *****************************************************************************
  * Copyright (C) 2002-2003 VideoLAN
- * $Id: controls.m,v 1.61 2004/02/17 03:12:00 hartman Exp $
+ * $Id: controls.m,v 1.62 2004/03/03 11:34:19 bigben Exp $
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *          Christophe Massiot <massiot@via.ecp.fr>
     }
 
     var_Get( p_playlist, "repeat", &val );
+    if (!val.b_bool)
+    {   
+        var_Set( p_playlist, "loop", val );
+    } 
     val.b_bool = !val.b_bool;
     var_Set( p_playlist, "repeat", val );
     if( val.b_bool )
     }
 
     var_Get( p_playlist, "loop", &val );
+    if (!val.b_bool)
+    {
+        var_Set( p_playlist, "repeat", val );
+    }
     val.b_bool = !val.b_bool;
     var_Set( p_playlist, "loop", val );
     if( val.b_bool )
index 346ac1e3d6199ca364db8dfb66f8985d508e6aa6..5195b047cfbaabc2044e07e4b5a991ce3d37f5ae 100644 (file)
@@ -2,7 +2,7 @@
  * playlist.h: MacOS X interface module
  *****************************************************************************
  * Copyright (C) 2002-2004 VideoLAN
- * $Id: playlist.h,v 1.21 2004/02/06 04:51:02 hartman Exp $
+ * $Id: playlist.h,v 1.22 2004/03/03 11:34:19 bigben Exp $
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *          Derk-Jan Hartman <hartman at videolan dot org>
     IBOutlet id o_mi_selectall;
 
     IBOutlet id o_random_ckb;
-    IBOutlet id o_loop_ckb;
-    IBOutlet id o_repeat_ckb;
 
     IBOutlet id o_search_keyword;
     IBOutlet id o_search_button;
 
+    IBOutlet id o_loop_popup;
+
     NSImage *o_descendingSortingImage;
     NSImage *o_ascendingSortingImage;
 
@@ -77,6 +77,7 @@
 - (IBAction)deleteItems:(id)sender;
 - (IBAction)selectAll:(id)sender;
 - (IBAction)searchItem:(id)sender;
+- (IBAction)handlePopUp:(id)sender;
 
 - (void)appendArray:(NSArray*)o_array atPos:(int)i_position enqueue:(BOOL)b_enqueue;
 
index 0e2d2146bab2d18fdcbf60aaab837cd7996705ec..3777360168bf6af19fe2423edca546db84e4aef4 100644 (file)
@@ -2,10 +2,11 @@
  * playlist.m: MacOS X interface module
  *****************************************************************************
  * Copyright (C) 2002-2004 VideoLAN
- * $Id: playlist.m,v 1.58 2004/02/26 14:40:29 hartman Exp $
+ * $Id: playlist.m,v 1.59 2004/03/03 11:34:19 bigben Exp $
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *          Derk-Jan Hartman <hartman at videolan dot org>
+ *          Benjamin Pracht <bigben at videolab dot org>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -35,6 +36,7 @@
 #include "intf.h"
 #include "playlist.h"
 #include "controls.h"
+#include <OSD.h>
 
 /*****************************************************************************
  * VLCPlaylistView implementation 
 
     [o_table_view registerForDraggedTypes: 
         [NSArray arrayWithObjects: NSFilenamesPboardType, nil]];
-
+    [o_table_view setIntercellSpacing: NSMakeSize (0.0, 1.0)];
     [o_window setExcludedFromWindowsMenu: TRUE];
 
 /* We need to check whether _defaultTableHeaderSortImage exists, since it 
@@ -157,6 +159,7 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
     }
 
     [self initStrings];
+    [self playlistUpdated];
 }
 
 - (void)initStrings
@@ -170,10 +173,11 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
     [[o_tc_author headerCell] setStringValue:_NS("Author")];
     [[o_tc_duration headerCell] setStringValue:_NS("Duration")];
     [o_random_ckb setTitle: _NS("Random")];
-    [o_loop_ckb setTitle: _NS("Repeat All")];
-    [o_repeat_ckb setTitle: _NS("Repeat One")];
     [o_search_button setTitle: _NS("Search")];
     [o_btn_playlist setToolTip: _NS("Playlist")];
+    [[o_loop_popup itemAtIndex:0] setTitle: _NS("Standard Play")];
+    [[o_loop_popup itemAtIndex:1] setTitle: _NS("Repeat One")];
+    [[o_loop_popup itemAtIndex:2] setTitle: _NS("Repeat All")];
 }
 
 - (void) tableView:(NSTableView*)o_tv
@@ -418,6 +422,54 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
 }
 
 
+- (IBAction)handlePopUp:(id)sender
+
+{
+             intf_thread_t * p_intf = [NSApp getIntf];
+             vlc_value_t val1,val2;
+             playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
+                                                        FIND_ANYWHERE );
+             if( p_playlist == NULL )
+             {
+                 return;
+             }
+
+    switch ([o_loop_popup indexOfSelectedItem])
+    {
+        case 1:
+
+             val1.b_bool = 0;
+             var_Set( p_playlist, "loop", val1 );
+             val1.b_bool = 1;
+             var_Set( p_playlist, "repeat", val1 );
+             vout_OSDMessage( p_intf, _( "Repeat One" ) );
+        break;
+
+        case 2:
+             val1.b_bool = 0;
+             var_Set( p_playlist, "repeat", val1 );
+             val1.b_bool = 1;
+             var_Set( p_playlist, "loop", val1 );
+             vout_OSDMessage( p_intf, _( "Repeat All" ) );
+        break;
+
+        default:
+             var_Get( p_playlist, "repeat", &val1 );
+             var_Get( p_playlist, "loop", &val2 );
+             if (val1.b_bool || val2.b_bool)
+             {
+                  val1.b_bool = 0;
+                  var_Set( p_playlist, "repeat", val1 );
+                  var_Set( p_playlist, "loop", val1 );
+                  vout_OSDMessage( p_intf, _( "Repeat Off" ) );
+             }
+         break;
+     }
+     vlc_object_release( p_playlist );
+     [self playlistUpdated];
+}
+
+
 - (void)appendArray:(NSArray*)o_array atPos:(int)i_position enqueue:(BOOL)b_enqueue
 {
     int i_item;
@@ -511,21 +563,29 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
 
 - (void)playlistUpdated
 {
-    vlc_value_t val;
+    vlc_value_t val1, val2;
     intf_thread_t * p_intf = [NSApp getIntf];
     playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
                                                        FIND_ANYWHERE );
     if( p_playlist != NULL )
     {
-        var_Get( p_playlist, "random", &val );
-        [o_random_ckb setState: val.b_bool];
-
-        var_Get( p_playlist, "loop", &val );
-        [o_loop_ckb setState: val.b_bool];
-
-        var_Get( p_playlist, "repeat", &val );
-        [o_repeat_ckb setState: val.b_bool];
+        var_Get( p_playlist, "random", &val1 );
+        [o_random_ckb setState: val1.b_bool];
 
+        var_Get( p_playlist, "repeat", &val1 );
+        var_Get( p_playlist, "loop", &val2 );
+        if(val1.b_bool)
+        {
+            [o_loop_popup selectItemAtIndex:1];
+        }
+        else if(val2.b_bool)
+        {
+            [o_loop_popup selectItemAtIndex:2];
+        }
+        else
+        {
+            [o_loop_popup selectItemAtIndex:0];
+        }
         vlc_object_release( p_playlist );
     }
     [o_table_view reloadData];
@@ -626,6 +686,64 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
     return( o_value );
 }
 
+- (void)tableView:(NSTableView *)o_tv
+                   willDisplayCell:(id)o_cell
+                   forTableColumn:(NSTableColumn *)o_tc
+                   row:(int)o_rows
+{
+    intf_thread_t * p_intf = [NSApp getIntf];
+    playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
+                                               FIND_ANYWHERE );
+    if ((p_playlist->i_groups) > 1 )
+    {
+       [o_cell setDrawsBackground: VLC_TRUE];
+       switch ( p_playlist->pp_items[o_rows]->i_group % 8 )
+       {
+            case 1:
+              /*white*/
+              [o_cell setBackgroundColor: [NSColor colorWithDeviceRed:1.0 green:1.0 blue:1.0 alpha:1.0]];
+              break;
+
+            case 2:
+              /*red*/
+             [o_cell setBackgroundColor: [NSColor colorWithDeviceRed:1.0 green:0.76471 blue:0.76471 alpha:1.0]];
+           break;
+
+           case 3:
+              /*dark blue*/
+                  [o_cell setBackgroundColor: [NSColor colorWithDeviceRed:0.76471 green:0.76471 blue:1.0 alpha:1.0]];
+            break; 
+
+            case 4:
+               /*orange*/
+                   [o_cell setBackgroundColor: [NSColor colorWithDeviceRed:1.0 green:0.89804 blue:0.76471 alpha:1.0]];
+            break;
+
+            case 5:
+                /*purple*/
+                   [o_cell setBackgroundColor: [NSColor colorWithDeviceRed:1.0 green:0.76471 blue:1.0 alpha:1.0]];
+            break;
+            case 6:
+                /*green*/
+                   [o_cell setBackgroundColor: [NSColor colorWithDeviceRed:0.76471 green:1.0 blue:0.76471 alpha:1.0]];
+            break; 
+
+            case 7:
+               /*light blue*/
+                   [o_cell setBackgroundColor: [NSColor colorWithDeviceRed:0.76471 green:1.0 blue:1.0 alpha:1.0]];
+            break;
+
+            case 0:
+               /*yellow*/
+                   [o_cell setBackgroundColor: [NSColor colorWithDeviceRed:1.0 green:1.0 blue:0.76471 alpha:1.0]];
+            break;
+       }
+     
+    }
+vlc_object_release( p_playlist );
+}
+
 - (BOOL)tableView:(NSTableView *)o_tv
                     writeRows:(NSArray*)o_rows
                     toPasteboard:(NSPasteboard*)o_pasteboard