void CPrivateChatFrame::OnProfileReceived() { m_sNick = m_pSession->m_sUserNick; AddTimestamp(); m_pContent.Add( retText, LoadString( IDS_CHAT_PROFILE_ACCEPTED ), NULL, retfColor )->m_cColor = Colors.m_crChatNull; m_pContent.Add( retLink, m_sNick, _T("command:ID_CHAT_BROWSE") ); m_pContent.Add( retNewline, NEWLINE_FORMAT ); m_wndView.InvalidateIfModified(); CString strCaption; LoadString( strCaption, IDR_CHATFRAME ); if ( Settings.General.LanguageRTL ) strCaption = _T("\x200F") + strCaption + _T("\x202E"); strCaption += _T(" : "); if ( Settings.General.LanguageRTL ) strCaption += _T("\x202B"); strCaption += m_sNick; CString strAddress; strAddress.Format( _T(" (%s:%lu)"), (LPCTSTR)CString( inet_ntoa( m_pSession->m_pHost.sin_addr ) ), ntohs( m_pSession->m_pHost.sin_port ) ); if ( Settings.General.LanguageRTL ) strCaption += _T("\x200F"); strCaption += strAddress; if ( ! m_pSession->m_sUserAgent.IsEmpty() ) { if ( Settings.General.LanguageRTL ) strCaption += _T("\x200F"); strCaption = strCaption + _T(" - ") + m_pSession->m_sUserAgent; } SetWindowText( strCaption ); GetParent()->PostMessage( WM_TIMER, 2 ); SetAlert(); }
void CChatWnd::AddLogin(LPCTSTR pszText) { AddTimestamp(); m_pContent.Add( retText, LoadString( IDS_CHAT_PROFILE_ACCEPTED ), NULL, retfColour )->m_cColour = CoolInterface.m_crChatNull ; m_pContent.Add( retLink, pszText, _T("raza:command:ID_CHAT_BROWSE") ); m_pContent.Add( retNewline, NEWLINE_FORMAT ); m_wndView.InvalidateIfModified(); }
void CChatWnd::OnStatusMessage(int nFlags, const CString& sText) { if ( sText.IsEmpty() ) return; AddTimestamp(); m_pContent.Add( retText, sText, NULL, retfColour )->m_cColour = ( nFlags == 1 ) ? CoolInterface.m_crChatOut : CoolInterface.m_crChatNull; m_pContent.Add( retNewline, NEWLINE_FORMAT ); m_wndView.InvalidateIfModified(); }
BOOL CPubThread::GetFileName(LPPUBINFO ppi, BOOL bPreview, LPSTR fname, LPSTR tfname, DWORD index ) { if ( ppi == NULL ) return FALSE; // Ensure buffer if ( fname == NULL ) fname = ppi->pub_fname; if ( tfname == NULL ) tfname = ppi->pub_tfname; if ( index == MAXDWORD ) index = ppi->curindex; // Add index to file name if ( ( ppi->f1 & PUBF1_ROTATEFNAME ) != 0 ) AddIndex( fname, ppi->fname, index ); else strcpy( fname, ppi->fname ); if ( ( ppi->f1 & PUBF1_TIMESTAMP ) != 0 ) AddTimestamp( fname, ppi->tmpl ); CWinFile::CleanChars( fname ); // Add index to thumbnail if ( ( ppi->f1 & PUBF1_ROTATEFNAME ) != 0 && ( ppi->f1 & PUBF1_TNROTATE ) != 0 ) AddIndex( tfname, ppi->tfname, index ); else strcpy( tfname, ppi->tfname ); if ( ( ppi->f1 & PUBF1_TIMESTAMP ) != 0 && ( ppi->f1 & PUBF1_TNTIMESTAMP ) != 0 ) AddTimestamp( tfname, ppi->tmpl ); CWinFile::CleanChars( tfname ); // Roll over index if ( !bPreview && ( ppi->f1 & PUBF1_ROTATEFNAME ) != 0 ) { ppi->curindex++; if ( ppi->curindex > ppi->stopindex ) ppi->curindex = ppi->startindex; if ( ppi->curindex < ppi->startindex ) ppi->curindex = ppi->startindex; } // end if return TRUE; }
void CChatWnd::AddText(bool bAction, bool bOutgoing, LPCTSTR pszNick, LPCTSTR pszBody) { AddTimestamp(); CString str; str.Format( bAction ? _T("* %s ") : _T("<%s> "), pszNick ); m_pContent.Add( retText, str, NULL, retfBold | retfColour )->m_cColour = ( bOutgoing ? CoolInterface.m_crChatIn : CoolInterface.m_crChatOut ); Emoticons.FormatText( &m_pContent, pszBody, TRUE ); m_pContent.Add( retNewline, NEWLINE_FORMAT ); m_wndView.InvalidateIfModified(); }
CString CUser::AddTimestamp(const CString& sStr) const { CString sRet; return AddTimestamp(sStr, sRet); }
/* yj: Added MultiSliceFlag for multi-slice decoding */ OMX_BOOL AvcDecoder_OMX::AvcDecodeVideo_OMX( OMX_U8** aOutBuf, OMX_U32* aOutBufSize, OMX_TICKS* aOutTimestamp, OMX_U8** aInBuf, OMX_U32* aInBufSize, OMX_TICKS* aInTimestamp, OMX_PARAM_PORTDEFINITIONTYPE* aPortParam, OMX_S32* iFrameCount, OMX_BOOL aMarkerFlag, OMX_BOOL *aResizeFlag, OMX_BOOL MultiSliceFlag) { OMX_BOOL Status = OMX_TRUE; int ret = 0; unsigned char* pNalBuffer = *aInBuf; int NalSize = *aInBufSize; // RainAde for thumbnail //*aInBufSize = 0; *aResizeFlag = OMX_FALSE; #ifdef MFC_FPS gettimeofday(&start, NULL); decode_cnt++; #endif ret = mfc_dec_slice(pNalBuffer, NalSize, MultiSliceFlag); switch(ret) { case -1 : { Status = OMX_FALSE; LOGE("mfc_dec_slice fail\n"); break; } case 0: { #ifdef MFC_FPS need_cnt++; #endif Status = OMX_TRUE; // RainAde for thumbnail *aInBufSize = 0; break; } case 1 : { #ifdef MFC_FPS gettimeofday(&stop, NULL); time += measureTime(&start, &stop); frame_cnt++; #endif if(aPortParam->format.video.nFrameWidth != (unsigned int)iDisplay_Width || aPortParam->format.video.nFrameHeight != (unsigned int)iDisplay_Height) { LOGV("iDisplay_Width : %d\n", (int)iDisplay_Width); LOGV("iDisplay_Height: %d\n", (int)iDisplay_Height); if(iDisplay_Width > 720) { Status = OMX_FALSE; break; } aPortParam->format.video.nFrameWidth = iDisplay_Width; aPortParam->format.video.nFrameHeight = iDisplay_Height; *aResizeFlag = OMX_TRUE; Status = OMX_TRUE; break; } if(AddTimestamp(aInTimestamp) == OMX_FALSE) { LOGE("AddTimestamp fail\n"); return OMX_FALSE; } if(GetYuv(aOutBuf, aOutBufSize, aOutTimestamp) == OMX_FALSE) { Status = OMX_FALSE; break; } (*iFrameCount)++; Status = OMX_TRUE; // RainAde for thumbnail *aInBufSize = 0; break; } default : { Status = OMX_FALSE; LOGE("UnExpected Operation\n"); break; } } if(Status == OMX_FALSE) { *iFrameCount = 0; *aOutBufSize = 0; return OMX_FALSE; } return OMX_TRUE; }
CString CUser::AddTimestamp(const CString& sStr) const { time_t tm; return AddTimestamp(time(&tm), sStr); }