Commit 2b78a774 authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

* include/vlc/vlc.h:

  - removed the defines for i_mode concerning random and loop. We use config
    variables for all of these.
* src/libvlc.h:
  - removed the enqueue playlist config option. It's no longer used.
  - added a repeat option. vlc will keep playing the same playlist_item,
    until the option is unset.
* src/playlist/playlist.c:
  - added a repeat, random and loop variable.
  - wxwindows should use these as well I think.
* modules/gui/macosx:
  - added the INTF_ABOUT_MSG to the about dialog.
  - implemented the about and repeat items.
parent 19ff195c
......@@ -27,6 +27,8 @@
pause = id;
play = id;
prev = id;
random = id;
repeat = id;
slower = id;
stop = id;
toggleVar = id;
......@@ -130,7 +132,9 @@
"o_mi_previous" = id;
"o_mi_program" = id;
"o_mi_quit" = id;
"o_mi_random" = id;
"o_mi_readme" = id;
"o_mi_repeat" = id;
"o_mi_reportabug" = id;
"o_mi_screen" = id;
"o_mi_select_all" = id;
......
......@@ -23,7 +23,7 @@
</array>
<key>IBOpenObjects</key>
<array>
<integer>636</integer>
<integer>29</integer>
</array>
<key>IBSystem Version</key>
<string>6L60</string>
......
......@@ -2,7 +2,7 @@
* vlc.h: global header for vlc
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: vlc.h,v 1.26 2003/09/07 22:45:16 fenrir Exp $
* $Id: vlc.h,v 1.27 2003/09/20 19:37:53 hartman Exp $
*
* 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
......@@ -97,15 +97,6 @@ struct vlc_list_t
#define PLAYLIST_END -666
/* Playlist parsing mode */
#define PLAYLIST_REPEAT_CURRENT 0 /* Keep playing current item */
#define PLAYLIST_FORWARD 1 /* Parse playlist until end */
#define PLAYLIST_BACKWARD -1 /* Parse backwards */
#define PLAYLIST_FORWARD_LOOP 2 /* Parse playlist and loop */
#define PLAYLIST_BACKWARD_LOOP -2 /* Parse backwards and loop */
#define PLAYLIST_RANDOM 3 /* Shuffle play */
#define PLAYLIST_REVERSE_RANDOM -3 /* Reverse shuffle play */
/** Playlist commands */
typedef enum {
PLAYLIST_PLAY, /**< Starts playing. No arg. */
......
......@@ -2,7 +2,7 @@
* about.m: MacOS X About Panel
*****************************************************************************
* Copyright (C) 2001-2003 VideoLAN
* $Id: about.m,v 1.2 2003/05/11 23:17:30 hartman Exp $
* $Id: about.m,v 1.3 2003/09/20 19:37:53 hartman Exp $
*
* Authors: Derk-Jan Hartman <thedj@users.sourceforge.net>
*
......@@ -84,7 +84,7 @@ static VLAboutBox *_o_sharedInstance = nil;
o_credits = [[NSString alloc] initWithData: [NSData dataWithContentsOfFile: o_credits_path ] encoding:NSWindowsCP1252StringEncoding];
/* Parse the authors string */
NSMutableString *o_outString = [NSMutableString string];
NSMutableString *o_outString = [NSMutableString stringWithFormat: @"%@\n\n", _NS(INTF_ABOUT_MSG)];
NSScanner *o_scan_credits = [NSScanner scannerWithString: o_credits];
NSCharacterSet *o_stopSet = [NSCharacterSet characterSetWithCharactersInString:@"\n\r"];
......
......@@ -2,7 +2,7 @@
* controls.h: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
* $Id: controls.h,v 1.6 2003/06/03 22:21:46 hartman Exp $
* $Id: controls.h,v 1.7 2003/09/20 19:37:53 hartman Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
......@@ -41,6 +41,8 @@
- (IBAction)prev:(id)sender;
- (IBAction)next:(id)sender;
- (IBAction)random:(id)sender;
- (IBAction)repeat:(id)sender;
- (IBAction)loop:(id)sender;
- (IBAction)forward:(id)sender;
......
......@@ -2,7 +2,7 @@
* controls.m: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
* $Id: controls.m,v 1.48 2003/09/20 13:46:00 hartman Exp $
* $Id: controls.m,v 1.49 2003/09/20 19:37:53 hartman Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
......@@ -207,10 +207,46 @@
vlc_object_release( p_playlist );
}
- (IBAction)loop:(id)sender
- (IBAction)random:(id)sender
{
intf_thread_t * p_intf = [NSApp getIntf];
vlc_value_t val;
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist == NULL )
{
return;
}
var_Get( p_playlist, "random", &val );
val.b_bool = !val.b_bool;
var_Set( p_playlist, "random", val );
vlc_object_release( p_playlist );
}
- (IBAction)repeat:(id)sender
{
intf_thread_t * p_intf = [NSApp getIntf];
vlc_value_t val;
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist == NULL )
{
return;
}
var_Get( p_playlist, "repeat", &val );
val.b_bool = !val.b_bool;
var_Set( p_playlist, "repeat", val );
vlc_object_release( p_playlist );
}
- (IBAction)loop:(id)sender
{
intf_thread_t * p_intf = [NSApp getIntf];
vlc_value_t val;
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist == NULL )
......@@ -218,8 +254,9 @@
return;
}
config_PutInt( p_playlist, "loop",
!config_GetInt( p_playlist, "loop" ) );
var_Get( p_playlist, "loop", &val );
val.b_bool = !val.b_bool;
var_Set( p_playlist, "loop", val );
vlc_object_release( p_playlist );
}
......@@ -232,7 +269,7 @@
if( p_input != NULL )
{
vlc_value_t time;
time.f_float = 5;
time.i_time = 5 * 1000000;
var_Set( p_input, "time-offset", time );
vlc_object_release( p_input );
}
......@@ -246,7 +283,7 @@
if( p_input != NULL )
{
vlc_value_t time;
time.f_float = -5;
time.i_time = -5 * 1000000;
var_Set( p_input, "time-offset", time );
vlc_object_release( p_input );
}
......@@ -589,8 +626,8 @@
- (BOOL)validateMenuItem:(NSMenuItem *)o_mi
{
BOOL bEnabled = TRUE;
vlc_value_t val;
intf_thread_t * p_intf = [NSApp getIntf];
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
......@@ -641,11 +678,25 @@
}
}
}
else if( [[o_mi title] isEqualToString: _NS("Loop")] )
else if( [[o_mi title] isEqualToString: _NS("Shuffle")] )
{
int i_state = config_GetInt( p_playlist, "loop" ) ?
NSOnState : NSOffState;
int i_state;
var_Get( p_playlist, "random", &val );
i_state = val.b_bool ? NSOnState : NSOffState;
[o_mi setState: i_state];
}
else if( [[o_mi title] isEqualToString: _NS("Repeat Item")] )
{
int i_state;
var_Get( p_playlist, "repeat", &val );
i_state = val.b_bool ? NSOnState : NSOffState;
[o_mi setState: i_state];
}
else if( [[o_mi title] isEqualToString: _NS("Repeat Playlist")] )
{
int i_state;
var_Get( p_playlist, "loop", &val );
i_state = val.b_bool ? NSOnState : NSOffState;
[o_mi setState: i_state];
}
else if( [[o_mi title] isEqualToString: _NS("Step Forward")] ||
......
......@@ -2,7 +2,7 @@
* intf.h: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
* $Id: intf.h,v 1.44 2003/09/20 13:46:00 hartman Exp $
* $Id: intf.h,v 1.45 2003/09/20 19:37:53 hartman Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
......@@ -160,6 +160,8 @@ struct intf_sys_t
IBOutlet id o_mi_slower;
IBOutlet id o_mi_previous;
IBOutlet id o_mi_next;
IBOutlet id o_mi_random;
IBOutlet id o_mi_repeat;
IBOutlet id o_mi_loop;
IBOutlet id o_mi_fwd;
IBOutlet id o_mi_bwd;
......
......@@ -2,7 +2,7 @@
* intf.m: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
* $Id: intf.m,v 1.95 2003/09/20 13:46:00 hartman Exp $
* $Id: intf.m,v 1.96 2003/09/20 19:37:53 hartman Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
......@@ -347,7 +347,9 @@ int PlaylistChanged( vlc_object_t *p_this, const char *psz_variable,
[o_mi_slower setTitle: _NS("Slower")];
[o_mi_previous setTitle: _NS("Previous")];
[o_mi_next setTitle: _NS("Next")];
[o_mi_loop setTitle: _NS("Loop")];
[o_mi_random setTitle: _NS("Shuffle")];
[o_mi_repeat setTitle: _NS("Repeat Item")];
[o_mi_loop setTitle: _NS("Repeat Playlist")];
[o_mi_fwd setTitle: _NS("Step Forward")];
[o_mi_bwd setTitle: _NS("Step Backward")];
[o_mi_program setTitle: _NS("Program")];
......
......@@ -3,7 +3,7 @@
* vout.m: MacOS X video output plugin
*****************************************************************************
* Copyright (C) 2001-2003 VideoLAN
* $Id: vout.m,v 1.56 2003/09/20 13:46:00 hartman Exp $
* $Id: vout.m,v 1.57 2003/09/20 19:37:53 hartman Exp $
*
* Authors: Colin Delacroix <colin@zoy.org>
* Florian G. Pflug <fgp@phlo.org>
......@@ -1412,7 +1412,7 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic )
backing: NSBackingStoreBuffered
defer: NO screen: o_screen];
[p_vout->p_sys->o_window setLevel: NSPopUpMenuWindowLevel - 1];
//[p_vout->p_sys->o_window setLevel: NSPopUpMenuWindowLevel - 1];
p_vout->p_sys->b_mouse_moved = YES;
p_vout->p_sys->i_time_mouse_last_moved = mdate();
}
......
......@@ -2,7 +2,7 @@
* libvlc.h: main libvlc header
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
* $Id: libvlc.h,v 1.85 2003/09/20 02:47:41 hartman Exp $
* $Id: libvlc.h,v 1.86 2003/09/20 19:37:54 hartman Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -374,15 +374,15 @@ static char *ppsz_language[] = { "auto", "en", "en_GB", "es", "de", "fr", "it",
"When selected, VLC will randomly play files in the playlist until " \
"interrupted.")
#define ENQUEUE_TEXT N_("Enqueue items in playlist")
#define ENQUEUE_LONGTEXT N_( \
"If you want VLC to add items to the playlist as you open them, then " \
"enable this option.")
#define LOOP_TEXT N_("Loop playlist on end")
#define LOOP_LONGTEXT N_( \
"If you want VLC to keep playing the playlist indefinitely then enable " \
"this option.")
#define REPEAT_TEXT N_("Repeat the current playlistitem")
#define REPEAT_LONGTEXT N_( \
"When this is active VLC will keep playing the current playlistitem " \
"over and over again.")
#define MEMCPY_TEXT N_("Memory copy module")
#define MEMCPY_LONGTEXT N_( \
......@@ -606,8 +606,8 @@ vlc_module_begin();
/* Playlist options */
add_category_hint( N_("Playlist"), NULL, VLC_FALSE );
add_bool_with_short( "random", 'Z', 0, NULL, RANDOM_TEXT, RANDOM_LONGTEXT, VLC_FALSE );
add_bool( "enqueue", 0, NULL, ENQUEUE_TEXT, ENQUEUE_LONGTEXT, VLC_FALSE );
add_bool( "loop", 0, NULL, LOOP_TEXT, LOOP_LONGTEXT, VLC_FALSE );
add_bool( "repeat", 0, NULL, REPEAT_TEXT, REPEAT_LONGTEXT, VLC_TRUE );
/* Misc options */
add_category_hint( N_("Miscellaneous"), NULL, VLC_TRUE );
......
......@@ -2,7 +2,7 @@
* playlist.c : Playlist management functions
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: playlist.c,v 1.53 2003/09/19 21:53:48 fenrir Exp $
* $Id: playlist.c,v 1.54 2003/09/20 19:37:54 hartman Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -73,6 +73,10 @@ playlist_t * __playlist_Create ( vlc_object_t *p_parent )
var_Create( p_playlist, "intf-show", VLC_VAR_BOOL );
val.b_bool = VLC_TRUE;
var_Set( p_playlist, "intf-show", val );
var_Create( p_playlist, "random", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
var_Create( p_playlist, "repeat", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
var_Create( p_playlist, "loop", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
p_playlist->p_input = NULL;
p_playlist->i_status = PLAYLIST_STOPPED;
......@@ -784,7 +788,7 @@ static void RunThread ( playlist_t *p_playlist )
static void SkipItem( playlist_t *p_playlist, int i_arg )
{
int i_oldindex = p_playlist->i_index;
vlc_bool_t b_random;
vlc_bool_t b_random, b_repeat, b_loop;
vlc_value_t val;
/* If the playlist is empty, there is no current item */
......@@ -794,7 +798,12 @@ static void SkipItem( playlist_t *p_playlist, int i_arg )
return;
}
b_random = config_GetInt( p_playlist, "random" );
var_Get( p_playlist, "random", &val );
b_random = val.b_bool;
var_Get( p_playlist, "repeat", &val );
b_repeat = val.b_bool;
var_Get( p_playlist, "loop", &val );
b_loop = val.b_bool;
/* Increment */
if( b_random )
......@@ -809,7 +818,10 @@ static void SkipItem( playlist_t *p_playlist, int i_arg )
i_arg = (int)((float)p_playlist->i_size * rand() / (RAND_MAX+1.0));
}
}
if( b_repeat )
{
i_arg = 0;
}
p_playlist->i_index += i_arg;
/* Boundary check */
......@@ -817,7 +829,7 @@ static void SkipItem( playlist_t *p_playlist, int i_arg )
{
if( p_playlist->i_status == PLAYLIST_STOPPED
|| b_random
|| config_GetInt( p_playlist, "loop" ) )
|| b_loop )
{
p_playlist->i_index -= p_playlist->i_size
* ( p_playlist->i_index / p_playlist->i_size );
......
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