typedef enum {
PLAYLIST_PLAY, /**< No arg. res=can fail*/
PLAYLIST_AUTOPLAY, /**< No arg. res=cant fail*/
- PLAYLIST_VIEWPLAY, /**< arg1= int, arg2= playlist_item_t*,*/
- /** arg3 = playlist_item_t* , res=can fail */
- PLAYLIST_ITEMPLAY, /** <arg1 = playlist_item_t * , res=can fail */
+ PLAYLIST_VIEWPLAY, /**< arg1= playlist_item_t*,*/
+ /** arg2 = playlist_item_t* , res=can fail */
PLAYLIST_PAUSE, /**< No arg res=can fail*/
PLAYLIST_STOP, /**< No arg res=can fail*/
PLAYLIST_SKIP, /**< arg1=int, res=can fail*/
- PLAYLIST_GOTO, /**< arg1=int res=can fail */
- PLAYLIST_VIEWGOTO /**< arg1=int res=can fail */
} playlist_command_t;
if( b_play )
{
- playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, 1242,
+ playlist_Control( p_playlist, PLAYLIST_VIEWPLAY,
p_playlist->request.p_node, NULL );
-// playlist_Play( p_playlist );
}
if( p_playlist ) vlc_object_release( p_playlist );
if( b_play )
{
- playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, 0,
+ playlist_Control( p_playlist, PLAYLIST_VIEWPLAY,
p_playlist->status.p_item, NULL );
}
if( !strcmp( psz_bookmark,
p_playlist->pp_items[i]->p_input->psz_uri ) )
{
- playlist_LockControl( p_playlist, PLAYLIST_ITEMPLAY,
+ playlist_LockControl( p_playlist, PLAYLIST_VIEWPLAY, NULL,
p_playlist->pp_items[i] );
break;
}
msg_Dbg( p_intf, "requested playlist play" );
break;
}
- playlist_Control( p_sys->p_playlist, PLAYLIST_ITEMPLAY,
+ playlist_Control( p_sys->p_playlist, PLAYLIST_VIEWPLAY,
+ NULL,
playlist_ItemGetById( p_sys->p_playlist,
i_item ) );
msg_Dbg( p_intf, "requested playlist item: %i", i_item );
int i_id = E_(SSPopN)( st, vars );
int i_ret;
- i_ret = playlist_Control( p_sys->p_playlist, PLAYLIST_ITEMPLAY,
+ i_ret = playlist_Control( p_sys->p_playlist, PLAYLIST_VIEWPLAY,
+ NULL,
playlist_ItemGetById( p_sys->p_playlist,
i_id ) );
msg_Dbg( p_intf, "requested playlist item: %i", i_id );
if( b_play && p_playlist->status.p_item && \
p_playlist->status.p_item->i_children > 0 ) \
{ \
- playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, 1242, \
+ playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, \
p_playlist->status.p_item, NULL ); \
} \
vlc_object_release( p_playlist );
p_item = NULL;
}
}
- playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, 0, p_node, p_item );
+ playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, p_node, p_item );
}
vlc_object_release( p_playlist );
}
{
playlist_item_t *p_item;
p_item = playlist_ItemGetByInput( p_playlist, p_input );
- playlist_Control( p_playlist, PLAYLIST_ITEMPLAY, p_item );
+ playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, NULL, p_item );
}
else
{
{
playlist_item_t *p_item;
p_item = playlist_ItemGetByInput( p_playlist, p_input );
- playlist_Control( p_playlist, PLAYLIST_ITEMPLAY, p_item );
+ playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, NULL, p_item );
}
else
{
{
/* play the first item and add the others afterwards */
playlist_item_t *p_item = playlist_ItemGetByInput( p_playlist, p_input );
- playlist_Control( p_playlist, PLAYLIST_ITEMPLAY, p_item );
+ playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, NULL,
+ p_item );
}
x += 1;
if( p_sys->pp_plist[p_sys->i_box_plidx]->p_item->i_children
== -1 )
{
- playlist_Control( p_sys->p_playlist, PLAYLIST_ITEMPLAY,
+ playlist_Control( p_sys->p_playlist, PLAYLIST_VIEWPLAY,
+ NULL,
p_sys->pp_plist[p_sys->i_box_plidx]->p_item );
}
else
{
playlist_Control( p_sys->p_playlist, PLAYLIST_VIEWPLAY,
- p_sys->i_current_view,
p_sys->pp_plist[p_sys->i_box_plidx]->p_item,
NULL );
}
QObject::connect( this, SIGNAL( inputChanged( input_thread_t * ) ),
main_input_manager, SLOT( setInput( input_thread_t * ) ) );
+ /* Connect the slider and the input manager */
+ // both ways
+
+ /* Connect the display and the input manager */
}
MainInterface::~MainInterface()
if( p_parent )
{
- playlist_Control( m_pPlaylist, PLAYLIST_VIEWPLAY, 1242,
- p_parent, p_item );
+ playlist_Control( m_pPlaylist, PLAYLIST_VIEWPLAY, p_parent, p_item );
}
vlc_mutex_unlock( &m_pPlaylist->object_lock );
}
}
}
- playlist_AddItem( p_playlist, p_item,
- PLAYLIST_APPEND, PLAYLIST_END );
if( b_start )
{
- playlist_Control( p_playlist, PLAYLIST_ITEMPLAY , p_item );
+ playlist_AddItem( p_playlist, p_item,
+ PLAYLIST_APPEND|PLAYLIST_GO, PLAYLIST_END );
+ }
+ else
+ {
+ playlist_AddItem( p_playlist, p_item,
+ PLAYLIST_APPEND, PLAYLIST_END );
}
}
if( p_parent )
{
- playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, 1242,
- p_parent, p_item );
+ playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, p_parent, p_item );
}
UnlockPlaylist( p_intf->p_sys, p_playlist );
}
if( p_popup_parent )
{
- playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, 1242,
- p_popup_parent, p_popup_item );
+ playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, p_popup_parent,
+ p_popup_item );
}
UnlockPlaylist( p_intf->p_sys, p_playlist );
}
msg_Dbg( p_vout, "Area(%d) matched, going to %s\n", i_area,
pp_curent_area->psz_mrl );
playlist_Control( p_vout->p_sys->p_playlist,
- PLAYLIST_ITEMPLAY, p_item );
+ PLAYLIST_VIEWPLAY, NULL, p_item );
pp_curent_area->i_matches = 0;
}
}
#include <vlc/vlc.h>
#include <vlc/input.h>
#include "vlc_playlist.h"
+#include <assert.h>
/*****************************************************************************
* Local prototypes
p_playlist->request.p_item = NULL;
break;
- case PLAYLIST_ITEMPLAY:
- p_item = (playlist_item_t *)va_arg( args, playlist_item_t * );
- if ( p_item == NULL || p_item->p_input->psz_uri == NULL )
- return VLC_EGENERIC;
- p_playlist->request.i_status = PLAYLIST_RUNNING;
- p_playlist->request.i_skip = 0;
- p_playlist->request.b_request = VLC_TRUE;
- p_playlist->request.p_item = p_item;
- p_playlist->request.p_node = p_playlist->status.p_node;
- break;
-
+ // Node can be null, it will keep the same. Use with care ...
+ // Item null = take the first child of node
case PLAYLIST_VIEWPLAY:
- i_view = (int) va_arg( args, playlist_item_t *);
p_node = (playlist_item_t *)va_arg( args, playlist_item_t * );
p_item = (playlist_item_t *)va_arg( args, playlist_item_t * );
if ( p_node == NULL )
{
p_node = p_playlist->status.p_node;
- if( !p_node )
- {
- p_playlist->status.i_status = PLAYLIST_STOPPED;
- p_playlist->request.b_request = VLC_TRUE;
- msg_Err( p_playlist, "null node" );
- return VLC_SUCCESS;
- }
+ assert( p_node );
}
p_playlist->request.i_status = PLAYLIST_RUNNING;
p_playlist->request.i_skip = 0;
break;
case PLAYLIST_PLAY:
- p_playlist->request.i_status = PLAYLIST_RUNNING;
- p_playlist->request.b_request = VLC_TRUE;
-
if( p_playlist->p_input )
{
val.i_int = PLAYING_S;
var_Set( p_playlist->p_input, "state", val );
break;
}
- p_playlist->request.p_node = p_playlist->status.p_node;
- p_playlist->request.p_item = p_playlist->status.p_item;
- p_playlist->request.i_skip = 0;
+ else
+ {
+ p_playlist->request.i_status = PLAYLIST_RUNNING;
+ p_playlist->request.b_request = VLC_TRUE;
+ p_playlist->request.p_node = p_playlist->status.p_node;
+ p_playlist->request.p_item = p_playlist->status.p_item;
+ p_playlist->request.i_skip = 0;
+ }
break;
case PLAYLIST_AUTOPLAY:
+ // AUTOPLAY is an ugly hack for initial status.
+ // Hopefully it will disappear
p_playlist->status.i_status = PLAYLIST_RUNNING;
- p_playlist->status.p_node = p_playlist->p_local_category;
+ p_playlist->request.p_node = p_playlist->status.p_node;
p_playlist->request.b_request = VLC_FALSE;
break;
vlc_bool_t b_playstop = var_GetBool( p_playlist, "play-and-stop" );
/* Handle quickly a few special cases */
-
/* No items to play */
if( p_playlist->i_size == 0 )
{
p_new = p_playlist->request.p_item;
i_skip = p_playlist->request.i_skip;
- p_playlist->status.p_node = p_playlist->request.p_node;
+ if( p_playlist->request.p_node )
+ p_playlist->status.p_node = p_playlist->request.p_node;
- /* If we are asked for a node, take its first item */
- if( i_skip == 0 &&
- ( p_new == NULL || p_new->i_children != -1 ) )
- {
+ /* If we are asked for a node, dont take it */
+ if( i_skip == 0 && ( p_new == NULL || p_new->i_children != -1 ) )
i_skip++;
- }
if( i_skip > 0 )
{
{
playlist_item_t *p_next;
+ assert( p_root && p_root->i_children != -1 );
+
#ifdef PLAYLIST_DEBUG
if( p_item != NULL )
msg_Dbg( p_playlist, "finding next of %s within %s",
p_root->p_input->psz_name );
#endif
- assert( p_root && p_root->i_children != -1 );
/* Now, walk the tree until we find a suitable next item */
p_next = p_item;