Commit a5b3becf authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen Committed by Laurent Aimar

Adding a libvlc_MediaPlayerLengthChanged event

Signed-off-by: default avatarLaurent Aimar <fenrir@videolan.org>
parent a1fbc870
......@@ -88,6 +88,7 @@ typedef enum libvlc_event_type_t {
libvlc_MediaPlayerTitleChanged,
libvlc_MediaPlayerSnapshotTaken,
libvlc_MediaPlayerLengthChanged,
/* New event types HERE */
} libvlc_event_type_t;
......@@ -202,6 +203,11 @@ typedef struct libvlc_event_t
char* psz_filename ;
} media_player_snapshot_taken ;
/* Length changed */
struct
{
libvlc_time_t new_length;
} media_player_length_changed;
} u;
} libvlc_event_t;
......
......@@ -232,6 +232,13 @@ input_event_changed( vlc_object_t * p_this, char const * psz_cmd,
var_GetTime( p_input, "time" );
libvlc_event_send( p_mi->p_event_manager, &event );
}
else if( newval.i_int == INPUT_EVENT_LENGTH )
{
event.type = libvlc_MediaPlayerLengthChanged;
event.u.media_player_length_changed.new_length =
var_GetTime( p_input, "length" );
libvlc_event_send( p_mi->p_event_manager, &event );
}
return VLC_SUCCESS;
......@@ -313,6 +320,8 @@ libvlc_media_player_new( libvlc_instance_t * p_libvlc_instance,
libvlc_MediaPlayerPositionChanged, p_e );
libvlc_event_manager_register_event_type( p_mi->p_event_manager,
libvlc_MediaPlayerTimeChanged, p_e );
libvlc_event_manager_register_event_type( p_mi->p_event_manager,
libvlc_MediaPlayerLengthChanged, p_e );
libvlc_event_manager_register_event_type( p_mi->p_event_manager,
libvlc_MediaPlayerTitleChanged, p_e );
libvlc_event_manager_register_event_type( p_mi->p_event_manager,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment