]> git.sesse.net Git - vlc/commitdiff
* ALL: playlist API changes
authorClément Stenac <zorglub@videolan.org>
Mon, 5 Jan 2004 13:07:03 +0000 (13:07 +0000)
committerClément Stenac <zorglub@videolan.org>
Mon, 5 Jan 2004 13:07:03 +0000 (13:07 +0000)
What may be broken (untested):
------------------------------
   - Theora and Speex decoders
   - some interfaces
   - VCDX and CDDAX access

The problems shouldn't hopefully excess compilation glitches.
(removal of AddExt, of psz_author, and prototype of Add)

Additionnaly, interfaces that do not support item-change will have
update problems.

* Updated modules list

24 files changed:
modules/LIST
modules/access/cdda/access.c
modules/access/http.c
modules/access/slp.c
modules/access/vcdx/access.c
modules/codec/speex.c
modules/codec/theora.c
modules/codec/vorbis.c
modules/control/corba/corba.c
modules/control/http.c
modules/control/rc/rc.c
modules/demux/m3u.c
modules/demux/mkv.cpp
modules/demux/mp4/mp4.c
modules/gui/beos/VlcWrapper.cpp
modules/gui/gtk/open.c
modules/gui/gtk/playlist.c
modules/gui/kde/interface.cpp
modules/gui/macosx/applescript.m
modules/gui/macosx/playlist.m
modules/gui/pda/pda_callbacks.c
modules/gui/qt/intf.cpp
modules/gui/skins/src/vlcproc.cpp
modules/gui/skins2/commands/cmd_add_item.cpp

index 2b88f55e7a9072e59a476c406a0f02b41b46bb2f..9f68c9eeb2f54fd3542002a59b711dcc02860478 100644 (file)
@@ -1,5 +1,5 @@
 List of vlc plugins (221)
-$Id: LIST,v 1.18 2003/12/06 22:47:37 jpsaman Exp $
+$Id: LIST,v 1.19 2004/01/05 13:07:02 zorglub Exp $
 
  * a52: A/52 basic parser/packetizer
 
@@ -31,6 +31,8 @@ $Id: LIST,v 1.18 2003/12/06 22:47:37 jpsaman Exp $
 
  * access_output_udp: UDP Network access_output module
 
+ * access_tcp: TCP Network access module
+
  * access_udp: UDP Network access module 
 
  * adjust: Contrast/Hue/saturation/Brightness adjust module
@@ -92,6 +94,8 @@ $Id: LIST,v 1.18 2003/12/06 22:47:37 jpsaman Exp $
  * dshow: DirectShow access plugin for encoding cards under Windows
 
  * dts: DTS basic parser/packetizer
+ * dtssys: raw DTS stream input module
 
  * dtstospdif: Audio converter that encapsulates DTS into S/PDIF
 
@@ -178,18 +182,18 @@ $Id: LIST,v 1.18 2003/12/06 22:47:37 jpsaman Exp $
 
  * i420_rgb_mmx: MMX accelerated version of i420_rgb.
 
+ * i420_ymga: YUV to YUC conversion functions
+  
  * i420_ymga_mmx: MMX accelerated version of i420_ymga
 
- * i420_ymga: YUV to YUC conversion functions
+ * i420_yuy2: planar 4:2:0 YUV to packed YUV conversion functions.
 
  * i420_yuy2_mmx: MMX accelerated version of i420_yuy2.
 
- * i420_yuy2: planar 4:2:0 YUV to packed YUV conversion functions.
+ * i422_yuy2: planar 4:2:2 YUV to packed YUV conversion functions.
 
  * i422_yuy2_mmx: MMX accelerated version of i422_yuy2.
 
- * i422_yuy2: planar 4:2:2 YUV to packed YUV conversion functions.
-
  * id3: ID3 tag skipper
  
  * id3tag: ID3 tag parser/skipper using libid3tag
@@ -226,13 +230,13 @@ $Id: LIST,v 1.18 2003/12/06 22:47:37 jpsaman Exp $
 
  * memcpy3dn: 3D Now! accelerated version of memcpy.
 
- * memcpyaltivec: Altivec accelerated version of memcpy.
-
  * memcpy: memory chunk copying module.
 
- * memcpymmxext: MMX EXT accelerated version of memcpy.
+ * memcpyaltivec: Altivec accelerated version of memcpy.
 
  * memcpymmx: MMX accelerated version of memcpy.
+ * memcpymmxext: MMX EXT accelerated version of memcpy.
 
  * mga: video output module for Matrox cards using the Linux mga kernel driver.
 
@@ -249,6 +253,8 @@ $Id: LIST,v 1.18 2003/12/06 22:47:37 jpsaman Exp $
  * mpga: MPEG-I/II Audio demuxer
 
  * mpgatofixed32: MPEG-1 & 2 audio layer I,II,III audio decoder using MAD
+ * mpgv: MPEG-I/II Vidéo demuxer
 
  * mux_asf: ASF muxer
 
@@ -261,11 +267,11 @@ $Id: LIST,v 1.18 2003/12/06 22:47:37 jpsaman Exp $
  * mux_ogg: OGG muxer
  
  * mux_ps: MPEG program stream muxer
+ * mux_ts: MPEG transport stream muxer
 
  * mux_ts_dvbpsi: MPEG transport stream muxer using libdvbpsi
 
- * mux_ts: MPEG transport stream muxer
-
  * ncurses: interface module using the ncurses library.
 
  * ntservice: run VLC as a NT service
@@ -288,9 +294,9 @@ $Id: LIST,v 1.18 2003/12/06 22:47:37 jpsaman Exp $
 
  * postprocessing_c: Video Postprocessing module
 
- * postprocessing_mmxext: Video Postprocessing module using MMX_EXT 
-
  * postprocessing_mmx: Video Postprocessing module using MMX
+ * postprocessing_mmxext: Video Postprocessing module using MMX_EXT 
 
  * ps: input module for MPEG PS decapsulation.
 
@@ -298,11 +304,11 @@ $Id: LIST,v 1.18 2003/12/06 22:47:37 jpsaman Exp $
 
  * qnx: QNX RTOS plugin
 
- * qte_main: QT Embedded wrapper for gte_main
+ * qt: interface module using the Qt widget set.
 
  * qte: video output module for Qt Embedded.
  
- * qt: interface module using the Qt widget set.
+ * qte_main: QT Embedded wrapper for gte_main
 
  * quicktime: Quicktime decoder that uses the QT library
 
@@ -348,9 +354,9 @@ $Id: LIST,v 1.18 2003/12/06 22:47:37 jpsaman Exp $
 
  * stream_out_gather: stream out module gathering inputs for seemless transitions
 
- * stream_out_standard: standard stream output module
  * stream_out_rtp: output using the RTP protocol
+ * stream_out_standard: standard stream output module
 
  * stream_out_transcode: audio & video transcoder using ffmpeg
 
@@ -383,9 +389,9 @@ $Id: LIST,v 1.18 2003/12/06 22:47:37 jpsaman Exp $
 
  * trivial_resampler: Simple audio resampler
 
- * ts_dvbpsi: same as ts using libdvbpsi
-
  * ts: input module for MPEG TS decapsulation.
+ * ts_dvbpsi: same as ts using libdvbpsi
 
  * u8tofixed32: unsigned 8 bits to fixed 32 bits audio converter 
 
index 9a1571ef461a85c8f87fd9a17f6f525772de29e0..1683b79b05032200668137c8c11f6f970bd70889 100644 (file)
@@ -2,7 +2,7 @@
  * cddax.c : CD digital audio input module for vlc using libcdio
  *****************************************************************************
  * Copyright (C) 2000,2003 VideoLAN
- * $Id: access.c,v 1.19 2003/12/28 20:50:20 asmax Exp $
+ * $Id: access.c,v 1.20 2004/01/05 13:07:02 zorglub Exp $
  *
  * Authors: Rocky Bernstein <rocky@panix.com>
  *          Laurent Aimar <fenrir@via.ecp.fr>
@@ -314,15 +314,20 @@ static void CDDASeek( input_thread_t * p_input, off_t i_off )
   if ( str ) {                                                 \
     dbg_print( INPUT_DBG_META, "field %s: %s\n", title, str);  \
     input_AddInfo( p_cat, _(title), "%s", str );               \
+    playlist_AddInfo( p_playlist, -1, p_cat->psz_name,         \
+                      _(title), "%s" , str );                  \
   }
 
 
 static void InformationCreate( input_thread_t *p_input  )
 {
   cdda_data_t *p_cdda = (cdda_data_t *) p_input->p_access_data;
+  playlist_t *p_playlist = vlc_object_find( p_input, VLC_OBJECT_PLAYLIST,
+                                            FIND_PARENT );
   input_info_category_t *p_cat;
 
   p_cat = input_InfoCategory( p_input, "General" );
+  
 
 #ifdef HAVE_LIBCDDB
   if (p_cdda->i_cddb_enabled) {
@@ -363,6 +368,7 @@ static void InformationCreate( input_thread_t *p_input  )
     input_AddInfo( p_cat, _("Duration"), "%s",
                    secstotimestr( psz_buffer, i_duration ) );
   }
+  if( p_playlist ) vlc_object_release( p_playlist );
 }
 
 
@@ -655,27 +661,23 @@ CDDACreatePlayListItem(const input_thread_t *p_input, cdda_data_t *p_cdda,
 
   dbg_print( INPUT_DBG_META, "mrl: %s, title: %s, duration, %ld, pos %d",
              psz_mrl, p_title, (long int) i_duration, i_pos );
+  playlist_Add( p_playlist, psz_mrl, p_title, playlist_operation, i_pos );
 
-  playlist_AddExt( p_playlist, psz_mrl, p_title, i_duration * 1000000,
-                   0, 0, playlist_operation, i_pos );
+  /* XXX Set the duration ! */
 
   p_author =
     CDDAFormatStr( p_input, p_cdda,
                    config_GetPsz( p_input, MODULE_STRING "-author-format" ),
                    psz_mrl, i_track );
 
-  /* FIXME: This is horrible, but until the playlist interface is fixed up
-     something like this has to be done for the "Author" field.
-   */
   if( i_pos == PLAYLIST_END ) i_pos = p_playlist->i_size - 1;
-  free(p_playlist->pp_items[i_pos]->psz_author);
-  p_playlist->pp_items[i_pos]->psz_author = strdup(p_author);
+  playlist_AddInfo( p_playlist, i_pos, _("General"),_("Author"),p_author);
 
 }
 
 static int
 CDDAFixupPlayList( input_thread_t *p_input, cdda_data_t *p_cdda,
-                  const char *psz_source, bool play_single_track)
+                   const char *psz_source, bool play_single_track)
 {
   int i;
   playlist_t * p_playlist;
index c08db7daf2c31277deb00bf49f640d9556982041..5de42c3232c4285d39e4d800ebce0241cdef4d2b 100644 (file)
@@ -2,7 +2,7 @@
  * http.c: HTTP access plug-in
  *****************************************************************************
  * Copyright (C) 2001, 2002 VideoLAN
- * $Id: http.c,v 1.49 2004/01/03 18:41:36 rocky Exp $
+ * $Id: http.c,v 1.50 2004/01/05 13:07:02 zorglub Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -350,7 +350,7 @@ static int HTTPConnect( input_thread_t * p_input, off_t i_tell )
                               i_code, psz_answer, psz_value );
             p_playlist->pp_items[p_playlist->i_index]->b_autodeletion
                                                                   = VLC_TRUE;
-            playlist_Add( p_playlist, psz_value, NULL, 0,
+            playlist_Add( p_playlist, psz_value, psz_value,
                           PLAYLIST_INSERT | PLAYLIST_GO,
                           p_playlist->i_index + 1 );
             vlc_object_release( p_playlist );
index 1ed54052677ebe738c9f0c1bc9760e72fee27b71..a3891656d80cd083ea7531ccd2e1326ce59341d0 100644 (file)
@@ -2,7 +2,7 @@
  * slp.c: SLP access plugin
  *****************************************************************************
  * Copyright (C) 2001, 2002 VideoLAN
- * $Id: slp.c,v 1.17 2003/10/29 17:32:54 zorglub Exp $
+ * $Id: slp.c,v 1.18 2004/01/05 13:07:02 zorglub Exp $
  *
  * Authors: Loïc Minier <lool@videolan.org>
  *
@@ -187,14 +187,13 @@ static SLPBoolean SrvUrlCallback( SLPHandle slph_slp,
 
     p_playlist_item->psz_name = NULL;
     p_playlist_item->psz_uri  = strdup( psz_s );
-    p_playlist_item->i_type = 0;
     p_playlist_item->i_status = 0;
     p_playlist_item->b_autodeletion = VLC_FALSE;
-    p_playlist_item->i_options = 0;
-    p_playlist_item->ppsz_options = 0;
-    p_playlist_item->psz_author = NULL;
+    p_playlist_item->i_duration = -1;
     p_playlist_item->i_group = i_group;
     p_playlist_item->b_enabled = VLC_TRUE;
+    p_playlist_item->pp_categories = NULL;
+    p_playlist_item->i_categories = NULL;
 
     /* search the description of the stream */
     if( SLPOpen( config_GetPsz( p_input, "slp-lang" ),
index 605e8a6f54ef4b10710be9c83e856e36e3c6ed3a..49d546f455efcbd193053b8a43ea9df8f7749e61 100644 (file)
@@ -4,7 +4,7 @@
  *         to go here.
  *****************************************************************************
  * Copyright (C) 2000, 2003, 2004 VideoLAN
- * $Id: access.c,v 1.14 2004/01/03 20:43:24 rocky Exp $
+ * $Id: access.c,v 1.15 2004/01/05 13:07:02 zorglub Exp $
  *
  * Authors: Rocky Bernstein <rocky@panix.com>
  *          Johan Bilien <jobi@via.ecp.fr>
@@ -979,12 +979,16 @@ VCDUpdateVar( input_thread_t *p_input, int i_num, int i_action,
 #define meta_info_add_str(title, str) \
   if ( str ) {                                                                \
     dbg_print( INPUT_DBG_META, "field: %s: %s\n", title, str);                \
-    input_AddInfo( p_cat, _(title), "%s", str );                        \
+    input_AddInfo( p_cat, _(title), "%s", str );                              \
+    playlist_AddInfo( p_playlist, -1, p_cat->psz_name, _(title),              \
+                      "%s",str );
   }
 
 #define meta_info_add_num(title, num) \
-  dbg_print( INPUT_DBG_META, "field %s: %d\n", title, num);                \
+  dbg_print( INPUT_DBG_META, "field %s: %d\n", title, num);                   \
   input_AddInfo( p_cat, _(title), "%d", num );                                \
+  playlist_AddInfo( p_playlist, -1, p_cat->psz_name, _(title),                \
+                    "%d",num );
 
 static void InformationCreate( input_thread_t *p_input  )
 {
@@ -992,7 +996,12 @@ static void InformationCreate( input_thread_t *p_input  )
   unsigned int i_nb = vcdinfo_get_num_entries(p_vcd->vcd);
   unsigned int last_entry = 0;
   input_info_category_t *p_cat;
+<<<<<<< access.c
+  playlist_item_t *p_playlist = vlc_object_find( p_input, VLC_OBJECT_PLAYLIST,
+                                                 FIND_PARENT );
+=======
   track_t i_track;
+>>>>>>> 1.14
 
   p_cat = input_InfoCategory( p_input, "General" );
 
@@ -1024,6 +1033,9 @@ static void InformationCreate( input_thread_t *p_input  )
   meta_info_add_num( _("Tracks"),
                     vcdinfo_get_num_tracks(p_vcd->vcd));
 
+<<<<<<< access.c
+  if( p_playlist) vlc_object_release( p_playlist );
+=======
   /* Spit out track information. Could also include MSF info.
    */
 
@@ -1047,6 +1059,7 @@ static void InformationCreate( input_thread_t *p_input  )
          last_entry++ ) ;
     meta_info_add_num( _("Last Entry Point"),  last_entry-1 );
   }
+>>>>>>> 1.14
 }
 
 #define add_format_str_info(val)                              \
@@ -1272,23 +1285,21 @@ VCDCreatePlayListItem(const input_thread_t *p_input,
 
   p_title =
     VCDFormatStr( p_input, p_vcd,
-                  config_GetPsz( p_input, MODULE_STRING "-title-format" ),
-                  psz_mrl, itemid );
-
-  playlist_AddExt( p_playlist, psz_mrl, p_title, i_duration,
-                   0, 0, playlist_operation, i_pos );
+                 config_GetPsz( p_input, MODULE_STRING "-title-format" ),
+                 psz_mrl, itemid );
+  
+  playlist_Add( p_playlist, psz_mrl, p_title, playlist_operation, i_pos );
 
   p_author =
     VCDFormatStr( p_input, p_vcd,
-                  config_GetPsz( p_input, MODULE_STRING "-author-format" ),
-                  psz_mrl, itemid );
+                 config_GetPsz( p_input, MODULE_STRING "-author-format" ),
+                 psz_mrl, itemid );
 
   /* FIXME: This is horrible, but until the playlist interface is fixed up
      something like this has to be done for the "Author" field.
    */
   if( i_pos == PLAYLIST_END ) i_pos = p_playlist->i_size - 1;
-  free(p_playlist->pp_items[i_pos]->psz_author);
-  p_playlist->pp_items[i_pos]->psz_author = strdup(p_author);
+  playlist_AddInfo(p_playlist, i_pos, _("General"), _("Author"), "%s",p_author);
 }
 
 static int
index fff0b35219c190b888fafcda424349d78cb2f667..f0eb5014b574b8f821410524bcc52c9d9c1a0d8d 100755 (executable)
@@ -2,7 +2,7 @@
  * speex.c: speex decoder/packetizer/encoder module making use of libspeex.
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: speex.c,v 1.8 2003/12/22 02:24:51 sam Exp $
+ * $Id: speex.c,v 1.9 2004/01/05 13:07:02 zorglub Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -26,6 +26,7 @@
  *****************************************************************************/
 #include <vlc/vlc.h>
 #include <vlc/decoder.h>
+#include "vlc_playlist.h"
 
 #include <ogg/ogg.h>
 #include <speex.h>
@@ -461,6 +462,8 @@ static void ParseSpeexComments( decoder_t *p_dec, ogg_packet *p_oggpacket )
 
     input_info_category_t *p_cat =
         input_InfoCategory( p_input, _("Speex comment") );
+    playlist_t *p_playlist = vlc_object_find( p_dec, VLC_OBJECT_PLAYLIST,
+                                              FIND_ANYWHERE );
 
     char *p_buf = (char *)p_oggpacket->packet;
     SpeexMode *p_mode;
@@ -469,6 +472,8 @@ static void ParseSpeexComments( decoder_t *p_dec, ogg_packet *p_oggpacket )
     p_mode = speex_mode_list[p_sys->p_header->mode];
     input_AddInfo( p_cat, _("Mode"), "%s%s",
                    p_mode->modeName, p_sys->p_header->vbr ? " VBR" : "" );
+    playlist_AddInfo( p_playlist, -1, _("Speex comment") , _("Mode"), "%s%s",
+                    p_mode->modeName, p_sys->p_header->vbr ? " VBR" : "" );
 
     if( p_oggpacket->bytes < 8 )
     {
@@ -484,6 +489,9 @@ static void ParseSpeexComments( decoder_t *p_dec, ogg_packet *p_oggpacket )
     }
 
     input_AddInfo( p_cat, p_buf, "" );
+    playlist_AddInfo( p_playlist, -1, _("Speex comment") , p_buf , "" );
+
+    if( p_playlist ) vlc_object_release( p_playlist );
 
     /* TODO: finish comments parsing */
 }
index e7bf1fb8b75af17207b4719ad107eb3fca5b9c5d..218be4279581a8c95b662baae347686e350f71d6 100644 (file)
@@ -2,7 +2,7 @@
  * theora.c: theora decoder module making use of libtheora.
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: theora.c,v 1.21 2003/12/22 02:24:51 sam Exp $
+ * $Id: theora.c,v 1.22 2004/01/05 13:07:02 zorglub Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -27,6 +27,7 @@
 #include <vlc/vlc.h>
 #include <vlc/decoder.h>
 #include "input_ext-plugins.h"
+#include "vlc_playlist.h"
 
 #include <ogg/ogg.h>
 
@@ -337,6 +338,8 @@ static void ParseTheoraComments( decoder_t *p_dec )
     input_thread_t *p_input = (input_thread_t *)p_dec->p_parent;
     input_info_category_t *p_cat =
         input_InfoCategory( p_input, _("Theora comment") );
+    playlist_t *p_playlist = vlc_object_find( p_dec, VLC_OBJECT_PLAYLIST,
+                                              FIND_ANYWHERE );
     int i = 0;
     char *psz_name, *psz_value, *psz_comment;
     while ( i < p_dec->p_sys->tc.comments )
@@ -354,10 +357,13 @@ static void ParseTheoraComments( decoder_t *p_dec )
             *psz_value = '\0';
             psz_value++;
             input_AddInfo( p_cat, psz_name, psz_value );
+            playlist_AddInfo( p_playlist, -1, _("Theora comment") ,
+                              psz_name, psz_value );
         }
         free( psz_comment );
         i++;
     }
+    if( p_playlist) vlc_object_release( p_playlist );
 }
 
 /*****************************************************************************
index 962dc8ebd79c040dad12e20afc7c934c9334d851..24c31b2562171af558ebed9e5f3d181c085e2022 100644 (file)
@@ -2,7 +2,7 @@
  * vorbis.c: vorbis decoder/encoder/packetizer module making use of libvorbis.
  *****************************************************************************
  * Copyright (C) 2001-2003 VideoLAN
- * $Id: vorbis.c,v 1.28 2003/12/22 02:24:51 sam Exp $
+ * $Id: vorbis.c,v 1.29 2004/01/05 13:07:02 zorglub Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -26,6 +26,7 @@
  *****************************************************************************/
 #include <vlc/vlc.h>
 #include <vlc/decoder.h>
+#include "vlc_playlist.h"
 
 #include <ogg/ogg.h>
 
@@ -453,6 +454,8 @@ static void ParseVorbisComments( decoder_t *p_dec )
     input_thread_t *p_input = (input_thread_t *)p_dec->p_parent;
     input_info_category_t *p_cat =
         input_InfoCategory( p_input, _("Vorbis comment") );
+    playlist_t *p_playlist = vlc_object_find( p_dec, VLC_OBJECT_PLAYLIST,
+                                              FIND_ANYWHERE );
     int i = 0;
     char *psz_name, *psz_value, *psz_comment;
     while ( i < p_dec->p_sys->vc.comments )
@@ -470,10 +473,13 @@ static void ParseVorbisComments( decoder_t *p_dec )
             *psz_value = '\0';
             psz_value++;
             input_AddInfo( p_cat, psz_name, psz_value );
+            playlist_AddInfo( p_playlist, -1, _("Vorbis comment") ,
+                              psz_name, psz_value );
         }
         free( psz_comment );
         i++;
     }
+    if( p_playlist ) vlc_object_release( p_playlist );
 }
 
 /*****************************************************************************
index a8b22b2873b5e07e2746f6b3a4e886ed3ff2f5f3..71437d1150537054bfdd9d814ce12a8a16eac460 100644 (file)
@@ -2,7 +2,7 @@
  * corba.c : CORBA (ORBit) remote control plugin for vlc
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: corba.c,v 1.2 2003/07/23 01:13:47 gbazin Exp $
+ * $Id: corba.c,v 1.3 2004/01/05 13:07:02 zorglub Exp $
  *
  * Authors: Olivier Aubert <oaubert at lisi dot univ-lyon1 dot fr>
  *
@@ -560,7 +560,7 @@ impl_VLC_MediaControl_add_to_playlist(impl_POA_VLC_MediaControl * servant,
       return;
     }
 
-  playlist_Add (p_playlist, psz_file, 0, 0, PLAYLIST_REPLACE, 0);
+  playlist_Add (p_playlist, psz_file, psz_file , PLAYLIST_REPLACE, 0);
   vlc_object_release( p_playlist );
 
   return;
index 7e94efd0dcf106338aafd670356cc3b05a60cf4e..6699f1541f1ad557b154da5df4663c9bcb6cf8b0 100644 (file)
@@ -2,7 +2,7 @@
  * http.c :  http mini-server ;)
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: http.c,v 1.41 2003/12/21 23:32:58 sam Exp $
+ * $Id: http.c,v 1.42 2004/01/05 13:07:02 zorglub Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *          Laurent Aimar <fenrir@via.ecp.fr>
@@ -2948,20 +2948,15 @@ playlist_item_t * parse_MRL( char *psz )
 
         p_item->psz_name   = mrl;
         p_item->psz_uri    = strdup( mrl );
-        p_item->psz_author = strdup( "" );
         p_item->i_duration = -1;
-        p_item->i_type = 0;
         p_item->i_status = 0;
         p_item->b_autodeletion = VLC_FALSE;
         p_item->b_enabled = VLC_TRUE;
         p_item->i_group = PLAYLIST_TYPE_MANUAL;
 
-        p_item->ppsz_options = NULL;
-        p_item->i_options = i_options;
-
-        if( i_options )
+        for( i = 0 ; i< i_options ; i++ )
         {
-            p_item->ppsz_options = ppsz_options;
+            playlist_AddItemOption( p_item, ppsz_options[i] );
         }
 
         return p_item;
index e0dad7ad61b601ab3096e77cf8bf7544ed69e49b..304fb5030c2bce6aa51d31dfce1e0486f525764d 100644 (file)
@@ -2,7 +2,7 @@
  * rc.c : remote control stdin/stdout plugin for vlc
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: rc.c,v 1.40 2003/12/22 14:32:55 sam Exp $
+ * $Id: rc.c,v 1.41 2004/01/05 13:07:02 zorglub Exp $
  *
  * Author: Peter Surda <shurdeek@panorama.sth.ac.at>
  *
@@ -655,7 +655,7 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd,
     else if( !strcmp( psz_cmd, "add" ) )
     {
         printf( "trying to add %s to playlist\n", newval.psz_string );
-        playlist_Add( p_playlist, newval.psz_string, NULL, 0,
+        playlist_Add( p_playlist, newval.psz_string, newval.psz_string,
                       PLAYLIST_GO|PLAYLIST_APPEND, PLAYLIST_END );
     }
     else if( !strcmp( psz_cmd, "playlist" ) )
index 0eacb4840d8a6ab19c5b0a5530c9129f1263c955..3668de9207a2ab65c80c8705e91be91052c20730 100644 (file)
@@ -2,7 +2,7 @@
  * m3u.c: a meta demux to parse pls, m3u, asx et b4s playlists
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: m3u.c,v 1.24 2003/08/14 13:02:55 sigmunau Exp $
+ * $Id: m3u.c,v 1.25 2004/01/05 13:07:02 zorglub Exp $
  *
  * Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
  *          Gildas Bazin <gbazin@netcourrier.com>
@@ -551,9 +551,9 @@ static void ProcessLine ( input_thread_t *p_input, playlist_t *p_playlist,
 
     if( b_next && *ppsz_uri )
     {
-        playlist_AddExt( p_playlist, *ppsz_uri,
-                         *ppsz_name ? *ppsz_name : *ppsz_uri, -1, 
-                         0, 0, PLAYLIST_INSERT, *pi_position );
+        playlist_Add( p_playlist, *ppsz_uri,
+                         *ppsz_name ? *ppsz_name : *ppsz_uri,
+                          PLAYLIST_INSERT, *pi_position );
         (*pi_position)++;
         if( *ppsz_name )
         {
@@ -660,7 +660,7 @@ static int Demux ( input_thread_t *p_input )
         /* is there a pendding uri without b_next */
         if( psz_uri )
         {
-            playlist_Add( p_playlist, psz_uri, 0, 0,
+            playlist_Add( p_playlist, psz_uri, psz_uri,
                           PLAYLIST_INSERT, i_position );
         }
     }
index b1d52d73376e46906b39ea73c07762e51c720874..0e56da9b2f592b65c5950ec473d58ba40f2256e7 100644 (file)
@@ -2,7 +2,7 @@
  * mkv.cpp : matroska demuxer
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: mkv.cpp,v 1.50 2003/12/22 02:24:52 sam Exp $
+ * $Id: mkv.cpp,v 1.51 2004/01/05 13:07:02 zorglub Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -2166,9 +2166,11 @@ static void InformationsCreate( input_thread_t *p_input )
 {
     demux_sys_t           *p_sys = p_input->p_demux_data;
     input_info_category_t *p_cat;
+    playlist_t            *p_playlist;
     int                   i_track;
 
     p_cat = input_InfoCategory( p_input, "Matroska" );
+    p_playlist = (playlist_t*)vlc_object_find( p_input, VLC_OBJECT_PLAYLIST, FIND_PARENT );
     if( p_sys->f_duration > 1000.1 )
     {
         char psz_buffer[MSTRTIME_MAX_SIZE];
index 19ab0718ed184cbc9210228d48be65a239ef7d87..e613a50de41c98471a6d6c51a5657eb694f4d0e2 100644 (file)
@@ -2,7 +2,7 @@
  * mp4.c : MP4 file input module for vlc
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: mp4.c,v 1.47 2004/01/05 12:37:52 jlj Exp $
+ * $Id: mp4.c,v 1.48 2004/01/05 13:07:02 zorglub Exp $
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -216,7 +216,7 @@ static int Open( vlc_object_t * p_this )
                         !strncmp( psz_ref, "rtsp://", 7 ) )
                     {
                         msg_Dbg( p_input, "adding ref = `%s'", psz_ref );
-                        playlist_Add( p_playlist, psz_ref, 0, 0,
+                        playlist_Add( p_playlist, psz_ref, psz_ref,
                                       PLAYLIST_APPEND, PLAYLIST_END );
                     }
                     else
@@ -238,7 +238,7 @@ static int Open( vlc_object_t * p_this )
                         }
                         strcat( psz_absolute, psz_ref );
                         msg_Dbg( p_input, "adding ref = `%s'", psz_absolute );
-                        playlist_Add( p_playlist, psz_absolute, 0, 0,
+                        playlist_Add( p_playlist, psz_absolute, psz_absolute,
                                       PLAYLIST_APPEND, PLAYLIST_END );
                     }
                 }
index 191048aed01202a70986383029c5a1d5b50f613b..c16ef22a3fe47b25d224215d24c0503a527db6d0 100644 (file)
@@ -2,7 +2,7 @@
  * VlcWrapper.cpp: BeOS plugin for vlc (derived from MacOS X port)
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: VlcWrapper.cpp,v 1.40 2003/12/04 10:25:47 gbazin Exp $
+ * $Id: VlcWrapper.cpp,v 1.41 2004/01/05 13:07:03 zorglub Exp $
  *
  * Authors: Florian G. Pflug <fgp@phlo.org>
  *          Jon Lech Johansen <jon-vl@nanocrew.net>
@@ -365,7 +365,7 @@ void VlcWrapper::OpenFiles( BList* o_files, bool replace, int32 index )
                if ( BString* o_file = (BString *)o_files->RemoveItem( i ) )
                {
                        playlist_Add( p_playlist, o_file->String(),
-                                     0, 0, mode, index );
+                                     o_file->String(), mode, index );
                        if ( mode == PLAYLIST_INSERT )
                                index++;
                        delete o_file;
@@ -388,7 +388,7 @@ void VlcWrapper::OpenDisc(BString o_type, BString o_device, int i_title, int i_c
         o_device.Prepend( "dvdplay:" );
     else
         o_device.Prepend( "dvdold:" );
-    playlist_Add( p_playlist, o_device.String(), 0, 0,
+    playlist_Add( p_playlist, o_device.String(), o_device.String(),
                   PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
 }
 
index 74baf51271e03f487e23a686d759af95efeace56..a2f8bc23d1d285ea3c3e0f67c087f9615678935a 100644 (file)
@@ -2,7 +2,7 @@
  * gtk_open.c : functions to handle file/disc/network open widgets.
  *****************************************************************************
  * Copyright (C) 2000, 2001, 2003 VideoLAN
- * $Id: open.c,v 1.22 2003/12/22 14:32:56 sam Exp $
+ * $Id: open.c,v 1.23 2004/01/05 13:07:03 zorglub Exp $
  *
  * Authors: Sam Hocevar <sam@zoy.org>
  *          Stéphane Borel <stef@via.ecp.fr>
@@ -650,7 +650,7 @@ void GtkOpenOk( GtkButton * button, gpointer user_data )
 
     psz_target = gtk_entry_get_text( GTK_ENTRY( lookup_widget(
                                        GTK_WIDGET(button), "entry_open" ) ) );
-    playlist_Add( p_playlist, (char*)psz_target, 0, 0,
+    playlist_Add( p_playlist, (char*)psz_target, (char*)psz_target,
                   PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
 
     /* catch the GTK CList */
index ba32c380f93ecdfd85ee66526af6f22fd3f34bf7..33f29bc600c3780cf1ed9c5e55e54fe84ff46e81 100644 (file)
@@ -2,7 +2,7 @@
  * gtk_playlist.c : Interface for the playlist dialog
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: playlist.c,v 1.8 2003/12/22 14:32:56 sam Exp $
+ * $Id: playlist.c,v 1.9 2004/01/05 13:07:03 zorglub Exp $
  *
  * Authors: Pierre Baillet <oct@zoy.org>
  *          Stéphane Borel <stef@via.ecp.fr>
@@ -622,7 +622,8 @@ int GtkAppendList( playlist_t * p_playlist, int i_pos, GList * p_list )
                 /* ok; this is a really nasty trick to insert
                    the item where they are suppose to go but, hey
                    this works :P (btw, you are really nasty too) */
-               g_list_nth_data( p_list, i_dummy ), 0, 0,
+               g_list_nth_data( p_list, i_dummy ),
+               g_list_nth_data( p_list, i_dummy ),
                i_dummy == 0 ? PLAYLIST_INSERT | PLAYLIST_GO : PLAYLIST_INSERT,
                i_pos == PLAYLIST_END ? PLAYLIST_END : ( i_pos + i_dummy ) );
     }
index 9ee0a8719f9e72642f3d00431ea076f2580b05ac..4fbdc4ae8535fe205034858daafe1bee766cdc3c 100644 (file)
@@ -208,7 +208,7 @@ void KInterface::slotFileOpen()
         if( p_playlist )
         {
             fileOpenRecent->addURL( url );
-            playlist_Add( p_playlist, url.path(), 0, 0,
+            playlist_Add( p_playlist, url.path(), url.path(), 
                           PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
             vlc_object_release( p_playlist );
         }
@@ -536,7 +536,7 @@ void KInterface::slotOpenDisk()
         if( p_playlist )
         {
             // add it to playlist
-            playlist_Add( p_playlist, source.latin1(), 0, 0,
+            playlist_Add( p_playlist, source.latin1(), source.latin1(),
                           PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
             vlc_object_release( p_playlist );
         }
@@ -562,7 +562,7 @@ void KInterface::slotOpenStream()
         if( p_playlist )
         {
             // add it to playlist
-            playlist_Add( p_playlist, source.latin1(), 0, 0,
+            playlist_Add( p_playlist, source.latin1(), source.latin1(),
                           PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
             vlc_object_release( p_playlist );
         }
@@ -664,7 +664,7 @@ void KInterface::dropEvent( QDropEvent *event )
             if( !(*i).isEmpty() )
             {
                 fileOpenRecent->addURL( *i );
-                playlist_Add( p_playlist, (*i).path(), 0, 0,
+                playlist_Add( p_playlist, (*i).path(), (*i).path(),
                           PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
             }
         }
index 6fc5528381a48fea09f5e0719af7b9e76407a8a1..47d427df9ec9685750120ab51f5576e8ffd1bce2 100644 (file)
@@ -2,7 +2,7 @@
  * applescript.m: MacOS X AppleScript support
  *****************************************************************************
  * Copyright (C) 2002-2003 VideoLAN
- * $Id: applescript.m,v 1.4 2003/07/23 01:13:47 gbazin Exp $
+ * $Id: applescript.m,v 1.5 2004/01/05 13:07:03 zorglub Exp $
  *
  * Authors: Derk-Jan Hartman <thedj@users.sourceforge.net>
  *
@@ -56,7 +56,8 @@
             int i_mode = PLAYLIST_INSERT | PLAYLIST_GO;
             
             playlist_Add( p_playlist, [o_urlString fileSystemRepresentation],
-                          0, 0, i_mode, PLAYLIST_END );
+                          [o_urlString fileSystemRepresentation],
+                          i_mode, PLAYLIST_END );
 
             o_url = [NSURL fileURLWithPath: o_urlString];
             if( o_url != nil )
index cf2f21e183332e409b539ab5648ae0bc8e5fb079..d85f581dc0a4648c0d0c6f43311f5782c682ef83 100644 (file)
@@ -2,7 +2,7 @@
  * playlist.m: MacOS X interface plugin
  *****************************************************************************
  * Copyright (C) 2002-2003 VideoLAN
- * $Id: playlist.m,v 1.49 2003/12/15 14:25:43 hartman Exp $
+ * $Id: playlist.m,v 1.50 2004/01/05 13:07:03 zorglub Exp $
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *          Derk-Jan Hartman <thedj@users.sourceforge.net>
         o_current_name = [NSString stringWithUTF8String: 
             p_playlist->pp_items[i_current]->psz_name];
         o_current_author = [NSString stringWithUTF8String: 
-            p_playlist->pp_items[i_current]->psz_author];
+            playlist_GetInfo(p_playlist, i_current ,_("General"),_("Author") )];
         vlc_mutex_unlock( &p_playlist->object_lock );
 
 
             }
         }
     
-        playlist_AddExt( p_playlist, [o_url fileSystemRepresentation], [o_name UTF8String], -1, 
+        playlist_Add( p_playlist, [o_url fileSystemRepresentation], 
+                      [o_name UTF8String], i_mode, 
+                      i_position == -1 ? PLAYLIST_END : i_position + i_item);
+/*-1, 
             (ppsz_options != NULL ) ? (const char **)ppsz_options : 0, i_total_options,
-            i_mode, i_position == -1 ? PLAYLIST_END : i_position + i_item);
+            i_mode, i_position == -1 ? PLAYLIST_END : i_position + i_item);*/
     
         /* clean up */
         for( j = 0; j < i_total_options; j++ )
     {
         vlc_mutex_lock( &p_playlist->object_lock );
         o_value = [NSString stringWithUTF8String: 
-            p_playlist->pp_items[i_row]->psz_author]; 
+            playlist_GetInfo(p_playlist, i_row ,_("General"),_("Author") )];
         vlc_mutex_unlock( &p_playlist->object_lock );
     }
 
index 9d61383529d544eee6537eb2ee3a1aef5bd34a7d..b5bcbb3624f8bf07a1a363b4607aad9d04c14cbf 100644 (file)
@@ -2,7 +2,7 @@
  * pda_callbacks.c : Callbacks for the pda Linux Gtk+ plugin.
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: pda_callbacks.c,v 1.23 2003/12/07 18:58:38 jpsaman Exp $
+ * $Id: pda_callbacks.c,v 1.24 2004/01/05 13:07:03 zorglub Exp $
  *
  * Authors: Jean-Paul Saman <jpsaman@wxs.nl>
  *
@@ -91,6 +91,7 @@ void PlaylistAddItem(GtkWidget *widget, gchar *name, char **ppsz_options, int i_
 {
     intf_thread_t *p_intf = GtkGetIntf( widget );
     playlist_t    *p_playlist;
+    int           i , i_id , i_pos;
     GtkTreeView   *p_tvplaylist = NULL;
 
     p_playlist = (playlist_t *)
@@ -132,8 +133,16 @@ void PlaylistAddItem(GtkWidget *widget, gchar *name, char **ppsz_options, int i_
             else
 #endif
             {
-                playlist_Add( p_playlist, (const char*)name, (const char**)ppsz_options, i_size,
+                i_id = playlist_Add( p_playlist, (const char*)name,
+                                (const char*)name,
                               PLAYLIST_APPEND, PLAYLIST_END );
+
+                i_pos = playlist_GetPositionById( p_playlist, i_id );
+
+                for( i = 0 ; i< i_size ; i++ )
+                {
+                    playlist_AddOption( p_playlist, i_pos , ppsz_options[i] );
+                }
             }
 
             /* Cleanup memory */
@@ -658,7 +667,7 @@ void onAddCameraToPlaylist(GtkButton *button, gpointer user_data)
     }
 
     i_pos = snprintf( &v4l_mrl[0], 6, "v4l");
-    v4l_mrl[5]='\0'; 
+    v4l_mrl[5]='\0';
 
     entryV4LChannel    = (GtkSpinButton*) lookup_widget( GTK_WIDGET(button), "entryV4LChannel" );
     entryV4LFrequency  = (GtkSpinButton*) lookup_widget( GTK_WIDGET(button), "entryV4LFrequency" );
index 8e5cb04eb8cc0bc3e4be8d52ca3474fd740b44a3..18420f162fb7521e8dfed5d58c6c6a79e9d80ecd 100644 (file)
@@ -2,7 +2,7 @@
  * intf.cpp: Qt interface
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: intf.cpp,v 1.5 2003/12/04 10:25:47 gbazin Exp $
+ * $Id: intf.cpp,v 1.6 2004/01/05 13:07:03 zorglub Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -299,7 +299,7 @@ void IntfWindow::FileOpen( void )
             return;
         }
 
-        playlist_Add( p_playlist, file.latin1(), 0, 0,
+        playlist_Add( p_playlist, file.latin1(), file.latin1(),
                       PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
         vlc_object_release( p_playlist );
     }
index c285a6936e9342dbd3be03f6a23e785e91991860..fc26a54632afc4a76ca7aa3e5c2ac9c1d648a8d9 100644 (file)
@@ -2,7 +2,7 @@
  * vlcproc.cpp: VlcProc class
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: vlcproc.cpp,v 1.52 2003/10/23 16:00:48 gbazin Exp $
+ * $Id: vlcproc.cpp,v 1.53 2004/01/05 13:07:03 zorglub Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -444,13 +444,13 @@ void VlcProc::DropFile( unsigned int param1, long param2 )
         if( param2 == 0 )
         {
             // Enqueue the item
-            playlist_Add( p_intf->p_sys->p_playlist, FileName, 0, 0,
+            playlist_Add( p_intf->p_sys->p_playlist, FileName, FileName,
                           PLAYLIST_APPEND, PLAYLIST_END );
         }
         else
         {
             // Enqueue and play the item
-            playlist_Add( p_intf->p_sys->p_playlist, FileName, 0, 0,
+            playlist_Add( p_intf->p_sys->p_playlist, FileName, FileName,
                           PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
         }
     }
index b26c452d266287537f109f9411eb9a287693df07..7eedc4cf1f9f6ca9e5375dcc3de72920d5eab2ba 100755 (executable)
@@ -2,7 +2,7 @@
  * cmd_add_item.cpp
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: cmd_add_item.cpp,v 1.1 2004/01/03 23:31:33 asmax Exp $
+ * $Id: cmd_add_item.cpp,v 1.2 2004/01/05 13:07:03 zorglub Exp $
  *
  * Authors: Cyril Deguet     <asmax@via.ecp.fr>
  *          Olivier Teulière <ipkiss@via.ecp.fr>
@@ -37,13 +37,13 @@ void CmdAddItem::execute()
     if( m_playNow )
     {
         // Enqueue and play the item
-        playlist_Add( pPlaylist, m_name.c_str(), 0, 0,
+        playlist_Add( pPlaylist, m_name.c_str(),m_name.c_str(),
                       PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
     }
     else
     {
         // Enqueue the item only
-        playlist_Add( pPlaylist, m_name.c_str(), 0, 0,
+        playlist_Add( pPlaylist, m_name.c_str(), m_name.c_str(),
                       PLAYLIST_APPEND, PLAYLIST_END );
     }
 }