]> git.sesse.net Git - vlc/commitdiff
* mtime_t != int This was causing incorrect results on big endian.
authorDerk-Jan Hartman <hartman@videolan.org>
Sat, 10 Jan 2004 03:36:03 +0000 (03:36 +0000)
committerDerk-Jan Hartman <hartman@videolan.org>
Sat, 10 Jan 2004 03:36:03 +0000 (03:36 +0000)
  Changed playlist_SetDuration.
* changed SORT_NORMAL SORT_REVERSE into ORDER_NORMAL ORDER_REVERSE

include/vlc_playlist.h
modules/control/http.c
modules/gui/ncurses/ncurses.c
modules/gui/skins2/commands/cmd_playlist.cpp
modules/gui/wxwindows/playlist.cpp
src/playlist/item-ext.c
src/playlist/sort.c

index 34bb08ffeedfbe432482c927b81b1bc415fc5e8a..d10d7ef6977b2b1608ec8244a2f951e4821dd3b9 100644 (file)
@@ -1,8 +1,8 @@
 /*****************************************************************************
  * vlc_playlist.h : Playlist functions
  *****************************************************************************
- * Copyright (C) 1999, 2000, 2001, 2002 VideoLAN
- * $Id: vlc_playlist.h,v 1.21 2004/01/06 08:50:20 zorglub Exp $
+ * Copyright (C) 1999-2004 VideoLAN
+ * $Id: vlc_playlist.h,v 1.22 2004/01/10 03:36:03 hartman Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -127,9 +127,10 @@ struct playlist_t
 #define SORT_AUTHOR 1
 #define SORT_GROUP 2
 #define SORT_RANDOM 3
+#define SORT_ID 4
 
-#define SORT_NORMAL 0
-#define SORT_REVERSE 1
+#define ORDER_NORMAL 0
+#define ORDER_REVERSE 1
 
 #define PLAYLIST_TYPE_MANUAL 1
 #define PLAYLIST_TYPE_SAP 2
@@ -167,7 +168,7 @@ VLC_EXPORT( int,  playlist_EnableGroup, ( playlist_t *, int ) );
 /* Basic item informations accessors */
 VLC_EXPORT( int, playlist_SetGroup, (playlist_t *, int, int ) );
 VLC_EXPORT( int, playlist_SetName, (playlist_t *, int, char * ) );
-VLC_EXPORT( int, playlist_SetDuration, (playlist_t *, int, int ) );
+VLC_EXPORT( int, playlist_SetDuration, (playlist_t *, int, mtime_t ) );
 
 /* Item search functions */
 VLC_EXPORT( int, playlist_GetPositionById, (playlist_t *, int) );
index 6699f1541f1ad557b154da5df4663c9bcb6cf8b0..aa74f93845ab72b02d6bb53768769c618160f427 100644 (file)
@@ -1,8 +1,8 @@
 /*****************************************************************************
  * http.c :  http mini-server ;)
  *****************************************************************************
- * Copyright (C) 2001 VideoLAN
- * $Id: http.c,v 1.42 2004/01/05 13:07:02 zorglub Exp $
+ * Copyright (C) 2001-2004 VideoLAN
+ * $Id: http.c,v 1.43 2004/01/10 03:36:03 hartman Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *          Laurent Aimar <fenrir@via.ecp.fr>
@@ -1864,8 +1864,8 @@ static void MacroDo( httpd_file_callback_args_t *p_args,
                     uri_extract_value( p_request, "type", type, 12 );
                     uri_extract_value( p_request, "order", order, 2 );
 
-                    if( order[0] == '0' ) i_order = SORT_NORMAL;
-                    else i_order = SORT_REVERSE;
+                    if( order[0] == '0' ) i_order = ORDER_NORMAL;
+                    else i_order = ORDER_REVERSE;
 
                     if( !strcmp( type , "title" ) )
                     {
index 065b18097a4821cbe78de5f29864b127faea0d2b..ff5d6aa24328a6a5e8233382bcace2b5242f61f3 100644 (file)
@@ -1,8 +1,8 @@
 /*****************************************************************************
  * ncurses.c : NCurses plugin for vlc
  *****************************************************************************
- * Copyright (C) 2001, 2002, 2003 VideoLAN
- * $Id: ncurses.c,v 1.7 2004/01/08 16:28:37 fenrir Exp $
+ * Copyright (C) 2001-2004 VideoLAN
+ * $Id: ncurses.c,v 1.8 2004/01/10 03:36:03 hartman Exp $
  *
  * Authors: Sam Hocevar <sam@zoy.org>
  *          Laurent Aimar <fenrir@via.ecp.fr>
@@ -265,13 +265,13 @@ static int HandleKey( intf_thread_t *p_intf, int i_key )
         {
             /* Playlist sort */
             case 'r':
-                playlist_Sort( p_sys->p_playlist, SORT_RANDOM, SORT_NORMAL );
+                playlist_Sort( p_sys->p_playlist, SORT_RANDOM, ORDER_NORMAL );
                 return 1;
             case 'o':
-                playlist_Sort( p_sys->p_playlist, SORT_TITLE, SORT_NORMAL );
+                playlist_Sort( p_sys->p_playlist, SORT_TITLE, ORDER_NORMAL );
                 return 1;
             case 'O':
-                playlist_Sort( p_sys->p_playlist, SORT_TITLE, SORT_REVERSE );
+                playlist_Sort( p_sys->p_playlist, SORT_TITLE, ORDER_REVERSE );
                 return 1;
 
             /* Playlist navigation */
index 599e7894d2d755cef315623f1b634f882f4cadaf..488ff55e0370bd2b52a0cc239b2cabc4115528df 100755 (executable)
@@ -2,7 +2,7 @@
  * cmd_playlist.cpp
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: cmd_playlist.cpp,v 1.1 2004/01/03 23:31:33 asmax Exp $
+ * $Id: cmd_playlist.cpp,v 1.2 2004/01/10 03:36:03 hartman Exp $
  *
  * Authors: Cyril Deguet     <asmax@via.ecp.fr>
  *          Olivier Teulière <ipkiss@via.ecp.fr>
@@ -37,7 +37,7 @@ void CmdPlaylistSort::execute()
     playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
     if( pPlaylist != NULL )
     {
-        playlist_Sort( pPlaylist, SORT_TITLE, SORT_NORMAL );
+        playlist_Sort( pPlaylist, SORT_TITLE, ORDER_NORMAL );
     }
 
 }
index f8c92ec89ca1185f017a6808e6e2cd56049fb55a..f06b64fd266145654f393cf0fdd3b97bee56d3fc 100644 (file)
@@ -1,8 +1,8 @@
 /*****************************************************************************
  * playlist.cpp : wxWindows plugin for vlc
  *****************************************************************************
- * Copyright (C) 2000-2001, 2003 VideoLAN
- * $Id: playlist.cpp,v 1.34 2004/01/08 00:52:08 sigmunau Exp $
+ * Copyright (C) 2000-2004 VideoLAN
+ * $Id: playlist.cpp,v 1.35 2004/01/10 03:36:03 hartman Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *
@@ -722,7 +722,7 @@ void Playlist::OnSort( wxCommandEvent& event )
            playlist_SortGroup( p_playlist , 1 );
            break;
         case Randomize_Event:
-           playlist_Sort( p_playlist , SORT_RANDOM, SORT_NORMAL );
+           playlist_Sort( p_playlist , SORT_RANDOM, ORDER_NORMAL );
            break;
     }
     vlc_object_release( p_playlist );
index 7296f0a56aac39b05238c5f54110af04bee62e7c..96b1ae89f237634809f81e1b117ad7c7a5628236 100644 (file)
@@ -2,7 +2,7 @@
  * item-ext.c : Exported playlist item functions
  *****************************************************************************
  * Copyright (C) 1999-2004 VideoLAN
- * $Id: item-ext.c,v 1.5 2004/01/07 19:20:30 gbazin Exp $
+ * $Id: item-ext.c,v 1.6 2004/01/10 03:36:03 hartman Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *          Clément Stenac <zorglub@videolan.org>
@@ -233,7 +233,7 @@ int playlist_SetName( playlist_t *p_playlist, int i_item, char *psz_name )
  * \param i_duration the duration to set
  * \return VLC_SUCCESS on success, VLC_EGENERIC on failure
  */
-int playlist_SetDuration( playlist_t *p_playlist, int i_item, int i_duration )
+int playlist_SetDuration( playlist_t *p_playlist, int i_item, mtime_t i_duration )
 {
     char psz_buffer[MSTRTIME_MAX_SIZE];
     vlc_value_t val;
index 1df97fbc59a3269d16791e1801c98604cf5c75d8..1e777f6ddd0dcb0735fa7eef5d66d04c7a7155cd 100644 (file)
@@ -2,7 +2,7 @@
  * sort.c : Playlist sorting functions
  *****************************************************************************
  * Copyright (C) 1999-2004 VideoLAN
- * $Id: sort.c,v 1.5 2004/01/06 08:50:20 zorglub Exp $
+ * $Id: sort.c,v 1.6 2004/01/10 03:36:03 hartman Exp $
  *
  * Authors: Clément Stenac <zorglub@videolan.org>
  *
@@ -33,8 +33,8 @@
 /**
  * Sort the playlist
  * \param p_playlist the playlist
- * \param i_mode: SORT_TITLE, SORT_GROUP, SORT_AUTHOR, SORT_RANDOM
- * \param i_type: SORT_NORMAL or SORT_REVERSE (reversed order)
+ * \param i_mode: SORT_TITLE, SORT_GROUP, SORT_AUTHOR, SORT_RANDOM SORT_ID
+ * \param i_type: ORDER_NORMAL or ORDER_REVERSE (reversed order)
  * \return 0 on success
  */
 int playlist_Sort( playlist_t * p_playlist , int i_mode, int i_type )
@@ -96,8 +96,8 @@ int playlist_Sort( playlist_t * p_playlist , int i_mode, int i_type )
                                             _("General") , _("Author") ) );
             }
 
-            if( ( i_type == SORT_NORMAL  && i_test < 0 ) ||
-                ( i_type == SORT_REVERSE && i_test > 0 ) )
+            if( ( i_type == ORDER_NORMAL  && i_test < 0 ) ||
+                ( i_type == ORDER_REVERSE && i_test > 0 ) )
             {
                 i_small = i;
             }