#undef ADD_ICON
rebuild( p_root );
+ CONNECT( THEMIM->getIM(), metaChanged( int ),
+ this, ProcessInputItemUpdate( int ) );
+ CONNECT( THEMIM, inputChanged( input_thread_t * ),
+ this, ProcessInputItemUpdate( input_thread_t* ) );
}
PLModel::~PLModel()
{
/* Some global changes happened -> Rebuild all */
var_AddCallback( p_playlist, "intf-change", PlaylistChanged, this );
- /* We went to the next item */
+ /* We went to the next item
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, "playlist-item-append", ItemAppended, this );
- var_AddCallback( p_playlist, "playlist-item-deleted", ItemDeleted, this );
+ var_AddCallback( p_playlist, "item-append", ItemAppended, this );
+ var_AddCallback( p_playlist, "item-deleted", ItemDeleted, this );
}
void PLModel::delCallbacks()
{
var_DelCallback( p_playlist, "item-change", ItemChanged, this );
+ /*
var_DelCallback( p_playlist, "item-current", PlaylistNext, this );
+ */
var_DelCallback( p_playlist, "intf-change", PlaylistChanged, this );
var_DelCallback( p_playlist, "playlist-item-append", ItemAppended, this );
var_DelCallback( p_playlist, "playlist-item-deleted", ItemDeleted, this );
void PLModel::customEvent( QEvent *event )
{
int type = event->type();
- if( type != ItemUpdate_Type && type != ItemAppend_Type &&
+ if( type != ItemAppend_Type &&
type != ItemDelete_Type && type != PLUpdate_Type )
return;
PLEvent *ple = static_cast<PLEvent *>(event);
- if( type == ItemUpdate_Type )
- ProcessInputItemUpdate( ple->i_id );
- else if( type == ItemAppend_Type )
- ProcessItemAppend( &ple->add );
+ if( type == ItemAppend_Type )
+ ProcessItemAppend( ple->p_add );
else if( type == ItemDelete_Type )
ProcessItemRemoval( ple->i_id );
else
}
/**** Events processing ****/
+void PLModel::ProcessInputItemUpdate( input_thread_t *p_input )
+{
+ if( !p_input ) return;
+ ProcessInputItemUpdate( input_GetItem( p_input )->i_id );
+}
void PLModel::ProcessInputItemUpdate( int i_input_id )
{
if( i_input_id <= 0 ) return;
/* Reset all InfoPanels but stats */
emit artChanged( NULL );
emit infoChanged( NULL );
- emit metaChanged( NULL );
+ emit metaChanged( (input_item_t *)NULL );
}
/* Convert the event from the callbacks in actions */
UpdateStatus();
// UpdateName();
UpdateArt();
+ /* Update duration of file */
}
+ UpdateMeta( ple->i_id );
break;
case ItemStateChanged_Type:
// TODO: Fusion with above state
emit statisticsUpdated( input_GetItem( p_input ) );
}
+inline void InputManager::UpdateMeta( int id )
+{
+ emit metaChanged( id );
+}
+
inline void InputManager::UpdateMeta()
{
emit metaChanged( input_GetItem( p_input ) );
vlc_mutex_lock( &p_intf->change_lock );
if( p_input && ( p_input->b_dead || !vlc_object_alive (p_input) ) )
{
- emit inputChanged( NULL );
+ emit inputChanged( p_input );
var_DelCallback( p_input, "state", PLItemChanged, this );
vlc_object_release( p_input );
p_input = NULL;