コード例 #1
0
ファイル: FBVLC.cpp プロジェクト: zhaoxiaohui/fbvlc
void FBVLC::process_startup_options()
{
    typedef boost::optional<std::string> param_type;
    typedef const FB::variant&           param_vtype;

    vlc_player_options& opts = get_options();

    param_vtype mute            = getParamVariant("mute");
    if ( !mute.empty() && mute.can_be_type<bool>() )
        get_player().audio().set_mute( mute.convert_cast<bool>() );

    param_vtype loop            = getParamVariant("loop");
    param_vtype autoloop        = getParamVariant("autoloop");
    bool set_loop = false;
    if ( !loop.empty() && loop.can_be_type<bool>() )
        set_loop = loop.convert_cast<bool>();
    if ( !autoloop.empty() && autoloop.can_be_type<bool>() )
        set_loop = autoloop.convert_cast<bool>();
    get_player().set_playback_mode( set_loop ?
                                    vlc::mode_loop :
                                    vlc::mode_normal );

    param_type target           = getParam("target");
    param_type mrl              = getParam("mrl");
    param_type filename         = getParam("filename");
    param_type src              = getParam("src");
    std::string set_mrl;
    if ( target )
        set_mrl = *target;
    if ( mrl )
        set_mrl = *mrl;
    if ( filename )
        set_mrl = *filename;
    if ( src )
        set_mrl = *src;
    if( !set_mrl.empty() ) {
        int item = add_playlist_item( set_mrl.c_str() );
        if ( opts.get_autoplay() )
            get_player().play(item);
    }
}
コード例 #2
0
ファイル: Chimera.cpp プロジェクト: RSATom/WebChimera
void Chimera::loadStartupOptions()
{
    typedef boost::optional<std::string> param_type;
    typedef const FB::variant&           param_vtype;

    vlc_player_options& opts = get_options();

    param_vtype autoplay  = getParamVariant( "autoplay" );
    param_vtype autostart = getParamVariant( "autostart" );

    if ( !autoplay.empty() && autoplay.can_be_type<bool>() )
        opts.set_autoplay( autoplay.convert_cast<bool>() );
    if ( !autostart.empty() && autostart.can_be_type<bool>() )
        opts.set_autoplay( autostart.convert_cast<bool>() );

    param_vtype fs         = getParamVariant( "fullscreen" );
    param_vtype allowfs    = getParamVariant( "allowfullscreen" );
    param_vtype allowfs2   = getParamVariant( "allow-fullscreen" );
    param_vtype fsenabled  = getParamVariant( "fullscreenenabled" );
    param_vtype fsenabled2 = getParamVariant( "fullscreen-enabled" );
    if ( !fs.empty() && fs.can_be_type<bool>() )
        opts.set_enable_fs( fs.convert_cast<bool>() );
    if ( !allowfs.empty() && allowfs.can_be_type<bool>() )
        opts.set_enable_fs( allowfs.convert_cast<bool>() );
    if ( !allowfs2.empty() && allowfs2.can_be_type<bool>() )
        opts.set_enable_fs( allowfs2.convert_cast<bool>() );
    if ( !fsenabled.empty() && fsenabled.can_be_type<bool>() )
        opts.set_enable_fs( fsenabled.convert_cast<bool>() );
    if ( !fsenabled2.empty() && fsenabled2.can_be_type<bool>() )
        opts.set_enable_fs( fsenabled2.convert_cast<bool>() );

    param_type bgcolor = getParam( "bgcolor" );
    if ( bgcolor )
        opts.set_bg_color( *bgcolor );

    param_vtype use_proxy = getParamVariant( "use-proxy" );
    if ( !use_proxy.empty() && use_proxy.can_be_type<bool>() )
        opts.set_use_proxy( use_proxy.convert_cast<bool>() );
}
コード例 #3
0
ファイル: Chimera.cpp プロジェクト: RSATom/WebChimera
void Chimera::loadLibvlcOptions()
{
    typedef boost::optional<std::string> param_type;
    typedef const FB::variant&           param_vtype;

    QmlVlcConfig& config = QmlVlcConfig::instance();

    param_vtype network_caching = getParamVariant( "network-caching" );
    if( !network_caching.empty() && network_caching.can_be_type<int>() ) {
        config.setNetworkCacheTime( network_caching.convert_cast<int>( ) );
    };

    param_vtype adjust = getParamVariant( "adjust-filter" );
    if( !adjust.empty() && adjust.can_be_type<bool>() && adjust.convert_cast<bool>( ) ) {
        config.enableAdjustFilter( true );
    }

    param_vtype marq = getParamVariant( "marquee-filter" );
    if( !marq.empty() && marq.can_be_type<bool>() && marq.convert_cast<bool>( ) ) {
        config.enableMarqueeFilter( true );
    }

    param_vtype logo = getParamVariant( "logo-filter" );
    if( !logo.empty() && logo.can_be_type<bool>() && logo.convert_cast<bool>( ) ) {
        config.enableLogoFilter( true );
    }

    param_vtype debug = getParamVariant( "debug" );
    if( !debug.empty() && debug.can_be_type<bool>() && debug.convert_cast<bool>( ) ) {
        config.enableDebug( true );
    }

    param_vtype hw_accel = getParamVariant( "hw-accel" );
    if( !hw_accel.empty() && hw_accel.can_be_type<bool>() && hw_accel.convert_cast<bool>( ) ) {
        config.enableHardwareAcceleration( true );
    }

    config.enableNoVideoTitleShow( true );
}
コード例 #4
0
ファイル: FBVLC.cpp プロジェクト: zhaoxiaohui/fbvlc
void FBVLC::init_vlc_player_options()
{
    typedef boost::optional<std::string> param_type;
    typedef const FB::variant&           param_vtype;

    vlc_player_options& opts = get_options();

    param_vtype autoplay        = getParamVariant("autoplay");
    param_vtype autostart       = getParamVariant("autostart");

    if ( !autoplay.empty() && autoplay.can_be_type<bool>() )
        opts.set_autoplay( autoplay.convert_cast<bool>() );
    if ( !autostart.empty() && autostart.can_be_type<bool>() )
        opts.set_autoplay( autostart.convert_cast<bool>() );

    param_vtype fs              = getParamVariant("fullscreen");
    param_vtype allowfs         = getParamVariant("allowfullscreen");
    param_vtype allowfs2        = getParamVariant("allow-fullscreen");
    param_vtype fsenabled       = getParamVariant("fullscreenenabled");
    param_vtype fsenabled2      = getParamVariant("fullscreen-enabled");
    if ( !fs.empty() && fs.can_be_type<bool>() )
        opts.set_enable_fs( fs.convert_cast<bool>() );
    if ( !allowfs.empty() && allowfs.can_be_type<bool>() )
        opts.set_enable_fs( allowfs.convert_cast<bool>() );
    if ( !allowfs2.empty() && allowfs2.can_be_type<bool>() )
        opts.set_enable_fs( allowfs2.convert_cast<bool>() );
    if ( !fsenabled.empty() && fsenabled.can_be_type<bool>() )
        opts.set_enable_fs( fsenabled.convert_cast<bool>() );
    if ( !fsenabled2.empty() && fsenabled2.can_be_type<bool>() )
        opts.set_enable_fs( fsenabled2.convert_cast<bool>() );

    param_vtype toolbar         = getParamVariant("toolbar");
    if ( !toolbar.empty() && toolbar.can_be_type<bool>() )
        opts.set_show_toolbar( toolbar.convert_cast<bool>() );

    param_vtype fs_toolbar      = getParamVariant("fullscreen-toolbar");
    if ( !fs_toolbar.empty() && fs_toolbar.can_be_type<bool>() )
        opts.set_show_fs_toolbar( fs_toolbar.convert_cast<bool>() );

#ifdef XP_WIN
    param_vtype native_scaling  = getParamVariant("native-scaling");
    if ( !native_scaling.empty() && native_scaling.can_be_type<bool>() )
        opts.set_native_scaling ( native_scaling.convert_cast<bool>() );
#endif

    param_type bgcolor          = getParam("bgcolor");
    if ( bgcolor )
        opts.set_bg_color( *bgcolor );

    param_vtype use_proxy = getParamVariant("use-proxy");
    if ( !use_proxy.empty() && use_proxy.can_be_type<bool>() )
        opts.set_use_proxy( use_proxy.convert_cast<bool>() );
}