53
53
DWORD WINAPI GetMPlayerVersionW( LPVOID lpParam )
55
55
DllLoader* mplayerDll;
56
wchar_t wszVersion[50];
57
wchar_t wszCompileDate[50];
58
56
const char* (__cdecl* pMplayerGetVersion)();
59
57
const char* (__cdecl* pMplayerGetCompileDate)();
61
wszVersion[0] = 0; wszCompileDate[0] = 0;
59
const char *version = NULL;
60
const char *date = NULL;
62
62
mplayerDll = new DllLoader("Q:\\system\\players\\mplayer\\mplayer.dll",true);
64
64
if( mplayerDll->Parse() )
66
66
if (mplayerDll->ResolveExport("mplayer_getversion", (void**)&pMplayerGetVersion))
67
mbstowcs(wszVersion, pMplayerGetVersion(), sizeof(wszVersion));
67
version = pMplayerGetVersion();
68
68
if (mplayerDll->ResolveExport("mplayer_getcompiledate", (void**)&pMplayerGetCompileDate))
69
mbstowcs(wszCompileDate, pMplayerGetCompileDate(), sizeof(wszCompileDate));
70
if (wszVersion[0]!=0 && wszCompileDate[0]!=0)
71
_snwprintf((wchar_t *)lpParam, 50, L"%s (%s)", wszVersion, wszCompileDate);
72
else if (wszVersion[0]!=0)
73
_snwprintf((wchar_t *)lpParam, 50, L"%s", wszVersion);
69
date = pMplayerGetCompileDate();
71
_snprintf((char *)lpParam, 50, "%s (%s)", version, date);
73
_snprintf((char *)lpParam, 50, "%s", version);
868
868
bool CGUIWindowSystemInfo::GetNetwork(int i_lblp1, int i_lblp2, int i_lblp3, int i_lblp4, int i_lblp5, int i_lblp6)
870
870
// Set Network Informations
875
874
// Set IP Type [DHCP/Fixed]
876
const WCHAR *psztext3=g_localizeStrings.Get(146).c_str();
877
const WCHAR *psztype3;
879
875
if(XNetGetTitleXnAddr(&net_stat) & XNET_GET_XNADDR_DHCP)
881
psztype3=g_localizeStrings.Get(148).c_str();
876
ip.Format("%s %s", g_localizeStrings.Get(146).c_str(), g_localizeStrings.Get(148).c_str());
884
psztype3=g_localizeStrings.Get(147).c_str();
878
ip.Format("%s %s", g_localizeStrings.Get(146).c_str(), g_localizeStrings.Get(147).c_str());
886
swprintf(wszText,L"%s %s", psztext3,psztype3);
887
SET_CONTROL_LABEL(i_lblp1,wszText);
880
SET_CONTROL_LABEL(i_lblp1,ip);
889
882
// Set Ethernet Link State
890
const WCHAR* pszHalf=g_localizeStrings.Get(152).c_str();
891
const WCHAR* pszFull=g_localizeStrings.Get(153).c_str();
892
const WCHAR* pszLink=g_localizeStrings.Get(151).c_str();
893
const WCHAR* pszNoLink=g_localizeStrings.Get(159).c_str();
894
883
DWORD dwnetstatus = XNetGetEthernetLinkStatus();
895
WCHAR linkstatus[64];
896
wcscpy(linkstatus,pszLink);
884
CStdString linkStatus = g_localizeStrings.Get(151);
897
885
if (dwnetstatus & XNET_ETHERNET_LINK_ACTIVE)
899
887
if (dwnetstatus & XNET_ETHERNET_LINK_100MBPS)
900
wcscat(linkstatus,L"100mbps ");
888
linkStatus += "100mbps ";
901
889
if (dwnetstatus & XNET_ETHERNET_LINK_10MBPS)
902
wcscat(linkstatus,L"10mbps ");
890
linkStatus += "10mbps ";
903
891
if (dwnetstatus & XNET_ETHERNET_LINK_FULL_DUPLEX)
904
wcscat(linkstatus,pszFull);
892
linkStatus += g_localizeStrings.Get(153);
905
893
if (dwnetstatus & XNET_ETHERNET_LINK_HALF_DUPLEX)
906
wcscat(linkstatus,pszHalf);
894
linkStatus += g_localizeStrings.Get(152);
909
wcscat(linkstatus,pszNoLink);
910
SET_CONTROL_LABEL(i_lblp3,linkstatus);
897
linkStatus += g_localizeStrings.Get(159);
899
SET_CONTROL_LABEL(i_lblp3,linkStatus);
912
901
// Get IP/Subnet/Gateway/DNS
913
const WCHAR* pszIP=g_localizeStrings.Get(150).c_str();
902
const char* pszIP=g_localizeStrings.Get(150).c_str();
915
904
CStdString strlblSubnet = g_localizeStrings.Get(13159).c_str(); //"Subnet:";
916
905
CStdString strlblGateway = g_localizeStrings.Get(13160).c_str(); //"Gateway:";
917
906
CStdString strlblDNS = g_localizeStrings.Get(13161).c_str(); //"DNS:";
918
CStdString strlblnetfail = g_localizeStrings.Get(13162).c_str(); //"Initialize failed";
920
908
if ( !CUtil::InitializeNetwork(g_guiSettings.GetInt("Network.Assignment"),
921
909
g_guiSettings.GetString("Network.IPAddress"),
926
914
CLog::Log(LOGERROR, "Network: Initialize network failed");
928
916
CStdString strp2, strp4, strp5, strp6;
929
strp2.Format("%s %s",pszIP,strlblnetfail);
930
strp4.Format("%s %s",strlblSubnet,strlblnetfail);
931
strp5.Format("%s %s",strlblGateway,strlblnetfail);
932
strp6.Format("%s %s",strlblDNS,strlblnetfail);
917
strp2.Format("%s %s",pszIP,g_localizeStrings.Get(13162).c_str());//"Initialize failed"
918
strp4.Format("%s %s",strlblSubnet,g_localizeStrings.Get(13162).c_str());
919
strp5.Format("%s %s",strlblGateway,g_localizeStrings.Get(13162).c_str());
920
strp6.Format("%s %s",strlblDNS,g_localizeStrings.Get(13162).c_str());
934
922
SET_CONTROL_LABEL(i_lblp2,strp2);
935
923
SET_CONTROL_LABEL(i_lblp4,strp4);
945
933
//17.05.2005 Todo: Complete Rewriting the Network Section in XBMC is needed to get all Network-Settings right!
947
swprintf(wzIP,L"%s: %S",pszIP,g_szTitleIP);
948
//swprintf(wzIP,L"%s: %S",pszIP,g_guiSettings.GetString("Network.IPAddress").c_str());
935
ip.Format("%s: %s",pszIP,g_szTitleIP);
949
936
strItem1.Format("%s %s", strlblSubnet.c_str(), g_guiSettings.GetString("Network.Subnet").c_str());
950
937
strItem2.Format("%s %s", strlblGateway.c_str(), g_guiSettings.GetString("Network.Gateway").c_str());
951
938
strItem3.Format("%s %s", strlblDNS.c_str(), g_guiSettings.GetString("Network.DNS").c_str());
953
SET_CONTROL_LABEL(i_lblp2,wzIP);
940
SET_CONTROL_LABEL(i_lblp2,ip);
954
941
SET_CONTROL_LABEL(i_lblp4,strItem1);
955
942
SET_CONTROL_LABEL(i_lblp5,strItem2);
956
943
SET_CONTROL_LABEL(i_lblp6,strItem3);
980
967
ULARGE_INTEGER lTotalFreeBytesY; ULARGE_INTEGER lTotalNumberOfBytesY;
981
968
ULARGE_INTEGER lTotalFreeBytesZ; ULARGE_INTEGER lTotalNumberOfBytesZ;
983
WCHAR wszHDc[64]; WCHAR wszHDca[64]; WCHAR wszHDTotalSize[64];
984
WCHAR wszHDe[64]; WCHAR wszHDea[64]; WCHAR wszHDTotalUsed[64];
985
WCHAR wszHDf[64]; WCHAR wszHDfa[64]; WCHAR wszHDTotalFree[64];
986
WCHAR wszHDg[64]; WCHAR wszHDga[64]; WCHAR wszDVDStatus[128];
987
WCHAR wszHDx[64]; WCHAR wszHDxa[64];
988
WCHAR wszHDy[64]; WCHAR wszHDya[64]; WCHAR wszHDTotalUsedPercent[64];
989
WCHAR wszHDz[64]; WCHAR wszHDza[64]; WCHAR wszHDTotalFreePercent[64];
994
const WCHAR *pszDrive=g_localizeStrings.Get(155).c_str();
995
const WCHAR *pszFree=g_localizeStrings.Get(160).c_str();
996
const WCHAR *pszUnavailable=g_localizeStrings.Get(161).c_str();
998
970
// Set DVD Drive State! [TrayOpen, NotReady....]
971
CStdString trayState = "D: ";
972
const char* pszStatus1;
999
974
CIoSupport m_pIOhelp;
1000
WCHAR wsztraystate[64];
1001
const WCHAR *pszDrive1=g_localizeStrings.Get(155).c_str();
1002
//swprintf(wsztraystate,L"%s D: ",pszDrive1);
1003
swprintf(wsztraystate,L"D:");
1004
const WCHAR* pszStatus1;
1005
975
switch (m_pIOhelp.GetTrayState())
1017
987
pszStatus1=g_localizeStrings.Get(165).c_str();
1020
swprintf(wszDVDStatus,L"%s %s", wsztraystate,pszStatus1);
1023
if (GetDiskFreeSpaceEx(
1024
"C:\\", // directory name LPCSTR lpDirectoryName,
1025
NULL, // bytes available PULARGE_INTEGER lpFreeBytesAvailable,
1026
&lTotalNumberOfBytesC, // bytes on disk PULARGE_INTEGER lpTotalNumberOfBytes,
1027
&lTotalFreeBytesC) // free bytes on disk PULARGE_INTEGER lpTotalNumberOfFreeBytes
1030
swprintf(wszHDc, L"C: %u MB of ",lTotalFreeBytesC.QuadPart/MB); //To make it MB
1031
swprintf(wszHDca, L"%u MB Free",lTotalNumberOfBytesC.QuadPart/MB); //To make it MB
1032
wcscat(wszHDc,wszHDca);
1036
swprintf(wszHDc, L"%s C: ",pszDrive);
1037
wcscat(wszHDc,pszUnavailable);
1041
if (GetDiskFreeSpaceEx( "E:\\", NULL, &lTotalNumberOfBytesE, &lTotalFreeBytesE))
1043
swprintf(wszHDe, L"E: %u MB of ",lTotalFreeBytesE.QuadPart/MB ); //To make it MB
1044
swprintf(wszHDea, L"%u MB Free",lTotalNumberOfBytesE.QuadPart/MB); //To make it MB
1045
wcscat(wszHDe,wszHDea);
1049
swprintf(wszHDe, L"%s E: ",pszDrive);
1050
wcscat(wszHDe,pszUnavailable);
1053
if (GetDiskFreeSpaceEx( "F:\\", NULL, &lTotalNumberOfBytesF, &lTotalFreeBytesF))
1055
swprintf(wszHDf, L"F: %u MB of ",lTotalFreeBytesF.QuadPart/MB); //To make it MB
1056
swprintf(wszHDfa, L"%u MB Free",lTotalNumberOfBytesF.QuadPart/MB); //To make it MB
1057
wcscat(wszHDf,wszHDfa);
1062
swprintf(wszHDf, L"%s F: ",pszDrive);
1063
wcscat(wszHDf,pszUnavailable);
1067
if (GetDiskFreeSpaceEx( "G:\\", NULL, &lTotalNumberOfBytesG, &lTotalFreeBytesG))
1069
swprintf(wszHDg, L"G: %u MB of ",lTotalFreeBytesG.QuadPart/MB ); //To make it MB
1070
swprintf(wszHDga, L"%u MB Free",lTotalNumberOfBytesG.QuadPart/MB); //To make it MB
1071
wcscat(wszHDg,wszHDga);
1075
{ swprintf(wszHDg, L"G: ");
1076
wcscat(wszHDg,pszUnavailable);
1080
if (GetDiskFreeSpaceEx( "X:\\", NULL, &lTotalNumberOfBytesX, &lTotalFreeBytesX))
1082
swprintf(wszHDx, L"X: %u MB of ",lTotalFreeBytesX.QuadPart/MB); //To make it MB
1083
swprintf(wszHDxa, L"%u MB Free",lTotalNumberOfBytesX.QuadPart/MB); //To make it MB
1084
wcscat(wszHDx,wszHDxa);
1088
swprintf(wszHDx, L"%s X: ",pszDrive);
1089
wcscat(wszHDx,pszUnavailable);
1092
if (GetDiskFreeSpaceEx( "Y:\\", NULL, &lTotalNumberOfBytesY, &lTotalFreeBytesY))
1094
swprintf(wszHDy, L"Y: %u MB of ",lTotalFreeBytesY.QuadPart/MB); //To make it MB
1095
swprintf(wszHDya, L"%u MB Free",lTotalNumberOfBytesY.QuadPart/MB); //To make it MB
1096
wcscat(wszHDy,wszHDya);
1100
swprintf(wszHDy, L"%s Y: ",pszDrive);
1101
wcscat(wszHDy,pszUnavailable);
1104
if (GetDiskFreeSpaceEx( "Z:\\", NULL, &lTotalNumberOfBytesZ, &lTotalFreeBytesZ))
1106
swprintf(wszHDz, L"Z: %u MB of ",lTotalFreeBytesZ.QuadPart/MB); //To make it MB
1107
swprintf(wszHDza, L"%u MB Free",lTotalNumberOfBytesZ.QuadPart/MB); //To make it MB
1108
wcscat(wszHDz,wszHDza);
1112
swprintf(wszHDz, L"%s Z: ",pszDrive);
1113
wcscat(wszHDz,pszUnavailable);
990
trayState += pszStatus1;
991
SET_CONTROL_LABEL(i_lblp2, trayState);
995
GetDiskSpace("C", lTotalNumberOfBytesC, lTotalFreeBytesC, hdC);
996
GetDiskSpace("E", lTotalNumberOfBytesE, lTotalFreeBytesE, hdE);
997
SET_CONTROL_LABEL(i_lblp1,hdC);
998
SET_CONTROL_LABEL(i_lblp3,hdE);
1002
bool bUseDriveF = GetDiskSpace("F", lTotalNumberOfBytesF, lTotalFreeBytesF, hdF);
1003
bool bUseDriveG = GetDiskSpace("G", lTotalNumberOfBytesG, lTotalFreeBytesG, hdG);
1006
CStdString hdX, hdY, hdZ;
1007
GetDiskSpace("X", lTotalNumberOfBytesX, lTotalFreeBytesX, hdX);
1008
GetDiskSpace("Y", lTotalNumberOfBytesY, lTotalFreeBytesY, hdY);
1009
GetDiskSpace("Z", lTotalNumberOfBytesZ, lTotalFreeBytesZ, hdZ);
1116
1011
// Total Free Size: Generate from Drives#
1117
1012
ULARGE_INTEGER lTotalDiscSpace;
1145
1041
lTotalDiscUsed.QuadPart = lTotalDiscSpace.QuadPart - lTotalDiscFree.QuadPart;
1146
1042
lTotalDiscPercent.QuadPart = lTotalDiscSpace.QuadPart/100; // => 1%
1148
swprintf(wszHDTotalSize, L"Total: %u MB",lTotalDiscSpace.QuadPart/MB ); //Total Used To make it MB
1149
swprintf(wszHDTotalUsed, L", Used: %u MB",lTotalDiscUsed.QuadPart/MB ); //Total Free To make it MB
1150
swprintf(wszHDTotalFree, L", Free: %u MB ",lTotalDiscFree.QuadPart/MB ); //Total Free To make it MB
1152
int iuAdd = 0, ifAdd = 0;
1153
if (lTotalDiscUsed.QuadPart % lTotalDiscPercent.QuadPart >= lTotalDiscPercent.QuadPart/2 )
1158
swprintf(wszHDTotalUsedPercent, L"Total HDD Used: %u%%",lTotalDiscUsed.QuadPart/lTotalDiscPercent.QuadPart+iuAdd ); //Total Used %
1159
swprintf(wszHDTotalFreePercent, L" Free: %u%%",lTotalDiscFree.QuadPart/lTotalDiscPercent.QuadPart+ifAdd); //Total Free %
1161
wcscat(wszHDTotalSize,wszHDTotalUsed);
1162
wcscat(wszHDTotalSize,wszHDTotalFree);
1164
wcscat(wszHDTotalUsedPercent,wszHDTotalFreePercent);
1044
CStdString hdTotalSize, hdTotalUsedPercent;
1045
hdTotalSize.Format("Total: %u MB, Used: %u MB, Free: %u MB ", lTotalDiscSpace.QuadPart/MB, lTotalDiscUsed.QuadPart/MB, lTotalDiscFree.QuadPart/MB ); //Total Free To make it MB
1047
int percentUsed = (int)(100.0f * lTotalDiscUsed.QuadPart/lTotalDiscSpace.QuadPart + 0.5f);
1048
hdTotalUsedPercent.Format("Total HDD Used: %u%% Free: %u%%", percentUsed, 100 - percentUsed); //Total Free %
1167
1050
CLog::Log(LOGDEBUG, "------------- HDD Space Info: -------------------");
1168
1051
CLog::Log(LOGDEBUG, "HDD Total Size: %u MB", lTotalDiscSpace.QuadPart/MB);
1174
1057
CLog::Log(LOGDEBUG, "-------------------------------------------------");
1176
1059
// Detect which to show!!
1177
SET_CONTROL_LABEL(i_lblp1,wszHDc);
1178
SET_CONTROL_LABEL(i_lblp2,wszDVDStatus);
1179
SET_CONTROL_LABEL(i_lblp3,wszHDe);
1181
1060
if(bUseDriveF) // Show if Drive F is availible
1183
SET_CONTROL_LABEL(i_lblp4,wszHDf);
1062
SET_CONTROL_LABEL(i_lblp4,hdF);
1186
SET_CONTROL_LABEL(i_lblp5,wszHDg);
1187
SET_CONTROL_LABEL(i_lblp6,wszHDx);
1188
SET_CONTROL_LABEL(i_lblp7,wszHDy);
1189
SET_CONTROL_LABEL(i_lblp8,wszHDz);
1190
SET_CONTROL_LABEL(i_lblp9,wszHDTotalSize);
1191
SET_CONTROL_LABEL(i_lblp10,wszHDTotalUsedPercent);
1192
//SET_CONTROL_LABEL(i_lblp10,wszHDTotalUsed);
1193
//SET_CONTROL_LABEL(i_lblp11,wszHDTotalFree);
1065
SET_CONTROL_LABEL(i_lblp5,hdG);
1066
SET_CONTROL_LABEL(i_lblp6,hdX);
1067
SET_CONTROL_LABEL(i_lblp7,hdY);
1068
SET_CONTROL_LABEL(i_lblp8,hdZ);
1069
SET_CONTROL_LABEL(i_lblp9,hdTotalSize);
1070
SET_CONTROL_LABEL(i_lblp10,hdTotalUsedPercent);
1197
SET_CONTROL_LABEL(i_lblp5,wszHDx);
1198
SET_CONTROL_LABEL(i_lblp6,wszHDy);
1199
SET_CONTROL_LABEL(i_lblp7,wszHDz);
1200
SET_CONTROL_LABEL(i_lblp8,wszHDTotalSize);
1201
SET_CONTROL_LABEL(i_lblp9,wszHDTotalUsedPercent);
1202
//SET_CONTROL_LABEL(i_lblp9,wszHDTotalUsed);
1203
//SET_CONTROL_LABEL(i_lblp10,wszHDTotalFree);
1074
SET_CONTROL_LABEL(i_lblp5,hdX);
1075
SET_CONTROL_LABEL(i_lblp6,hdY);
1076
SET_CONTROL_LABEL(i_lblp7,hdZ);
1077
SET_CONTROL_LABEL(i_lblp8,hdTotalSize);
1078
SET_CONTROL_LABEL(i_lblp9,hdTotalUsedPercent);
1207
if(bUseDriveG) // Show if Drive G is availible
1209
SET_CONTROL_LABEL(i_lblp4,wszHDg);
1212
SET_CONTROL_LABEL(i_lblp5,wszHDf);
1213
SET_CONTROL_LABEL(i_lblp6,wszHDx);
1214
SET_CONTROL_LABEL(i_lblp7,wszHDy);
1215
SET_CONTROL_LABEL(i_lblp8,wszHDz);
1216
SET_CONTROL_LABEL(i_lblp9,wszHDTotalSize);
1217
SET_CONTROL_LABEL(i_lblp10,wszHDTotalUsedPercent);
1218
//SET_CONTROL_LABEL(i_lblp10,wszHDTotalUsed);
1219
//SET_CONTROL_LABEL(i_lblp11,wszHDTotalFree);
1223
SET_CONTROL_LABEL(i_lblp5,wszHDx);
1224
SET_CONTROL_LABEL(i_lblp6,wszHDy);
1225
SET_CONTROL_LABEL(i_lblp7,wszHDz);
1226
SET_CONTROL_LABEL(i_lblp8,wszHDTotalSize);
1227
SET_CONTROL_LABEL(i_lblp9,wszHDTotalUsedPercent);
1228
//SET_CONTROL_LABEL(i_lblp9,wszHDTotalUsed);
1229
//SET_CONTROL_LABEL(i_lblp10,wszHDTotalFree);
1233
if(!bUseDriveF && !bUseDriveG)
1235
SET_CONTROL_LABEL(i_lblp4,wszHDx);
1236
SET_CONTROL_LABEL(i_lblp5,wszHDy);
1237
SET_CONTROL_LABEL(i_lblp6,wszHDz);
1238
SET_CONTROL_LABEL(i_lblp7,wszHDTotalSize);
1239
SET_CONTROL_LABEL(i_lblp8,wszHDTotalUsedPercent);
1240
//SET_CONTROL_LABEL(i_lblp8,wszHDTotalUsed);
1241
//SET_CONTROL_LABEL(i_lblp9,wszHDTotalFree);
1082
else // F and G not available
1084
SET_CONTROL_LABEL(i_lblp4,hdX);
1085
SET_CONTROL_LABEL(i_lblp5,hdY);
1086
SET_CONTROL_LABEL(i_lblp6,hdZ);
1087
SET_CONTROL_LABEL(i_lblp7,hdTotalSize);
1088
SET_CONTROL_LABEL(i_lblp8,hdTotalUsedPercent);
1244
1092
//Only DebugOutput!
1245
1093
MEMORYSTATUS stat;
1246
1094
CHAR strOut[1024], *pstrOut;
1256
1104
AddStr( "%4d free MB of paging file.\n", stat.dwAvailPageFile / MB );
1257
1105
AddStr( "%4d percent of memory is in use.\n", stat.dwMemoryLoad );
1258
1106
OutputDebugString( strOut );
1111
bool CGUIWindowSystemInfo::GetDiskSpace(const CStdString &drive, ULARGE_INTEGER &total, ULARGE_INTEGER& totalFree, CStdString &string)
1113
CStdString driveName = drive + ":\\";
1115
if ((ret = GetDiskFreeSpaceEx( driveName.c_str(), NULL, &total, &totalFree)))
1116
string.Format("%s: %u MB of %u MB %s", drive.c_str(), totalFree.QuadPart/MB, total.QuadPart/MB, g_localizeStrings.Get(160).c_str());
1118
string.Format("%s %s: %s", g_localizeStrings.Get(155).c_str(), drive.c_str(), g_localizeStrings.Get(161).c_str());
1262
1122
bool CGUIWindowSystemInfo::GetBuildTime(int label1, int label2, int label3)
1264
CStdStringW version, buildDate, mplayerVersion;
1265
buildDate.Format(L"XBMC Compile Date: %S", g_infoManager.GetBuild().c_str());
1266
version.Format(L"%s %S", g_localizeStrings.Get(144).c_str(), g_infoManager.GetVersion().c_str());
1124
CStdString version, buildDate, mplayerVersion;
1125
buildDate.Format("XBMC Compile Date: %S", g_infoManager.GetBuild().c_str());
1126
version.Format("%s %S", g_localizeStrings.Get(144).c_str(), g_infoManager.GetVersion().c_str());
1267
1127
if (wcslen(m_wszMPlayerVersion))
1268
mplayerVersion.Format(L"Mplayer Version: %s", m_wszMPlayerVersion);
1128
mplayerVersion.Format("Mplayer Version: %ls", m_wszMPlayerVersion);
1270
mplayerVersion.Format(L"Mplayer Version: Finding...");
1130
mplayerVersion.Format("Mplayer Version: Finding...");
1271
1131
SET_CONTROL_LABEL(label1, version);
1272
1132
SET_CONTROL_LABEL(label2, buildDate);
1273
1133
SET_CONTROL_LABEL(label3, mplayerVersion);