#define PLAYLIST_RO_FLAG 0x0008 /**< Write-enabled ? */
#define PLAYLIST_REMOVE_FLAG 0x0010 /**< Remove this item at the end */
#define PLAYLIST_EXPANDED_FLAG 0x0020 /**< Expanded node */
+#define PLAYLIST_SUBITEM_STOP_FLAG 0x0040 /**< Must playlist stop if the item gets subitems ?*/
/** Playlist status */
typedef enum
void StandardPLPanel::activate( const QModelIndex &index )
{
- last_activated_id = model->getItem( index )->inputItem()->i_id;
if( model->hasChildren( index ) )
{
if( currentView == iconView ) {
}
else
{
+ playlist_Lock( THEPL );
+ playlist_item_t *p_item = playlist_ItemGetById( THEPL, model->itemId( index ) );
+ p_item->i_flags |= PLAYLIST_SUBITEM_STOP_FLAG;
+ last_activated_id = p_item->p_input->i_id;//model->getItem( index )->inputItem()->i_id;
+ playlist_Unlock( THEPL );
model->activateItem( index );
}
}
playlist_item_t *p_item = playlist_ItemGetByInput( THEPL, p_input );
assert( p_item != NULL );
+ QModelIndex index = model->index( p_item->i_id, 0 );
if( currentView == iconView ) {
- QModelIndex index = model->index( p_item->i_id, 0 );
iconView->setRootIndex( index );
locationBar->setIndex( index );
}
- last_activated_id = p_item->pp_children[0]->p_input->i_id;
+ else
+ treeView->setExpanded( index, true );
+
+ last_activated_id = -1;
playlist_Unlock( THEPL );
}
return;
}
+ bool b_stop = p_item_in_category->i_flags & PLAYLIST_SUBITEM_STOP_FLAG;
+
b_play = b_play &&
- p_item_in_category == get_current_status_item( p_playlist );
+ p_item_in_category == get_current_status_item( p_playlist ) &&
+ p_item_in_category->i_children == -1;
/* If this item is already a node don't transform it */
if( p_item_in_category->i_children == -1 )
if( i_ret == VLC_SUCCESS && b_play )
{
+ if( b_stop )
+ {
+ p_item_in_category->i_flags &= ~PLAYLIST_SUBITEM_STOP_FLAG;
+ PL_UNLOCK;
+ playlist_Stop( p_playlist );
+ return;
+ }
playlist_Control( p_playlist, PLAYLIST_VIEWPLAY,
pl_Locked, p_item_in_category, NULL );
}