2 Copyright 2004-2005 Chris Tallon
4 This file is part of VOMP.
6 VOMP is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 VOMP is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with VOMP; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 #define _WIN32_WINNT 0x501
30 #include "vompreswin.h"
34 #include "remotewin.h"
41 #include "windowsosd.h"
43 #include "osdwinpixel.h"
45 #include "osdwinvector.h"
50 #include "vsleeptimer.h"
52 void sighandler(int signalReceived);
53 void shutdown(int code);
55 // Global variables --------------------------------------------------------------------------------------------------
69 Sleeptimer* sleeptimer;
72 bool wnd_fullscreen=false;
73 bool wnd_topmost=false;
74 RECT wnd_fs_rect={20,20,768+20,576+20};
75 RECT wnd_fs_rect_client={0,0,768,576};
76 //OSVERSIONINFO windows_ver; //attempt to distigsh windows versions
82 typedef UINT (WINAPI *GETRAWINPUTDATAFNC) (HRAWINPUT,UINT,LPVOID,PUINT,UINT);
83 typedef UINT (WINAPI *REGISTERRAWINPUTDEVICEFNC) (PCRAWINPUTDEVICE,UINT,UINT);
85 GETRAWINPUTDATAFNC dynGetRawInputData=NULL;
86 REGISTERRAWINPUTDEVICEFNC dynRegisterRawInputDevices=NULL;
91 void MILLISLEEP(ULONG a)
98 int getClockRealTime(struct timespec *tp){
102 GetSystemTime(&systime);
103 SystemTimeToFileTime(&systime, (FILETIME*)&filetime);
104 tp->tv_sec = (filetime - WINDOWS_TIME_BASE_OFFSET) / (10 * 1000 * 1000);
105 tp->tv_nsec = ((filetime - WINDOWS_TIME_BASE_OFFSET) % (10 * 1000 * 1000)) * 100;
109 DWORD WINAPI commandthreadStart(void *arg)
115 void LoadRemoteFunctions() {
116 user32dll=LoadLibrary("user32.dll");
117 if (user32dll!=NULL) {
118 dynGetRawInputData=(GETRAWINPUTDATAFNC)GetProcAddress(user32dll,"GetRawInputData");
119 if (dynGetRawInputData!=NULL) {
120 dynRegisterRawInputDevices=(REGISTERRAWINPUTDEVICEFNC)GetProcAddress(user32dll,"RegisterRawInputDevices");
121 if (dynRegisterRawInputDevices!=NULL) {
128 bool InitApp(HINSTANCE hinst,int cmdshow);
130 HWND win_main;//global window handle
131 HWND win;//global child window handle
134 #define ERROR_MSG(str) MessageBox(win_main,str,"Error!",MB_OK|MB_ICONWARNING)
135 INT WINAPI WinMain( HINSTANCE hinst , HINSTANCE previnst, LPSTR cmdline, int cmdshow)
138 //On Windows we have to init a window, we use DXUT
139 LoadRemoteFunctions();
140 if (!InitApp(hinst,cmdshow)) return false;
141 //Starting Network support
143 int result = WSAStartup(MAKEWORD(2,2),&wsadat);
144 if (result!=NO_ERROR) {
145 ERROR_MSG("Initialising WinSocked: Error at WSAStartup()\n");
149 result= CoInitializeEx(NULL,COINIT_MULTITHREADED );//Initialize COM for DirectShow
151 ERROR_MSG("Initialising COM: Error at Coinitialize()\n");
158 // Init global vars ------------------------------------------------------------------------------------------------
161 remote = new RemoteWin();
164 timers = new Timers();
165 osd = new Osd_TYPE();
167 video = new VideoWin();
168 audio = new AudioWin();
169 boxstack = new BoxStack();
170 command = new Command();
172 sleeptimer = new Sleeptimer();
174 if (!logger || !remote || !mtd || !led || !osd || !video || !audio || !boxstack || !command || !sleeptimer)
176 ERROR_MSG("Could not create objects. Memory problems?\n");
182 // Get logging module started --------------------------------------------------------------------------------------
184 if (!logger->init(Log::DEBUG, "vompwin.log", true))
186 ERROR_MSG("Could not initialise log object. Aborting.\n");
192 logger->log("Core", Log::INFO, "Starting up...");
196 // Init modules ----------------------------------------------------------------------------------------------------
199 success = remote->init("/dev/rawir");
202 logger->log("Core", Log::INFO, "Remote module initialised");
206 logger->log("Core", Log::EMERG, "Remote module failed to initialise");
212 success = led->init(0);
215 logger->log("Core", Log::INFO, "LED module initialised");
219 logger->log("Core", Log::EMERG, "LED module failed to initialise");
225 success = mtd->init();
228 logger->log("Core", Log::INFO, "Mtd module initialised");
232 logger->log("Core", Log::EMERG, "Mtd module failed to initialise");
238 success = timers->init();
241 logger->log("Core", Log::INFO, "Timers module initialised");
245 logger->log("Core", Log::EMERG, "Timers module failed to initialise");
251 UCHAR videoFormat = (UCHAR)mtd->getPALorNTSC();
252 if (videoFormat == Video::PAL) logger->log("Core", Log::INFO, "Read from MTD: PAL 720x576");
253 else if (videoFormat == Video::NTSC) logger->log("Core", Log::INFO, "Read from MTD: NTSC 720x480");
254 else logger->log("Core", Log::INFO, "No help from MTD. Assuming NTSC 720x480");
256 success = video->init(videoFormat);
259 logger->log("Core", Log::INFO, "Video module initialised");
263 logger->log("Core", Log::EMERG, "Video module failed to initialise");
269 dynamic_cast<WindowsOsd*>(osd)->setWindow(win);
270 success = osd->init(NULL);
273 logger->log("Core", Log::INFO, "OSD module initialised");
277 logger->log("Core", Log::EMERG, "OSD module failed to initialise");
282 video->setDefaultAspect();
284 success = audio->init(Audio::MPEG2_PES);
287 logger->log("Core", Log::INFO, "Audio module initialised");
291 logger->log("Core", Log::EMERG, "Audio module failed to initialise");
297 success = vdr->init(3024);
300 logger->log("Core", Log::INFO, "VDR module initialised");
304 logger->log("Core", Log::EMERG, "VDR module failed to initialise");
310 success = boxstack->init();
313 logger->log("Core", Log::INFO, "BoxStack module initialised");
317 logger->log("Core", Log::EMERG, "BoxStack module failed to initialise");
323 success = command->init();
326 logger->log("Core", Log::INFO, "Command module initialised");
330 logger->log("Core", Log::EMERG, "Command module failed to initialise");
336 // Other init ------------------------------------------------------------------------------------------------------
338 logger->log("Core", Log::NOTICE, "Startup successful");
340 // Run main loop ---------------------------------------------------------------------------------------------------
342 // Ok, all major device components and other bits are loaded and ready
343 lastmousemove=timeGetTime();
345 HANDLE commandthread;
346 commandthread= CreateThread(NULL, 0, commandthreadStart, NULL,0,
349 message.message=WM_NULL;
351 while(run && WaitForSingleObject(commandthread,0)==WAIT_TIMEOUT) {
352 if (PeekMessage(&message, NULL, 0,0,PM_REMOVE)!=0) {
353 if (TranslateAccelerator(win_main,acc,&message)==NULL) {
354 TranslateMessage(&message);
355 DispatchMessage(&message);
356 switch (message.message) {
358 run=false; //TODO post exit to command Messages
362 //Render, moved to OSD !
364 //((OsdWin*)osd)->Render();
367 // When that returns quit ------------------------------------------------------------------------------------------
368 WaitForSingleObject(commandthread,INFINITE);
371 if (user32dll) FreeModule(user32dll);
376 bool TranslateMousePosition(POINT *pos) {
379 ScreenToClient(win,pos);
380 GetClientRect(win,&clientrect);
381 if (!PtInRect(&clientrect,*pos)) return false;//Don't pass it further
382 pos->x=((double)pos->x)/((double) (clientrect.right-clientrect.left))
383 *((double)Video::getInstance()->getScreenWidth());
384 pos->y=((double)pos->y)/((double) (clientrect.bottom-clientrect.top))
385 *((double)Video::getInstance()->getScreenHeight());
392 void CalculateWindowSize(RECT * size,ULONG size_mode) {
395 DWORD adjheight,adjwidth;
396 if (!wnd_fullscreen) {
397 DWORD flags =WS_VISIBLE | WS_POPUP | WS_CAPTION | WS_SYSMENU
398 |WS_MINIMIZEBOX | WS_SIZEBOX |WS_MAXIMIZEBOX;
399 RECT wnted={50,50,150,150};
400 AdjustWindowRect(&wnted,flags ,false);
401 adjwidth=-wnted.left+wnted.right-100;
402 adjheight=-wnted.top+wnted.bottom-100;
404 adjwidth=adjheight=0;
406 width=size->right-size->left-adjwidth;
407 height=size->bottom-size->top-adjheight;
408 UCHAR mode=Video::PAL;
409 UCHAR aspect=Video::ASPECT4X3;
410 UCHAR tvsize=Video::ASPECT4X3;
412 mode=video->getMode();
413 aspect=((VideoWin*)video)->getAspectRatio();
414 tvsize=((VideoWin*)video)->getPseudoTVsize();
417 double aspectrt=4./3.;
418 if (tvsize==Video::ASPECT16X9) {
419 if (aspect==Video::ASPECT16X9) {
420 aspectrt=4./3.; //looks strange, but it is a 16:9 tv
421 } else if (aspect==Video::ASPECT4X3) {
422 aspectrt=4./3./(16./9.)*(4./3.); //I hope this is correct
424 } else if (tvsize==Video::ASPECT4X3) {
425 if (aspect==Video::ASPECT16X9) {
426 if (mode!=Video::NORMAL) {
431 } else if (aspect==Video::ASPECT4X3) {
435 if (!wnd_fullscreen) {
438 case WMSZ_BOTTOMRIGHT:
441 width=(ULONG)(((double)height)*aspectrt);
442 size->right=size->left+width+adjwidth;
444 case WMSZ_BOTTOMLEFT:
446 width=(ULONG)(((double)height)*aspectrt);
447 size->left=size->right-width-adjwidth;
451 height=(ULONG)(((double)width)/aspectrt);
452 size->bottom=size->top+height+adjheight;
455 MoveWindow(win,0,0,width,height,TRUE);
457 RECT newrect={0,0,width,height};
459 if ((ULONG)(((double)height)*aspectrt)>width) {
460 newlength=(ULONG)(((double)width)/aspectrt);
461 newrect.top+=(height-newlength)/2;
462 newrect.bottom-=(height-newlength);
464 newlength=(ULONG)(((double)height)*aspectrt);
465 newrect.left+=(width-newlength)/2;
466 newrect.right-=(width-newlength);
468 MoveWindow(win,newrect.left,newrect.top,newrect.right,newrect.bottom,TRUE);
473 void AdjustWindow() {
474 if (!wnd_fullscreen) {
476 GetWindowRect(win_main,&winrect);
477 CalculateWindowSize(&winrect,WMSZ_BOTTOM);
478 MoveWindow(win_main,winrect.left,
479 winrect.top,winrect.right-winrect.left,winrect.bottom-winrect.top,true);
482 GetWindowRect(win_main,&winrect);
483 CalculateWindowSize(&winrect,WMSZ_BOTTOM);
488 void ToggleFullscreen() {
489 if (wnd_fullscreen) {
490 wnd_fullscreen=false;
491 SetWindowLong(win_main,GWL_STYLE,WS_VISIBLE | WS_POPUP | WS_CAPTION | WS_SYSMENU
492 |WS_MINIMIZEBOX | WS_SIZEBOX |WS_MAXIMIZEBOX);
493 SetWindowPos(win_main,NULL,0,0,0,0,SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);
495 SetWindowPos(win_main,wnd_topmost?HWND_TOPMOST:HWND_TOP,wnd_fs_rect.left,wnd_fs_rect.top,
496 wnd_fs_rect.right-wnd_fs_rect.left,
497 wnd_fs_rect.bottom-wnd_fs_rect.top,
498 SWP_DRAWFRAME | SWP_FRAMECHANGED);
499 MoveWindow(win,wnd_fs_rect_client.left,wnd_fs_rect_client.top,
500 wnd_fs_rect_client.right-wnd_fs_rect_client.left,
501 wnd_fs_rect_client.bottom-wnd_fs_rect_client.top,TRUE);
504 GetWindowRect(win_main,&wnd_fs_rect);
505 GetWindowRect(win,&wnd_fs_rect_client);
506 SetWindowLong(win_main,GWL_STYLE,WS_VISIBLE | WS_POPUP );
507 SetWindowPos(win_main,NULL,0,0,0,0,SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);
508 HMONITOR monitor=MonitorFromWindow(win_main,MONITOR_DEFAULTTONEAREST);
510 moninfo.cbSize=sizeof(moninfo);
512 if (!GetMonitorInfo(monitor,&moninfo)) return ;
513 SetWindowPos(win_main,wnd_topmost?HWND_TOPMOST:HWND_TOP,moninfo.rcMonitor.left,moninfo.rcMonitor.top,
514 moninfo.rcMonitor.right,moninfo.rcMonitor.bottom,SWP_FRAMECHANGED);
523 void ToggleTopmost() {
524 wnd_topmost=!wnd_topmost;
525 SetWindowPos(win_main,wnd_topmost?HWND_TOPMOST:HWND_NOTOPMOST,0,0,
526 0,0,SWP_NOMOVE | SWP_NOSIZE);
529 void CursorUpdate() {
531 GetCursorPos(&cursorpos);
533 asswind=WindowFromPoint(cursorpos);
534 if (asswind!=win_main && asswind!=win) {
535 return ; //not our responsibility
537 if ((timeGetTime()-lastmousemove)<4000 || cmenu) {
538 SetCursor(LoadCursor(NULL,IDC_ARROW));
544 bool ContextMenu(HWND wind,int x,int y) {
547 ScreenToClient(wind,&p);
548 GetClientRect(wind,&clientrect);
549 if (!PtInRect(&clientrect,p)) return false;
550 ClientToScreen(wind,&p);
553 menu=LoadMenu(hinstance,MAKEINTRESOURCE(VOMPMENU));
554 popup=GetSubMenu(menu,0);
555 if (wnd_fullscreen) {
556 CheckMenuItem(popup,VOMP_FULL_SCREEN,MF_BYCOMMAND|MF_CHECKED);
558 CheckMenuItem(popup,VOMP_FULL_SCREEN,MF_BYCOMMAND|MF_UNCHECKED);
561 CheckMenuItem(popup,VOMP_TOPMOST,MF_BYCOMMAND|MF_CHECKED);
563 CheckMenuItem(popup,VOMP_TOPMOST,MF_BYCOMMAND|MF_UNCHECKED);
566 TrackPopupMenu(popup,TPM_RIGHTBUTTON|TPM_LEFTALIGN,x,y,0,wind, NULL);
574 LONG FAR PASCAL WindowProc(HWND wind, UINT msg, WPARAM wparam, LPARAM lparam)
580 logger->log("Core", Log::NOTICE, "Window closed, shutting down...");
582 ((RemoteWin*)Remote::getInstance())->SendPower();
586 CalculateWindowSize((RECT*) lparam,wparam);
590 int width = LOWORD(lparam);
591 int height = HIWORD(lparam);
593 if (wparam == SIZE_MAXIMIZED) {
596 } /*else if (wparam == SIZE_MINIMIZED) {
606 if (GetUpdateRect(wind, &r, FALSE)) {
607 BeginPaint(wind, &ps);
608 //Call Painting Mechanism
613 if (((RemoteWin*)remote)->ReceiveButtonVK(wparam)) {
614 return 0L; //We process that Key
616 return DefWindowProc(wind, msg, wparam, lparam);
621 if (((RemoteWin*)remote)->ReceiveButtonCH(wparam)) {
622 return 0L; //We process that Key
624 return DefWindowProc(wind, msg, wparam, lparam);
629 if (((RemoteWin*)remote)->ReceiveButtonAP(GET_APPCOMMAND_LPARAM(lparam))){
630 return TRUE; //yes we process that message
632 return DefWindowProc(wind, msg, wparam, lparam);
641 dynGetRawInputData((HRAWINPUT)lparam,RID_INPUT,NULL,&risize,sizeof(RAWINPUTHEADER));
642 lpit=(LPRAWINPUT)malloc(risize);
643 dynGetRawInputData((HRAWINPUT)lparam,RID_INPUT,lpit,&risize,sizeof(RAWINPUTHEADER));
645 if (lpit->header.dwType==RIM_TYPEHID && lpit->data.hid.dwSizeHid>=2) {
646 DWORD button=lpit->data.hid.bRawData[1] | (lpit->data.hid.bRawData[0]<< 8);
647 if (((RemoteWin*)remote)->ReceiveButtonRI(button)){
649 return 0; //yes we process that message
654 return DefWindowProc(wind, msg, wparam, lparam);
659 if (LOWORD(wparam)==VOMP_FULL_SCREEN) {
663 if (LOWORD(wparam)==VOMP_TOPMOST) {
667 if (((RemoteWin*)remote)->ReceiveButtonAP(LOWORD(wparam))){
668 return 0; //yes we process that message
670 return DefWindowProc(wind, msg, wparam, lparam);
675 if (((HANDLE)wparam)==win) {
679 return DefWindowProc(wind, msg, wparam, lparam);
683 if (wparam==SC_MAXIMIZE) {
686 } else if (wparam==SC_SCREENSAVE || wparam==SC_MONITORPOWER) {
689 return DefWindowProc(wind,msg,wparam, lparam);
694 lastmousemove=timeGetTime();
695 SetCursor(LoadCursor(NULL,IDC_ARROW));
696 SetTimer(wind,VOMP_CURSORUPDATE,4500,NULL);
697 POINT mpos={GET_X_LPARAM(lparam),GET_Y_LPARAM(lparam)};
698 ClientToScreen(wind,&mpos);
699 if (TranslateMousePosition(&mpos)) {
700 Message *mousemes=new Message();
701 mousemes->message=Message::MOUSE_MOVE;
703 mousemes->to=BoxStack::getInstance();
704 mousemes->parameter.num=(mpos.x & 0xFFFF)<< 16| (mpos.y & 0xFFFF);
706 //command->postMessageFromOuterSpace(mousemes);
707 command->postMessageIfNotBusy(mousemes);
711 //return DefWindowProc(wind,msg,wparam, lparam);
715 if (wparam==VOMP_CURSORUPDATE) {
719 return DefWindowProc(wind, msg, wparam, lparam);
723 if (!ContextMenu(wind,GET_X_LPARAM(lparam),GET_Y_LPARAM(lparam))) {
724 return DefWindowProc(wind, msg, wparam, lparam);
729 case WM_LBUTTONDOWN:{
730 POINT mpos={GET_X_LPARAM(lparam),GET_Y_LPARAM(lparam)};
731 ClientToScreen(wind,&mpos);
732 if (TranslateMousePosition(&mpos)) {
733 Message *mousemes=new Message();
734 mousemes->message=Message::MOUSE_LBDOWN;
736 mousemes->to=BoxStack::getInstance();
737 mousemes->parameter.num=(mpos.x & 0xFFFF)<< 16| (mpos.y & 0xFFFF);
739 command->postMessageFromOuterSpace(mousemes);
743 POINT mpos = { GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam) };
744 ClientToScreen(wind, &mpos);
745 if (TranslateMousePosition(&mpos)) {
746 Message *mousemes = new Message();
747 mousemes->message = Message::MOUSE_SCROLL;
748 mousemes->from = NULL;
749 mousemes->to = BoxStack::getInstance();
750 mousemes->parameter.num = (0 & 0xFFFF) << 16 | (GET_WHEEL_DELTA_WPARAM(wparam) &0xFFFF);
751 mousemes->tag = (mpos.x & 0xFFFF) << 16 | (mpos.y & 0xFFFF);
752 command->postMessageFromOuterSpace(mousemes);
757 return DefWindowProc(wind, msg, wparam, lparam);
763 bool InitApp(HINSTANCE hinst,int cmdshow) {
767 wcs.style = CS_HREDRAW | CS_VREDRAW;
768 wcs.lpfnWndProc = WindowProc;
770 wcs.cbWndExtra = sizeof(DWORD);
771 wcs.hInstance = hinst;
774 wcs.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
775 wcs.lpszMenuName = NULL;
776 wcs.lpszClassName = "vomp";
777 acc=LoadAccelerators(hinst,MAKEINTRESOURCE(VOMPACCELERATOR));
778 if (!RegisterClass(&wcs))
780 flags =WS_VISIBLE | WS_POPUP | WS_CAPTION | WS_SYSMENU
781 |WS_MINIMIZEBOX | WS_SIZEBOX |WS_MAXIMIZEBOX;
782 RECT wnted={50,50,768+50,576+50};
783 AdjustWindowRect(&wnted,flags ,false);
784 win_main=CreateWindow("vomp","VOMP on Windows",flags, CW_USEDEFAULT,CW_USEDEFAULT,
785 wnted.right-wnted.left,wnted.bottom-wnted.top,NULL,NULL,hinst,NULL);
788 ShowWindow(win_main,SW_SHOWNORMAL);
789 UpdateWindow(win_main);
790 /* in order to handle letterboxing we use a child window */
792 child_wcs.style = CS_HREDRAW | CS_VREDRAW;
793 child_wcs.lpfnWndProc = WindowProc;
794 child_wcs.cbClsExtra = 0;
795 child_wcs.cbWndExtra = sizeof(DWORD);
796 child_wcs.hInstance = hinst;
797 child_wcs.hIcon = NULL;
798 child_wcs.hCursor = NULL;
799 child_wcs.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
800 child_wcs.lpszMenuName = NULL;
801 child_wcs.lpszClassName = "vomp_playback";
802 if (!RegisterClass(&child_wcs))
805 win=CreateWindow("vomp_playback","Vomp Playback Window",WS_VISIBLE | WS_CHILD |WS_CLIPCHILDREN,
806 0,0,768,576,win_main,NULL,hinst,NULL);
809 ShowWindow(win,SW_SHOWNORMAL);
811 if (remotefnc) {//at least windows XP
812 /* We want to support MCE Remote controls*/
813 RAWINPUTDEVICE remote_control_data[4];
814 ZeroMemory(remote_control_data,sizeof(remote_control_data));
815 remote_control_data[0].usUsagePage=0xFFBC;
816 remote_control_data[0].usUsage=0x88;
817 remote_control_data[0].dwFlags=0;
818 remote_control_data[1].usUsagePage=0x0C;
819 remote_control_data[1].usUsage=0x80;
820 remote_control_data[1].dwFlags=0;
821 remote_control_data[2].usUsagePage=0x0C;
822 remote_control_data[2].usUsage=0x01;
823 remote_control_data[2].dwFlags=0;
824 remote_control_data[3].usUsagePage=0x01;
825 remote_control_data[3].usUsage=0x80;
826 remote_control_data[3].dwFlags=0;
827 if (dynRegisterRawInputDevices(remote_control_data,4,sizeof(remote_control_data[0]))!=TRUE) {
828 MessageBox(0,"Registering remote control failed!","Aborting!",0);
840 // -------------------------------------------------------------------------------------------------------------------
842 void shutdown(int code)
846 boxstack->shutdown();
848 logger->log("Core", Log::NOTICE, "BoxStack module shut down");
851 if (command) // shut down command here in case views have posted messages
855 logger->log("Core", Log::NOTICE, "Command module shut down");
862 logger->log("Core", Log::NOTICE, "VDR module shut down");
869 logger->log("Core", Log::NOTICE, "OSD module shut down");
876 logger->log("Core", Log::NOTICE, "Audio module shut down");
883 logger->log("Core", Log::NOTICE, "Video module shut down");
890 logger->log("Core", Log::NOTICE, "Timers module shut down");
897 logger->log("Core", Log::NOTICE, "MTD module shut down");
904 logger->log("Core", Log::NOTICE, "LED module shut down");
911 logger->log("Core", Log::NOTICE, "Remote module shut down");
916 logger->log("Core", Log::NOTICE, "WOL module shut down");
921 logger->log("Core", Log::NOTICE, "Log module shutting down... bye!\n\n");
928 logger->log("Core", Log::NOTICE, "Sleeptimer module shut down");
934 // -------------------------------------------------------------------------------------------------------------------
936 ULLONG htonll(ULLONG a)
938 return (((ULLONG)htonl((ULONG)((a<<32)>> 32))<<32)
939 |(ULONG)htonl(((ULONG) (a >> 32))));
942 ULLONG ntohll(ULLONG a)