From: Filippo Carone Date: Sun, 20 May 2007 16:58:44 +0000 (+0000) Subject: Use oldval and newval in libvlc_event_t X-Git-Tag: 0.9.0-test0~7292 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=be07ad9457b6756f96629b7ad1d3a267ebf2c8d9;p=vlc Use oldval and newval in libvlc_event_t --- diff --git a/include/vlc/libvlc_structures.h b/include/vlc/libvlc_structures.h index e7cb50d506..145f190ad6 100644 --- a/include/vlc/libvlc_structures.h +++ b/include/vlc/libvlc_structures.h @@ -144,14 +144,30 @@ typedef struct libvlc_log_message_t * - VOLUME_CHANGED * - INPUT_POSITION_CHANGED */ + typedef enum { VOLUME_CHANGED, INPUT_POSITION_CHANGED, } libvlc_event_type_t; +typedef enum { + INT_EVENT, + BOOLEAN_EVENT, + FLOAT_EVENT, + STRING_EVENT, + ADDRESS_EVENT, + OBJECT_EVENT, + LIST_EVENT, + TIME_EVENT, + VAR_EVENT, +} libvlc_event_value_type_t; + typedef struct { libvlc_event_type_t type; + libvlc_event_value_type_t value_type; + vlc_value_t old_value; + vlc_value_t new_value; char reserved[8]; /* For future use */ } libvlc_event_t; diff --git a/src/control/callback.c b/src/control/callback.c index 531afd85c1..91f30632c7 100644 --- a/src/control/callback.c +++ b/src/control/callback.c @@ -110,6 +110,18 @@ int libvlc_private_handle_callback( vlc_object_t *p_this, char const *psz_cmd, struct libvlc_callback_entry_t *entry = p_data; libvlc_event_t event; event.type = entry->i_event_type; + switch ( event.type ) + { + case VOLUME_CHANGED: + event.value_type = BOOLEAN_EVENT; + break; + case INPUT_POSITION_CHANGED: + break; + default: + break; + } + event.old_value = oldval; + event.new_value = newval; /* Call the client entry */ entry->f_callback( entry->p_instance, &event, entry->p_user_data );