Commit 6b772873 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Use "activity" instead of "item-current" variable

parent 9ee23d40
......@@ -242,7 +242,7 @@ static int Open( vlc_object_t *p_this )
p_playlist = pl_Get( p_intf );
p_sys->p_playlist = p_playlist;
var_AddCallback( p_playlist, "item-current", AllCallback, p_intf );
var_AddCallback( p_playlist, "activity", AllCallback, p_intf );
var_AddCallback( p_playlist, "intf-change", AllCallback, p_intf );
var_AddCallback( p_playlist, "volume", AllCallback, p_intf );
var_AddCallback( p_playlist, "mute", AllCallback, p_intf );
......@@ -292,7 +292,7 @@ static void Close ( vlc_object_t *p_this )
intf_sys_t *p_sys = p_intf->p_sys;
playlist_t *p_playlist = p_sys->p_playlist;
var_DelCallback( p_playlist, "item-current", AllCallback, p_intf );
var_DelCallback( p_playlist, "activity", AllCallback, p_intf );
var_DelCallback( p_playlist, "intf-change", AllCallback, p_intf );
var_DelCallback( p_playlist, "volume", AllCallback, p_intf );
var_DelCallback( p_playlist, "mute", AllCallback, p_intf );
......@@ -985,7 +985,7 @@ static int AllCallback( vlc_object_t *p_this, const char *psz_var,
callback_info_t info = { .signal = SIGNAL_NONE };
// Wich event is it ?
if( !strcmp( "item-current", psz_var ) )
if( !strcmp( "activity", psz_var ) )
info.signal = SIGNAL_ITEM_CURRENT;
else if( !strcmp( "volume", psz_var ) )
{
......@@ -1040,7 +1040,7 @@ static int AllCallback( vlc_object_t *p_this, const char *psz_var,
}
/*****************************************************************************
* TrackChange: callback on playlist "item-current"
* TrackChange: callback on playlist "activity"
*****************************************************************************/
static int TrackChange( intf_thread_t *p_intf )
{
......
......@@ -639,7 +639,6 @@ static VLCMain *_o_sharedMainInstance = nil;
var_AddCallback(p_intf->p_libvlc, "intf-toggle-fscontrol", ShowController, self);
var_AddCallback(p_intf->p_libvlc, "intf-show", ShowController, self);
// var_AddCallback(p_playlist, "item-change", PLItemChanged, self);
var_AddCallback(p_playlist, "item-current", PLItemChanged, self);
var_AddCallback(p_playlist, "activity", PLItemChanged, self);
var_AddCallback(p_playlist, "leaf-to-parent", PlaylistUpdated, self);
var_AddCallback(p_playlist, "playlist-item-append", PlaylistUpdated, self);
......@@ -812,7 +811,6 @@ static VLCMain *_o_sharedMainInstance = nil;
var_DelCallback(p_intf, "dialog-question", DialogCallback, self);
var_DelCallback(p_intf, "dialog-progress-bar", DialogCallback, self);
//var_DelCallback(p_playlist, "item-change", PLItemChanged, self);
var_DelCallback(p_playlist, "item-current", PLItemChanged, self);
var_DelCallback(p_playlist, "activity", PLItemChanged, self);
var_DelCallback(p_playlist, "leaf-to-parent", PlaylistUpdated, self);
var_DelCallback(p_playlist, "playlist-item-append", PlaylistUpdated, self);
......
......@@ -977,7 +977,6 @@ MainInputManager::MainInputManager( intf_thread_t *_p_intf )
im = new InputManager( this, p_intf );
var_AddCallback( THEPL, "item-change", ItemChanged, im );
var_AddCallback( THEPL, "item-current", PLItemChanged, this );
var_AddCallback( THEPL, "activity", PLItemChanged, this );
var_AddCallback( THEPL, "leaf-to-parent", LeafToParent, this );
var_AddCallback( THEPL, "playlist-item-append", PLItemAppended, this );
......@@ -1016,7 +1015,6 @@ MainInputManager::~MainInputManager()
var_DelCallback( THEPL, "item-change", ItemChanged, im );
var_DelCallback( THEPL, "leaf-to-parent", LeafToParent, this );
var_DelCallback( THEPL, "item-current", PLItemChanged, this );
var_DelCallback( THEPL, "playlist-item-append", PLItemAppended, this );
var_DelCallback( THEPL, "playlist-item-deleted", PLItemRemoved, this );
}
......
......@@ -157,7 +157,7 @@ VlcProc::VlcProc( intf_thread_t *pIntf ): SkinObject( pIntf ),
ADD_CALLBACK( pIntf->p_sys->p_playlist, "volume" )
ADD_CALLBACK( pIntf->p_libvlc, "intf-toggle-fscontrol" )
ADD_CALLBACK( pIntf->p_sys->p_playlist, "item-current" )
ADD_CALLBACK( pIntf->p_sys->p_playlist, "activity" )
ADD_CALLBACK( pIntf->p_sys->p_playlist, "random" )
ADD_CALLBACK( pIntf->p_sys->p_playlist, "loop" )
ADD_CALLBACK( pIntf->p_sys->p_playlist, "repeat" )
......@@ -205,7 +205,7 @@ VlcProc::~VlcProc()
var_DelCallback( getIntf()->p_libvlc, "intf-toggle-fscontrol",
onGenericCallback, this );
var_DelCallback( getIntf()->p_sys->p_playlist, "item-current",
var_DelCallback( getIntf()->p_sys->p_playlist, "activity",
onGenericCallback, this );
var_DelCallback( getIntf()->p_sys->p_playlist, "random",
onGenericCallback, this );
......@@ -367,7 +367,7 @@ int VlcProc::onGenericCallback( vlc_object_t *pObj, const char *pVariable,
} \
}
ADD_CALLBACK_ENTRY( "item-current", on_item_current_changed, false )
ADD_CALLBACK_ENTRY( "activity", on_item_current_changed, false )
ADD_CALLBACK_ENTRY( "volume", on_volume_changed, true )
ADD_CALLBACK_ENTRY( "bit-rate", on_bit_rate_changed, false )
......
......@@ -107,12 +107,12 @@ int watch_Init( media_library_t *p_ml )
/* Wait on playlist events
* playlist-item-append -> entry to playlist
* item-current -> to ensure that we catch played item only!
* activity -> to ensure that we catch played item only!
* playlist-item-deleted -> exit from playlist
* item-change -> Currently not required, as we monitor input_item events
*/
playlist_t *p_pl = pl_Get( p_ml );
var_AddCallback( p_pl, "item-current", watch_PlaylistItemCurrent, p_ml );
var_AddCallback( p_pl, "activity", watch_PlaylistItemCurrent, p_ml );
var_AddCallback( p_pl, "playlist-item-append", watch_PlaylistItemAppend, p_ml );
var_AddCallback( p_pl, "playlist-item-deleted", watch_PlaylistItemDeleted, p_ml );
......@@ -169,7 +169,7 @@ void watch_Close( media_library_t *p_ml )
playlist_t *p_pl = pl_Get( p_ml );
var_DelCallback( p_pl, "playlist-item-deleted", watch_PlaylistItemDeleted, p_ml );
var_DelCallback( p_pl, "playlist-item-append", watch_PlaylistItemAppend, p_ml );
var_DelCallback( p_pl, "item-current", watch_PlaylistItemCurrent, p_ml );
var_DelCallback( p_pl, "activity", watch_PlaylistItemCurrent, p_ml );
/* Flush item list */
il_foreachhashlist( p_ml->p_sys->p_watch->p_hlist, p_elt, ixx )
......@@ -386,10 +386,6 @@ static int watch_PlaylistItemCurrent( vlc_object_t *p_this, char const *psz_var,
media_library_t *p_ml = ( media_library_t* ) data;
input_item_t *p_item = NULL;
if( strcmp( psz_var, "item-current" ) != 0 )
/* This case should not happen... */
return VLC_EGENERIC;
/* Get current input */
input_thread_t *p_input = pl_CurrentInput( p_ml );
p_item = p_input ? input_GetItem( p_input ) : NULL;
......
......@@ -419,7 +419,7 @@ static int Open(vlc_object_t *p_this)
vlc_mutex_init(&p_sys->lock);
vlc_cond_init(&p_sys->wait);
var_AddCallback(pl_Get(p_intf), "item-current", ItemChange, p_intf);
var_AddCallback(pl_Get(p_intf), "activity", ItemChange, p_intf);
p_intf->pf_run = Run;
......@@ -436,7 +436,7 @@ static void Close(vlc_object_t *p_this)
intf_thread_t *p_intf = (intf_thread_t*) p_this;
intf_sys_t *p_sys = p_intf->p_sys;
var_DelCallback(p_playlist, "item-current", ItemChange, p_intf);
var_DelCallback(p_playlist, "activity", ItemChange, p_intf);
p_input = playlist_CurrentInput(p_playlist);
if (p_input)
......
......@@ -131,7 +131,7 @@ static int Activate( vlc_object_t *p_this )
}
p_sys->p_playlist = pl_Get( p_intf );
var_AddCallback( p_sys->p_playlist, "item-current", InputChange, p_intf );
var_AddCallback( p_sys->p_playlist, "activity", InputChange, p_intf );
return VLC_SUCCESS;
}
......@@ -143,7 +143,7 @@ static void Deactivate( vlc_object_t *p_this )
intf_thread_t *p_intf = (intf_thread_t*)p_this;
intf_sys_t *p_sys = p_intf->p_sys;
var_DelCallback( p_sys->p_playlist, "item-current", InputChange, p_intf );
var_DelCallback( p_sys->p_playlist, "activity", InputChange, p_intf );
if( p_sys->p_input ) /* Do delete "state" after "item-changed"! */
{
......
......@@ -121,7 +121,7 @@ static int Open( vlc_object_t *p_this )
}
/* */
var_AddCallback( pl_Get( p_intf ), "item-current", ItemChange, p_intf );
var_AddCallback( pl_Get( p_intf ), "activity", ItemChange, p_intf );
return VLC_SUCCESS;
}
......@@ -134,7 +134,7 @@ static void Close( vlc_object_t *p_this )
intf_thread_t *p_intf = ( intf_thread_t* ) p_this;
intf_sys_t *p_sys = p_intf->p_sys;
var_DelCallback( pl_Get( p_this ), "item-current", ItemChange, p_this );
var_DelCallback( pl_Get( p_this ), "activity", ItemChange, p_this );
if( p_sys->notification )
{
......
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