Commit 43a486b5 authored by Jean-Paul Saman's avatar Jean-Paul Saman

Make distinction between stop and ended status.

parent 13706670
...@@ -52,9 +52,10 @@ typedef enum libvlc_event_type_t { ...@@ -52,9 +52,10 @@ typedef enum libvlc_event_type_t {
libvlc_MediaPlayerBuffering, libvlc_MediaPlayerBuffering,
libvlc_MediaPlayerPlaying, libvlc_MediaPlayerPlaying,
libvlc_MediaPlayerPaused, libvlc_MediaPlayerPaused,
libvlc_MediaPlayerEndReached, libvlc_MediaPlayerStopped,
libvlc_MediaPlayerForward, libvlc_MediaPlayerForward,
libvlc_MediaPlayerBackward, libvlc_MediaPlayerBackward,
libvlc_MediaPlayerEndReached,
libvlc_MediaPlayerEncounteredError, libvlc_MediaPlayerEncounteredError,
libvlc_MediaPlayerTimeChanged, libvlc_MediaPlayerTimeChanged,
libvlc_MediaPlayerPositionChanged, libvlc_MediaPlayerPositionChanged,
......
...@@ -125,7 +125,7 @@ typedef struct libvlc_media_player_t libvlc_media_player_t; ...@@ -125,7 +125,7 @@ typedef struct libvlc_media_player_t libvlc_media_player_t;
* *
* Expected states by web plugins are: * Expected states by web plugins are:
* IDLE/CLOSE=0, OPENING=1, BUFFERING=2, PLAYING=3, PAUSED=4, * IDLE/CLOSE=0, OPENING=1, BUFFERING=2, PLAYING=3, PAUSED=4,
* STOPPING=5, FORWARD=6, BACKWARD=7, ERROR=8 * STOPPING=5, FORWARD=6, BACKWARD=7, ENDED=8, ERROR=9
*/ */
typedef enum libvlc_state_t typedef enum libvlc_state_t
{ {
...@@ -134,9 +134,10 @@ typedef enum libvlc_state_t ...@@ -134,9 +134,10 @@ typedef enum libvlc_state_t
libvlc_Buffering, libvlc_Buffering,
libvlc_Playing, libvlc_Playing,
libvlc_Paused, libvlc_Paused,
libvlc_Ended, libvlc_Stopped,
libvlc_Forward, libvlc_Forward,
libvlc_Backward, libvlc_Backward,
libvlc_Ended,
libvlc_Error libvlc_Error
} libvlc_state_t; } libvlc_state_t;
......
...@@ -68,9 +68,9 @@ typedef enum { ...@@ -68,9 +68,9 @@ typedef enum {
typedef enum { typedef enum {
mediacontrol_UndefinedStatus=0, mediacontrol_InitStatus, mediacontrol_UndefinedStatus=0, mediacontrol_InitStatus,
mediacontrol_BufferingStatus, mediacontrol_PlayingStatus, mediacontrol_BufferingStatus, mediacontrol_PlayingStatus,
mediacontrol_PauseStatus, mediacontrol_EndStatus, mediacontrol_PauseStatus, mediacontrol_StopStatus,
mediacontrol_ForwardStatus, mediacontrol_BackwardStatus, mediacontrol_ForwardStatus, mediacontrol_BackwardStatus,
mediacontrol_ErrorStatus, mediacontrol_EndStatus, mediacontrol_ErrorStatus,
} mediacontrol_PlayerStatus; } mediacontrol_PlayerStatus;
/** /**
......
...@@ -532,9 +532,10 @@ enum input_state_e ...@@ -532,9 +532,10 @@ enum input_state_e
BUFFERING_S, BUFFERING_S,
PLAYING_S, PLAYING_S,
PAUSE_S, PAUSE_S,
END_S, STOP_S,
FORWARD_S, FORWARD_S,
BACKWARD_S, BACKWARD_S,
END_S,
ERROR_S ERROR_S
}; };
......
...@@ -949,7 +949,7 @@ static int StateChange( vlc_object_t *p_this, const char* psz_var, ...@@ -949,7 +949,7 @@ static int StateChange( vlc_object_t *p_this, const char* psz_var,
} }
if( newval.i_int == PLAYING_S || newval.i_int == PAUSE_S || 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 ); StatusChangeSignal( p_sys->p_conn, (void*) p_intf );
} }
......
...@@ -1558,6 +1558,10 @@ static void Redraw( intf_thread_t *p_intf, time_t *t_last_refresh ) ...@@ -1558,6 +1558,10 @@ static void Redraw( intf_thread_t *p_intf, time_t *t_last_refresh )
{ {
mvnprintw( y++, 0, COLS, _(" State : Playing %s"), psz_state ); mvnprintw( y++, 0, COLS, _(" State : Playing %s"), psz_state );
} }
else if( val.i_int == STOP_S )
{
mvnprintw( y++, 0, COLS, _(" State : Stopped %s"), psz_state );
}
else if( val.i_int == OPENING_S ) else if( val.i_int == OPENING_S )
{ {
mvnprintw( y++, 0, COLS, _(" State : Opening/Connecting %s"), psz_state ); mvnprintw( y++, 0, COLS, _(" State : Opening/Connecting %s"), psz_state );
......
...@@ -244,9 +244,10 @@ static const char event_type_to_name[][35] = ...@@ -244,9 +244,10 @@ static const char event_type_to_name[][35] =
EVENT(libvlc_MediaPlayerBuffering), EVENT(libvlc_MediaPlayerBuffering),
EVENT(libvlc_MediaPlayerPlaying), EVENT(libvlc_MediaPlayerPlaying),
EVENT(libvlc_MediaPlayerPaused), EVENT(libvlc_MediaPlayerPaused),
EVENT(libvlc_MediaPlayerEndReached), EVENT(libvlc_MediaPlayerStopped),
EVENT(libvlc_MediaPlayerForward), EVENT(libvlc_MediaPlayerForward),
EVENT(libvlc_MediaPlayerBackward), EVENT(libvlc_MediaPlayerBackward),
EVENT(libvlc_MediaPlayerEndReached),
EVENT(libvlc_MediaPlayerTimeChanged), EVENT(libvlc_MediaPlayerTimeChanged),
EVENT(libvlc_MediaPlayerPositionChanged), EVENT(libvlc_MediaPlayerPositionChanged),
EVENT(libvlc_MediaPlayerSeekableChanged), EVENT(libvlc_MediaPlayerSeekableChanged),
......
...@@ -56,9 +56,10 @@ static const libvlc_state_t vlc_to_libvlc_state_array[] = ...@@ -56,9 +56,10 @@ static const libvlc_state_t vlc_to_libvlc_state_array[] =
[BUFFERING_S] = libvlc_Buffering, [BUFFERING_S] = libvlc_Buffering,
[PLAYING_S] = libvlc_Playing, [PLAYING_S] = libvlc_Playing,
[PAUSE_S] = libvlc_Paused, [PAUSE_S] = libvlc_Paused,
[END_S] = libvlc_Ended, [STOP_S] = libvlc_Stopped,
[FORWARD_S] = libvlc_Forward, [FORWARD_S] = libvlc_Forward,
[BACKWARD_S] = libvlc_Backward, [BACKWARD_S] = libvlc_Backward,
[END_S] = libvlc_Ended,
[ERROR_S] = libvlc_Error, [ERROR_S] = libvlc_Error,
}; };
...@@ -166,9 +167,9 @@ input_state_changed( const vlc_event_t * event, void * p_userdata ) ...@@ -166,9 +167,9 @@ input_state_changed( const vlc_event_t * event, void * p_userdata )
libvlc_media_set_state( p_mi->p_md, libvlc_Paused, NULL); libvlc_media_set_state( p_mi->p_md, libvlc_Paused, NULL);
forwarded_event.type = libvlc_MediaPlayerPaused; forwarded_event.type = libvlc_MediaPlayerPaused;
break; break;
case END_S: case STOP_S:
libvlc_media_set_state( p_mi->p_md, libvlc_Ended, NULL); libvlc_media_set_state( p_mi->p_md, libvlc_Stopped, NULL);
forwarded_event.type = libvlc_MediaPlayerEndReached; forwarded_event.type = libvlc_MediaPlayerStopped;
break; break;
case FORWARD_S: case FORWARD_S:
libvlc_media_set_state( p_mi->p_md, libvlc_Forward, NULL); libvlc_media_set_state( p_mi->p_md, libvlc_Forward, NULL);
...@@ -178,6 +179,9 @@ input_state_changed( const vlc_event_t * event, void * p_userdata ) ...@@ -178,6 +179,9 @@ input_state_changed( const vlc_event_t * event, void * p_userdata )
libvlc_media_set_state( p_mi->p_md, libvlc_Backward, NULL); libvlc_media_set_state( p_mi->p_md, libvlc_Backward, NULL);
forwarded_event.type = libvlc_MediaPlayerBackward; forwarded_event.type = libvlc_MediaPlayerBackward;
break; break;
case END_S:
libvlc_media_set_state( p_mi->p_md, libvlc_Ended, NULL);
forwarded_event.type = libvlc_MediaPlayerEndReached;
case ERROR_S: case ERROR_S:
libvlc_media_set_state( p_mi->p_md, libvlc_Error, NULL); libvlc_media_set_state( p_mi->p_md, libvlc_Error, NULL);
forwarded_event.type = libvlc_MediaPlayerEncounteredError; forwarded_event.type = libvlc_MediaPlayerEncounteredError;
...@@ -350,11 +354,13 @@ libvlc_media_player_new( libvlc_instance_t * p_libvlc_instance, ...@@ -350,11 +354,13 @@ libvlc_media_player_new( libvlc_instance_t * p_libvlc_instance,
libvlc_event_manager_register_event_type( p_mi->p_event_manager, libvlc_event_manager_register_event_type( p_mi->p_event_manager,
libvlc_MediaPlayerPaused, p_e ); libvlc_MediaPlayerPaused, p_e );
libvlc_event_manager_register_event_type( p_mi->p_event_manager, libvlc_event_manager_register_event_type( p_mi->p_event_manager,
libvlc_MediaPlayerEndReached, p_e ); libvlc_MediaPlayerStopped, p_e );
libvlc_event_manager_register_event_type( p_mi->p_event_manager, libvlc_event_manager_register_event_type( p_mi->p_event_manager,
libvlc_MediaPlayerForward, p_e ); libvlc_MediaPlayerForward, p_e );
libvlc_event_manager_register_event_type( p_mi->p_event_manager, libvlc_event_manager_register_event_type( p_mi->p_event_manager,
libvlc_MediaPlayerBackward, p_e ); libvlc_MediaPlayerBackward, p_e );
libvlc_event_manager_register_event_type( p_mi->p_event_manager,
libvlc_MediaPlayerEndReached, p_e );
libvlc_event_manager_register_event_type( p_mi->p_event_manager, libvlc_event_manager_register_event_type( p_mi->p_event_manager,
libvlc_MediaPlayerEncounteredError, p_e ); libvlc_MediaPlayerEncounteredError, p_e );
......
...@@ -376,8 +376,8 @@ mediacontrol_get_stream_information( mediacontrol_Instance *self, ...@@ -376,8 +376,8 @@ mediacontrol_get_stream_information( mediacontrol_Instance *self,
case libvlc_Paused: case libvlc_Paused:
retval->streamstatus = mediacontrol_PauseStatus; retval->streamstatus = mediacontrol_PauseStatus;
break; break;
case libvlc_Ended: case libvlc_Stopped:
retval->streamstatus = mediacontrol_EndStatus; retval->streamstatus = mediacontrol_StopStatus;
break; break;
case libvlc_Forward: case libvlc_Forward:
retval->streamstatus = mediacontrol_ForwardStatus; retval->streamstatus = mediacontrol_ForwardStatus;
...@@ -385,6 +385,9 @@ mediacontrol_get_stream_information( mediacontrol_Instance *self, ...@@ -385,6 +385,9 @@ mediacontrol_get_stream_information( mediacontrol_Instance *self,
case libvlc_Backward: case libvlc_Backward:
retval->streamstatus = mediacontrol_BackwardStatus; retval->streamstatus = mediacontrol_BackwardStatus;
break; break;
case libvlc_Ended:
retval->streamstatus = mediacontrol_EndStatus;
break;
case libvlc_Error: case libvlc_Error:
retval->streamstatus = mediacontrol_ErrorStatus; retval->streamstatus = mediacontrol_ErrorStatus;
break; break;
......
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