* controls.m: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
- * $Id: controls.m,v 1.41 2003/06/03 22:21:46 hartman Exp $
+ * $Id: controls.m,v 1.42 2003/06/30 01:51:10 hartman Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
- (IBAction)prev:(id)sender
{
+ vlc_value_t val;
intf_thread_t * p_intf = [NSApp getIntf];
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
vlc_mutex_lock( &p_playlist->p_input->stream.stream_lock );
#define p_area p_playlist->p_input->stream.p_selected_area
-
- if( p_area->i_part_nb > 1 && p_area->i_part > 1 )
+NSLog( @"current title: %d, all titles: %d\ncurrent chapter: %d, all chapters: %d", p_area->i_id, p_playlist->p_input->stream.i_area_nb, p_area->i_part, p_area->i_part_nb);
+ if( p_area->i_part > 0 && p_area->i_part_nb > 1)
{
- p_area->i_part--;
+ NSLog(@"Prev Chap");
+ vlc_mutex_unlock( &p_playlist->p_input->stream.stream_lock );
+ vlc_mutex_unlock( &p_playlist->object_lock );
+ var_Get( p_playlist->p_input, "prev-chapter", &val );
+ var_Set( p_playlist->p_input, "prev-chapter", val );
+ p_intf->p_sys->b_input_update = VLC_TRUE;
+ }
+ else if( p_area->i_id > 1 )
+ {
+ NSLog(@"Prev Title");
vlc_mutex_unlock( &p_playlist->p_input->stream.stream_lock );
- input_ChangeArea( p_playlist->p_input, p_area );
vlc_mutex_unlock( &p_playlist->object_lock );
+ var_Get( p_playlist->p_input, "prev-title", &val );
+ var_Set( p_playlist->p_input, "prev-title", val );
p_intf->p_sys->b_input_update = VLC_TRUE;
}
else
{
+ NSLog(@"Prev PlaylistItem");
vlc_mutex_unlock( &p_playlist->p_input->stream.stream_lock );
vlc_mutex_unlock( &p_playlist->object_lock );
playlist_Prev( p_playlist );
}
-
+NSLog( @"current title: %d, all titles: %d\ncurrent chapter: %d, all chapters: %d", p_area->i_id, p_playlist->p_input->stream.i_area_nb, p_area->i_part, p_area->i_part_nb);
#undef p_area
vlc_object_release( p_playlist );
- (IBAction)next:(id)sender
{
+ vlc_value_t val;
intf_thread_t * p_intf = [NSApp getIntf];
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
{
return;
}
-
+
vlc_mutex_lock( &p_playlist->object_lock );
if( p_playlist->p_input == NULL )
vlc_mutex_lock( &p_playlist->p_input->stream.stream_lock );
#define p_area p_playlist->p_input->stream.p_selected_area
-
- if( p_area->i_part_nb > 1 && p_area->i_part + 1 < p_area->i_part_nb )
+NSLog( @"current title: %d, all titles: %d\ncurrent chapter: %d, all chapters: %d", p_area->i_id, p_playlist->p_input->stream.i_area_nb, p_area->i_part, p_area->i_part_nb);
+ if( p_area->i_part < p_area->i_part_nb && p_area->i_part_nb > 1 )
{
- p_area->i_part++;
+ NSLog(@"Next Chap");
+ vlc_mutex_unlock( &p_playlist->p_input->stream.stream_lock );
+ vlc_mutex_unlock( &p_playlist->object_lock );
+ var_Get( p_playlist->p_input, "next-chapter", &val );
+ var_Set( p_playlist->p_input, "next-chapter", val );
+ p_intf->p_sys->b_input_update = VLC_TRUE;
+ }
+ else if( p_area->i_id < p_playlist->p_input->stream.i_area_nb )
+ {
+ NSLog(@"Next Title");
vlc_mutex_unlock( &p_playlist->p_input->stream.stream_lock );
- input_ChangeArea( p_playlist->p_input, p_area );
vlc_mutex_unlock( &p_playlist->object_lock );
+ var_Get( p_playlist->p_input, "next-title", &val );
+ var_Set( p_playlist->p_input, "next-title", val );
p_intf->p_sys->b_input_update = VLC_TRUE;
}
else
{
+ NSLog(@"Next PlaylistItem");
vlc_mutex_unlock( &p_playlist->p_input->stream.stream_lock );
vlc_mutex_unlock( &p_playlist->object_lock );
playlist_Next( p_playlist );
}
-
+NSLog( @"current title: %d, all titles: %d\ncurrent chapter: %d, all chapters: %d", p_area->i_id, p_playlist->p_input->stream.i_area_nb, p_area->i_part, p_area->i_part_nb);
#undef p_area
vlc_object_release( p_playlist );
if( p_input != NULL )
{
vlc_mutex_lock( &p_input->stream.stream_lock );
- bEnabled |= p_input->stream.p_selected_area->i_part_nb > 1;
+ bEnabled |= p_input->stream.i_area_nb > 1;
vlc_mutex_unlock( &p_input->stream.stream_lock );
}
}
* playlist.m: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
- * $Id: playlist.m,v 1.26 2003/06/29 00:14:50 hartman Exp $
+ * $Id: playlist.m,v 1.27 2003/06/30 01:51:10 hartman Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Derk-Jan Hartman <thedj@users.sourceforge.net>
- (void)keyDown:(NSEvent *)o_event
{
unichar key = 0;
- int i_row;
+ int i, c, i_row;
+ NSMutableArray *o_to_delete;
+ NSNumber *o_number;
+
playlist_t * p_playlist;
intf_thread_t * p_intf = [NSApp getIntf];
case NSDeleteFunctionKey:
case NSDeleteCharFunctionKey:
case NSBackspaceCharacter:
- while( ( i_row = [self selectedRow] ) != -1 )
- {
+ o_to_delete = [NSMutableArray arrayWithArray:[[self selectedRowEnumerator] allObjects]];
+ c = [o_to_delete count];
+
+ for( i = 0; i < c; i++ ) {
+ o_number = [o_to_delete lastObject];
+ i_row = [o_number intValue];
+
if( p_playlist->i_index == i_row && p_playlist->i_status )
{
playlist_Stop( p_playlist );
}
-
- playlist_Delete( p_playlist, i_row );
-
+ [o_to_delete removeObject: o_number];
[self deselectRow: i_row];
+ playlist_Delete( p_playlist, i_row );
}
[self reloadData];
break;
- (IBAction)deleteItems:(id)sender
{
- int i_row;
+ int i, c, i_row;
+ NSMutableArray *o_to_delete;
+ NSNumber *o_number;
intf_thread_t * p_intf = [NSApp getIntf];
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
{
return;
}
-
- while( ( i_row = [o_table_view selectedRow] ) != -1 )
- {
+
+ o_to_delete = [NSMutableArray arrayWithArray:[[o_table_view selectedRowEnumerator] allObjects]];
+ c = [o_to_delete count];
+
+ for( i = 0; i < c; i++ ) {
+ o_number = [o_to_delete lastObject];
+ i_row = [o_number intValue];
+
if( p_playlist->i_index == i_row && p_playlist->i_status )
{
playlist_Stop( p_playlist );
}
-
- playlist_Delete( p_playlist, i_row );
-
+ [o_to_delete removeObject: o_number];
[o_table_view deselectRow: i_row];
+ playlist_Delete( p_playlist, i_row );
}
vlc_object_release( p_playlist );