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"
42 #ifndef GRADIENT_DRAWING
43 #include "osdwinpixel.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");
283 success = audio->init(Audio::MPEG2_PES);
286 logger->log("Core", Log::INFO, "Audio module initialised");
290 logger->log("Core", Log::EMERG, "Audio module failed to initialise");
296 success = vdr->init(3024);
299 logger->log("Core", Log::INFO, "VDR module initialised");
303 logger->log("Core", Log::EMERG, "VDR module failed to initialise");
309 success = boxstack->init();
312 logger->log("Core", Log::INFO, "BoxStack module initialised");
316 logger->log("Core", Log::EMERG, "BoxStack module failed to initialise");
322 success = command->init();
325 logger->log("Core", Log::INFO, "Command module initialised");
329 logger->log("Core", Log::EMERG, "Command module failed to initialise");
335 // Other init ------------------------------------------------------------------------------------------------------
337 logger->log("Core", Log::NOTICE, "Startup successful");
339 // Run main loop ---------------------------------------------------------------------------------------------------
341 // Ok, all major device components and other bits are loaded and ready
342 lastmousemove=timeGetTime();
344 HANDLE commandthread;
345 commandthread= CreateThread(NULL, 0, commandthreadStart, NULL,0,
348 message.message=WM_NULL;
350 while(run && WaitForSingleObject(commandthread,0)==WAIT_TIMEOUT) {
351 if (PeekMessage(&message, NULL, 0,0,PM_REMOVE)!=0) {
352 if (TranslateAccelerator(win_main,acc,&message)==NULL) {
353 TranslateMessage(&message);
354 DispatchMessage(&message);
355 switch (message.message) {
357 run=false; //TODO post exit to command Messages
361 //Render, moved to OSD !
363 //((OsdWin*)osd)->Render();
366 // When that returns quit ------------------------------------------------------------------------------------------
367 WaitForSingleObject(commandthread,INFINITE);
370 if (user32dll) FreeModule(user32dll);
375 bool TranslateMousePosition(POINT *pos) {
378 ScreenToClient(win,pos);
379 GetClientRect(win,&clientrect);
380 if (!PtInRect(&clientrect,*pos)) return false;//Don't pass it further
381 pos->x=((double)pos->x)/((double) (clientrect.right-clientrect.left))
382 *((double)Video::getInstance()->getScreenWidth());
383 pos->y=((double)pos->y)/((double) (clientrect.bottom-clientrect.top))
384 *((double)Video::getInstance()->getScreenHeight());
391 void CalculateWindowSize(RECT * size,ULONG size_mode) {
394 DWORD adjheight,adjwidth;
395 if (!wnd_fullscreen) {
396 DWORD flags =WS_VISIBLE | WS_POPUP | WS_CAPTION | WS_SYSMENU
397 |WS_MINIMIZEBOX | WS_SIZEBOX |WS_MAXIMIZEBOX;
398 RECT wnted={50,50,150,150};
399 AdjustWindowRect(&wnted,flags ,false);
400 adjwidth=-wnted.left+wnted.right-100;
401 adjheight=-wnted.top+wnted.bottom-100;
403 adjwidth=adjheight=0;
405 width=size->right-size->left-adjwidth;
406 height=size->bottom-size->top-adjheight;
407 UCHAR mode=Video::PAL;
408 UCHAR aspect=Video::ASPECT4X3;
409 UCHAR tvsize=Video::ASPECT4X3;
411 mode=video->getMode();
412 aspect=((VideoWin*)video)->getAspectRatio();
413 tvsize=((VideoWin*)video)->getPseudoTVsize();
416 double aspectrt=4./3.;
417 if (tvsize==Video::ASPECT16X9) {
418 if (aspect==Video::ASPECT16X9) {
419 aspectrt=4./3.; //looks strange, but it is a 16:9 tv
420 } else if (aspect==Video::ASPECT4X3) {
421 aspectrt=4./3./(16./9.)*(4./3.); //I hope this is correct
423 } else if (tvsize==Video::ASPECT4X3) {
424 if (aspect==Video::ASPECT16X9) {
425 if (mode!=Video::NORMAL) {
430 } else if (aspect==Video::ASPECT4X3) {
434 if (!wnd_fullscreen) {
437 case WMSZ_BOTTOMRIGHT:
440 width=(ULONG)(((double)height)*aspectrt);
441 size->right=size->left+width+adjwidth;
443 case WMSZ_BOTTOMLEFT:
445 width=(ULONG)(((double)height)*aspectrt);
446 size->left=size->right-width-adjwidth;
450 height=(ULONG)(((double)width)/aspectrt);
451 size->bottom=size->top+height+adjheight;
454 MoveWindow(win,0,0,width,height,TRUE);
456 RECT newrect={0,0,width,height};
458 if ((ULONG)(((double)height)*aspectrt)>width) {
459 newlength=(ULONG)(((double)width)/aspectrt);
460 newrect.top+=(height-newlength)/2;
461 newrect.bottom-=(height-newlength);
463 newlength=(ULONG)(((double)height)*aspectrt);
464 newrect.left+=(width-newlength)/2;
465 newrect.right-=(width-newlength);
467 MoveWindow(win,newrect.left,newrect.top,newrect.right,newrect.bottom,TRUE);
472 void AdjustWindow() {
473 if (!wnd_fullscreen) {
475 GetWindowRect(win_main,&winrect);
476 CalculateWindowSize(&winrect,WMSZ_BOTTOM);
477 MoveWindow(win_main,winrect.left,
478 winrect.top,winrect.right-winrect.left,winrect.bottom-winrect.top,true);
481 GetWindowRect(win_main,&winrect);
482 CalculateWindowSize(&winrect,WMSZ_BOTTOM);
487 void ToggleFullscreen() {
488 if (wnd_fullscreen) {
489 wnd_fullscreen=false;
490 SetWindowLong(win_main,GWL_STYLE,WS_VISIBLE | WS_POPUP | WS_CAPTION | WS_SYSMENU
491 |WS_MINIMIZEBOX | WS_SIZEBOX |WS_MAXIMIZEBOX);
492 SetWindowPos(win_main,NULL,0,0,0,0,SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);
494 SetWindowPos(win_main,wnd_topmost?HWND_TOPMOST:HWND_TOP,wnd_fs_rect.left,wnd_fs_rect.top,
495 wnd_fs_rect.right-wnd_fs_rect.left,
496 wnd_fs_rect.bottom-wnd_fs_rect.top,
497 SWP_DRAWFRAME | SWP_FRAMECHANGED);
498 MoveWindow(win,wnd_fs_rect_client.left,wnd_fs_rect_client.top,
499 wnd_fs_rect_client.right-wnd_fs_rect_client.left,
500 wnd_fs_rect_client.bottom-wnd_fs_rect_client.top,TRUE);
503 GetWindowRect(win_main,&wnd_fs_rect);
504 GetWindowRect(win,&wnd_fs_rect_client);
505 SetWindowLong(win_main,GWL_STYLE,WS_VISIBLE | WS_POPUP );
506 SetWindowPos(win_main,NULL,0,0,0,0,SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);
507 HMONITOR monitor=MonitorFromWindow(win_main,MONITOR_DEFAULTTONEAREST);
509 moninfo.cbSize=sizeof(moninfo);
511 if (!GetMonitorInfo(monitor,&moninfo)) return ;
512 SetWindowPos(win_main,wnd_topmost?HWND_TOPMOST:HWND_TOP,moninfo.rcMonitor.left,moninfo.rcMonitor.top,
513 moninfo.rcMonitor.right,moninfo.rcMonitor.bottom,SWP_FRAMECHANGED);
522 void ToggleTopmost() {
523 wnd_topmost=!wnd_topmost;
524 SetWindowPos(win_main,wnd_topmost?HWND_TOPMOST:HWND_NOTOPMOST,0,0,
525 0,0,SWP_NOMOVE | SWP_NOSIZE);
528 void CursorUpdate() {
530 GetCursorPos(&cursorpos);
532 asswind=WindowFromPoint(cursorpos);
533 if (asswind!=win_main && asswind!=win) {
534 return ; //not our responsibility
536 if ((timeGetTime()-lastmousemove)<4000 || cmenu) {
537 SetCursor(LoadCursor(NULL,IDC_ARROW));
543 bool ContextMenu(HWND wind,int x,int y) {
546 ScreenToClient(wind,&p);
547 GetClientRect(wind,&clientrect);
548 if (!PtInRect(&clientrect,p)) return false;
549 ClientToScreen(wind,&p);
552 menu=LoadMenu(hinstance,MAKEINTRESOURCE(VOMPMENU));
553 popup=GetSubMenu(menu,0);
554 if (wnd_fullscreen) {
555 CheckMenuItem(popup,VOMP_FULL_SCREEN,MF_BYCOMMAND|MF_CHECKED);
557 CheckMenuItem(popup,VOMP_FULL_SCREEN,MF_BYCOMMAND|MF_UNCHECKED);
560 CheckMenuItem(popup,VOMP_TOPMOST,MF_BYCOMMAND|MF_CHECKED);
562 CheckMenuItem(popup,VOMP_TOPMOST,MF_BYCOMMAND|MF_UNCHECKED);
565 TrackPopupMenu(popup,TPM_RIGHTBUTTON|TPM_LEFTALIGN,x,y,0,wind, NULL);
573 LONG FAR PASCAL WindowProc(HWND wind, UINT msg, WPARAM wparam, LPARAM lparam)
579 logger->log("Core", Log::NOTICE, "Window closed, shutting down...");
581 ((RemoteWin*)Remote::getInstance())->SendPower();
585 CalculateWindowSize((RECT*) lparam,wparam);
589 int width = LOWORD(lparam);
590 int height = HIWORD(lparam);
592 if (wparam == SIZE_MAXIMIZED) {
595 } /*else if (wparam == SIZE_MINIMIZED) {
605 if (GetUpdateRect(wind, &r, FALSE)) {
606 BeginPaint(wind, &ps);
607 //Call Painting Mechanism
612 if (((RemoteWin*)remote)->ReceiveButtonVK(wparam)) {
613 return 0L; //We process that Key
615 return DefWindowProc(wind, msg, wparam, lparam);
620 if (((RemoteWin*)remote)->ReceiveButtonCH(wparam)) {
621 return 0L; //We process that Key
623 return DefWindowProc(wind, msg, wparam, lparam);
628 if (((RemoteWin*)remote)->ReceiveButtonAP(GET_APPCOMMAND_LPARAM(lparam))){
629 return TRUE; //yes we process that message
631 return DefWindowProc(wind, msg, wparam, lparam);
640 dynGetRawInputData((HRAWINPUT)lparam,RID_INPUT,NULL,&risize,sizeof(RAWINPUTHEADER));
641 lpit=(LPRAWINPUT)malloc(risize);
642 dynGetRawInputData((HRAWINPUT)lparam,RID_INPUT,lpit,&risize,sizeof(RAWINPUTHEADER));
644 if (lpit->header.dwType==RIM_TYPEHID && lpit->data.hid.dwSizeHid>=2) {
645 DWORD button=lpit->data.hid.bRawData[1] | (lpit->data.hid.bRawData[0]<< 8);
646 if (((RemoteWin*)remote)->ReceiveButtonRI(button)){
648 return 0; //yes we process that message
653 return DefWindowProc(wind, msg, wparam, lparam);
658 if (LOWORD(wparam)==VOMP_FULL_SCREEN) {
662 if (LOWORD(wparam)==VOMP_TOPMOST) {
666 if (((RemoteWin*)remote)->ReceiveButtonAP(LOWORD(wparam))){
667 return 0; //yes we process that message
669 return DefWindowProc(wind, msg, wparam, lparam);
674 if (((HANDLE)wparam)==win) {
678 return DefWindowProc(wind, msg, wparam, lparam);
682 if (wparam==SC_MAXIMIZE) {
685 } else if (wparam==SC_SCREENSAVE || wparam==SC_MONITORPOWER) {
688 return DefWindowProc(wind,msg,wparam, lparam);
693 lastmousemove=timeGetTime();
694 SetCursor(LoadCursor(NULL,IDC_ARROW));
695 SetTimer(wind,VOMP_CURSORUPDATE,4500,NULL);
696 POINT mpos={GET_X_LPARAM(lparam),GET_Y_LPARAM(lparam)};
697 ClientToScreen(wind,&mpos);
698 if (TranslateMousePosition(&mpos)) {
699 Message *mousemes=new Message();
700 mousemes->message=Message::MOUSE_MOVE;
702 mousemes->to=BoxStack::getInstance();
703 mousemes->parameter=(mpos.x & 0xFFFF)<< 16| (mpos.y & 0xFFFF);
705 //command->postMessageFromOuterSpace(mousemes);
706 command->postMessageIfNotBusy(mousemes);
710 //return DefWindowProc(wind,msg,wparam, lparam);
714 if (wparam==VOMP_CURSORUPDATE) {
718 return DefWindowProc(wind, msg, wparam, lparam);
722 if (!ContextMenu(wind,GET_X_LPARAM(lparam),GET_Y_LPARAM(lparam))) {
723 return DefWindowProc(wind, msg, wparam, lparam);
728 case WM_LBUTTONDOWN:{
729 POINT mpos={GET_X_LPARAM(lparam),GET_Y_LPARAM(lparam)};
730 ClientToScreen(wind,&mpos);
731 if (TranslateMousePosition(&mpos)) {
732 Message *mousemes=new Message();
733 mousemes->message=Message::MOUSE_LBDOWN;
735 mousemes->to=BoxStack::getInstance();
736 mousemes->parameter=(mpos.x & 0xFFFF)<< 16| (mpos.y & 0xFFFF);
738 command->postMessageFromOuterSpace(mousemes);
742 POINT mpos = { GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam) };
743 ClientToScreen(wind, &mpos);
744 if (TranslateMousePosition(&mpos)) {
745 Message *mousemes = new Message();
746 mousemes->message = Message::MOUSE_SCROLL;
747 mousemes->from = NULL;
748 mousemes->to = BoxStack::getInstance();
749 mousemes->parameter = (0 & 0xFFFF) << 16 | (GET_WHEEL_DELTA_WPARAM(wparam) &0xFFFF);
750 mousemes->tag = (mpos.x & 0xFFFF) << 16 | (mpos.y & 0xFFFF);
751 command->postMessageFromOuterSpace(mousemes);
756 return DefWindowProc(wind, msg, wparam, lparam);
762 bool InitApp(HINSTANCE hinst,int cmdshow) {
766 wcs.style = CS_HREDRAW | CS_VREDRAW;
767 wcs.lpfnWndProc = WindowProc;
769 wcs.cbWndExtra = sizeof(DWORD);
770 wcs.hInstance = hinst;
773 wcs.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
774 wcs.lpszMenuName = NULL;
775 wcs.lpszClassName = "vomp";
776 acc=LoadAccelerators(hinst,MAKEINTRESOURCE(VOMPACCELERATOR));
777 if (!RegisterClass(&wcs))
779 flags =WS_VISIBLE | WS_POPUP | WS_CAPTION | WS_SYSMENU
780 |WS_MINIMIZEBOX | WS_SIZEBOX |WS_MAXIMIZEBOX;
781 RECT wnted={50,50,768+50,576+50};
782 AdjustWindowRect(&wnted,flags ,false);
783 win_main=CreateWindow("vomp","VOMP on Windows",flags, CW_USEDEFAULT,CW_USEDEFAULT,
784 wnted.right-wnted.left,wnted.bottom-wnted.top,NULL,NULL,hinst,NULL);
787 ShowWindow(win_main,SW_SHOWNORMAL);
788 UpdateWindow(win_main);
789 /* in order to handle letterboxing we use a child window */
791 child_wcs.style = CS_HREDRAW | CS_VREDRAW;
792 child_wcs.lpfnWndProc = WindowProc;
793 child_wcs.cbClsExtra = 0;
794 child_wcs.cbWndExtra = sizeof(DWORD);
795 child_wcs.hInstance = hinst;
796 child_wcs.hIcon = NULL;
797 child_wcs.hCursor = NULL;
798 child_wcs.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
799 child_wcs.lpszMenuName = NULL;
800 child_wcs.lpszClassName = "vomp_playback";
801 if (!RegisterClass(&child_wcs))
804 win=CreateWindow("vomp_playback","Vomp Playback Window",WS_VISIBLE | WS_CHILD |WS_CLIPCHILDREN,
805 0,0,768,576,win_main,NULL,hinst,NULL);
808 ShowWindow(win,SW_SHOWNORMAL);
810 if (remotefnc) {//at least windows XP
811 /* We want to support MCE Remote controls*/
812 RAWINPUTDEVICE remote_control_data[4];
813 ZeroMemory(remote_control_data,sizeof(remote_control_data));
814 remote_control_data[0].usUsagePage=0xFFBC;
815 remote_control_data[0].usUsage=0x88;
816 remote_control_data[0].dwFlags=0;
817 remote_control_data[1].usUsagePage=0x0C;
818 remote_control_data[1].usUsage=0x80;
819 remote_control_data[1].dwFlags=0;
820 remote_control_data[2].usUsagePage=0x0C;
821 remote_control_data[2].usUsage=0x01;
822 remote_control_data[2].dwFlags=0;
823 remote_control_data[3].usUsagePage=0x01;
824 remote_control_data[3].usUsage=0x80;
825 remote_control_data[3].dwFlags=0;
826 if (dynRegisterRawInputDevices(remote_control_data,4,sizeof(remote_control_data[0]))!=TRUE) {
827 MessageBox(0,"Registering remote control failed!","Aborting!",0);
839 // -------------------------------------------------------------------------------------------------------------------
841 void shutdown(int code)
845 boxstack->shutdown();
847 logger->log("Core", Log::NOTICE, "BoxStack module shut down");
850 if (command) // shut down command here in case views have posted messages
854 logger->log("Core", Log::NOTICE, "Command module shut down");
861 logger->log("Core", Log::NOTICE, "VDR module shut down");
868 logger->log("Core", Log::NOTICE, "OSD module shut down");
875 logger->log("Core", Log::NOTICE, "Audio module shut down");
882 logger->log("Core", Log::NOTICE, "Video module shut down");
889 logger->log("Core", Log::NOTICE, "Timers module shut down");
896 logger->log("Core", Log::NOTICE, "MTD module shut down");
903 logger->log("Core", Log::NOTICE, "LED module shut down");
910 logger->log("Core", Log::NOTICE, "Remote module shut down");
915 logger->log("Core", Log::NOTICE, "WOL module shut down");
920 logger->log("Core", Log::NOTICE, "Log module shutting down... bye!\n\n");
927 logger->log("Core", Log::NOTICE, "Sleeptimer module shut down");
933 // -------------------------------------------------------------------------------------------------------------------
935 ULLONG htonll(ULLONG a)
937 return (((ULLONG)htonl((ULONG)((a<<32)>> 32))<<32)
938 |(ULONG)htonl(((ULONG) (a >> 32))));
941 ULLONG ntohll(ULLONG a)