Ejemplo n.º 1
0
bool CGUIDialogBoxeeTechInfo::LoadItems()
{
    if (g_application.GetPlaySpeed() != 1)
        g_infoManager.SetDisplayAfterSeek();
    //if (m_bShowCurrentTime)
    //  g_infoManager.SetDisplayAfterSeek();

    //m_bLastRender = true;
    if (!g_application.m_pPlayer) return false;

    /*
    if( g_application.m_pPlayer->IsCaching() )
    {
      g_infoManager.SetDisplayAfterSeek(0); //Make sure these stuff aren't visible now
      SET_CONTROL_VISIBLE(LABEL_BUFFERING);
    }
    else
    {
      SET_CONTROL_HIDDEN(LABEL_BUFFERING);
    }
    */

    // show audio codec info
    CStdString strAudio, strVideo, strGeneral;
    g_application.m_pPlayer->GetAudioInfo(strAudio);
    strAudio = FormatAudioInfo(strAudio);
    {
        CGUIMessage msg(GUI_MSG_LABEL_SET, GetID(), LABEL1);
        msg.SetLabel(strAudio);
        OnMessage(msg);
    }
    // show video codec info
    g_application.m_pPlayer->GetVideoInfo(strVideo);
    strVideo = FormatVideoInfo(strVideo);
    {
        CGUIMessage msg(GUI_MSG_LABEL_SET, GetID(), LABEL2);
        msg.SetLabel(strVideo);
        OnMessage(msg);
    }
    // show general info
    g_application.m_pPlayer->GetGeneralInfo(strGeneral);
    {
        CStdString strGeneralFPS;
        /*
        #ifdef __APPLE__
            // We show CPU usage for the entire process, as it's arguably more useful.
            double dCPU = m_resourceCounter.GetCPUUsage();
            CStdString strCores;
            strCores.Format("cpu: %.0f%%", dCPU);
        #else
        */
        CStdString strCores = g_cpuInfo.GetCoresUsageString();
//#endif
        int missedvblanks;
        int    refreshrate;
        double clockspeed;
        CStdString strClock;

        if (g_VideoReferenceClock.GetClockInfo(missedvblanks, clockspeed, refreshrate))
            strClock.Format("S( refresh:%i missed:%i speed:%+.3f%% %s )"
                            , refreshrate
                            , missedvblanks
                            , clockspeed - 100.0
                            , g_renderManager.GetVSyncState().c_str());

        strGeneralFPS.Format("%s\nW( fps:%02.2f %s ) %s"
                             , strGeneral.c_str()
                             , g_infoManager.GetFPS()
                             , strCores.c_str(), strClock.c_str() );
#ifdef HAS_INTEL_SMD
        unsigned int videoCur, videoMax, audioCur, audioMax;
        videoCur = videoMax = audioCur = audioMax = 0;

        g_IntelSMDGlobals.GetPortStatus(g_IntelSMDGlobals.GetVidDecInput(), videoCur, videoMax);
        g_IntelSMDGlobals.GetPortStatus(g_IntelSMDGlobals.GetAudioInput(), audioCur, audioMax);

        strGeneralFPS.Format("%s\nW( DVDPlayer: %.2f SMD Audio: %.2f %d/%d SMD Video %.2f %d/%d %s ) %s"
                             , strGeneral.c_str()
                             , (float)(g_application.m_pPlayer->GetTime() / 1000.0)
                             ,  g_IntelSMDGlobals.IsmdToDvdPts(g_IntelSMDGlobals.GetAudioCurrentTime())/1000000
                             ,  audioCur, audioMax
                             ,  g_IntelSMDGlobals.IsmdToDvdPts(g_IntelSMDGlobals.GetVideoCurrentTime())/1000000
                             ,  videoCur, videoMax
                             , strCores.c_str()
                             , strClock.c_str() );
#endif

        strGeneralFPS = FormatGeneralInfo(strGeneralFPS);
        CGUIMessage msg(GUI_MSG_LABEL_SET, GetID(), LABEL3);
        msg.SetLabel(strGeneralFPS);
        OnMessage(msg);
    }
    //----------------------
    // ViewMode Information
    //----------------------
    /*
    if (m_bShowViewModeInfo && CTimeUtils::GetTimeMS() - m_dwShowViewModeTimeout > 2500)
    {
      m_bShowViewModeInfo = false;
    }
    if (m_bShowViewModeInfo)
    {
      {
        // get the "View Mode" string
        CStdString strTitle = g_localizeStrings.Get(629);
        CStdString strMode = g_localizeStrings.Get(630 + g_stSettings.m_currentVideoSettings.m_ViewMode);
        CStdString strInfo;
        strInfo.Format("%s : %s", strTitle.c_str(), strMode.c_str());
        CGUIMessage msg(GUI_MSG_LABEL_SET, GetID(), LABEL1);
        msg.SetLabel(strInfo);
        OnMessage(msg);
      }
      // show sizing information
      CRect SrcRect, DestRect;
      float fAR;
      g_application.m_pPlayer->GetVideoRect(SrcRect, DestRect);
      g_application.m_pPlayer->GetVideoAspectRatio(fAR);
      {
        CStdString strSizing;
        strSizing.Format("Sizing: (%i,%i)->(%i,%i) (Zoom x%2.2f) AR:%2.2f:1 (Pixels: %2.2f:1)",
                         (int)SrcRect.Width(), (int)SrcRect.Height(),
                         (int)DestRect.Width(), (int)DestRect.Height(), g_stSettings.m_fZoomAmount, fAR*g_stSettings.m_fPixelRatio, g_stSettings.m_fPixelRatio);
        CGUIMessage msg(GUI_MSG_LABEL_SET, GetID(), LABEL2);
        msg.SetLabel(strSizing);
        OnMessage(msg);
      }
      // show resolution information
      int iResolution = g_graphicsContext.GetVideoResolution();
      {
        CStdString strStatus;
        strStatus.Format("%s %ix%i@%.2fHz %s",
          g_localizeStrings.Get(13287), g_settings.m_ResInfo[iResolution].iWidth,
          g_settings.m_ResInfo[iResolution].iHeight, g_settings.m_ResInfo[iResolution].fRefreshRate,
          g_settings.m_ResInfo[iResolution].strMode.c_str());
        CGUIMessage msg(GUI_MSG_LABEL_SET, GetID(), LABEL3);
        msg.SetLabel(strStatus);
        OnMessage(msg);
      }
    }

    // TTF subs should render 1:1
    TransformMatrix m;
    g_graphicsContext.PushTransform(m, true);
    //RenderTTFSubtitles();
    g_graphicsContext.PopTransform();

    g_graphicsContext.ApplyGuiTransform();

    if (m_timeCodeShow && m_timeCodePosition != 0)
    {
      if ( (CTimeUtils::GetTimeMS() - m_timeCodeTimeout) >= 2500)
      {
        m_timeCodeShow = false;
        m_timeCodePosition = 0;
      }
      CStdString strDispTime = "hh:mm";

      CGUIMessage msg(GUI_MSG_LABEL_SET, GetID(), LABEL1);
      for (int count = 0; count < m_timeCodePosition; count++)
      {
        if (m_timeCodeStamp[count] == -1)
          strDispTime[count] = ':';
        else
          strDispTime[count] = (char)m_timeCodeStamp[count] + 48;
      }
      strDispTime += "/" + g_infoManager.GetLabel(PLAYER_DURATION) + " [" + g_infoManager.GetLabel(PLAYER_TIME) + "]"; // duration [ time ]
      msg.SetLabel(strDispTime);
      OnMessage(msg);
    }
    */

    //CGUIWindow::Render();

    g_graphicsContext.RestoreGuiTransform();

    return true;
}
Ejemplo n.º 2
0
void CEventInfoPopup::SetEventInfo(const CEventInfoData *pEventInfo)
{
	if (m_EventInfo==*pEventInfo)
		return;

	m_EventInfo=*pEventInfo;

	TCHAR szText[4096];
	CStaticStringFormatter Formatter(szText,lengthof(szText));

	if (!IsStringEmpty(m_EventInfo.GetEventText())) {
		Formatter.Append(m_EventInfo.GetEventText());
		Formatter.RemoveTrailingWhitespace();
	}
	if (!IsStringEmpty(m_EventInfo.GetEventExtText())) {
		if (!Formatter.IsEmpty())
			Formatter.Append(TEXT("\r\n\r\n"));
		Formatter.Append(m_EventInfo.GetEventExtText());
		Formatter.RemoveTrailingWhitespace();
	}

	Formatter.Append(TEXT("\r\n"));

	LPCTSTR pszVideo=EpgUtil::GetVideoComponentTypeText(m_EventInfo.m_VideoInfo.ComponentType);
	if (pszVideo!=NULL) {
		Formatter.AppendFormat(TEXT("\r\n■ 映像: %s"),pszVideo);
	}

	if (!m_EventInfo.m_AudioList.empty()) {
		const CEventInfoData::AudioInfo *pMainAudioInfo=m_EventInfo.GetMainAudioInfo();
		TCHAR szBuff[64];

		Formatter.Append(TEXT("\r\n■ 音声: "));
		if (m_EventInfo.m_AudioList.size()==1) {
			FormatAudioInfo(pMainAudioInfo,szBuff,lengthof(szBuff));
			Formatter.Append(szBuff);
		} else {
			Formatter.Append(TEXT("主: "));
			FormatAudioInfo(pMainAudioInfo,szBuff,lengthof(szBuff));
			Formatter.Append(szBuff);
			for (size_t i=0;i<m_EventInfo.m_AudioList.size();i++) {
				const CEventInfoData::AudioInfo *pAudioInfo=&m_EventInfo.m_AudioList[i];
				if (pAudioInfo!=pMainAudioInfo) {
					Formatter.Append(TEXT(" / 副: "));
					FormatAudioInfo(pAudioInfo,szBuff,lengthof(szBuff));
					Formatter.Append(szBuff);
				}
			}
		}
	}

	for (int i=0;i<m_EventInfo.m_ContentNibble.NibbleCount;i++) {
		if (m_EventInfo.m_ContentNibble.NibbleList[i].ContentNibbleLevel1!=0xE) {
			CEpgGenre EpgGenre;
			LPCTSTR pszGenre=EpgGenre.GetText(m_EventInfo.m_ContentNibble.NibbleList[i].ContentNibbleLevel1,-1);
			if (pszGenre!=NULL) {
				Formatter.AppendFormat(TEXT("\r\n■ ジャンル: %s"),pszGenre);
				pszGenre=EpgGenre.GetText(
					m_EventInfo.m_ContentNibble.NibbleList[i].ContentNibbleLevel1,
					m_EventInfo.m_ContentNibble.NibbleList[i].ContentNibbleLevel2);
				if (pszGenre!=NULL)
					Formatter.AppendFormat(TEXT(" - %s"),pszGenre);
			}
			break;
		}
	}

	if (m_fDetailInfo) {
		Formatter.AppendFormat(TEXT("\r\n■ イベントID: 0x%04X"),m_EventInfo.m_EventID);
		if (m_EventInfo.m_fCommonEvent)
			Formatter.AppendFormat(TEXT(" (イベント共有 サービスID 0x%04X / イベントID 0x%04X)"),
								   m_EventInfo.m_CommonEventInfo.ServiceID,
								   m_EventInfo.m_CommonEventInfo.EventID);
	}

	LOGFONT lf;
	CHARFORMAT cf;
	HDC hdc=::GetDC(m_hwndEdit);
	m_Font.GetLogFont(&lf);
	CRichEditUtil::LogFontToCharFormat(hdc,&lf,&cf);
	cf.dwMask|=CFM_COLOR;
	cf.crTextColor=m_TextColor;
	::ReleaseDC(m_hwndEdit,hdc);
	::SendMessage(m_hwndEdit,WM_SETREDRAW,FALSE,0);
	::SetWindowText(m_hwndEdit,NULL);
	CRichEditUtil::AppendText(m_hwndEdit,
		SkipLeadingWhitespace(Formatter.GetString()),&cf);
	CRichEditUtil::DetectURL(m_hwndEdit,&cf);
	POINT pt={0,0};
	::SendMessage(m_hwndEdit,EM_SETSCROLLPOS,0,reinterpret_cast<LPARAM>(&pt));
	::SendMessage(m_hwndEdit,WM_SETREDRAW,TRUE,0);
	::InvalidateRect(m_hwndEdit,NULL,TRUE);

	CalcTitleHeight();
	RECT rc;
	GetClientRect(&rc);
	::MoveWindow(m_hwndEdit,0,m_TitleHeight,rc.right,max(rc.bottom-m_TitleHeight,0),TRUE);
	Invalidate();
}