VLC_PUBLIC_API void mediacontrol_PlaylistSeq__free( mediacontrol_PlaylistSeq *ps );
/**
- * Initialize an exception structure.
- * \param p_exception the exception to initialize. If NULL, a new exception will be created.
+ * Instanciate and initialize an exception structure.
* \return the exception
*/
VLC_PUBLIC_API mediacontrol_Exception *
+ mediacontrol_exception_create( void );
+
+/**
+ * Initialize an existing exception structure.
+ * \param p_exception the exception to initialize.
+ */
+VLC_PUBLIC_API void
mediacontrol_exception_init( mediacontrol_Exception *exception );
/**
char path[256];
snapshot_t *p_snapshot;
- exception=mediacontrol_exception_init( exception );
+ mediacontrol_exception_init( exception );
p_vout = vlc_object_find( self->p_playlist, VLC_OBJECT_VOUT, FIND_CHILD );
if( ! p_vout )
mediacontrol_all_snapshots( mediacontrol_Instance *self,
mediacontrol_Exception *exception )
{
- exception=mediacontrol_exception_init( exception );
+ mediacontrol_exception_init( exception );
RAISE_NULL( mediacontrol_InternalException, "unsupported method" );
}
int i_index;
libvlc_exception_init( &ex );
- exception=mediacontrol_exception_init( exception );
+ mediacontrol_exception_init( exception );
retval = ( mediacontrol_Instance* )malloc( sizeof( mediacontrol_Instance ) );
if( !retval )
vlc_int64_t pos;
libvlc_input_t * p_input;
- exception = mediacontrol_exception_init( exception );
+ mediacontrol_exception_init( exception );
libvlc_exception_init( &ex );
retval = ( mediacontrol_Position* )malloc( sizeof( mediacontrol_Position ) );
{
playlist_t * p_playlist = self->p_playlist;
- exception = mediacontrol_exception_init( exception );
+ mediacontrol_exception_init( exception );
if( ! p_playlist )
{
RAISE( mediacontrol_PlaylistException, "No available playlist" );
input_thread_t *p_input = self->p_playlist->p_input;
/* FIXME: use the a_position parameter */
- exception=mediacontrol_exception_init( exception );
+ mediacontrol_exception_init( exception );
if( p_input != NULL )
{
var_SetInteger( p_input, "state", PAUSE_S );
input_thread_t *p_input = self->p_playlist->p_input;
/* FIXME: use the a_position parameter */
- exception=mediacontrol_exception_init( exception );
+ mediacontrol_exception_init( exception );
if( p_input != NULL )
{
var_SetInteger( p_input, "state", PAUSE_S );
mediacontrol_Exception *exception )
{
/* FIXME: use the a_position parameter */
- exception=mediacontrol_exception_init( exception );
+ mediacontrol_exception_init( exception );
if( !self->p_playlist )
{
RAISE( mediacontrol_PlaylistException, "No playlist" );
playlist_t * p_playlist = self->p_playlist;
int i_playlist_size;
- exception=mediacontrol_exception_init( exception );
+ mediacontrol_exception_init( exception );
if( !p_playlist )
{
RAISE( mediacontrol_PlaylistException, "No playlist" );
}
vlc_mutex_lock( &p_playlist->object_lock );
- i_playlist_size = p_playlist->items.i_size;
+ i_playlist_size = p_playlist->current.i_size;
retval = mediacontrol_PlaylistSeq__alloc( i_playlist_size );
for( i_index = 0 ; i_index < i_playlist_size ; i_index++ )
{
- retval->data[i_index] = strdup( ARRAY_VAL(p_playlist->items, i_index)->p_input->psz_uri );
+ retval->data[i_index] = strdup( ARRAY_VAL(p_playlist->current, i_index)->p_input->psz_uri );
}
vlc_mutex_unlock( &p_playlist->object_lock );
# include <sys/types.h>
#endif
-#define RAISE( c, m ) exception->code = c; \
- exception->message = strdup(m);
-
/* FIXME: Need to stop accessing private input structures !! */
#include "input/input_internal.h"
free( ps );
}
-/**
- * Initialize a VLC exception.
- *
- * If given a NULL pointer, it will instanciate a new exception, which
- * should be later freed by the caller. If given an existing
- * exception, it will reset its code and message fields. In both
- * cases, the exception pointer is returned.
- *
- * \param exception a pointer on a mediacontrol_Exception
- * \return a pointer on a mediacontrol_Exception.
- */
mediacontrol_Exception*
+mediacontrol_exception_create( void )
+{
+ mediacontrol_Exception* exception;
+
+ exception = ( mediacontrol_Exception* )malloc( sizeof( mediacontrol_Exception ) );
+ mediacontrol_exception_init( exception );
+ return exception;
+}
+
+void
mediacontrol_exception_init( mediacontrol_Exception *exception )
{
- if( !exception )
+ if( exception )
{
- exception = ( mediacontrol_Exception* )malloc( sizeof( mediacontrol_Exception ) );
- if( !exception )
- {
- return NULL;
- }
+ exception->code = 0;
+ exception->message = NULL;
}
- exception->code = 0;
- exception->message = NULL;
- return exception;
}
void