X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=include%2Fmediacontrol_internal.h;h=a6021566e4432c6c49e2f18b285027b40719580e;hb=1b9fc13769a259169aa3c2f9400c80c2d5241b0d;hp=40ca6633d418b53d7dd6aefbdbd8a6efa35a81af;hpb=8f1a5b3d5bb05308237086c9a1391cf2e5f0511f;p=vlc diff --git a/include/mediacontrol_internal.h b/include/mediacontrol_internal.h index 40ca6633d4..a6021566e4 100644 --- a/include/mediacontrol_internal.h +++ b/include/mediacontrol_internal.h @@ -29,14 +29,14 @@ extern "C" { # endif #include -#include "vlc/mediacontrol_structures.h" +#include +#include +#include -typedef struct mediacontrol_Instance { - vlc_object_t *p_vlc; +struct mediacontrol_Instance { + struct libvlc_instance_t * p_instance; playlist_t *p_playlist; - intf_thread_t *p_intf; - int vlc_object_id; -} mediacontrol_Instance; +}; vlc_int64_t mediacontrol_unit_convert( input_thread_t *p_input, mediacontrol_PositionKey from, @@ -46,6 +46,28 @@ vlc_int64_t mediacontrol_position2microsecond( input_thread_t *p_input, const mediacontrol_Position *pos ); +#define RAISE( c, m ) exception->code = c; \ + exception->message = strdup(m); + +#define RAISE_NULL( c, m ) { RAISE( c, m ); return NULL; } +#define RAISE_VOID( c, m ) { RAISE( c, m ); return; } + +#define HANDLE_LIBVLC_EXCEPTION_VOID( e ) if( libvlc_exception_raised( e ) ) { \ + RAISE( mediacontrol_InternalException, libvlc_exception_get_message( e )); \ + libvlc_exception_clear( e ); \ + return; } + +#define HANDLE_LIBVLC_EXCEPTION_NULL( e ) if( libvlc_exception_raised( e ) ) { \ + RAISE( mediacontrol_InternalException, libvlc_exception_get_message( e )); \ + libvlc_exception_clear( e ); \ + return NULL; } + +#define HANDLE_LIBVLC_EXCEPTION_ZERO( e ) if( libvlc_exception_raised( e ) ) { \ + RAISE( mediacontrol_InternalException, libvlc_exception_get_message( e )); \ + libvlc_exception_clear( e ); \ + return 0; } + + # ifdef __cplusplus } # endif