# include "config.h"
#endif
-#include <vlc/vlc.h>
+#include <vlc_common.h>
+#include <vlc_plugin.h>
#include <vlc_aout.h>
#include <vlc_interface.h>
#include <vlc_meta.h>
#include <math.h>
+#include <assert.h>
+
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
*****************************************************************************/
vlc_module_begin();
- set_shortname( _("dbus"));
+ set_shortname( N_("dbus"));
set_category( CAT_INTERFACE );
set_subcategory( SUBCAT_INTERFACE_CONTROL );
- set_description( _("D-Bus control interface") );
+ set_description( N_("D-Bus control interface") );
set_capability( "interface", 0 );
set_callbacks( Open, Close );
vlc_module_end();
{
REPLY_INIT;
playlist_t *p_playlist = pl_Yield( (vlc_object_t*) p_this );
- playlist_Play( p_playlist );
+
+ PL_LOCK;
+ input_thread_t *p_input = p_playlist->p_input;
+ if( p_input )
+ vlc_object_yield( p_input );
+ PL_UNLOCK;
+
+ if( p_input )
+ {
+ double i_pos = 0;
+ input_Control( p_input, INPUT_SET_POSITION, i_pos );
+ vlc_object_release( p_input );
+ }
+ else
+ playlist_Play( p_playlist );
+
pl_Release( p_playlist );
REPLY_SEND;
}
DBUS_METHOD( AddTrack )
{ /* add the string to the playlist, and play it if the boolean is true */
REPLY_INIT;
+ OUT_ARGUMENTS;
DBusError error;
dbus_error_init( &error );
PLAYLIST_END, true, false );
pl_Release( p_playlist );
+ dbus_int32_t i_success = 0;
+ ADD_INT32( &i_success );
+
REPLY_SEND;
}
playlist_t *p_playlist = (playlist_t*)p_this;
playlist_add_t *p_add = newval.p_address;
playlist_item_t *p_item;
- p_item = playlist_ItemGetById( p_playlist, p_add->i_node, true );
+ p_item = playlist_ItemGetById( p_playlist, p_add->i_node, false );
assert( p_item );
while( p_item->p_parent )
p_item = p_item->p_parent;
}
if( newval.i_int == PLAYING_S || newval.i_int == PAUSE_S ||
- newval.i_int == END_S )
+ newval.i_int == STOP_S || newval.i_int == END_S )
{
StatusChangeSignal( p_sys->p_conn, (void*) p_intf );
}