From 28738629292776691ff6440fc093fb9287f61fdc Mon Sep 17 00:00:00 2001 From: Patrick McIlroy Date: Sun, 24 Feb 2008 04:34:16 +0000 Subject: [PATCH] git-svn-id: https://openitg.svn.sourceforge.net/svnroot/openitg@39 83fadc84-e282-4d84-a09a-c4228d6ae7e5 --- src/ScreenArcadeDiagnostics.cpp | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/src/ScreenArcadeDiagnostics.cpp b/src/ScreenArcadeDiagnostics.cpp index f84de53b..226bc422 100644 --- a/src/ScreenArcadeDiagnostics.cpp +++ b/src/ScreenArcadeDiagnostics.cpp @@ -11,7 +11,7 @@ #include "GameManager.h" #include "PrefsManager.h" #include "RageInput.h" - +#include "ActorUtil.h" #include "ActorFrame.h" // We need this to call PlayCommand,Refresh and update the uptime. REGISTER_SCREEN_CLASS( ScreenArcadeDiagnostics ); @@ -24,6 +24,19 @@ ScreenArcadeDiagnostics::ScreenArcadeDiagnostics( CString sClassName ) : ScreenW void ScreenArcadeDiagnostics::Init() { ScreenWithMenuElements::Init(); + + USBInfo.LoadFromFont( THEME->GetPathF( "ScreenArcadeDiagnostics", "text" ) ); + USBInfo.SetName( "USBInfo" ); + + // XXX: SOMEONE PLEASE FIX THE TEXT D= --infamouspat + ActorUtil::SetXY( USBInfo, "ScreenArcadeDiagnostics" ); + USBInfo.SetZoom( 0.6f ); + USBInfo.SetText("USB Info: "); + USBInfo.AddX(100.0f); + USBInfo.AddY(25.0f); + USBInfo.SetVisible(true); + + this->AddChild(&USBInfo); this->SortByDrawOrder(); } @@ -36,6 +49,26 @@ void ScreenArcadeDiagnostics::Update( float fDeltaTime ) { ActorFrame::PlayCommand( "Refresh" ); // This updates our uptime. Screen::Update( fDeltaTime ); + + vector vDevList; + CString sDispInfo = "USB Info:\n"; + GetUSBDeviceList(vDevList); + + if (vDevList.size() == 0) + { + USBInfo.SetText("No USB Devices"); + return; + } + + for (unsigned i = 0; i < vDevList.size(); i++) + { + USBDevice nDevice = vDevList[i]; + sDispInfo += ssprintf("\n%s: %.04X:%.04X: %s (%dmA)", + nDevice.GetDeviceDir().c_str(), + nDevice.GetIdVendor(), nDevice.GetIdProduct(), + nDevice.GetDescription().c_str(), nDevice.GetMaxPower() ); + } + USBInfo.SetText(sDispInfo); } void ScreenArcadeDiagnostics::DrawPrimitives() -- 2.11.0