예제 #1
0
파일: TokenGroup.cpp 프로젝트: Olti/mythtv
void MHListGroup::Initialise(MHParseNode *p, MHEngine *engine)
{
    MHTokenGroup::Initialise(p, engine);
    MHParseNode *pPositions = p->GetNamedArg(C_POSITIONS);

    if (pPositions)
    {
        for (int i = 0; i < pPositions->GetArgCount(); i++)
        {
            MHParseNode *pPos = pPositions->GetArgN(i);
            QPoint pos(pPos->GetSeqN(0)->GetIntValue(), pPos->GetSeqN(1)->GetIntValue());
            m_Positions.Append(pos);
        }
    }

    MHParseNode *pWrap = p->GetNamedArg(C_WRAP_AROUND);

    if (pWrap)
    {
        m_fWrapAround = pWrap->GetArgN(0)->GetBoolValue();
    }

    MHParseNode *pMultiple = p->GetNamedArg(C_WRAP_AROUND);

    if (pMultiple)
    {
        m_fMultipleSelection = pMultiple->GetArgN(0)->GetBoolValue();
    }
}
예제 #2
0
void MHSetData::Initialise(MHParseNode *p, MHEngine *engine)
{
    MHElemAction::Initialise(p, engine); // Target
    MHParseNode *pContent = p->GetArgN(1);

    if (pContent->m_nNodeType == MHParseNode::PNSeq)
    {
        // Referenced content.
        m_fIsIncluded = false;
        m_fSizePresent = m_fCCPriorityPresent = false;
        m_Referenced.Initialise(pContent->GetSeqN(0), engine);

        if (pContent->GetSeqCount() > 1)
        {
            MHParseNode *pArg = pContent->GetSeqN(1);

            if (pArg->m_nNodeType == MHParseNode::PNTagged && pArg->GetTagNo() == C_NEW_CONTENT_SIZE)
            {
                MHParseNode *pVal = pArg->GetArgN(0);

                // It may be NULL as a place-holder
                if (pVal->m_nNodeType == MHParseNode::PNInt)
                {
                    m_fSizePresent = true;
                    m_ContentSize.Initialise(pVal, engine);
                }
            }
        }

        if (pContent->GetSeqCount() > 2)
        {
            MHParseNode *pArg = pContent->GetSeqN(2);

            if (pArg->m_nNodeType == MHParseNode::PNTagged && pArg->GetTagNo() == C_NEW_CONTENT_CACHE_PRIO)
            {
                MHParseNode *pVal = pArg->GetArgN(0);

                if (pVal->m_nNodeType == MHParseNode::PNInt)
                {
                    m_fCCPriorityPresent = true;
                    m_CCPriority.Initialise(pVal, engine);
                }
            }
        }
    }
    else
    {
        m_Included.Initialise(pContent, engine);
        m_fIsIncluded = true;
    }
}
예제 #3
0
파일: Groups.cpp 프로젝트: DocOnDev/mythtv
void MHSetTimer::Initialise(MHParseNode *p, MHEngine *engine)
{
    MHElemAction::Initialise(p, engine);
    m_TimerId.Initialise(p->GetArgN(1), engine); // The timer id
    if (p->GetArgCount() > 2) {
        MHParseNode *pNewTimer = p->GetArgN(2);
        m_TimerValue.Initialise(pNewTimer->GetSeqN(0), engine);
        if (pNewTimer->GetSeqCount() > 1) {
            m_TimerType = ST_TimerAbsolute; // May be absolute - depends on the value.
            m_AbsFlag.Initialise(pNewTimer->GetSeqN(1), engine);
        }
        else m_TimerType = ST_TimerRelative;
    }
}
예제 #4
0
파일: Groups.cpp 프로젝트: DocOnDev/mythtv
void MHPersistent::Initialise(MHParseNode *p, MHEngine *engine)
{
    MHElemAction::Initialise(p, engine); // Target
    m_Succeeded.Initialise(p->GetArgN(1), engine);
    MHParseNode *pVarSeq = p->GetArgN(2);
    for (int i = 0; i < pVarSeq->GetSeqCount(); i++) {
        MHObjectRef *pVar = new MHObjectRef;
        m_Variables.Append(pVar);
        pVar->Initialise(pVarSeq->GetSeqN(i), engine);
    }
    m_FileName.Initialise(p->GetArgN(3), engine);
}
예제 #5
0
// Actions.
void MHCall::Initialise(MHParseNode *p, MHEngine *engine)
{
    MHElemAction::Initialise(p, engine); // Target
    m_Succeeded.Initialise(p->GetArgN(1), engine); // Call/fork succeeded flag
    // Arguments.
    MHParseNode *args = p->GetArgN(2);

    for (int i = 0; i < args->GetSeqCount(); i++)
    {
        MHParameter *pParm = new MHParameter;
        m_Parameters.Append(pParm);
        pParm->Initialise(args->GetSeqN(i), engine);
    }
}
예제 #6
0
파일: TokenGroup.cpp 프로젝트: Olti/mythtv
void MHTokenGroupItem::Initialise(MHParseNode *p, MHEngine *engine)
{
    // A pair consisting of an object reference and an optional action slot sequence.
    m_Object.Initialise(p->GetSeqN(0), engine);

    if (p->GetSeqCount() > 1)
    {
        MHParseNode *pSlots = p->GetSeqN(1);

        for (int i = 0; i < pSlots->GetSeqCount(); i++)
        {
            MHParseNode *pAct = pSlots->GetSeqN(i);
            MHActionSequence *pActions = new MHActionSequence;
            m_ActionSlots.Append(pActions);

            // The action slot entry may be NULL.
            if (pAct->m_nNodeType != MHParseNode::PNNull)
            {
                pActions->Initialise(pAct, engine);
            }
        }
    }
}