]> git.sesse.net Git - vlc/blobdiff - modules/demux/playlist/playlist.c
Replace vlc_bool_t by bool, VLC_TRUE by true and VLC_FALSE by false.
[vlc] / modules / demux / playlist / playlist.c
index e1d6336f1f172c5ef856fb384760a9856918e6c8..442abb58fecb4a615a699474d33702926a368d23 100644 (file)
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
 #include <vlc/vlc.h>
-#include <vlc/input.h>
+#include <vlc_demux.h>
 #include <vlc_playlist.h>
 
 #include "playlist.h"
  * Module descriptor
  *****************************************************************************/
 #define AUTOSTART_TEXT N_( "Auto start" )
-/// \bug [String] Why \n ?
 #define AUTOSTART_LONGTEXT N_( "Automatically start playing the playlist " \
-                "content once it's loaded.\n" )
+                "content once it's loaded." )
 
 #define SHOW_ADULT_TEXT N_( "Show shoutcast adult content" )
 #define SHOW_ADULT_LONGTEXT N_( "Show NC17 rated video streams when " \
                 "using shoutcast video playlists." )
 
+#define SKIP_ADS_TEXT N_( "Skip ads" )
+#define SKIP_ADS_LONGTEXT N_( "Use playlist options usually used to prevent " \
+    "ads skipping to detect ads and prevent adding them to the playlist." )
+
 vlc_module_begin();
     add_shortcut( "playlist" );
     set_category( CAT_INPUT );
     set_subcategory( SUBCAT_INPUT_DEMUX );
 
     add_bool( "playlist-autostart", 1, NULL,
-              AUTOSTART_TEXT, AUTOSTART_LONGTEXT, VLC_FALSE );
+              AUTOSTART_TEXT, AUTOSTART_LONGTEXT, false );
 
-    add_integer( "parent-item", 0, NULL, NULL, NULL, VLC_TRUE );
+    add_integer( "parent-item", 0, NULL, NULL, NULL, true );
         change_internal();
 
+    add_bool( "playlist-skip-ads", 1, NULL,
+              SKIP_ADS_TEXT, SKIP_ADS_LONGTEXT, false );
+
     set_shortname( _("Playlist") );
     set_description( _("Playlist") );
-    add_shortcut( "old-open" );
-    set_capability( "demux2", 10 );
-    set_callbacks( E_(Import_Old), NULL );
     add_submodule();
         set_description( _("M3U playlist import") );
         add_shortcut( "m3u-open" );
@@ -88,14 +95,14 @@ vlc_module_begin();
         set_description( _("XSPF playlist import") );
         add_shortcut( "xspf-open" );
         set_capability( "demux2", 10 );
-        set_callbacks( E_(xspf_import_Activate), NULL );
+        set_callbacks( E_(Import_xspf),E_(Close_xspf) );
     add_submodule();
         set_description( _("New winamp 5.2 shoutcast import") );
         add_shortcut( "shout-winamp" );
         set_capability( "demux2", 10 );
         set_callbacks( E_(Import_Shoutcast), E_(Close_Shoutcast) );
-        add_bool( "shoutcast-show-adult", VLC_FALSE, NULL,
-                   SHOW_ADULT_TEXT, SHOW_ADULT_LONGTEXT, VLC_FALSE );
+        add_bool( "shoutcast-show-adult", false, NULL,
+                   SHOW_ADULT_TEXT, SHOW_ADULT_LONGTEXT, false );
     add_submodule();
         set_description( _("ASX playlist import") );
         add_shortcut( "asx-open" );
@@ -111,6 +118,20 @@ vlc_module_begin();
         add_shortcut( "qtl" );
         set_capability( "demux2", 10 );
         set_callbacks( E_(Import_QTL), E_(Close_QTL) );
+    add_submodule();
+        set_description( _("Google Video Playlist importer") );
+        add_shortcut( "gvp" );
+        set_capability( "demux2", 10 );
+        set_callbacks( E_(Import_GVP), E_(Close_GVP) );
+    add_submodule();
+        set_description( _("Dummy ifo demux") );
+        set_capability( "demux2", 12 );
+        set_callbacks( E_(Import_IFO), E_(Close_IFO) );
+    add_submodule();
+        set_description( _("iTunes Music Library importer") );
+        add_shortcut( "itml" );
+        set_capability( "demux2", 10 );
+        set_callbacks( E_(Import_iTML), E_(Close_iTML) );
 vlc_module_end();
 
 
@@ -162,55 +183,3 @@ char *E_(ProcessMRL)( char *psz_mrl, char *psz_prefix )
     asprintf( &psz_mrl, "%s%s", psz_prefix, psz_mrl );
     return psz_mrl;
 }
-
-void E_(AddToPlaylist)( demux_t *p_demux, playlist_t *p_playlist,
-                        input_item_t *p_input,
-                        playlist_item_t *p_item, int i_parent_id )
-{
-    // Only add to parent if specific parent requested or not current
-    // playlist item
-   if( i_parent_id > 0 || ! (
-         p_playlist->status.p_item &&
-         p_playlist->status.p_item->p_input ==
-              ((input_thread_t *)p_demux->p_parent)->input.p_item ) )
-   {
-       playlist_NodeAddInput( p_playlist, p_input, p_item,
-                              PLAYLIST_APPEND, PLAYLIST_END );
-   }
-   // Else, add to both
-   else
-   {
-       playlist_BothAddInput( p_playlist, p_input, p_item,
-                              PLAYLIST_APPEND, PLAYLIST_END );
-   }
-   vlc_input_item_CopyOptions( p_item->p_input, p_input );
-}
-
-
-vlc_bool_t E_(FindItem)( demux_t *p_demux, playlist_t *p_playlist,
-                     playlist_item_t **pp_item )
-{
-     vlc_bool_t b_play = var_CreateGetBool( p_demux, "playlist-autostart" );
-
-     if( b_play && p_playlist->status.p_item &&
-             p_playlist->status.p_item->p_input ==
-                ((input_thread_t *)p_demux->p_parent)->input.p_item )
-     {
-         msg_Dbg( p_playlist, "starting playlist playback" );
-         *pp_item = p_playlist->status.p_item;
-         b_play = VLC_TRUE;
-     }
-     else
-     {
-         input_item_t *p_current = ( (input_thread_t*)p_demux->p_parent)->
-                                                        input.p_item;
-         *pp_item = playlist_LockItemGetByInput( p_playlist, p_current );
-         if( !*pp_item )
-         {
-             msg_Dbg( p_playlist, "unable to find item in playlist");
-         }
-         msg_Dbg( p_playlist, "not starting playlist playback");
-         b_play = VLC_FALSE;
-     }
-     return b_play;
-}