Renamed playlist "playlist-current" to "item-current".
authorLaurent Aimar <fenrir@videolan.org>
Mon, 16 Feb 2009 21:24:38 +0000 (22:24 +0100)
committerLaurent Aimar <fenrir@videolan.org>
Mon, 16 Feb 2009 21:24:38 +0000 (22:24 +0100)
18 files changed:
include/vlc_playlist.h
modules/control/dbus.c
modules/gui/beos/InterfaceWindow.cpp
modules/gui/macosx/intf.m
modules/gui/maemo/maemo.c
modules/gui/qt4/components/playlist/playlist_model.cpp
modules/gui/qt4/input_manager.cpp
modules/gui/skins2/src/vlcproc.cpp
modules/misc/audioscrobbler.c
modules/misc/lua/libs/playlist.c
modules/misc/notify/growl.m
modules/misc/notify/growl_udp.c
modules/misc/notify/msn.c
modules/misc/notify/notify.c
modules/misc/notify/telepathy.c
modules/misc/notify/xosd.c
src/playlist/engine.c
src/playlist/thread.c

index dd16486..dd56d01 100644 (file)
@@ -116,13 +116,15 @@ TYPEDEF_ARRAY(playlist_item_t*, playlist_item_array_t);
  *
  *
  * The playlist defines the following event variables:
+ *
  * - "item-change": It will contains the input_item_t->i_id of a changed input
  * item monitored by the playlist.
+ * * - "item-current": It will contains a input_item_t->i_id of the current
+ * item being played.
+ *
+ * - "item-append": It will contains a pointer to a playlist_add_t.
  * - "item-deleted": It will contains the playlist_item_t->i_id of a deleted
  * playlist_item_t.
- * - "item-append": It will contains a pointer to a playlist_add_t.
- * - "playlist-current": It will contains a input_item_t->i_id of the current
- * item being played.
  *
  * XXX Be really carefull, playlist_item_t->i_id and input_item_t->i_id are not
  * the same. Yes, the situation is pretty bad.
index 1cf6b18..5897acf 100644 (file)
@@ -757,7 +757,7 @@ static int Open( vlc_object_t *p_this )
 
     p_playlist = pl_Hold( p_intf );
     PL_LOCK;
-    var_AddCallback( p_playlist, "playlist-current", TrackChange, p_intf );
+    var_AddCallback( p_playlist, "item-current", TrackChange, p_intf );
     var_AddCallback( p_playlist, "intf-change", TrackListChangeEmit, p_intf );
     var_AddCallback( p_playlist, "item-append", TrackListChangeEmit, p_intf );
     var_AddCallback( p_playlist, "item-deleted", TrackListChangeEmit, p_intf );
@@ -786,7 +786,7 @@ static void Close   ( vlc_object_t *p_this )
     playlist_t      *p_playlist = pl_Hold( p_intf );;
     input_thread_t  *p_input;
 
-    var_DelCallback( p_playlist, "playlist-current", TrackChange, p_intf );
+    var_DelCallback( p_playlist, "item-current", TrackChange, p_intf );
     var_DelCallback( p_playlist, "intf-change", TrackListChangeEmit, p_intf );
     var_DelCallback( p_playlist, "item-append", TrackListChangeEmit, p_intf );
     var_DelCallback( p_playlist, "item-deleted", TrackListChangeEmit, p_intf );
@@ -966,7 +966,7 @@ static int StatusChangeEmit( vlc_object_t *p_this, const char *psz_var,
 }
 
 /*****************************************************************************
- * TrackChange: callback on playlist "playlist-current"
+ * TrackChange: callback on playlist "item-current"
  *****************************************************************************/
 static int TrackChange( vlc_object_t *p_this, const char *psz_var,
             vlc_value_t oldval, vlc_value_t newval, void *p_data )
index 5fe92d4..cddbc54 100644 (file)
@@ -209,7 +209,7 @@ InterfaceWindow::InterfaceWindow( intf_thread_t * _p_intf, BRect frame,
     var_AddCallback( p_playlist, "item-change", PlaylistChanged, this );
     var_AddCallback( p_playlist, "item-append", PlaylistChanged, this );
     var_AddCallback( p_playlist, "item-deleted", PlaylistChanged, this );
-    var_AddCallback( p_playlist, "playlist-current", PlaylistChanged, this );
+    var_AddCallback( p_playlist, "item-current", PlaylistChanged, this );
 
     char psz_tmp[1024];
 #define ADD_ELLIPSIS( a ) \
index 5619aa2..0df3b5a 100644 (file)
@@ -1410,7 +1410,7 @@ static void * manage_cleanup( void * args )
     id self = manage_cleanup_stack->self;
     playlist_t * p_playlist = manage_cleanup_stack->p_playlist;
 
-    var_AddCallback( p_playlist, "playlist-current", PlaylistChanged, self );
+    var_AddCallback( p_playlist, "item-current", PlaylistChanged, self );
     var_AddCallback( p_playlist, "intf-change", PlaylistChanged, self );
     var_AddCallback( p_playlist, "item-change", PlaylistChanged, self );
     var_AddCallback( p_playlist, "item-append", PlaylistChanged, self );
@@ -1433,7 +1433,7 @@ static void * manage_cleanup( void * args )
 
     p_playlist = pl_Hold( p_intf );
 
-    var_AddCallback( p_playlist, "playlist-current", PlaylistChanged, self );
+    var_AddCallback( p_playlist, "item-current", PlaylistChanged, self );
     var_AddCallback( p_playlist, "intf-change", PlaylistChanged, self );
     var_AddCallback( p_playlist, "item-change", PlaylistChanged, self );
     var_AddCallback( p_playlist, "item-append", PlaylistChanged, self );
index 82c6a1d..96e6080 100644 (file)
@@ -228,7 +228,7 @@ static void Run( intf_thread_t *p_intf )
     g_timeout_add( 150 /* miliseconds */, should_die, p_intf );
     var_AddCallback( p_intf->p_sys->p_playlist, "item-change",
                      item_changed_cb, p_intf );
-    var_AddCallback( p_intf->p_sys->p_playlist, "playlist-current",
+    var_AddCallback( p_intf->p_sys->p_playlist, "item-current",
                      playlist_current_cb, p_intf );
     var_AddCallback( p_intf->p_sys->p_playlist, "activity",
                      activity_cb, p_intf );
@@ -244,7 +244,7 @@ static void Run( intf_thread_t *p_intf )
     delete_input( p_intf );
     var_DelCallback( p_intf->p_sys->p_playlist, "item-change",
                      item_changed_cb, p_intf );
-    var_DelCallback( p_intf->p_sys->p_playlist, "playlist-current",
+    var_DelCallback( p_intf->p_sys->p_playlist, "item-current",
                      playlist_current_cb, p_intf );
     var_DelCallback( p_intf->p_sys->p_playlist, "activity",
                      activity_cb, p_intf );
index 4cb8c2c..bbdb77a 100644 (file)
@@ -221,7 +221,7 @@ void PLModel::addCallbacks()
     /* Some global changes happened -> Rebuild all */
     var_AddCallback( p_playlist, "intf-change", PlaylistChanged, this );
     /* We went to the next item */
-    var_AddCallback( p_playlist, "playlist-current", PlaylistNext, this );
+    var_AddCallback( p_playlist, "item-current", PlaylistNext, this );
     /* One item has been updated */
     var_AddCallback( p_playlist, "item-change", ItemChanged, this );
     var_AddCallback( p_playlist, "item-append", ItemAppended, this );
@@ -231,7 +231,7 @@ void PLModel::addCallbacks()
 void PLModel::delCallbacks()
 {
     var_DelCallback( p_playlist, "item-change", ItemChanged, this );
-    var_DelCallback( p_playlist, "playlist-current", PlaylistNext, this );
+    var_DelCallback( p_playlist, "item-current", PlaylistNext, this );
     var_DelCallback( p_playlist, "intf-change", PlaylistChanged, this );
     var_DelCallback( p_playlist, "item-append", ItemAppended, this );
     var_DelCallback( p_playlist, "item-deleted", ItemDeleted, this );
index ff50671..f36b64c 100644 (file)
@@ -825,7 +825,7 @@ MainInputManager::MainInputManager( intf_thread_t *_p_intf )
     im = new InputManager( this, p_intf );
 
     var_AddCallback( THEPL, "item-change", ItemChanged, im );
-    var_AddCallback( THEPL, "playlist-current", PLItemChanged, this );
+    var_AddCallback( THEPL, "item-current", PLItemChanged, this );
     var_AddCallback( THEPL, "activity", PLItemChanged, this );
 
     var_AddCallback( p_intf->p_libvlc, "volume-change", VolumeChanged, this );
@@ -836,7 +836,7 @@ MainInputManager::MainInputManager( intf_thread_t *_p_intf )
 
     /* emit check if playlist has allready started playing */
     vlc_value_t val;
-    var_Change( THEPL, "playlist-current", VLC_VAR_CHOICESCOUNT, &val, NULL );
+    var_Change( THEPL, "item-current", VLC_VAR_CHOICESCOUNT, &val, NULL );
 
     IMEvent *event = new IMEvent( ItemChanged_Type, val.i_int);
     customEvent( event );
@@ -857,7 +857,7 @@ MainInputManager::~MainInputManager()
     var_DelCallback( THEPL, "activity", PLItemChanged, this );
     var_DelCallback( THEPL, "item-change", ItemChanged, im );
 
-    var_DelCallback( THEPL, "playlist-current", PLItemChanged, this );
+    var_DelCallback( THEPL, "item-current", PLItemChanged, this );
 }
 
 vout_thread_t* MainInputManager::getVout()
index bc86792..e551022 100644 (file)
@@ -153,7 +153,7 @@ VlcProc::VlcProc( intf_thread_t *pIntf ): SkinObject( pIntf ),
     var_AddCallback( pIntf->p_libvlc, "intf-show",
                      onIntfShow, this );
     // Called when the current played item changes
-    var_AddCallback( pIntf->p_sys->p_playlist, "playlist-current",
+    var_AddCallback( pIntf->p_sys->p_playlist, "item-current",
                      onPlaylistChange, this );
     // Called when a playlist item changed
     var_AddCallback( pIntf->p_sys->p_playlist, "item-change",
@@ -189,7 +189,7 @@ VlcProc::~VlcProc()
                      onItemDelete, this );
     var_DelCallback( getIntf()->p_libvlc, "intf-show",
                      onIntfShow, this );
-    var_DelCallback( getIntf()->p_sys->p_playlist, "playlist-current",
+    var_DelCallback( getIntf()->p_sys->p_playlist, "item-current",
                      onPlaylistChange, this );
     var_DelCallback( getIntf()->p_sys->p_playlist, "item-change",
                      onItemChange, this );
index 72bd1d3..ec3f547 100644 (file)
@@ -185,7 +185,7 @@ static int Open( vlc_object_t *p_this )
 
     p_playlist = pl_Hold( p_intf );
     PL_LOCK;
-    var_AddCallback( p_playlist, "playlist-current", ItemChange, p_intf );
+    var_AddCallback( p_playlist, "item-current", ItemChange, p_intf );
     PL_UNLOCK;
     pl_Release( p_intf );
 
@@ -208,7 +208,7 @@ static void Close( vlc_object_t *p_this )
     if( p_playlist )
     {
 
-        var_DelCallback( p_playlist, "playlist-current", ItemChange, p_intf );
+        var_DelCallback( p_playlist, "item-current", ItemChange, p_intf );
 
         p_input = playlist_CurrentInput( p_playlist );
         if ( p_input )
index 404064d..58ce8c0 100644 (file)
@@ -318,7 +318,7 @@ static int vlclua_playlist_search( lua_State *L )
 static int vlclua_playlist_current( lua_State *L )
 {
     playlist_t *p_playlist = vlclua_get_playlist_internal( L );
-    lua_pushinteger( L, var_GetInteger( p_playlist, "playlist-current" ) );
+    lua_pushinteger( L, var_GetInteger( p_playlist, "item-current" ) );
     vlclua_release_playlist_internal( p_playlist );
     return 1;
 }
index 32abcb5..21b9ad5 100644 (file)
@@ -120,7 +120,7 @@ static int Open( vlc_object_t *p_this )
     p_sys->default_icon = (CFDataRef) readFile( buf );
 
     playlist_t *p_playlist = pl_Hold( p_intf );
-    var_AddCallback( p_playlist, "playlist-current", ItemChange, p_intf );
+    var_AddCallback( p_playlist, "item-current", ItemChange, p_intf );
     pl_Release( p_intf );
 
     RegisterToGrowl( p_this );
@@ -141,7 +141,7 @@ static void Close( vlc_object_t *p_this )
     free( p_sys );
 
     playlist_t *p_playlist = pl_Hold( p_this );
-    var_DelCallback( p_playlist, "playlist-current", ItemChange, p_this );
+    var_DelCallback( p_playlist, "item-current", ItemChange, p_this );
     pl_Release( p_this );
 }
 
index dfa7d4d..4e980c1 100644 (file)
@@ -91,7 +91,7 @@ static int Open( vlc_object_t *p_this )
     intf_thread_t *p_intf = (intf_thread_t *)p_this;
 
     playlist_t *p_playlist = pl_Hold( p_intf );
-    var_AddCallback( p_playlist, "playlist-current", ItemChange, p_intf );
+    var_AddCallback( p_playlist, "item-current", ItemChange, p_intf );
     pl_Release( p_intf );
 
     RegisterToGrowl( p_this );
@@ -104,7 +104,7 @@ static int Open( vlc_object_t *p_this )
 static void Close( vlc_object_t *p_this )
 {
     playlist_t *p_playlist = pl_Hold( p_this );
-    var_DelCallback( p_playlist, "playlist-current", ItemChange, p_this );
+    var_DelCallback( p_playlist, "item-current", ItemChange, p_this );
     pl_Release( p_this );
 }
 
index 78db563..d38fcbf 100644 (file)
@@ -103,7 +103,7 @@ static int Open( vlc_object_t *p_this )
 
     p_playlist = pl_Hold( p_intf );
     var_AddCallback( p_playlist, "item-change", ItemChange, p_intf );
-    var_AddCallback( p_playlist, "playlist-current", ItemChange, p_intf );
+    var_AddCallback( p_playlist, "item-current", ItemChange, p_intf );
     pl_Release( p_intf );
 
     return VLC_SUCCESS;
@@ -122,7 +122,7 @@ static void Close( vlc_object_t *p_this )
     SendToMSN( "\\0Music\\01\\0\\0\\0\\0\\0\\0\\0" );
 
     var_DelCallback( p_playlist, "item-change", ItemChange, p_intf );
-    var_DelCallback( p_playlist, "playlist-current", ItemChange, p_intf );
+    var_DelCallback( p_playlist, "item-current", ItemChange, p_intf );
     pl_Release( p_this );
 
     /* Destroy structure */
index 2c6b0fd..7345744 100644 (file)
@@ -103,7 +103,7 @@ static int Open( vlc_object_t *p_this )
     p_intf->p_sys->notification = NULL;
 
     p_playlist = pl_Hold( p_intf );
-    var_AddCallback( p_playlist, "playlist-current", ItemChange, p_intf );
+    var_AddCallback( p_playlist, "item-current", ItemChange, p_intf );
     pl_Release( p_intf );
 
     return VLC_SUCCESS;
@@ -118,7 +118,7 @@ static void Close( vlc_object_t *p_this )
     intf_sys_t      *p_sys  = p_intf->p_sys;
 
     playlist_t *p_playlist = pl_Hold( p_this );
-    var_DelCallback( p_playlist, "playlist-current", ItemChange, p_this );
+    var_DelCallback( p_playlist, "item-current", ItemChange, p_this );
     pl_Release( p_this );
 
     if( p_intf->p_sys->notification )
index 3c2e3d4..f2fff32 100644 (file)
@@ -126,7 +126,7 @@ static int Open( vlc_object_t *p_this )
 
     p_playlist = pl_Hold( p_intf );
     var_AddCallback( p_playlist, "item-change", ItemChange, p_intf );
-    var_AddCallback( p_playlist, "playlist-current", ItemChange, p_intf );
+    var_AddCallback( p_playlist, "item-current", ItemChange, p_intf );
     pl_Release( p_intf );
 
     return VLC_SUCCESS;
@@ -142,7 +142,7 @@ static void Close( vlc_object_t *p_this )
     input_thread_t *p_input = NULL;
 
     var_DelCallback( p_playlist, "item-change", ItemChange, p_intf );
-    var_DelCallback( p_playlist, "playlist-current", ItemChange, p_intf );
+    var_DelCallback( p_playlist, "item-current", ItemChange, p_intf );
     if( (p_input = playlist_CurrentInput( p_playlist )) )
     {
         var_DelCallback( p_input, "state", StateChange, p_intf );
@@ -177,7 +177,7 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var,
     input_thread_t *p_input;
 
     /* Don't update Telepathy presence each time an item has been preparsed */
-    if( !strncmp( "playlist-current", psz_var, 16 ) )
+    if( !strncmp( "item-current", psz_var, 16 ) )
     { /* stores the current input item id */
         p_intf->p_sys->i_id = newval.i_int;
         p_intf->p_sys->i_item_changes = 0;
@@ -211,7 +211,7 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var,
         }
     }
 
-    if( !strncmp( "playlist-current", psz_var, 16 ) )
+    if( !strncmp( "item-current", psz_var, 16 ) )
         var_AddCallback( p_input, "state", StateChange, p_intf );
 
     /* We format the string to be displayed */
index a7b2b9b..b080c66 100644 (file)
@@ -154,7 +154,7 @@ static int Open( vlc_object_t *p_this )
 
 
     playlist_t *p_playlist = pl_Hold( p_intf );
-    var_AddCallback( p_playlist, "playlist-current", PlaylistNext, p_this );
+    var_AddCallback( p_playlist, "item-current", PlaylistNext, p_this );
     var_AddCallback( p_playlist, "item-change", PlaylistNext, p_this );
     pl_Release( p_intf );
 
@@ -195,7 +195,7 @@ static void Close( vlc_object_t *p_this )
 {
     intf_thread_t *p_intf = (intf_thread_t *)p_this;
     playlist_t *p_playlist = pl_Hold( p_intf );
-    var_DelCallback( p_playlist, "playlist-current", PlaylistNext, p_this );
+    var_DelCallback( p_playlist, "item-current", PlaylistNext, p_this );
     var_DelCallback( p_playlist, "item-change", PlaylistNext, p_this );
     pl_Release( p_intf );
 
index cd363ec..cf4d3f0 100644 (file)
@@ -278,8 +278,8 @@ static void VariablesInit( playlist_t *p_playlist )
 
     var_Create( p_playlist, "item-append", VLC_VAR_ADDRESS );
 
-    var_Create( p_playlist, "playlist-current", VLC_VAR_INTEGER );
-    var_SetInteger( p_playlist, "playlist-current", -1 );
+    var_Create( p_playlist, "item-current", VLC_VAR_INTEGER );
+    var_SetInteger( p_playlist, "item-current", -1 );
 
     var_Create( p_playlist, "activity", VLC_VAR_INTEGER );
     var_SetInteger( p_playlist, "activity", 0 );
index 8803619..5d1c60f 100644 (file)
@@ -294,7 +294,7 @@ static int PlayItem( playlist_t *p_playlist, playlist_item_t *p_item )
     }
 
     PL_UNLOCK;
-    var_SetInteger( p_playlist, "playlist-current", p_input->i_id );
+    var_SetInteger( p_playlist, "item-current", p_input->i_id );
     PL_LOCK;
 
     return VLC_SUCCESS;