📄 lirc.c
字号:
} continue; } if( !strcmp( c, "RIGHT" ) ) { vlc_value_t val; val.psz_string = "RIGHT"; if (var_Set( p_vout, "key-pressed", val ) != VLC_SUCCESS) { msg_Warn( p_intf, "key-press failed" ); } continue; } if( !strcmp( c, "UP" ) ) { vlc_value_t val; val.psz_string = "UP"; if (var_Set( p_vout, "key-pressed", val ) != VLC_SUCCESS) { msg_Warn( p_intf, "key-press failed" ); } continue; } if( !strcmp( c, "DOWN" ) ) { vlc_value_t val; val.psz_string = "DOWN"; if (var_Set( p_vout, "key-pressed", val ) != VLC_SUCCESS) { msg_Warn( p_intf, "key-press failed" ); } continue; } } if( !strcmp( c, "PLAY" ) ) { p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE ); if( p_playlist ) { vlc_mutex_lock( &p_playlist->object_lock ); if( p_playlist->i_size ) { vlc_mutex_unlock( &p_playlist->object_lock ); playlist_Play( p_playlist ); vlc_object_release( p_playlist ); } } continue; } if( !strcmp( c, "PLAYPAUSE" ) ) { vlc_value_t val; val.i_int = PLAYING_S; if( p_input ) { var_Get( p_input, "state", &val ); } if( p_input && val.i_int != PAUSE_S ) { vout_OSDMessage( VLC_OBJECT(p_intf), _( "Pause" ) ); val.i_int = PAUSE_S; var_Set( p_input, "state", val ); } else { p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE ); if( p_playlist ) { vlc_mutex_lock( &p_playlist->object_lock ); if( p_playlist->i_size ) { vlc_mutex_unlock( &p_playlist->object_lock ); vout_OSDMessage( p_intf, _( "Play" ) ); playlist_Play( p_playlist ); vlc_object_release( p_playlist ); } } } continue; } else if( p_input ) { if( !strcmp( c, "AUDIO_TRACK" ) ) { vlc_value_t val,list,list2; int i_count, i; var_Get( p_input, "audio-es", &val ); var_Change( p_input, "audio-es", VLC_VAR_GETCHOICES, &list, &list2 ); i_count = list.p_list->i_count; for( i = 0; i < i_count; i++ ) { if( val.i_int == list.p_list->p_values[i].i_int ) { break; } } /* value of audio-es was not in choices list */ if( i == i_count ) { msg_Warn( p_input, "invalid current audio track, selecting 0" ); var_Set( p_input, "audio-es", list.p_list->p_values[0] ); i = 0; } else if( i == i_count - 1 ) { var_Set( p_input, "audio-es", list.p_list->p_values[0] ); i = 0; } else { var_Set( p_input, "audio-es", list.p_list->p_values[i+1] ); i = i + 1; } vout_OSDMessage( VLC_OBJECT(p_input), _("Audio track: %s"), list2.p_list->p_values[i].psz_string ); } else if( !strcmp( c, "SUBTITLE_TRACK" ) ) { vlc_value_t val,list,list2; int i_count, i; var_Get( p_input, "spu-es", &val ); var_Change( p_input, "spu-es", VLC_VAR_GETCHOICES, &list, &list2 ); i_count = list.p_list->i_count; for( i = 0; i < i_count; i++ ) { if( val.i_int == list.p_list->p_values[i].i_int ) { break; } } /* value of audio-es was not in choices list */ if( i == i_count ) { msg_Warn( p_input, "invalid current subtitle track, selecting 0" ); var_Set( p_input, "spu-es", list.p_list->p_values[0] ); i = 0; } else if( i == i_count - 1 ) { var_Set( p_input, "spu-es", list.p_list->p_values[0] ); i = 0; } else { var_Set( p_input, "spu-es", list.p_list->p_values[i+1] ); i = i + 1; } vout_OSDMessage( VLC_OBJECT(p_input), _("Subtitle track: %s"), list2.p_list->p_values[i].psz_string ); } else if( !strcmp( c, "PAUSE" ) ) { vlc_value_t val; vout_OSDMessage( p_intf, _( "Pause" ) ); val.i_int = PAUSE_S; var_Set( p_input, "state", val ); } else if( !strcmp( c, "NEXT" ) ) { p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE ); if( p_playlist ) { playlist_Next( p_playlist ); vlc_object_release( p_playlist ); } } else if( !strcmp( c, "PREV" ) ) { p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE ); if( p_playlist ) { playlist_Prev( p_playlist ); vlc_object_release( p_playlist ); } } else if( !strcmp( c, "STOP" ) ) { p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE ); if( p_playlist ) { playlist_Stop( p_playlist ); vlc_object_release( p_playlist ); } } else if( !strcmp( c, "FAST" ) ) { vlc_value_t val; val.b_bool = VLC_TRUE; var_Set( p_input, "rate-faster", val ); } else if( !strcmp( c, "SLOW" ) ) { vlc_value_t val; val.b_bool = VLC_TRUE; var_Set( p_input, "rate-slower", val ); }/* beginning of modifications by stephane Thu Jun 19 15:29:49 CEST 2003 */ else if ( !strcmp(c, "CHAPTER_N" ) || !strcmp( c, "CHAPTER_P" ) ) { unsigned int i_chapter = 0; if( !strcmp( c, "CHAPTER_N" ) ) { vlc_mutex_lock( &p_input->stream.stream_lock ); i_chapter = p_input->stream.p_selected_area->i_part + 1; vlc_mutex_unlock( &p_input->stream.stream_lock ); } else if( !strcmp( c, "CHAPTER_P" ) ) { vlc_mutex_lock( &p_input->stream.stream_lock ); i_chapter = p_input->stream.p_selected_area->i_part - 1; vlc_mutex_unlock( &p_input->stream.stream_lock ); } vlc_mutex_lock( &p_input->stream.stream_lock ); if( ( i_chapter > 0 ) && ( i_chapter < p_input->stream.p_selected_area->i_part_nb ) ) { input_area_t *p_area = p_input->stream.p_selected_area; p_input->stream.p_selected_area->i_part = i_chapter; vlc_mutex_unlock( &p_input->stream.stream_lock ); input_ChangeArea( p_input, p_area ); input_SetStatus( p_input, INPUT_STATUS_PLAY ); vlc_mutex_lock( &p_input->stream.stream_lock ); } vlc_mutex_unlock( &p_input->stream.stream_lock ); }/* end of modification by stephane Thu Jun 19 15:29:49 CEST 2003 */ } } free( code ); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -