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

📄 effect.cpp

📁 linux下的一款播放器
💻 CPP
📖 第 1 页 / 共 4 页
字号:
                                                   m_pFileObject->GetTimeFormat(),                                                   m_ulDuration);    if (retVal != HXR_OK)    {        if (retVal == HXR_PROP_NOT_FOUND)        {            m_cErrorMessage = "Missing duration attribute in ";        }        else        {            m_cErrorMessage = "Invalid time formatting in ";        }        m_cErrorMessage += rText;        return FALSE;    }//    if (!CIMFFileObject::SetAttributeValue(rText, m_pszStart,    m_ulStart))    return FALSE;//    if (!CIMFFileObject::SetAttributeValue(rText, m_pszDuration, m_ulDuration)) return FALSE;    if (!CIMFFileObject::SetAttributeValue(rText, m_pszTarget,   m_ulTarget))   return FALSE;    // These are optional attributes    m_cSrcRect.InitFromText(rText);    m_cDstRect.InitFromText(rText);    CIMFFileObject::SetAttributeValue(rText, m_pszURL, m_cURL);	CIMFFileObject::SetAttributeValue(rText, m_pszMaxFps, m_ulMaxFps);    if (!CIMFFileObject::SetAttributeValueBOOL(rText, m_pszAspect, m_bAspectFlag))    {        m_bAspectFlag = m_bAspectDefault;    }    return TRUE;}void CIMFCrossfadeEffect::RenderToolData(IMFEFFECT& imfEffect){    imfEffect.m_ulBinSize        = GetBinaryLength();    imfEffect.m_ulMaxFps         = GetMaxFps();    imfEffect.m_ulStart          = GetStart();    imfEffect.m_ulDuration       = GetDuration();    imfEffect.m_bAspect          = GetAspectFlag();    imfEffect.m_bDefaultAspect   = GetAspectDefault();    imfEffect.m_ulTarget         = GetTargetImageHandle();    imfEffect.m_ulType           = GetType();    imfEffect.m_nSrc_x           = m_cSrcRect.GetX();    imfEffect.m_nSrc_y           = m_cSrcRect.GetY();    imfEffect.m_nSrc_W           = m_cSrcRect.GetWidth();    imfEffect.m_nSrc_H           = m_cSrcRect.GetHeight();    imfEffect.m_nDest_x          = m_cDstRect.GetX();    imfEffect.m_nDest_y          = m_cDstRect.GetY();    imfEffect.m_nDest_W          = m_cDstRect.GetWidth();    imfEffect.m_nDest_H          = m_cDstRect.GetHeight();    if (m_cURL.length() > 0)        SafeStrCpy(imfEffect.m_cURL, GetURL().c_str(), 256);    }BOOL CIMFCrossfadeEffect::InitFromToolData(IMFEFFECT imfEffect){    SetStart(imfEffect.m_ulStart);    SetDefaultMaxFps(imfEffect.m_ulMaxFps);    SetDuration(imfEffect.m_ulDuration);       SetAspectFlag(imfEffect.m_bAspect);    SetAspectDefault(imfEffect.m_bDefaultAspect);    SetTargetImageHandle(imfEffect.m_ulTarget);    SetURL(imfEffect.m_cURL);    m_cSrcRect.SetX(imfEffect.m_nSrc_x);    m_cSrcRect.SetY(imfEffect.m_nSrc_y);    m_cSrcRect.SetWidth(imfEffect.m_nSrc_W);    m_cSrcRect.SetHeight(imfEffect.m_nSrc_H);    m_cDstRect.SetX(imfEffect.m_nDest_x);    m_cDstRect.SetY(imfEffect.m_nDest_y);    m_cDstRect.SetWidth(imfEffect.m_nDest_W);    m_cDstRect.SetHeight(imfEffect.m_nDest_H);    return TRUE;    }//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////ULONG32 CIMFFillEffect::GetBinaryLength(){    return 30 + 4 + m_cURL.length();}ULONG32 CIMFFillEffect::RenderBinary(unsigned char *pBuffer){    ULONG32 ulCurPos = 0;    ulCurPos += RenderBinaryType(pBuffer + ulCurPos, (ULONG32) kTypeFill);    ulCurPos += RenderBinaryType(pBuffer + ulCurPos, m_ulStart);	ulCurPos += RenderBinaryType(pBuffer + ulCurPos, m_ulMaxFps);    ulCurPos += RenderBinaryType(pBuffer + ulCurPos, m_cURL);    ulCurPos += m_cColor.RenderBinary(pBuffer + ulCurPos);    ulCurPos += m_cDstRect.RenderBinary(pBuffer + ulCurPos);    return ulCurPos;}ULONG32 CIMFFillEffect::InitFromBinary(unsigned char *pBuffer){    ULONG32 ulCurPos = 0;    ULONG32 ulTmp;    ulCurPos += InitFromBinaryType(pBuffer + ulCurPos, ulTmp); // This is the type    ulCurPos += InitFromBinaryType(pBuffer + ulCurPos, m_ulStart);	ulCurPos += InitFromBinaryType(pBuffer + ulCurPos, m_ulMaxFps);    ulCurPos += InitFromBinaryType(pBuffer + ulCurPos, m_cURL);    ulCurPos += m_cColor.InitFromBinary(pBuffer + ulCurPos);    ulCurPos += m_cDstRect.InitFromBinary(pBuffer + ulCurPos);    return ulCurPos;}void CIMFFillEffect::RenderText(GString &rText){    rText += CIMFFileObject::m_pszTagStart;    rText += CIMFFileObject::m_pszFillTag;    rText += " ";    CIMFFileObject::RenderAttribute(m_pszStart, m_ulStart, rText);    m_cColor.RenderText(rText);    m_cDstRect.RenderText(rText);    if (m_cURL.length() > 0)    {        CIMFFileObject::RenderAttribute(m_pszURL, m_cURL, rText);    }    rText += CIMFFileObject::m_pszTagEnd;}BOOL CIMFFillEffect::InitFromText(GString &rText){    // Get the start time    HX_RESULT retVal = CIMFFileObject::SetAttributeTimeValue(rText,                                                             m_pszStart,                                                             m_pFileObject->GetTimeFormat(),                                                             m_ulStart);    if (retVal != HXR_OK)    {        if (retVal == HXR_PROP_NOT_FOUND)        {            m_cErrorMessage = "Missing start attribute in ";        }        else        {            m_cErrorMessage = "Invalid time formatting in ";        }        m_cErrorMessage += rText;        return FALSE;    }    // Get the color    if (!m_cColor.InitFromText(rText)) return FALSE;    // These are optional attributes    m_cDstRect.InitFromText(rText);    CIMFFileObject::SetAttributeValue(rText, m_pszURL, m_cURL);	CIMFFileObject::SetAttributeValue(rText, m_pszMaxFps, m_ulMaxFps);    return TRUE;}void CIMFFillEffect::RenderToolData(IMFEFFECT& imfEffect){    imfEffect.m_ulBinSize        = GetBinaryLength();    imfEffect.m_ulMaxFps         = GetMaxFps();    imfEffect.m_ulStart          = GetStart();    imfEffect.m_ucRed            = m_cColor.GetRed();    imfEffect.m_ucBlue           = m_cColor.GetBlue();    imfEffect.m_ucGreen          = m_cColor.GetGreen();    imfEffect.m_ulType           = GetType();    imfEffect.m_nDest_x          = m_cDstRect.GetX();    imfEffect.m_nDest_y          = m_cDstRect.GetY();    imfEffect.m_nDest_W          = m_cDstRect.GetWidth();    imfEffect.m_nDest_H          = m_cDstRect.GetHeight();    if (m_cURL.length() > 0)        SafeStrCpy(imfEffect.m_cURL, GetURL().c_str(), 256);    }BOOL  CIMFFillEffect::InitFromToolData(IMFEFFECT imfEffect){    SetDefaultMaxFps(imfEffect.m_ulMaxFps);    SetStart(imfEffect.m_ulStart);    SetURL(imfEffect.m_cURL);    CIMFColor newColor(imfEffect.m_ucRed,imfEffect.m_ucBlue,imfEffect.m_ucGreen);    m_cColor= newColor;    m_cDstRect.SetX(imfEffect.m_nDest_x);    m_cDstRect.SetY(imfEffect.m_nDest_y);    m_cDstRect.SetWidth(imfEffect.m_nDest_W);    m_cDstRect.SetHeight(imfEffect.m_nDest_H);    return TRUE;    }//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////ULONG32 CIMFFadeoutEffect::GetBinaryLength(){    return 34 + 4 + m_cURL.length();}ULONG32 CIMFFadeoutEffect::RenderBinary(unsigned char *pBuffer){    ULONG32 ulCurPos = 0;    ulCurPos += RenderBinaryType(pBuffer + ulCurPos, (ULONG32) kTypeFadeOut);    ulCurPos += RenderBinaryType(pBuffer + ulCurPos, m_ulStart);	ulCurPos += RenderBinaryType(pBuffer + ulCurPos, m_ulMaxFps);    ulCurPos += RenderBinaryType(pBuffer + ulCurPos, m_cURL);    ulCurPos += RenderBinaryType(pBuffer + ulCurPos, m_ulDuration);    ulCurPos += m_cColor.RenderBinary(pBuffer + ulCurPos);    ulCurPos += m_cDstRect.RenderBinary(pBuffer + ulCurPos);    return ulCurPos;}ULONG32 CIMFFadeoutEffect::InitFromBinary(unsigned char *pBuffer){    ULONG32 ulCurPos = 0;    ULONG32 ulTmp;    ulCurPos += InitFromBinaryType(pBuffer + ulCurPos, ulTmp); // This is the type    ulCurPos += InitFromBinaryType(pBuffer + ulCurPos, m_ulStart);	ulCurPos += InitFromBinaryType(pBuffer + ulCurPos, m_ulMaxFps);    ulCurPos += InitFromBinaryType(pBuffer + ulCurPos, m_cURL);    ulCurPos += InitFromBinaryType(pBuffer + ulCurPos, m_ulDuration);    ulCurPos += m_cColor.InitFromBinary(pBuffer + ulCurPos);    ulCurPos += m_cDstRect.InitFromBinary(pBuffer + ulCurPos);    return ulCurPos;}void CIMFFadeoutEffect::RenderText(GString &rText){    rText += CIMFFileObject::m_pszTagStart;    rText += CIMFFileObject::m_pszFadeoutTag;    rText += " ";    CIMFFileObject::RenderAttribute(m_pszStart,    m_ulStart,     rText);    CIMFFileObject::RenderAttribute(m_pszDuration, m_ulDuration,  rText);    m_cColor.RenderText(rText);    m_cDstRect.RenderText(rText);    if (m_cURL.length() > 0)    {        CIMFFileObject::RenderAttribute(m_pszURL, m_cURL, rText);    }    rText += CIMFFileObject::m_pszTagEnd;}BOOL CIMFFadeoutEffect::InitFromText(GString &rText){    // These are required attributes    // Get the start time    HX_RESULT retVal = CIMFFileObject::SetAttributeTimeValue(rText,                                                             m_pszStart,                                                             m_pFileObject->GetTimeFormat(),                                                             m_ulStart);    if (retVal != HXR_OK)    {        if (retVal == HXR_PROP_NOT_FOUND)        {            m_cErrorMessage = "Missing start attribute in ";        }        else        {            m_cErrorMessage = "Invalid time formatting in ";        }        m_cErrorMessage += rText;        return FALSE;    }    // Get the duration    retVal = CIMFFileObject::SetAttributeTimeValue(rText,                                                   m_pszDuration,                                                   m_pFileObject->GetTimeFormat(),                                                   m_ulDuration);    if (retVal != HXR_OK)    {        if (retVal == HXR_PROP_NOT_FOUND)        {            m_cErrorMessage = "Missing duration attribute in ";        }        else        {            m_cErrorMessage = "Invalid time formatting in ";        }        m_cErrorMessage += rText;        return FALSE;    }//    if (!CIMFFileObject::SetAttributeValue(rText, m_pszStart,    m_ulStart))    return FALSE;//    if (!CIMFFileObject::SetAttributeValue(rText, m_pszDuration, m_ulDuration)) return FALSE;    if (!m_cColor.InitFromText(rText)) return FALSE;    // These are optional attributes    m_cDstRect.InitFromText(rText);    CIMFFileObject::SetAttributeValue(rText, m_pszURL, m_cURL);	CIMFFileObject::SetAttributeValue(rText, m_pszMaxFps, m_ulMaxFps);    return TRUE;}void CIMFFadeoutEffect::RenderToolData(IMFEFFECT& imfEffect){    imfEffect.m_ulBinSize        = GetBinaryLength();    imfEffect.m_ulMaxFps         = GetMaxFps();    imfEffect.m_ulStart          = GetStart();    imfEffect.m_ulDuration       = GetDuration();    imfEffect.m_ucRed            = m_cColor.GetRed();    imfEffect.m_ucBlue           = m_cColor.GetBlue();    imfEffect.m_ucGreen          = m_cColor.GetGreen();    imfEffect.m_ulType           = GetType();    imfEffect.m_nDest_x          = m_cDstRect.GetX();    imfEffect.m_nDest_y          = m_cDstRect.GetY();    imfEffect.m_nDest_W          = m_cDstRect.GetWidth();    imfEffect.m_nDest_H          = m_cDstRect.GetHeight();    if (m_cURL.length() > 0)        SafeStrCpy(imfEffect.m_cURL, GetURL().c_str(), 256);    }BOOL CIMFFadeoutEffect::InitFromToolData(IMFEFFECT imfEffect){    SetStart(imfEffect.m_ulStart);    SetDefaultMaxFps(imfEffect.m_ulMaxFps);    SetDuration(imfEffect.m_ulDuration);    SetURL(imfEffect.m_cURL);           CIMFColor newColor(imfEffect.m_ucRed,imfEffect.m_ucBlue,imfEffect.m_ucGreen);    m_cColor= newColor;    m_cDstRect.SetX(imfEffect.m_nDest_x);    m_cDstRect.SetY(imfEffect.m_nDest_y);    m_cDstRect.SetWidth(imfEffect.m_nDest_W);    m_cDstRect.SetHeight(imfEffect.m_nDest_H);    return TRUE;    }//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////ULONG32 CIMFWipeEffect::GetBinaryLength(){    return 62 + 4 + m_cURL.length();}ULONG32 CIMFWipeEffect::RenderBinary(unsigned char *pBuffer){    ULONG32 ulCurPos = 0;    ulCurPos += RenderBinaryType(pBuffer + ulCurPos, (ULONG32) kTypeWipe);    ulCurPos += RenderBinaryType(pBuffer + ulCurPos, m_ulStart);	ulCurPos += RenderBinaryType(pBuffer + ulCurPos, m_ulMaxFps);    ulCurPos += RenderBinaryType(pBuffer + ulCurPos, m_cURL);    ulCurPos += RenderBinaryType(pBuffer + ulCurPos, m_ulDuration);    ulCurPos += RenderBinaryType(pBuffer + ulCurPos, m_ulType);    ulCurPos += RenderBinaryType(pBuffer + ulCurPos, m_ulDirection);    ulCurPos += RenderBinaryType(pBuffer + ulCurPos, m_ulTarget);    ulCurPos += m_cSrcRect.RenderBinary(pBuffer + ulCurPos);    ulCurPos += m_cDstRect.RenderBinary(pBuffer + ulCurPos);    ulCurPos += RenderBinaryType(pBuffer + ulCurPos, m_bAspectFlag);    return ulCurPos;}ULONG32 CIMFWipeEffect::InitFromBinary(unsigned char *pBuffer){    ULONG32 ulCurPos = 0;    ULONG32 ulTmp;    ulCurPos += InitFromBinaryType(pBuffer + ulCurPos, ulTmp); // This is the type    ulCurPos += InitFromBinaryType(pBuffer + ulCurPos, m_ulStart);	ulCurPos += InitFromBinaryType(pBuffer + ulCurPos, m_ulMaxFps);    ulCurPos += InitFromBinaryType(pBuffer + ulCurPos, m_cURL);    ulCurPos += InitFromBinaryType(pBuffer + ulCurPos, m_ulDuration);    ulCurPos += InitFromBinaryType(pBuffer + ulCurPos, m_ulType);    ulCurPos += InitFromBinaryType(pBuffer + ulCurPos, m_ulDirection);

⌨️ 快捷键说明

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