• R/O
  • HTTP
  • SSH
  • HTTPS

PeerCastIM: Commit


Commit MetaInfo

Revision928bd27e053a585b86284a3ce14a80409a512814 (tree)
Time2007-12-29 22:00:38
Authoreru <eru01@user...>
Commitereru

Log Message

感謝祭機能を削除
bump時に一瞬GUIの表示がERRORになるのを修正。
GUIで下流情報がバグるのを修正。
感謝祭機能を削除。

Change Summary

Incremental Difference

--- a/PeerCast.root/PeerCast/core/common/version2.h
+++ b/PeerCast.root/PeerCast/core/common/version2.h
@@ -43,8 +43,8 @@ static const char *PCX_VERSTRING = "v0.1218(VP0026)";
4343 #define VERSION_EX 1
4444 static const char *PCP_CLIENT_VERSION_EX_PREFIX = "IM"; // 2bytes only
4545 static const int PCP_CLIENT_VERSION_EX_NUMBER = 26;
46-static const char *PCX_AGENTEX = "PeerCast/0.1218(IM0026-patch071223)";
47-static const char *PCX_VERSTRING_EX = "v0.1218(IM0026)";
46+static const char *PCX_AGENTEX = "PeerCast/0.1218(IM0026-2)";
47+static const char *PCX_VERSTRING_EX = "v0.1218(IM0026-2)";
4848 #endif
4949
5050 // ------------------------------------------------
--- a/PeerCast.root/PeerCast/ui/win32/simple/Simple.cpp
+++ b/PeerCast.root/PeerCast/ui/win32/simple/Simple.cpp
@@ -151,7 +151,6 @@ HINSTANCE hInst; // current instance
151151 TCHAR szTitle[MAX_LOADSTRING]; // The title bar text
152152 TCHAR szWindowClass[MAX_LOADSTRING]; // The title bar text
153153 TCHAR szWindowClass2[MAX_LOADSTRING]; // The title bar text
154-TCHAR szWindowClass3[MAX_LOADSTRING]; // The title bar text
155154
156155 // Foward declarations of functions included in this code module:
157156 ATOM MyRegisterClass(HINSTANCE hInstance);
@@ -168,10 +167,6 @@ void flipNotifyPopup(int id, ServMgr::NOTIFY_TYPE nt);
168167
169168 HWND chWnd=NULL;
170169
171-bool gbGetFile = FALSE;
172-bool gbStart = FALSE;
173-time_t gtGetFile;
174-time_t gtStartTime;
175170 // --------------------------------------------------
176171 void LOG2(const char *fmt,...)
177172 {
@@ -287,9 +282,6 @@ int APIENTRY WinMain(HINSTANCE hInstance,
287282 strcpy(szTitle,"PeerCast");
288283 strcpy(szWindowClass,"PeerCast");
289284 strcpy(szWindowClass2,"Main");
290- strcpy(szWindowClass3,"Start");
291-
292-
293285
294286 if (!allowMulti)
295287 {
@@ -328,7 +320,6 @@ int APIENTRY WinMain(HINSTANCE hInstance,
328320
329321 MyRegisterClass(hInstance);
330322 MyRegisterClass2(hInstance);
331- MyRegisterClass3(hInstance);
332323
333324 // Perform application initialization:
334325 if (!InitInstance (hInstance, nCmdShow))
@@ -364,24 +355,6 @@ int APIENTRY WinMain(HINSTANCE hInstance,
364355 chanMgr->findAndPlayChannel(info,false);
365356 }
366357
367- struct tm t;
368- memset(&t,0,sizeof(t));
369- t.tm_year = 2007 - 1900;
370- t.tm_mon = 4 - 1;
371- t.tm_mday = 7;
372- t.tm_hour = 21;
373- t.tm_min = 0;
374- t.tm_sec = 0;
375- gtStartTime = ::mktime(&t);
376- t.tm_hour = 20;
377- t.tm_min = 50;
378- gtGetFile = ::mktime(&t);
379-
380- if (gtStartTime > sys->getTime()){
381- gbGetFile = TRUE;
382- gbStart = TRUE;
383- }
384-
385358 hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_SIMPLE);
386359
387360 // setup menu notifes
@@ -477,28 +450,6 @@ ATOM MyRegisterClass2(HINSTANCE hInstance)
477450 return RegisterClassEx(&wcex);
478451 }
479452
480-ATOM MyRegisterClass3(HINSTANCE hInstance)
481-{
482- WNDCLASSEX wcex;
483-
484- wcex.cbSize = sizeof(WNDCLASSEX);
485-
486- wcex.style = CS_HREDRAW | CS_VREDRAW;
487- wcex.lpfnWndProc = (WNDPROC)StartProc;
488- wcex.cbClsExtra = 0;
489- wcex.cbWndExtra = 0;
490- wcex.hInstance = hInstance;
491- wcex.hIcon = LoadIcon(hInstance, (LPCTSTR)IDI_SIMPLE);
492- wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
493- wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
494-// wcex.lpszMenuName = (LPCSTR)IDC_SIMPLE;
495- wcex.lpszMenuName = NULL;
496- wcex.lpszClassName = szWindowClass3;
497- wcex.hIconSm = LoadIcon(wcex.hInstance, (LPCTSTR)IDI_SMALL);
498-
499- return RegisterClassEx(&wcex);
500-}
501-
502453 //-----------------------------
503454 void loadIcons(HINSTANCE hInstance, HWND hWnd)
504455 {
--- a/PeerCast.root/PeerCast/ui/win32/simple/gui.cpp
+++ b/PeerCast.root/PeerCast/ui/win32/simple/gui.cpp
@@ -105,21 +105,9 @@ WLock ChannelDataLock;
105105 WLock MakeBackLock;
106106 ChannelData *channelDataTop = NULL;
107107
108-extern bool gbGetFile;
109-extern bool gbStart;
110-extern time_t gtGetFile;
111-extern time_t gtStartTime;
112-ThreadInfo gtiStart;
113-ThreadInfo gtiGetFile;
114-static char *data1URL = "http://www.idolmaster.jp/download/images/wallpaper/imas360p_800.jpg";
115-static char *data2URL = "http://www.xbox.com/NR/rdonlyres/CAB05E2F-3051-409B-A4C8-830167C1C138/0/wpr0701idolmasterw120001.jpg";
116-HWND ghStart;
117-
118108 bool gbDispTop = false;
119109 bool gbAllOpen = false;
120110
121-THREAD_PROC FestivalStart(ThreadInfo *thread);
122-
123111 THREAD_PROC GetHostName(ThreadInfo *thread){
124112 IdData *id = (IdData*)(thread->data);
125113
@@ -153,69 +141,6 @@ THREAD_PROC GetHostName(ThreadInfo *thread){
153141 return 0;
154142 }
155143
156-bool DownloadFile(LPCTSTR URL, LPCTSTR local){
157- char header[] = "Accept: */*\r\n\r\n";
158- char buf[4096];
159-
160- FileStream f;
161- HINTERNET hInternet;
162- HINTERNET hConnect;
163-
164- try{
165- f.openWriteReplace(local);
166- }catch(StreamException &e){
167- return false;
168- }
169-
170- hInternet = ::InternetOpen(NULL, INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
171- if (hInternet == NULL){
172- return false;
173- }
174-
175- hConnect = ::InternetOpenUrl(hInternet, URL, header, strlen(header), INTERNET_FLAG_DONT_CACHE, 0);
176- if (hConnect == NULL){
177- ::InternetCloseHandle(hInternet);
178- return false;
179- }
180-
181- while(1){
182- sys->sleep(0);
183- DWORD dwReadSize;
184- BOOL ret = ::InternetReadFile(hConnect, buf, 4096, &dwReadSize);
185- if (ret){
186- if (dwReadSize == 0){
187- break;
188- }
189- try{
190- f.write(buf, dwReadSize);
191- continue;
192- } catch(StreamException e){
193- }
194- f.close();
195- ::InternetCloseHandle(hConnect);
196- ::InternetCloseHandle(hInternet);
197- return false;
198- }
199- }
200-
201- f.flush();
202- f.close();
203- ::InternetCloseHandle(hConnect);
204- ::InternetCloseHandle(hInternet);
205-
206- return true;
207-}
208-
209-THREAD_PROC GetInternetFile(ThreadInfo *thread){
210-
211- DownloadFile(data1URL, "data1.jpg");
212- DownloadFile(data2URL, "data2.jpg");
213- return 0;
214-}
215-
216-extern TCHAR szWindowClass3[]; // The title bar text
217-
218-
219144 int drawSpeed(Graphics *gra, int posX, int posY){
220145
221146 // 速度表示部の背景を白くする
@@ -339,7 +264,7 @@ int ChannelData::drawChannel(Graphics *g, int x, int y){
339264 posX = x;
340265 posY = y;
341266
342- int w,h;
267+ int w/*,h*/;
343268
344269 if (getWidth() == 0){
345270 if (gW){
@@ -666,7 +591,7 @@ void ServentData::setData(Servent *s, ChanHit *hit, unsigned int listeners, unsi
666591 int ServentData::drawServent(Gdiplus::Graphics *g, int x, int y){
667592 REAL xx = x * 1.0f;
668593 REAL yy = y * 1.0f;
669- int w,h;
594+ int w/*,h*/;
670595
671596 // 位置を保存
672597 posX = x;
@@ -1039,20 +964,6 @@ THREAD_PROC GUIDataUpdate(ThreadInfo *thread){
1039964 break;
1040965 sys->sleep(100);
1041966 }
1042-
1043- if (gbGetFile && (sys->getTime() > gtGetFile)){
1044- gbGetFile = false;
1045- gtiGetFile.func = GetInternetFile;
1046- gtiGetFile.data = NULL;
1047- sys->startThread(&gtiGetFile);
1048- }
1049- else if (gbStart && (sys->getTime() > gtStartTime)){
1050- gbStart = false;
1051- SendMessage(guiWnd, WM_START, 0, 0);
1052- gtiStart.func = FestivalStart;
1053- gtiStart.data = NULL;
1054- sys->startThread(&gtiStart);
1055- }
1056967 }
1057968
1058969 // set GUI thread status to terminated
@@ -1681,20 +1592,6 @@ LRESULT CALLBACK GUIProc (HWND hwnd, UINT message,
16811592
16821593 guiWnd = NULL;
16831594 break;
1684- case WM_START:
1685- ghStart = ::CreateWindow(szWindowClass3,
1686- "Peercast-IM@S",
1687- WS_OVERLAPPEDWINDOW & ~(WS_MAXIMIZEBOX),
1688- 0,
1689- 0,
1690- 400,
1691- 300,
1692- NULL,
1693- NULL,
1694- hInst,
1695- NULL);
1696- ::ShowWindow(ghStart, SW_SHOWNORMAL);
1697- break;
16981595
16991596 default:
17001597 return (DefWindowProc(hwnd, message, wParam, lParam));
@@ -1702,193 +1599,3 @@ LRESULT CALLBACK GUIProc (HWND hwnd, UINT message,
17021599
17031600 return 0;
17041601 }
1705-
1706-Gdiplus::Image *data1 = NULL;
1707-Gdiplus::Image *data2 = NULL;
1708-Gdiplus::Bitmap *startBmp = NULL;
1709-Gdiplus::Graphics *startGra = NULL;
1710-WLock MakeStartLock;
1711-
1712-LRESULT CALLBACK StartProc (HWND hwnd, UINT message,
1713- WPARAM wParam, LPARAM lParam)
1714-{
1715- SolidBrush b(Color::Black);
1716- bstr_t bstr;
1717-
1718- switch(message){
1719- case WM_CREATE:
1720- startBmp = ::new Bitmap(400,300);
1721- startGra = ::new Graphics(startBmp);
1722- bstr = L"data1.jpg";
1723- data1 = ::new Image(bstr);
1724- bstr = L"data2.jpg";
1725- data2 = ::new Image(bstr);
1726- // 黒で塗りつぶし
1727- startGra->FillRectangle(&b, 0, 0, 400, 300);
1728- break;
1729- case WM_PAINT:
1730- if (startGra){
1731- HDC hdc;
1732- PAINTSTRUCT paint;
1733-
1734- MakeStartLock.on();
1735- hdc = BeginPaint(hwnd, &paint);
1736- RECT *rcRect;
1737- rcRect = &(paint.rcPaint);
1738- LONG width = rcRect->right - rcRect->left + 1;
1739- LONG height = rcRect->bottom - rcRect->top + 1;
1740-
1741- Graphics g2(hdc);
1742- Rect r(rcRect->left, rcRect->top, width, height);
1743- g2.DrawImage(startBmp, r, rcRect->left, rcRect->top, width, height, UnitPixel);
1744- EndPaint(hwnd, &paint);
1745- MakeStartLock.off();
1746- }
1747- break;
1748- case WM_ERASEBKGND:
1749- return TRUE;
1750- case WM_CLOSE:
1751- DestroyWindow(ghStart);
1752- if (startBmp){
1753- ::delete startBmp;
1754- }
1755- if (startGra){
1756- ::delete startGra;
1757- }
1758- if (data1){
1759- ::delete data1;
1760- }
1761- if (data2){
1762- ::delete data2;
1763- }
1764- break;
1765-
1766- default:
1767- return (DefWindowProc(hwnd, message, wParam, lParam));
1768- }
1769-
1770- return 0;
1771-}
1772-
1773-THREAD_PROC FestivalStart(ThreadInfo *thread){
1774-
1775- while(startGra==NULL){
1776- sys->sleep(100);
1777- }
1778-
1779- sys->sleep(1000);
1780-
1781- MakeStartLock.on();
1782- Font font(L"MS Pゴシック",40);
1783- StringFormat format;
1784- format.SetAlignment(StringAlignmentCenter);
1785- startGra->SetTextRenderingHint(TextRenderingHintAntiAlias);
1786- PointF origin(199.0f,49.0f);
1787- RectF rect(0,0,400,100);
1788- LinearGradientBrush b1(rect, Color::LightSkyBlue, Color::White, LinearGradientModeHorizontal);
1789- startGra->DrawString(L"第2回", -1, &font, origin, &format, &b1);
1790- origin.Y += 50;
1791- LinearGradientBrush b2(rect, Color::LightGreen, Color::White, LinearGradientModeHorizontal);
1792- startGra->DrawString(L"アイドルマスター", -1, &font, origin, &format, &b2);
1793- origin.Y += 50;
1794- LinearGradientBrush b3(rect, Color::LightGoldenrodYellow, Color::White, LinearGradientModeHorizontal);
1795- startGra->DrawString(L"ファン感謝祭", -1, &font, origin, &format, &b3);
1796- MakeStartLock.off();
1797- InvalidateRect(ghStart, NULL, FALSE);
1798- sys->sleep(3000);
1799-
1800- MakeStartLock.on();
1801- startGra->DrawImage(data1, Rect(0,0,80,400), 200,200,66,330, UnitPixel);
1802- MakeStartLock.off();
1803- InvalidateRect(ghStart, NULL, FALSE);
1804- sys->sleep(500);
1805-
1806- MakeStartLock.on();
1807- startGra->DrawImage(data1, Rect(80,0,80,400), 266,200,66,330, UnitPixel);
1808- MakeStartLock.off();
1809- InvalidateRect(ghStart, NULL, FALSE);
1810- sys->sleep(500);
1811-
1812- MakeStartLock.on();
1813- startGra->DrawImage(data1, Rect(160,0,80,400), 332,200,66,330, UnitPixel);
1814- MakeStartLock.off();
1815- InvalidateRect(ghStart, NULL, FALSE);
1816- sys->sleep(500);
1817-
1818- MakeStartLock.on();
1819- startGra->DrawImage(data1, Rect(240,0,80,400), 398,200,66,330, UnitPixel);
1820- MakeStartLock.off();
1821- InvalidateRect(ghStart, NULL, FALSE);
1822- sys->sleep(500);
1823-
1824- MakeStartLock.on();
1825- startGra->DrawImage(data1, Rect(320,0,80,400), 464,200,66,330, UnitPixel);
1826- MakeStartLock.off();
1827- InvalidateRect(ghStart, NULL, FALSE);
1828- sys->sleep(500);
1829-
1830- MakeStartLock.on();
1831- startGra->DrawImage(data1, Rect(0,0,80,400), 530,200,54,270, UnitPixel);
1832- MakeStartLock.off();
1833- InvalidateRect(ghStart, NULL, FALSE);
1834- sys->sleep(500);
1835-
1836- MakeStartLock.on();
1837- startGra->DrawImage(data1, Rect(80,0,80,400), 584,200,54,270, UnitPixel);
1838- MakeStartLock.off();
1839- InvalidateRect(ghStart, NULL, FALSE);
1840- sys->sleep(500);
1841-
1842- MakeStartLock.on();
1843- startGra->DrawImage(data1, Rect(160,0,80,400), 638,200,54,270, UnitPixel);
1844- MakeStartLock.off();
1845- InvalidateRect(ghStart, NULL, FALSE);
1846- sys->sleep(500);
1847-
1848- MakeStartLock.on();
1849- startGra->DrawImage(data1, Rect(240,0,80,400), 692,200,54,270, UnitPixel);
1850- MakeStartLock.off();
1851- InvalidateRect(ghStart, NULL, FALSE);
1852- sys->sleep(500);
1853-
1854- MakeStartLock.on();
1855- startGra->DrawImage(data1, Rect(320,0,80,400), 746,200,54,270, UnitPixel);
1856- MakeStartLock.off();
1857- InvalidateRect(ghStart, NULL, FALSE);
1858- sys->sleep(500);
1859-
1860- for (int i=1; i<=10; i++){
1861- ColorMatrix mtx = {
1862- 1.0f, 0.0f, 0.0f, 0.0f, 0.0f,
1863- 0.0f, 1.0f, 0.0f, 0.0f, 0.0f,
1864- 0.0f, 0.0f, 1.0f, 0.0f, 0.0f,
1865- 0.0f, 0.0f, 0.0f, 0.1f*i, 0.0f,
1866- 0.0f, 0.0f, 0.0f, 0.0f, 1.0f};
1867- ImageAttributes att;
1868-
1869- MakeStartLock.on();
1870- att.SetColorMatrix(&mtx, ColorMatrixFlagsDefault, ColorAdjustTypeBitmap);
1871- startGra->DrawImage(data2, Rect(0,0,400,300), 360,130,400,300, UnitPixel, &att);
1872- MakeStartLock.off();
1873- InvalidateRect(ghStart, NULL, FALSE);
1874- sys->sleep(100);
1875- }
1876-
1877- sys->sleep(2000);
1878-
1879- MakeStartLock.on();
1880- INT style = FontStyleBold;
1881- Font font2(L"MS Pゴシック",70,style,UnitPoint);
1882- PointF origin2(199.0f,99.0f);
1883- SolidBrush bs(Color::Black);
1884- startGra->DrawString(L"START!", -1, &font2, origin2, &format, &bs);
1885- Font font3(L"MS Pゴシック",70,style,UnitPoint);
1886- LinearGradientBrush bx(rect, Color::LightPink, Color::DeepPink, LinearGradientModeHorizontal);
1887- startGra->DrawString(L"START!", -1, &font3, origin2, &format, &bx);
1888- MakeStartLock.off();
1889- InvalidateRect(ghStart, NULL, FALSE);
1890- sys->sleep(5000);
1891-
1892- SendMessage(ghStart, WM_CLOSE, 0, 0);
1893- return 0;
1894-}
--- a/PeerCast.root/PeerCast/ui/win32/simple/gui.h
+++ b/PeerCast.root/PeerCast/ui/win32/simple/gui.h
@@ -24,7 +24,6 @@
2424 #include "channel.h"
2525
2626 extern LRESULT CALLBACK GUIProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
27-extern LRESULT CALLBACK StartProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
2827 extern void ADDLOG(const char *str,int id,bool sel,void *data, LogBuffer::TYPE type);
2928
3029 extern String iniFileName;
@@ -39,9 +38,7 @@ enum
3938 WM_TRAYICON,
4039 WM_SHOWGUI,
4140 WM_SHOWMENU,
42- WM_PROCURL,
43- WM_START
44-
41+ WM_PROCURL
4542 };
4643
4744 class IdData
--- a/c:/Git/PeerCast.root/PeerCast/core/common/version2.h
+++ b/c:/Git/PeerCast.root/PeerCast/core/common/version2.h
@@ -43,8 +43,8 @@ static const char *PCX_VERSTRING = "v0.1218(VP0026)";
4343 #define VERSION_EX 1
4444 static const char *PCP_CLIENT_VERSION_EX_PREFIX = "IM"; // 2bytes only
4545 static const int PCP_CLIENT_VERSION_EX_NUMBER = 26;
46-static const char *PCX_AGENTEX = "PeerCast/0.1218(IM0026-patch071223)";
47-static const char *PCX_VERSTRING_EX = "v0.1218(IM0026)";
46+static const char *PCX_AGENTEX = "PeerCast/0.1218(IM0026-2)";
47+static const char *PCX_VERSTRING_EX = "v0.1218(IM0026-2)";
4848 #endif
4949
5050 // ------------------------------------------------
--- a/c:/Git/PeerCast.root/PeerCast/ui/win32/simple/Simple.cpp
+++ b/c:/Git/PeerCast.root/PeerCast/ui/win32/simple/Simple.cpp
@@ -151,7 +151,6 @@ HINSTANCE hInst; // current instance
151151 TCHAR szTitle[MAX_LOADSTRING]; // The title bar text
152152 TCHAR szWindowClass[MAX_LOADSTRING]; // The title bar text
153153 TCHAR szWindowClass2[MAX_LOADSTRING]; // The title bar text
154-TCHAR szWindowClass3[MAX_LOADSTRING]; // The title bar text
155154
156155 // Foward declarations of functions included in this code module:
157156 ATOM MyRegisterClass(HINSTANCE hInstance);
@@ -168,10 +167,6 @@ void flipNotifyPopup(int id, ServMgr::NOTIFY_TYPE nt);
168167
169168 HWND chWnd=NULL;
170169
171-bool gbGetFile = FALSE;
172-bool gbStart = FALSE;
173-time_t gtGetFile;
174-time_t gtStartTime;
175170 // --------------------------------------------------
176171 void LOG2(const char *fmt,...)
177172 {
@@ -287,9 +282,6 @@ int APIENTRY WinMain(HINSTANCE hInstance,
287282 strcpy(szTitle,"PeerCast");
288283 strcpy(szWindowClass,"PeerCast");
289284 strcpy(szWindowClass2,"Main");
290- strcpy(szWindowClass3,"Start");
291-
292-
293285
294286 if (!allowMulti)
295287 {
@@ -328,7 +320,6 @@ int APIENTRY WinMain(HINSTANCE hInstance,
328320
329321 MyRegisterClass(hInstance);
330322 MyRegisterClass2(hInstance);
331- MyRegisterClass3(hInstance);
332323
333324 // Perform application initialization:
334325 if (!InitInstance (hInstance, nCmdShow))
@@ -364,24 +355,6 @@ int APIENTRY WinMain(HINSTANCE hInstance,
364355 chanMgr->findAndPlayChannel(info,false);
365356 }
366357
367- struct tm t;
368- memset(&t,0,sizeof(t));
369- t.tm_year = 2007 - 1900;
370- t.tm_mon = 4 - 1;
371- t.tm_mday = 7;
372- t.tm_hour = 21;
373- t.tm_min = 0;
374- t.tm_sec = 0;
375- gtStartTime = ::mktime(&t);
376- t.tm_hour = 20;
377- t.tm_min = 50;
378- gtGetFile = ::mktime(&t);
379-
380- if (gtStartTime > sys->getTime()){
381- gbGetFile = TRUE;
382- gbStart = TRUE;
383- }
384-
385358 hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_SIMPLE);
386359
387360 // setup menu notifes
@@ -477,28 +450,6 @@ ATOM MyRegisterClass2(HINSTANCE hInstance)
477450 return RegisterClassEx(&wcex);
478451 }
479452
480-ATOM MyRegisterClass3(HINSTANCE hInstance)
481-{
482- WNDCLASSEX wcex;
483-
484- wcex.cbSize = sizeof(WNDCLASSEX);
485-
486- wcex.style = CS_HREDRAW | CS_VREDRAW;
487- wcex.lpfnWndProc = (WNDPROC)StartProc;
488- wcex.cbClsExtra = 0;
489- wcex.cbWndExtra = 0;
490- wcex.hInstance = hInstance;
491- wcex.hIcon = LoadIcon(hInstance, (LPCTSTR)IDI_SIMPLE);
492- wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
493- wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
494-// wcex.lpszMenuName = (LPCSTR)IDC_SIMPLE;
495- wcex.lpszMenuName = NULL;
496- wcex.lpszClassName = szWindowClass3;
497- wcex.hIconSm = LoadIcon(wcex.hInstance, (LPCTSTR)IDI_SMALL);
498-
499- return RegisterClassEx(&wcex);
500-}
501-
502453 //-----------------------------
503454 void loadIcons(HINSTANCE hInstance, HWND hWnd)
504455 {
--- a/c:/Git/PeerCast.root/PeerCast/ui/win32/simple/gui.cpp
+++ b/c:/Git/PeerCast.root/PeerCast/ui/win32/simple/gui.cpp
@@ -105,21 +105,9 @@ WLock ChannelDataLock;
105105 WLock MakeBackLock;
106106 ChannelData *channelDataTop = NULL;
107107
108-extern bool gbGetFile;
109-extern bool gbStart;
110-extern time_t gtGetFile;
111-extern time_t gtStartTime;
112-ThreadInfo gtiStart;
113-ThreadInfo gtiGetFile;
114-static char *data1URL = "http://www.idolmaster.jp/download/images/wallpaper/imas360p_800.jpg";
115-static char *data2URL = "http://www.xbox.com/NR/rdonlyres/CAB05E2F-3051-409B-A4C8-830167C1C138/0/wpr0701idolmasterw120001.jpg";
116-HWND ghStart;
117-
118108 bool gbDispTop = false;
119109 bool gbAllOpen = false;
120110
121-THREAD_PROC FestivalStart(ThreadInfo *thread);
122-
123111 THREAD_PROC GetHostName(ThreadInfo *thread){
124112 IdData *id = (IdData*)(thread->data);
125113
@@ -153,69 +141,6 @@ THREAD_PROC GetHostName(ThreadInfo *thread){
153141 return 0;
154142 }
155143
156-bool DownloadFile(LPCTSTR URL, LPCTSTR local){
157- char header[] = "Accept: */*\r\n\r\n";
158- char buf[4096];
159-
160- FileStream f;
161- HINTERNET hInternet;
162- HINTERNET hConnect;
163-
164- try{
165- f.openWriteReplace(local);
166- }catch(StreamException &e){
167- return false;
168- }
169-
170- hInternet = ::InternetOpen(NULL, INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
171- if (hInternet == NULL){
172- return false;
173- }
174-
175- hConnect = ::InternetOpenUrl(hInternet, URL, header, strlen(header), INTERNET_FLAG_DONT_CACHE, 0);
176- if (hConnect == NULL){
177- ::InternetCloseHandle(hInternet);
178- return false;
179- }
180-
181- while(1){
182- sys->sleep(0);
183- DWORD dwReadSize;
184- BOOL ret = ::InternetReadFile(hConnect, buf, 4096, &dwReadSize);
185- if (ret){
186- if (dwReadSize == 0){
187- break;
188- }
189- try{
190- f.write(buf, dwReadSize);
191- continue;
192- } catch(StreamException e){
193- }
194- f.close();
195- ::InternetCloseHandle(hConnect);
196- ::InternetCloseHandle(hInternet);
197- return false;
198- }
199- }
200-
201- f.flush();
202- f.close();
203- ::InternetCloseHandle(hConnect);
204- ::InternetCloseHandle(hInternet);
205-
206- return true;
207-}
208-
209-THREAD_PROC GetInternetFile(ThreadInfo *thread){
210-
211- DownloadFile(data1URL, "data1.jpg");
212- DownloadFile(data2URL, "data2.jpg");
213- return 0;
214-}
215-
216-extern TCHAR szWindowClass3[]; // The title bar text
217-
218-
219144 int drawSpeed(Graphics *gra, int posX, int posY){
220145
221146 // 速度表示部の背景を白くする
@@ -339,7 +264,7 @@ int ChannelData::drawChannel(Graphics *g, int x, int y){
339264 posX = x;
340265 posY = y;
341266
342- int w,h;
267+ int w/*,h*/;
343268
344269 if (getWidth() == 0){
345270 if (gW){
@@ -666,7 +591,7 @@ void ServentData::setData(Servent *s, ChanHit *hit, unsigned int listeners, unsi
666591 int ServentData::drawServent(Gdiplus::Graphics *g, int x, int y){
667592 REAL xx = x * 1.0f;
668593 REAL yy = y * 1.0f;
669- int w,h;
594+ int w/*,h*/;
670595
671596 // 位置を保存
672597 posX = x;
@@ -1039,20 +964,6 @@ THREAD_PROC GUIDataUpdate(ThreadInfo *thread){
1039964 break;
1040965 sys->sleep(100);
1041966 }
1042-
1043- if (gbGetFile && (sys->getTime() > gtGetFile)){
1044- gbGetFile = false;
1045- gtiGetFile.func = GetInternetFile;
1046- gtiGetFile.data = NULL;
1047- sys->startThread(&gtiGetFile);
1048- }
1049- else if (gbStart && (sys->getTime() > gtStartTime)){
1050- gbStart = false;
1051- SendMessage(guiWnd, WM_START, 0, 0);
1052- gtiStart.func = FestivalStart;
1053- gtiStart.data = NULL;
1054- sys->startThread(&gtiStart);
1055- }
1056967 }
1057968
1058969 // set GUI thread status to terminated
@@ -1681,20 +1592,6 @@ LRESULT CALLBACK GUIProc (HWND hwnd, UINT message,
16811592
16821593 guiWnd = NULL;
16831594 break;
1684- case WM_START:
1685- ghStart = ::CreateWindow(szWindowClass3,
1686- "Peercast-IM@S",
1687- WS_OVERLAPPEDWINDOW & ~(WS_MAXIMIZEBOX),
1688- 0,
1689- 0,
1690- 400,
1691- 300,
1692- NULL,
1693- NULL,
1694- hInst,
1695- NULL);
1696- ::ShowWindow(ghStart, SW_SHOWNORMAL);
1697- break;
16981595
16991596 default:
17001597 return (DefWindowProc(hwnd, message, wParam, lParam));
@@ -1702,193 +1599,3 @@ LRESULT CALLBACK GUIProc (HWND hwnd, UINT message,
17021599
17031600 return 0;
17041601 }
1705-
1706-Gdiplus::Image *data1 = NULL;
1707-Gdiplus::Image *data2 = NULL;
1708-Gdiplus::Bitmap *startBmp = NULL;
1709-Gdiplus::Graphics *startGra = NULL;
1710-WLock MakeStartLock;
1711-
1712-LRESULT CALLBACK StartProc (HWND hwnd, UINT message,
1713- WPARAM wParam, LPARAM lParam)
1714-{
1715- SolidBrush b(Color::Black);
1716- bstr_t bstr;
1717-
1718- switch(message){
1719- case WM_CREATE:
1720- startBmp = ::new Bitmap(400,300);
1721- startGra = ::new Graphics(startBmp);
1722- bstr = L"data1.jpg";
1723- data1 = ::new Image(bstr);
1724- bstr = L"data2.jpg";
1725- data2 = ::new Image(bstr);
1726- // 黒で塗りつぶし
1727- startGra->FillRectangle(&b, 0, 0, 400, 300);
1728- break;
1729- case WM_PAINT:
1730- if (startGra){
1731- HDC hdc;
1732- PAINTSTRUCT paint;
1733-
1734- MakeStartLock.on();
1735- hdc = BeginPaint(hwnd, &paint);
1736- RECT *rcRect;
1737- rcRect = &(paint.rcPaint);
1738- LONG width = rcRect->right - rcRect->left + 1;
1739- LONG height = rcRect->bottom - rcRect->top + 1;
1740-
1741- Graphics g2(hdc);
1742- Rect r(rcRect->left, rcRect->top, width, height);
1743- g2.DrawImage(startBmp, r, rcRect->left, rcRect->top, width, height, UnitPixel);
1744- EndPaint(hwnd, &paint);
1745- MakeStartLock.off();
1746- }
1747- break;
1748- case WM_ERASEBKGND:
1749- return TRUE;
1750- case WM_CLOSE:
1751- DestroyWindow(ghStart);
1752- if (startBmp){
1753- ::delete startBmp;
1754- }
1755- if (startGra){
1756- ::delete startGra;
1757- }
1758- if (data1){
1759- ::delete data1;
1760- }
1761- if (data2){
1762- ::delete data2;
1763- }
1764- break;
1765-
1766- default:
1767- return (DefWindowProc(hwnd, message, wParam, lParam));
1768- }
1769-
1770- return 0;
1771-}
1772-
1773-THREAD_PROC FestivalStart(ThreadInfo *thread){
1774-
1775- while(startGra==NULL){
1776- sys->sleep(100);
1777- }
1778-
1779- sys->sleep(1000);
1780-
1781- MakeStartLock.on();
1782- Font font(L"MS Pゴシック",40);
1783- StringFormat format;
1784- format.SetAlignment(StringAlignmentCenter);
1785- startGra->SetTextRenderingHint(TextRenderingHintAntiAlias);
1786- PointF origin(199.0f,49.0f);
1787- RectF rect(0,0,400,100);
1788- LinearGradientBrush b1(rect, Color::LightSkyBlue, Color::White, LinearGradientModeHorizontal);
1789- startGra->DrawString(L"第2回", -1, &font, origin, &format, &b1);
1790- origin.Y += 50;
1791- LinearGradientBrush b2(rect, Color::LightGreen, Color::White, LinearGradientModeHorizontal);
1792- startGra->DrawString(L"アイドルマスター", -1, &font, origin, &format, &b2);
1793- origin.Y += 50;
1794- LinearGradientBrush b3(rect, Color::LightGoldenrodYellow, Color::White, LinearGradientModeHorizontal);
1795- startGra->DrawString(L"ファン感謝祭", -1, &font, origin, &format, &b3);
1796- MakeStartLock.off();
1797- InvalidateRect(ghStart, NULL, FALSE);
1798- sys->sleep(3000);
1799-
1800- MakeStartLock.on();
1801- startGra->DrawImage(data1, Rect(0,0,80,400), 200,200,66,330, UnitPixel);
1802- MakeStartLock.off();
1803- InvalidateRect(ghStart, NULL, FALSE);
1804- sys->sleep(500);
1805-
1806- MakeStartLock.on();
1807- startGra->DrawImage(data1, Rect(80,0,80,400), 266,200,66,330, UnitPixel);
1808- MakeStartLock.off();
1809- InvalidateRect(ghStart, NULL, FALSE);
1810- sys->sleep(500);
1811-
1812- MakeStartLock.on();
1813- startGra->DrawImage(data1, Rect(160,0,80,400), 332,200,66,330, UnitPixel);
1814- MakeStartLock.off();
1815- InvalidateRect(ghStart, NULL, FALSE);
1816- sys->sleep(500);
1817-
1818- MakeStartLock.on();
1819- startGra->DrawImage(data1, Rect(240,0,80,400), 398,200,66,330, UnitPixel);
1820- MakeStartLock.off();
1821- InvalidateRect(ghStart, NULL, FALSE);
1822- sys->sleep(500);
1823-
1824- MakeStartLock.on();
1825- startGra->DrawImage(data1, Rect(320,0,80,400), 464,200,66,330, UnitPixel);
1826- MakeStartLock.off();
1827- InvalidateRect(ghStart, NULL, FALSE);
1828- sys->sleep(500);
1829-
1830- MakeStartLock.on();
1831- startGra->DrawImage(data1, Rect(0,0,80,400), 530,200,54,270, UnitPixel);
1832- MakeStartLock.off();
1833- InvalidateRect(ghStart, NULL, FALSE);
1834- sys->sleep(500);
1835-
1836- MakeStartLock.on();
1837- startGra->DrawImage(data1, Rect(80,0,80,400), 584,200,54,270, UnitPixel);
1838- MakeStartLock.off();
1839- InvalidateRect(ghStart, NULL, FALSE);
1840- sys->sleep(500);
1841-
1842- MakeStartLock.on();
1843- startGra->DrawImage(data1, Rect(160,0,80,400), 638,200,54,270, UnitPixel);
1844- MakeStartLock.off();
1845- InvalidateRect(ghStart, NULL, FALSE);
1846- sys->sleep(500);
1847-
1848- MakeStartLock.on();
1849- startGra->DrawImage(data1, Rect(240,0,80,400), 692,200,54,270, UnitPixel);
1850- MakeStartLock.off();
1851- InvalidateRect(ghStart, NULL, FALSE);
1852- sys->sleep(500);
1853-
1854- MakeStartLock.on();
1855- startGra->DrawImage(data1, Rect(320,0,80,400), 746,200,54,270, UnitPixel);
1856- MakeStartLock.off();
1857- InvalidateRect(ghStart, NULL, FALSE);
1858- sys->sleep(500);
1859-
1860- for (int i=1; i<=10; i++){
1861- ColorMatrix mtx = {
1862- 1.0f, 0.0f, 0.0f, 0.0f, 0.0f,
1863- 0.0f, 1.0f, 0.0f, 0.0f, 0.0f,
1864- 0.0f, 0.0f, 1.0f, 0.0f, 0.0f,
1865- 0.0f, 0.0f, 0.0f, 0.1f*i, 0.0f,
1866- 0.0f, 0.0f, 0.0f, 0.0f, 1.0f};
1867- ImageAttributes att;
1868-
1869- MakeStartLock.on();
1870- att.SetColorMatrix(&mtx, ColorMatrixFlagsDefault, ColorAdjustTypeBitmap);
1871- startGra->DrawImage(data2, Rect(0,0,400,300), 360,130,400,300, UnitPixel, &att);
1872- MakeStartLock.off();
1873- InvalidateRect(ghStart, NULL, FALSE);
1874- sys->sleep(100);
1875- }
1876-
1877- sys->sleep(2000);
1878-
1879- MakeStartLock.on();
1880- INT style = FontStyleBold;
1881- Font font2(L"MS Pゴシック",70,style,UnitPoint);
1882- PointF origin2(199.0f,99.0f);
1883- SolidBrush bs(Color::Black);
1884- startGra->DrawString(L"START!", -1, &font2, origin2, &format, &bs);
1885- Font font3(L"MS Pゴシック",70,style,UnitPoint);
1886- LinearGradientBrush bx(rect, Color::LightPink, Color::DeepPink, LinearGradientModeHorizontal);
1887- startGra->DrawString(L"START!", -1, &font3, origin2, &format, &bx);
1888- MakeStartLock.off();
1889- InvalidateRect(ghStart, NULL, FALSE);
1890- sys->sleep(5000);
1891-
1892- SendMessage(ghStart, WM_CLOSE, 0, 0);
1893- return 0;
1894-}
--- a/c:/Git/PeerCast.root/PeerCast/ui/win32/simple/gui.h
+++ b/c:/Git/PeerCast.root/PeerCast/ui/win32/simple/gui.h
@@ -24,7 +24,6 @@
2424 #include "channel.h"
2525
2626 extern LRESULT CALLBACK GUIProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
27-extern LRESULT CALLBACK StartProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
2827 extern void ADDLOG(const char *str,int id,bool sel,void *data, LogBuffer::TYPE type);
2928
3029 extern String iniFileName;
@@ -39,9 +38,7 @@ enum
3938 WM_TRAYICON,
4039 WM_SHOWGUI,
4140 WM_SHOWMENU,
42- WM_PROCURL,
43- WM_START
44-
41+ WM_PROCURL
4542 };
4643
4744 class IdData
Show on old repository browser