Commit 81ec7faf authored by Benjamin Pracht's avatar Benjamin Pracht

- Repeat and loop are now mutually exclusive

- 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.
parent 9e4b5e02
......@@ -327,6 +327,7 @@
{
ACTIONS = {
deleteItems = id;
handlePopUp = id;
playItem = id;
savePlaylist = id;
searchItem = id;
......@@ -338,15 +339,12 @@
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;
......@@ -375,4 +373,4 @@
}
);
IBVersion = 1;
}
\ No newline at end of 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>
......
......@@ -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>
......@@ -194,6 +194,10 @@
}
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 )
......@@ -222,6 +226,10 @@
}
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 )
......
......@@ -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>
......@@ -57,12 +57,12 @@
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;
......
......@@ -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
......@@ -132,7 +134,7 @@
[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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment