コード例 #1
0
void DrChannelDescription::CopyFrom(DrChannelDescriptionPtr src, bool includeLengths)
{
    DrAssert(m_isInputChannel == src->m_isInputChannel);

    SetChannelURI(src->GetChannelURI());
    SetChannelState(src->GetChannelState());
    SetChannelMetaData(src->GetChannelMetaData());
    if (includeLengths)
    {
        SetChannelProcessedLength(src->GetChannelProcessedLength());
        SetChannelTotalLength(src->GetChannelTotalLength());
    }
}
コード例 #2
0
ファイル: DrVertexCommand.cpp プロジェクト: CodEnFisH/Dryad
HRESULT DrChannelDescription::ParseProperty(DrPropertyReaderPtr reader,
                                            UINT16 enumID, UINT32 /* unused dataLen */)
{
    HRESULT err;

    switch (enumID)
    {
    default:
        DrLogW("Unknown property in channel description enumID %u", (UINT32) enumID);
        err = reader->SkipNextPropertyOrAggregate();
        break;

    case DrProp_ChannelState:
        err = reader->ReadNextProperty(enumID, m_state);
        break;

    case DrProp_ChannelURI:
        {
            DrString URI;
            err = reader->ReadNextProperty(enumID, URI);
            if (err == S_OK)
            {
                SetChannelURI(URI);
            }
        }
        break;

    case DrProp_ChannelErrorCode:
        err = reader->ReadNextProperty(enumID, m_errorCode);
        break;

    case DrProp_ChannelErrorString:
        {
            DrString errorString;
            err = reader->ReadNextProperty(enumID, errorString);
            if (err == S_OK)
            {
                SetChannelErrorString(errorString);
            }
        }
        break;

    case DrProp_ChannelTotalLength:
        err = reader->ReadNextProperty(enumID, m_totalLength);
        break;

    case DrProp_ChannelProcessedLength:
        err = reader->ReadNextProperty(enumID, m_processedLength);
        break;

    case DrProp_BeginTag:
        {
            UINT16 tagID;
            err = reader->PeekNextAggregateTag(&tagID);
            if (err == S_OK)
            {
                if (tagID == DrTag_ChannelMetaData)
                {
                    DrMetaDataRef mData = DrNew DrMetaData();
                    err = reader->ReadAggregate(tagID, mData);
                    if (err == S_OK)
                    {
                        SetChannelMetaData(mData);
                    }
                }
                else
                {
                    DrLogW("Unknown aggregate in channel description tagID %u", (UINT32) tagID);
                }
            }
        }
        break;
    }

    return err;
}