当前位置: 首页>>代码示例>>C++>>正文


C++ CmdGenericPtr函数代码示例

本文整理汇总了C++中CmdGenericPtr函数的典型用法代码示例。如果您正苦于以下问题:C++ CmdGenericPtr函数的具体用法?C++ CmdGenericPtr怎么用?C++ CmdGenericPtr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了CmdGenericPtr函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: CmdChangeSkin

/// Callback called when a new skin is chosen
void Dialogs::showChangeSkinCB( intf_dialog_args_t *pArg )
{
    intf_thread_t *pIntf = (intf_thread_t *)pArg->p_arg;

    if( pArg->i_results )
    {
        if( pArg->psz_results[0] )
        {
            // Create a change skin command
            CmdChangeSkin *pCmd =
                new CmdChangeSkin( pIntf, sFromLocale( pArg->psz_results[0] ) );

            // Push the command in the asynchronous command queue
            AsyncQueue *pQueue = AsyncQueue::instance( pIntf );
            pQueue->push( CmdGenericPtr( pCmd ) );
        }
    }
    else if( !pIntf->p_sys->p_theme )
    {
        // If no theme is already loaded, it's time to quit!
        CmdQuit *pCmd = new CmdQuit( pIntf );
        AsyncQueue *pQueue = AsyncQueue::instance( pIntf );
        pQueue->push( CmdGenericPtr( pCmd ) );
    }
}
开发者ID:AsamQi,项目名称:vlc,代码行数:26,代码来源:dialogs.cpp

示例2: onTaskBarChange

/// Callback for the systray configuration option
static int onTaskBarChange( vlc_object_t *pObj, const char *pVariable,
                            vlc_value_t oldVal, vlc_value_t newVal,
                            void *pParam )
{
    intf_thread_t *pIntf;

    vlc_mutex_lock( &skin_load.mutex );
    pIntf = skin_load.intf;
    if( pIntf )
        vlc_object_hold( pIntf );
    vlc_mutex_unlock( &skin_load.mutex );

    if( pIntf == NULL )
    {
        return VLC_EGENERIC;
    }

    AsyncQueue *pQueue = AsyncQueue::instance( pIntf );
    if( newVal.b_bool )
    {
        CmdAddInTaskBar *pCmd = new CmdAddInTaskBar( pIntf );
        pQueue->push( CmdGenericPtr( pCmd ) );
    }
    else
    {
        CmdRemoveFromTaskBar *pCmd = new CmdRemoveFromTaskBar( pIntf );
        pQueue->push( CmdGenericPtr( pCmd ) );
    }

    vlc_object_release( pIntf );
    return VLC_SUCCESS;
}
开发者ID:FLYKingdom,项目名称:vlc,代码行数:33,代码来源:skin_main.cpp

示例3: WindowControl

static int WindowControl( vout_window_t *pWnd, int query, va_list args )
{
    vout_window_sys_t* sys = pWnd->sys;
    intf_thread_t *pIntf = sys->pIntf;
    AsyncQueue *pQueue = AsyncQueue::instance( pIntf );

    switch( query )
    {
        case VOUT_WINDOW_SET_SIZE:
        {
            unsigned int i_width  = va_arg( args, unsigned int );
            unsigned int i_height = va_arg( args, unsigned int );

            if( i_width && i_height )
            {
                // Post a vout resize command
                CmdResizeVout *pCmd =
                    new CmdResizeVout( pIntf, pWnd,
                                       (int)i_width, (int)i_height );
                pQueue->push( CmdGenericPtr( pCmd ) );
            }
            return VLC_EGENERIC;
        }

        case VOUT_WINDOW_SET_FULLSCREEN:
        {
            bool b_fullscreen = va_arg( args, int );

            // Post a set fullscreen command
            CmdSetFullscreen* pCmd =
                new CmdSetFullscreen( pIntf, pWnd, b_fullscreen );
            pQueue->push( CmdGenericPtr( pCmd ) );
            return VLC_SUCCESS;
        }

        case VOUT_WINDOW_SET_STATE:
        {
            unsigned i_arg = va_arg( args, unsigned );
            unsigned on_top = i_arg & VOUT_WINDOW_STATE_ABOVE;

            // Post a SetOnTop command
            CmdSetOnTop* pCmd =
                new CmdSetOnTop( pIntf, on_top );
            pQueue->push( CmdGenericPtr( pCmd ) );
            return VLC_SUCCESS;
        }

        default:
            msg_Dbg( pIntf, "control query not supported" );
            return VLC_EGENERIC;
    }
}
开发者ID:vlcchina,项目名称:vlc-player-experimental,代码行数:52,代码来源:skin_main.cpp

示例4: Close

//---------------------------------------------------------------------------
// Close: destroy interface
//---------------------------------------------------------------------------
static void Close( vlc_object_t *p_this )
{
    intf_thread_t *p_intf = (intf_thread_t *)p_this;

    msg_Dbg( p_intf, "closing skins2 module" );

    /* Terminate input to ensure that our window provider is released. */
    playlist_Deactivate( p_intf->p_sys->p_playlist );

    vlc_mutex_lock( &skin_load.mutex );
    skin_load.intf = NULL;
    vlc_mutex_unlock( &skin_load.mutex);

    AsyncQueue *pQueue = p_intf->p_sys->p_queue;
    if( pQueue )
    {
        CmdGeneric *pCmd = new CmdExitLoop( p_intf );
        if( pCmd )
            pQueue->push( CmdGenericPtr( pCmd ) );
    }
    else
    {
        msg_Err( p_intf, "thread found already stopped (weird!)" );
    }

    vlc_join( p_intf->p_sys->thread, NULL );

    vlc_mutex_destroy( &p_intf->p_sys->init_lock );
    vlc_cond_destroy( &p_intf->p_sys->init_wait );

    // Destroy structure
    free( p_intf->p_sys );
}
开发者ID:371816210,项目名称:vlc_vlc,代码行数:36,代码来源:skin_main.cpp

示例5: getFullscreenVar

void VlcProc::on_intf_show_changed( vlc_object_t* p_obj, vlc_value_t newVal )
{
    (void)p_obj; (void)newVal;
    bool b_fullscreen = getFullscreenVar().get();

    if( !b_fullscreen )
    {
        if( newVal.b_bool )
        {
            // Create a raise all command
            CmdRaiseAll *pCmd = new CmdRaiseAll( getIntf(),
                getIntf()->p_sys->p_theme->getWindowManager() );

            // Push the command in the asynchronous command queue
            AsyncQueue *pQueue = AsyncQueue::instance( getIntf() );
            pQueue->push( CmdGenericPtr( pCmd ) );
        }
    }
    else
    {
        VoutManager* pVoutManager =  VoutManager::instance( getIntf() );
        FscWindow *pWin = pVoutManager->getFscWindow();
        if( pWin )
        {
            bool b_visible = pWin->getVisibleVar().get();
            AsyncQueue *pQueue = AsyncQueue::instance( getIntf() );

            if( !b_visible )
            {
               CmdShowWindow* pCmd = new CmdShowWindow( getIntf(),
                             getIntf()->p_sys->p_theme->getWindowManager(),
                             *pWin );
               pQueue->push( CmdGenericPtr( pCmd ) );
            }
            else
            {
               CmdHideWindow* pCmd = new CmdHideWindow( getIntf(),
                              getIntf()->p_sys->p_theme->getWindowManager(),
                              *pWin );
               pQueue->push( CmdGenericPtr( pCmd ) );
            }
        }
    }
}
开发者ID:RodrigoNieves,项目名称:vlc,代码行数:44,代码来源:vlcproc.cpp

示例6: CmdInteraction

int VlcProc::onInteraction( vlc_object_t *pObj, const char *pVariable,
                            vlc_value_t oldVal, vlc_value_t newVal,
                            void *pParam )
{
    VlcProc *pThis = (VlcProc*)pParam;
    interaction_dialog_t *p_dialog = (interaction_dialog_t *)(newVal.p_address);

    CmdInteraction *pCmd = new CmdInteraction( pThis->getIntf(), p_dialog );
    AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
    pQueue->push( CmdGenericPtr( pCmd ) );
    return VLC_SUCCESS;
}
开发者ID:banketree,项目名称:faplayer,代码行数:12,代码来源:vlcproc.cpp

示例7: getIntf

void CmdUpdateItem::execute()
{
    playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
    if( pPlaylist == NULL )
        return;

    input_thread_t *p_input = playlist_CurrentInput( pPlaylist );
    if( !p_input )
        return;

    // Get playlist item information
    input_item_t *pItem = input_GetItem( p_input );

    char *pszName = input_item_GetName( pItem );
    char *pszUri = input_item_GetURI( pItem );

    string name = pszName;
    // XXX: This should be done in VLC core, not here...
    // Remove path information if any
    OSFactory *pFactory = OSFactory::instance( getIntf() );
    string::size_type pos = name.rfind( pFactory->getDirSeparator() );
    if( pos != string::npos )
    {
        name = name.substr( pos + 1, name.size() - pos + 1 );
    }
    UString srcName( getIntf(), name.c_str() );
    UString srcURI( getIntf(), pszUri );

    free( pszName );
    free( pszUri );

    // Create commands to update the stream variables
    CmdSetText *pCmd1 = new CmdSetText( getIntf(), m_rStreamName, srcName );
    CmdSetText *pCmd2 = new CmdSetText( getIntf(), m_rStreamURI, srcURI );
    // Push the commands in the asynchronous command queue
    AsyncQueue *pQueue = AsyncQueue::instance( getIntf() );
    pQueue->push( CmdGenericPtr( pCmd1 ), false );
    pQueue->push( CmdGenericPtr( pCmd2 ), false );
    vlc_object_release( p_input );
}
开发者ID:FLYKingdom,项目名称:vlc,代码行数:40,代码来源:cmd_update_item.cpp

示例8: WindowClose

static void WindowClose( vout_window_t *pWnd )
{
    vout_window_sys_t* sys = pWnd->sys;
    intf_thread_t *pIntf = sys->pIntf;

    // force execution in the skins2 thread context
    CmdExecuteBlock* cmd = new CmdExecuteBlock( pIntf, VLC_OBJECT( pWnd ),
                                                WindowCloseLocal );
    CmdExecuteBlock::executeWait( CmdGenericPtr( cmd ) );

    vlc_object_release( sys->pIntf );
    free( sys );
}
开发者ID:vlcchina,项目名称:vlc-player-experimental,代码行数:13,代码来源:skin_main.cpp

示例9: switch

int VlcProc::onGenericCallback2( vlc_object_t *pObj, const char *pVariable,
                                 vlc_value_t oldVal, vlc_value_t newVal,
                                 void *pParam )
{
    (void)oldVal;
    VlcProc *pThis = (VlcProc*)pParam;
    AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );

    /**
     * For intf-event, commands are labeled based on the value of newVal.
     *
     * For some values (e.g position), only keep the latest command
     * when there are multiple pending commands (remove=true).
     *
     * for others, don't discard commands (remove=false)
     **/
    if( strcmp( pVariable, "intf-event" ) == 0 )
    {
        stringstream label;
        bool b_remove;
        switch( newVal.i_int )
        {
            case INPUT_EVENT_STATE:
            case INPUT_EVENT_POSITION:
            case INPUT_EVENT_RATE:
            case INPUT_EVENT_ES:
            case INPUT_EVENT_CHAPTER:
            case INPUT_EVENT_RECORD:
                b_remove = true;
                break;
            case INPUT_EVENT_VOUT:
            case INPUT_EVENT_AOUT:
            case INPUT_EVENT_DEAD:
                b_remove = false;
                break;
            default:
                return VLC_SUCCESS;
        }
        label <<  pVariable << "_" << newVal.i_int;
        CmdGeneric *pCmd = new CmdCallback( pThis->getIntf(), pObj, newVal,
                                            &VlcProc::on_intf_event_changed,
                                            label.str() );
        if( pCmd )
            pQueue->push( CmdGenericPtr( pCmd ), b_remove );

        return VLC_SUCCESS;
    }

    msg_Err( pThis->getIntf(), "no callback entry for %s", pVariable );
    return VLC_EGENERIC;
}
开发者ID:RodrigoNieves,项目名称:vlc,代码行数:51,代码来源:vlcproc.cpp

示例10: WindowOpen

static int WindowOpen( vout_window_t *pWnd, const vout_window_cfg_t *cfg )
{
    vout_window_sys_t* sys;

    vlc_mutex_lock( &skin_load.mutex );
    intf_thread_t *pIntf = skin_load.intf;
    if( pIntf )
        vlc_object_hold( pIntf );
    vlc_mutex_unlock( &skin_load.mutex );

    if( pIntf == NULL )
        return VLC_EGENERIC;

    if( !vlc_object_alive( pIntf ) ||
        !var_InheritBool( pIntf, "skinned-video") ||
        cfg->is_standalone )
    {
        vlc_object_release( pIntf );
        return VLC_EGENERIC;
    }

    sys = (vout_window_sys_t*)calloc( 1, sizeof( *sys ) );
    if( !sys )
    {
        vlc_object_release( pIntf );
        return VLC_ENOMEM;
    }

    pWnd->sys = sys;
    pWnd->sys->cfg = *cfg;
    pWnd->sys->pIntf = pIntf;
    pWnd->control = WindowControl;

    // force execution in the skins2 thread context
    CmdExecuteBlock* cmd = new CmdExecuteBlock( pIntf, VLC_OBJECT( pWnd ),
                                                WindowOpenLocal );
    CmdExecuteBlock::executeWait( CmdGenericPtr( cmd ) );

#ifdef X11_SKINS
    if( !pWnd->handle.xid )
#else
    if( !pWnd->handle.hwnd )
#endif
    {
        free( sys );
        vlc_object_release( pIntf );
        return VLC_EGENERIC;
    }

    return VLC_SUCCESS;
}
开发者ID:vlcchina,项目名称:vlc-player-experimental,代码行数:51,代码来源:skin_main.cpp

示例11: CmdSetEqBands

int VlcProc::onEqBandsChange( vlc_object_t *pObj, const char *pVariable,
                              vlc_value_t oldVal, vlc_value_t newVal,
                              void *pParam )
{
    VlcProc *pThis = (VlcProc*)pParam;

    // Post a set equalizer bands command
    CmdSetEqBands *pCmd = new CmdSetEqBands( pThis->getIntf(),
                                             pThis->m_varEqBands,
                                             newVal.psz_string );
    AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
    pQueue->push( CmdGenericPtr( pCmd ) );

    return VLC_SUCCESS;
}
开发者ID:banketree,项目名称:faplayer,代码行数:15,代码来源:vlcproc.cpp

示例12: CmdSetEqPreamp

int VlcProc::onEqPreampChange( vlc_object_t *pObj, const char *pVariable,
                               vlc_value_t oldVal, vlc_value_t newVal,
                               void *pParam )
{
    VlcProc *pThis = (VlcProc*)pParam;
    EqualizerPreamp *pVarPreamp = (EqualizerPreamp*)(pThis->m_cVarEqPreamp.get());

    // Post a set preamp command
    CmdSetEqPreamp *pCmd = new CmdSetEqPreamp( pThis->getIntf(), *pVarPreamp,
                                              (newVal.f_float + 20.0) / 40.0 );
    AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
    pQueue->push( CmdGenericPtr( pCmd ) );

    return VLC_SUCCESS;
}
开发者ID:banketree,项目名称:faplayer,代码行数:15,代码来源:vlcproc.cpp

示例13: CmdPlaylistSave

void Dialogs::showPlaylistSaveCB( intf_dialog_args_t *pArg )
{
    intf_thread_t *pIntf = (intf_thread_t *)pArg->p_arg;

    if( pArg->i_results && pArg->psz_results[0] )
    {
        // Create a Playlist Save command
        CmdPlaylistSave *pCmd =
            new CmdPlaylistSave( pIntf, pArg->psz_results[0] );

        // Push the command in the asynchronous command queue
        AsyncQueue *pQueue = AsyncQueue::instance( pIntf );
        pQueue->push( CmdGenericPtr( pCmd ) );
    }
}
开发者ID:AsamQi,项目名称:vlc,代码行数:15,代码来源:dialogs.cpp

示例14: CmdPlaytreeAppend

int VlcProc::onItemAppend( vlc_object_t *pObj, const char *pVariable,
                           vlc_value_t oldVal, vlc_value_t newVal,
                           void *pParam )
{
    VlcProc *pThis = (VlcProc*)pParam;

    playlist_add_t *p_add = static_cast<playlist_add_t*>(newVal.p_address);
    CmdPlaytreeAppend *pCmdTree =
        new CmdPlaytreeAppend( pThis->getIntf(), p_add );

    // Push the command in the asynchronous command queue
    AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
    pQueue->push( CmdGenericPtr( pCmdTree ), false );

    return VLC_SUCCESS;
}
开发者ID:banketree,项目名称:faplayer,代码行数:16,代码来源:vlcproc.cpp

示例15: CmdPlaytreeDelete

int VlcProc::onItemDelete( vlc_object_t *pObj, const char *pVariable,
                           vlc_value_t oldVal, vlc_value_t newVal,
                           void *pParam )
{
    VlcProc *pThis = (VlcProc*)pParam;

    int i_id = newVal.i_int;
    CmdPlaytreeDelete *pCmdTree =
        new CmdPlaytreeDelete( pThis->getIntf(), i_id);

    // Push the command in the asynchronous command queue
    AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
    pQueue->push( CmdGenericPtr( pCmdTree ), false );

    return VLC_SUCCESS;
}
开发者ID:banketree,项目名称:faplayer,代码行数:16,代码来源:vlcproc.cpp


注:本文中的CmdGenericPtr函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。