⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rc.c

📁 video linux conference
💻 C
📖 第 1 页 / 共 4 页
字号:
        var_Set( p_input, "rate", val );        vlc_object_release( p_input );        return VLC_SUCCESS;    }    else if ( !strcmp( psz_cmd, "rewind" ) )    {        val.i_int = INPUT_RATE_MIN;        var_Set( p_input, "rate", val );        vlc_object_release( p_input );        return VLC_SUCCESS;    }    else if( !strcmp( psz_cmd, "chapter" ) ||             !strcmp( psz_cmd, "chapter_n" ) ||             !strcmp( psz_cmd, "chapter_p" ) )    {        if( !strcmp( psz_cmd, "chapter" ) )        {            if ( *newval.psz_string )            {                /* Set. */                val.i_int = atoi( newval.psz_string );                var_Set( p_input, "chapter", val );            }            else            {                vlc_value_t val_list;                /* Get. */                var_Get( p_input, "chapter", &val );                var_Change( p_input, "chapter", VLC_VAR_GETCHOICES,                            &val_list, NULL );                msg_rc( "Currently playing chapter %d/%d\n",                        val.i_int, val_list.p_list->i_count );                var_Change( p_this, "chapter", VLC_VAR_FREELIST,                            &val_list, NULL );            }        }        else if( !strcmp( psz_cmd, "chapter_n" ) )        {            val.b_bool = VLC_TRUE;            var_Set( p_input, "next-chapter", val );        }        else if( !strcmp( psz_cmd, "chapter_p" ) )        {            val.b_bool = VLC_TRUE;            var_Set( p_input, "prev-chapter", val );        }        vlc_object_release( p_input );        return VLC_SUCCESS;    }    else if( !strcmp( psz_cmd, "title" ) ||             !strcmp( psz_cmd, "title_n" ) ||             !strcmp( psz_cmd, "title_p" ) )    {        if( !strcmp( psz_cmd, "title" ) )        {            if ( *newval.psz_string )            {                /* Set. */                val.i_int = atoi( newval.psz_string );                var_Set( p_input, "title", val );            }            else            {                vlc_value_t val_list;                /* Get. */                var_Get( p_input, "title", &val );                var_Change( p_input, "title", VLC_VAR_GETCHOICES,                            &val_list, NULL );                msg_rc( "Currently playing title %d/%d\n",                        val.i_int, val_list.p_list->i_count );                var_Change( p_this, "title", VLC_VAR_FREELIST,                            &val_list, NULL );            }        }        else if( !strcmp( psz_cmd, "title_n" ) )        {            val.b_bool = VLC_TRUE;            var_Set( p_input, "next-title", val );        }        else if( !strcmp( psz_cmd, "title_p" ) )        {            val.b_bool = VLC_TRUE;            var_Set( p_input, "prev-title", val );        }        vlc_object_release( p_input );        return VLC_SUCCESS;    }    /* Never reached. */    return VLC_EGENERIC;}static int Playlist( vlc_object_t *p_this, char const *psz_cmd,                     vlc_value_t oldval, vlc_value_t newval, void *p_data ){    vlc_value_t val;    intf_thread_t *p_intf = (intf_thread_t*)p_this;    playlist_t *p_playlist;    p_playlist = vlc_object_find( p_this, VLC_OBJECT_PLAYLIST,                                           FIND_ANYWHERE );    if( !p_playlist )    {        return VLC_ENOOBJ;    }    /* Parse commands that require a playlist */    if( !strcmp( psz_cmd, "prev" ) )    {        playlist_Prev( p_playlist );    }    else if( !strcmp( psz_cmd, "next" ) )    {        playlist_Next( p_playlist );    }    else if( !strcmp( psz_cmd, "play" ) )    {        playlist_Play( p_playlist );    }    else if (!strcmp( psz_cmd, "goto" ) )    {        if( strlen( newval.psz_string ) > 0)         {            val.i_int = atoi( newval.psz_string );            playlist_Goto( p_playlist, val.i_int);         }    }    else if( !strcmp( psz_cmd, "stop" ) )    {        playlist_Stop( p_playlist );    }    else if( !strcmp( psz_cmd, "add" ) &&             newval.psz_string && *newval.psz_string )    {        playlist_item_t *p_item = parse_MRL( p_intf, newval.psz_string );        if( p_item )        {            msg_rc( "trying to add %s to playlist\n", newval.psz_string );            playlist_AddItem( p_playlist, p_item,                              PLAYLIST_GO|PLAYLIST_APPEND, PLAYLIST_END );        }    }    else if( !strcmp( psz_cmd, "playlist" ) )    {        int i;        for ( i = 0; i < p_playlist->i_size; i++ )        {            msg_rc( "|%s%s   %s|%s|\n", i == p_playlist->i_index ? "*" : " ",                    p_playlist->pp_items[i]->input.psz_name,                    p_playlist->pp_items[i]->input.psz_uri,                    p_playlist->pp_items[i]->i_parents > 0 ?                    p_playlist->pp_items[i]->pp_parents[0]->p_parent->input.psz_name : "" );        }        if ( i == 0 )        {            msg_rc( "| no entries\n" );        }    }     /*     * sanity check     */    else    {        msg_rc( "unknown command!\n" );    }    vlc_object_release( p_playlist );    return VLC_SUCCESS;}static int Other( vlc_object_t *p_this, char const *psz_cmd,                     vlc_value_t oldval, vlc_value_t newval, void *p_data ){    intf_thread_t *p_intf = (intf_thread_t*)p_this;    vlc_object_t *p_pl;    vlc_value_t     val;    vlc_object_t *p_inp;    p_pl = vlc_object_find( p_this, VLC_OBJECT_PLAYLIST,                                           FIND_ANYWHERE );    if( !p_pl )    {        return VLC_ENOOBJ;    }        p_inp = vlc_object_find( p_this, VLC_OBJECT_INPUT,                                           FIND_ANYWHERE );    if( !p_inp )    {        return VLC_ENOOBJ;    }    /* Parse miscellaneous commands */    if( !strcmp( psz_cmd, "marq-marquee" ) )    {        if( strlen( newval.psz_string ) > 0 )        {            val.psz_string = newval.psz_string;            var_Set( p_inp->p_libvlc, "marq-marquee", val );        }        else         {                val.psz_string = "";                var_Set( p_inp->p_libvlc, "marq-marquee", val);        }    }    else if( !strcmp( psz_cmd, "marq-x" ) )    {        if( strlen( newval.psz_string ) > 0)         {            val.i_int = atoi( newval.psz_string );            var_Set( p_inp->p_libvlc, "marq-x", val );        }    }    else if( !strcmp( psz_cmd, "marq-y" ) )    {        if( strlen( newval.psz_string ) > 0)         {            val.i_int = atoi( newval.psz_string );            var_Set( p_inp->p_libvlc, "marq-y", val );        }    }    else if( !strcmp( psz_cmd, "marq-position" ) )    {        if( strlen( newval.psz_string ) > 0)         {            val.i_int = atoi( newval.psz_string );            var_Set( p_inp->p_libvlc, "marq-position", val );        }    }    else if( !strcmp( psz_cmd, "marq-color" ) )    {        if( strlen( newval.psz_string ) > 0)         {            val.i_int = strtol( newval.psz_string, NULL, 0 );            var_Set( p_inp->p_libvlc, "marq-color", val );        }    }    else if( !strcmp( psz_cmd, "marq-opacity" ) )    {        if( strlen( newval.psz_string ) > 0)         {            val.i_int = strtol( newval.psz_string, NULL, 0 );            var_Set( p_inp->p_libvlc, "marq-opacity", val );        }    }    else if( !strcmp( psz_cmd, "marq-size" ) )    {        if( strlen( newval.psz_string ) > 0)         {            val.i_int = atoi( newval.psz_string );            var_Set( p_inp->p_libvlc, "marq-size", val );        }    }    else if( !strcmp( psz_cmd, "marq-timeout" ) )    {        if( strlen( newval.psz_string ) > 0)         {            val.i_int = atoi( newval.psz_string );            var_Set( p_inp, "marq-timeout", val );        }    }    else if( !strcmp( psz_cmd, "mosaic-alpha" ) )    {        if( strlen( newval.psz_string ) > 0)        {            val.i_int = atoi( newval.psz_string );            var_Set( p_inp->p_libvlc, "mosaic-alpha", val );        }    }    else if( !strcmp( psz_cmd, "mosaic-height" ) )    {        if( strlen( newval.psz_string ) > 0)        {            val.i_int = atoi( newval.psz_string );            var_Set( p_inp->p_libvlc, "mosaic-height", val );        }    }    else if( !strcmp( psz_cmd, "mosaic-width" ) )    {        if( strlen( newval.psz_string ) > 0)        {            val.i_int = atoi( newval.psz_string );            var_Set( p_inp->p_libvlc, "mosaic-width", val );        }    }    else if( !strcmp( psz_cmd, "mosaic-xoffset" ) )    {        if( strlen( newval.psz_string ) > 0)        {            val.i_int = atoi( newval.psz_string );            var_Set( p_inp->p_libvlc, "mosaic-xoffset", val );        }    }    else if( !strcmp( psz_cmd, "mosaic-yoffset" ) )    {        if( strlen( newval.psz_string ) > 0)        {            val.i_int = atoi( newval.psz_string );            var_Set( p_inp->p_libvlc, "mosaic-yoffset", val );        }    }    else if( !strcmp( psz_cmd, "mosaic-align" ) )    {        if( strlen( newval.psz_string ) > 0 )        {            val.i_int = atoi( newval.psz_string );            var_Set( p_inp->p_libvlc, "mosaic-align", val );        }    }    else if( !strcmp( psz_cmd, "mosaic-vborder" ) )    {        if( strlen( newval.psz_string ) > 0)        {            val.i_int = atoi( newval.psz_string );            var_Set( p_inp->p_libvlc, "mosaic-vborder", val );        }    }    else if( !strcmp( psz_cmd, "mosaic-hborder" ) )    {        if( strlen( newval.psz_string ) > 0)        {            val.i_int = atoi( newval.psz_string );            var_Set( p_inp->p_libvlc, "mosaic-hborder", val );        }    }    else if( !strcmp( psz_cmd, "mosaic-position" ) )    {        if( strlen( newval.psz_string ) > 0)        {            val.i_int = atoi( newval.psz_string );            var_Set( p_inp->p_libvlc, "mosaic-position", val );        }    }    else if( !strcmp( psz_cmd, "mosaic-rows" ) )    {        if( strlen( newval.psz_string ) > 0)        {            val.i_int = atoi( newval.psz_string );            var_Set( p_inp->p_libvlc, "mosaic-rows", val );        }    }    else if( !strcmp( psz_cmd, "mosaic-cols" ) )    {        if( strlen( newval.psz_string ) > 0)        {            val.i_int = atoi( newval.psz_string );            var_Set( p_inp->p_libvlc, "mosaic-cols", val );        }    }    else if( !strcmp( psz_cmd, "mosaic-keep-aspect-ratio" ) )    {        if( strlen( newval.psz_string ) > 0)        {            val.i_int = atoi( newval.psz_string );            var_Set( p_inp->p_libvlc, "mosaic-keep-aspect-ratio", val );        }    }    else if( !strcmp( psz_cmd, "time-format" ) )    {        if( strlen( newval.psz_string ) > 0 )        {            val.psz_string = newval.psz_string;            var_Set( p_inp->p_libvlc, "time-format", val );        }        else         {                val.psz_string = "";                var_Set( p_inp->p_libvlc, "time-format", val);        }    }    else if( !strcmp( psz_cmd, "time-x" ) )    {        if( strlen( newval.psz_string ) > 0)         {            val.i_int = atoi( newval.psz_string );            var_Set( p_inp->p_libvlc, "time-x", val );        }    }    else if( !strcmp( psz_cmd, "time-y" ) )    {        if( strlen( newval.psz_string ) > 0)         {            val.i_int = atoi( newval.psz_string );            var_Set( p_inp->p_libvlc, "time-y", val );        }    }    else if( !strcmp( psz_cmd, "time-position" ) )    {        if( strlen( newval.psz_string ) > 0)         {            val.i_int = atoi( newval.psz_string );            var_Set( p_inp->p_libvlc, "time-position", val );        }    }    else if( !strcmp( psz_cmd, "time-color" ) )    {        if( strlen( newval.psz_string ) > 0)         {            val.i_int = strtol( newval.psz_string, NULL, 0 );            var_Set( p_inp->p_libvlc, "time-color", val );        }    }    else if( !strcmp( psz_cmd, "time-opacity" ) )    {        if( strlen( newval.psz_string ) > 0)         {            val.i_int = strtol( newval.psz_string, NULL, 0 );            var_Set( p_inp->p_libvlc, "time-opacity", val );        }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -