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"
45 #include "vsleeptimer.h"
47 void sighandler(int signalReceived);
48 void shutdown(int code);
50 // Global variables --------------------------------------------------------------------------------------------------
64 Sleeptimer* sleeptimer;
67 bool wnd_fullscreen=false;
68 bool wnd_topmost=false;
69 RECT wnd_fs_rect={20,20,768+20,576+20};
70 RECT wnd_fs_rect_client={0,0,768,576};
71 //OSVERSIONINFO windows_ver; //attempt to distigsh windows versions
77 typedef UINT (WINAPI *GETRAWINPUTDATAFNC) (HRAWINPUT,UINT,LPVOID,PUINT,UINT);
78 typedef UINT (WINAPI *REGISTERRAWINPUTDEVICEFNC) (PCRAWINPUTDEVICE,UINT,UINT);
80 GETRAWINPUTDATAFNC dynGetRawInputData=NULL;
81 REGISTERRAWINPUTDEVICEFNC dynRegisterRawInputDevices=NULL;
86 void MILLISLEEP(ULONG a)
93 int getClockRealTime(struct timespec *tp){
97 GetSystemTime(&systime);
98 SystemTimeToFileTime(&systime, (FILETIME*)&filetime);
99 tp->tv_sec = (filetime - WINDOWS_TIME_BASE_OFFSET) / (10 * 1000 * 1000);
100 tp->tv_nsec = ((filetime - WINDOWS_TIME_BASE_OFFSET) % (10 * 1000 * 1000)) * 100;
104 DWORD WINAPI commandthreadStart(void *arg)
110 void LoadRemoteFunctions() {
111 user32dll=LoadLibrary("user32.dll");
112 if (user32dll!=NULL) {
113 dynGetRawInputData=(GETRAWINPUTDATAFNC)GetProcAddress(user32dll,"GetRawInputData");
114 if (dynGetRawInputData!=NULL) {
115 dynRegisterRawInputDevices=(REGISTERRAWINPUTDEVICEFNC)GetProcAddress(user32dll,"RegisterRawInputDevices");
116 if (dynRegisterRawInputDevices!=NULL) {
123 bool InitApp(HINSTANCE hinst,int cmdshow);
125 HWND win_main;//global window handle
126 HWND win;//global child window handle
129 #define ERROR_MSG(str) MessageBox(win_main,str,"Error!",MB_OK|MB_ICONWARNING)
130 INT WINAPI WinMain( HINSTANCE hinst , HINSTANCE previnst, LPSTR cmdline, int cmdshow)
133 //On Windows we have to init a window, we use DXUT
134 LoadRemoteFunctions();
135 if (!InitApp(hinst,cmdshow)) return false;
136 //Starting Network support
138 int result = WSAStartup(MAKEWORD(2,2),&wsadat);
139 if (result!=NO_ERROR) {
140 ERROR_MSG("Initialising WinSocked: Error at WSAStartup()\n");
144 result= CoInitializeEx(NULL,COINIT_MULTITHREADED );//Initialize COM for DirectShow
146 ERROR_MSG("Initialising COM: Error at Coinitialize()\n");
153 // Init global vars ------------------------------------------------------------------------------------------------
156 remote = new RemoteWin();
159 timers = new Timers();
162 video = new VideoWin();
163 audio = new AudioWin();
164 boxstack = new BoxStack();
165 command = new Command();
167 sleeptimer = new Sleeptimer();
169 if (!logger || !remote || !mtd || !led || !osd || !video || !audio || !boxstack || !command || !sleeptimer)
171 ERROR_MSG("Could not create objects. Memory problems?\n");
177 // Get logging module started --------------------------------------------------------------------------------------
179 if (!logger->init(Log::DEBUG, "vompwin.log", true))
181 ERROR_MSG("Could not initialise log object. Aborting.\n");
187 logger->log("Core", Log::INFO, "Starting up...");
191 // Init modules ----------------------------------------------------------------------------------------------------
194 success = remote->init("/dev/rawir");
197 logger->log("Core", Log::INFO, "Remote module initialised");
201 logger->log("Core", Log::EMERG, "Remote module failed to initialise");
207 success = led->init(0);
210 logger->log("Core", Log::INFO, "LED module initialised");
214 logger->log("Core", Log::EMERG, "LED module failed to initialise");
220 success = mtd->init();
223 logger->log("Core", Log::INFO, "Mtd module initialised");
227 logger->log("Core", Log::EMERG, "Mtd module failed to initialise");
233 success = timers->init();
236 logger->log("Core", Log::INFO, "Timers module initialised");
240 logger->log("Core", Log::EMERG, "Timers module failed to initialise");
246 UCHAR videoFormat = (UCHAR)mtd->getPALorNTSC();
247 if (videoFormat == Video::PAL) logger->log("Core", Log::INFO, "Read from MTD: PAL 720x576");
248 else if (videoFormat == Video::NTSC) logger->log("Core", Log::INFO, "Read from MTD: NTSC 720x480");
249 else logger->log("Core", Log::INFO, "No help from MTD. Assuming NTSC 720x480");
251 success = video->init(videoFormat);
254 logger->log("Core", Log::INFO, "Video module initialised");
258 logger->log("Core", Log::EMERG, "Video module failed to initialise");
264 success = osd->init((void*)&win);
267 logger->log("Core", Log::INFO, "OSD module initialised");
271 logger->log("Core", Log::EMERG, "OSD module failed to initialise");
277 success = audio->init(Audio::MPEG2_PES);
280 logger->log("Core", Log::INFO, "Audio module initialised");
284 logger->log("Core", Log::EMERG, "Audio module failed to initialise");
290 success = vdr->init(3024);
293 logger->log("Core", Log::INFO, "VDR module initialised");
297 logger->log("Core", Log::EMERG, "VDR module failed to initialise");
303 success = boxstack->init();
306 logger->log("Core", Log::INFO, "BoxStack module initialised");
310 logger->log("Core", Log::EMERG, "BoxStack module failed to initialise");
316 success = command->init();
319 logger->log("Core", Log::INFO, "Command module initialised");
323 logger->log("Core", Log::EMERG, "Command module failed to initialise");
329 // Other init ------------------------------------------------------------------------------------------------------
331 logger->log("Core", Log::NOTICE, "Startup successful");
333 // Run main loop ---------------------------------------------------------------------------------------------------
335 // Ok, all major device components and other bits are loaded and ready
336 lastmousemove=timeGetTime();
338 HANDLE commandthread;
339 commandthread= CreateThread(NULL, 0, commandthreadStart, NULL,0,
342 message.message=WM_NULL;
344 while(run && WaitForSingleObject(commandthread,0)==WAIT_TIMEOUT) {
345 if (PeekMessage(&message, NULL, 0,0,PM_REMOVE)!=0) {
346 if (TranslateAccelerator(win_main,acc,&message)==NULL) {
347 TranslateMessage(&message);
348 DispatchMessage(&message);
349 switch (message.message) {
351 run=false; //TODO post exit to command Messages
355 //Render, moved to OSD !
357 //((OsdWin*)osd)->Render();
360 // When that returns quit ------------------------------------------------------------------------------------------
361 WaitForSingleObject(commandthread,INFINITE);
364 if (user32dll) FreeModule(user32dll);
369 bool TranslateMousePosition(POINT *pos) {
372 ScreenToClient(win,pos);
373 GetClientRect(win,&clientrect);
374 if (!PtInRect(&clientrect,*pos)) return false;//Don't pass it further
375 pos->x=((double)pos->x)/((double) (clientrect.right-clientrect.left))
376 *((double)Video::getInstance()->getScreenWidth());
377 pos->y=((double)pos->y)/((double) (clientrect.bottom-clientrect.top))
378 *((double)Video::getInstance()->getScreenHeight());
385 void CalculateWindowSize(RECT * size,ULONG size_mode) {
388 DWORD adjheight,adjwidth;
389 if (!wnd_fullscreen) {
390 DWORD flags =WS_VISIBLE | WS_POPUP | WS_CAPTION | WS_SYSMENU
391 |WS_MINIMIZEBOX | WS_SIZEBOX |WS_MAXIMIZEBOX;
392 RECT wnted={50,50,150,150};
393 AdjustWindowRect(&wnted,flags ,false);
394 adjwidth=-wnted.left+wnted.right-100;
395 adjheight=-wnted.top+wnted.bottom-100;
397 adjwidth=adjheight=0;
399 width=size->right-size->left-adjwidth;
400 height=size->bottom-size->top-adjheight;
401 UCHAR mode=Video::PAL;
402 UCHAR aspect=Video::ASPECT4X3;
403 UCHAR tvsize=Video::ASPECT4X3;
405 mode=video->getMode();
406 aspect=((VideoWin*)video)->getAspectRatio();
407 tvsize=((VideoWin*)video)->getPseudoTVsize();
410 double aspectrt=4./3.;
411 if (tvsize==Video::ASPECT16X9) {
412 if (aspect==Video::ASPECT16X9) {
413 aspectrt=4./3.; //looks strange, but it is a 16:9 tv
414 } else if (aspect==Video::ASPECT4X3) {
415 aspectrt=4./3./(16./9.)*(4./3.); //I hope this is correct
417 } else if (tvsize==Video::ASPECT4X3) {
418 if (aspect==Video::ASPECT16X9) {
419 if (mode!=Video::NORMAL) {
424 } else if (aspect==Video::ASPECT4X3) {
428 if (!wnd_fullscreen) {
431 case WMSZ_BOTTOMRIGHT:
434 width=(ULONG)(((double)height)*aspectrt);
435 size->right=size->left+width+adjwidth;
437 case WMSZ_BOTTOMLEFT:
439 width=(ULONG)(((double)height)*aspectrt);
440 size->left=size->right-width-adjwidth;
444 height=(ULONG)(((double)width)/aspectrt);
445 size->bottom=size->top+height+adjheight;
448 MoveWindow(win,0,0,width,height,TRUE);
450 RECT newrect={0,0,width,height};
452 if ((ULONG)(((double)height)*aspectrt)>width) {
453 newlength=(ULONG)(((double)width)/aspectrt);
454 newrect.top+=(height-newlength)/2;
455 newrect.bottom-=(height-newlength);
457 newlength=(ULONG)(((double)height)*aspectrt);
458 newrect.left+=(width-newlength)/2;
459 newrect.right-=(width-newlength);
461 MoveWindow(win,newrect.left,newrect.top,newrect.right,newrect.bottom,TRUE);
466 void AdjustWindow() {
467 if (!wnd_fullscreen) {
469 GetWindowRect(win_main,&winrect);
470 CalculateWindowSize(&winrect,WMSZ_BOTTOM);
471 MoveWindow(win_main,winrect.left,
472 winrect.top,winrect.right-winrect.left,winrect.bottom-winrect.top,true);
475 GetWindowRect(win_main,&winrect);
476 CalculateWindowSize(&winrect,WMSZ_BOTTOM);
481 void ToggleFullscreen() {
482 if (wnd_fullscreen) {
483 wnd_fullscreen=false;
484 SetWindowLong(win_main,GWL_STYLE,WS_VISIBLE | WS_POPUP | WS_CAPTION | WS_SYSMENU
485 |WS_MINIMIZEBOX | WS_SIZEBOX |WS_MAXIMIZEBOX);
486 SetWindowPos(win_main,NULL,0,0,0,0,SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);
488 SetWindowPos(win_main,wnd_topmost?HWND_TOPMOST:HWND_TOP,wnd_fs_rect.left,wnd_fs_rect.top,
489 wnd_fs_rect.right-wnd_fs_rect.left,
490 wnd_fs_rect.bottom-wnd_fs_rect.top,
491 SWP_DRAWFRAME | SWP_FRAMECHANGED);
492 MoveWindow(win,wnd_fs_rect_client.left,wnd_fs_rect_client.top,
493 wnd_fs_rect_client.right-wnd_fs_rect_client.left,
494 wnd_fs_rect_client.bottom-wnd_fs_rect_client.top,TRUE);
497 GetWindowRect(win_main,&wnd_fs_rect);
498 GetWindowRect(win,&wnd_fs_rect_client);
499 SetWindowLong(win_main,GWL_STYLE,WS_VISIBLE | WS_POPUP );
500 SetWindowPos(win_main,NULL,0,0,0,0,SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);
501 HMONITOR monitor=MonitorFromWindow(win_main,MONITOR_DEFAULTTONEAREST);
503 moninfo.cbSize=sizeof(moninfo);
505 if (!GetMonitorInfo(monitor,&moninfo)) return ;
506 SetWindowPos(win_main,wnd_topmost?HWND_TOPMOST:HWND_TOP,moninfo.rcMonitor.left,moninfo.rcMonitor.top,
507 moninfo.rcMonitor.right,moninfo.rcMonitor.bottom,SWP_FRAMECHANGED);
516 void ToggleTopmost() {
517 wnd_topmost=!wnd_topmost;
518 SetWindowPos(win_main,wnd_topmost?HWND_TOPMOST:HWND_NOTOPMOST,0,0,
519 0,0,SWP_NOMOVE | SWP_NOSIZE);
522 void CursorUpdate() {
524 GetCursorPos(&cursorpos);
526 asswind=WindowFromPoint(cursorpos);
527 if (asswind!=win_main && asswind!=win) {
528 return ; //not our responsibility
530 if ((timeGetTime()-lastmousemove)<4000 || cmenu) {
531 SetCursor(LoadCursor(NULL,IDC_ARROW));
537 bool ContextMenu(HWND wind,int x,int y) {
540 ScreenToClient(wind,&p);
541 GetClientRect(wind,&clientrect);
542 if (!PtInRect(&clientrect,p)) return false;
543 ClientToScreen(wind,&p);
546 menu=LoadMenu(hinstance,MAKEINTRESOURCE(VOMPMENU));
547 popup=GetSubMenu(menu,0);
548 if (wnd_fullscreen) {
549 CheckMenuItem(popup,VOMP_FULL_SCREEN,MF_BYCOMMAND|MF_CHECKED);
551 CheckMenuItem(popup,VOMP_FULL_SCREEN,MF_BYCOMMAND|MF_UNCHECKED);
554 CheckMenuItem(popup,VOMP_TOPMOST,MF_BYCOMMAND|MF_CHECKED);
556 CheckMenuItem(popup,VOMP_TOPMOST,MF_BYCOMMAND|MF_UNCHECKED);
559 TrackPopupMenu(popup,TPM_RIGHTBUTTON|TPM_LEFTALIGN,x,y,0,wind, NULL);
567 LONG FAR PASCAL WindowProc(HWND wind, UINT msg, WPARAM wparam, LPARAM lparam)
573 logger->log("Core", Log::NOTICE, "Window closed, shutting down...");
575 ((RemoteWin*)Remote::getInstance())->SendPower();
579 CalculateWindowSize((RECT*) lparam,wparam);
583 int width = LOWORD(lparam);
584 int height = HIWORD(lparam);
586 if (wparam == SIZE_MAXIMIZED) {
589 } /*else if (wparam == SIZE_MINIMIZED) {
599 if (GetUpdateRect(wind, &r, FALSE)) {
600 BeginPaint(wind, &ps);
601 //Call Painting Mechanism
606 if (((RemoteWin*)remote)->ReceiveButtonVK(wparam)) {
607 return 0L; //We process that Key
609 return DefWindowProc(wind, msg, wparam, lparam);
614 if (((RemoteWin*)remote)->ReceiveButtonCH(wparam)) {
615 return 0L; //We process that Key
617 return DefWindowProc(wind, msg, wparam, lparam);
622 if (((RemoteWin*)remote)->ReceiveButtonAP(GET_APPCOMMAND_LPARAM(lparam))){
623 return TRUE; //yes we process that message
625 return DefWindowProc(wind, msg, wparam, lparam);
634 dynGetRawInputData((HRAWINPUT)lparam,RID_INPUT,NULL,&risize,sizeof(RAWINPUTHEADER));
635 lpit=(LPRAWINPUT)malloc(risize);
636 dynGetRawInputData((HRAWINPUT)lparam,RID_INPUT,lpit,&risize,sizeof(RAWINPUTHEADER));
638 if (lpit->header.dwType==RIM_TYPEHID && lpit->data.hid.dwSizeHid>=2) {
639 DWORD button=lpit->data.hid.bRawData[1] | (lpit->data.hid.bRawData[0]<< 8);
640 if (((RemoteWin*)remote)->ReceiveButtonRI(button)){
642 return 0; //yes we process that message
647 return DefWindowProc(wind, msg, wparam, lparam);
652 if (LOWORD(wparam)==VOMP_FULL_SCREEN) {
656 if (LOWORD(wparam)==VOMP_TOPMOST) {
660 if (((RemoteWin*)remote)->ReceiveButtonAP(LOWORD(wparam))){
661 return 0; //yes we process that message
663 return DefWindowProc(wind, msg, wparam, lparam);
668 if (((HANDLE)wparam)==win) {
672 return DefWindowProc(wind, msg, wparam, lparam);
676 if (wparam==SC_MAXIMIZE) {
679 } else if (wparam==SC_SCREENSAVE || wparam==SC_MONITORPOWER) {
682 return DefWindowProc(wind,msg,wparam, lparam);
687 lastmousemove=timeGetTime();
688 SetCursor(LoadCursor(NULL,IDC_ARROW));
689 SetTimer(wind,VOMP_CURSORUPDATE,4500,NULL);
690 POINT mpos={GET_X_LPARAM(lparam),GET_Y_LPARAM(lparam)};
691 ClientToScreen(wind,&mpos);
692 if (TranslateMousePosition(&mpos)) {
693 Message *mousemes=new Message();
694 mousemes->message=Message::MOUSE_MOVE;
696 mousemes->to=BoxStack::getInstance();
697 mousemes->parameter=(mpos.x & 0xFFFF)<< 16| (mpos.y & 0xFFFF);
699 //command->postMessageFromOuterSpace(mousemes);
700 command->postMessageIfNotBusy(mousemes);
704 //return DefWindowProc(wind,msg,wparam, lparam);
708 if (wparam==VOMP_CURSORUPDATE) {
712 return DefWindowProc(wind, msg, wparam, lparam);
716 if (!ContextMenu(wind,GET_X_LPARAM(lparam),GET_Y_LPARAM(lparam))) {
717 return DefWindowProc(wind, msg, wparam, lparam);
722 case WM_LBUTTONDOWN:{
723 POINT mpos={GET_X_LPARAM(lparam),GET_Y_LPARAM(lparam)};
724 ClientToScreen(wind,&mpos);
725 if (TranslateMousePosition(&mpos)) {
726 Message *mousemes=new Message();
727 mousemes->message=Message::MOUSE_LBDOWN;
729 mousemes->to=BoxStack::getInstance();
730 mousemes->parameter=(mpos.x & 0xFFFF)<< 16| (mpos.y & 0xFFFF);
732 command->postMessageFromOuterSpace(mousemes);
736 POINT mpos = { GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam) };
737 ClientToScreen(wind, &mpos);
738 if (TranslateMousePosition(&mpos)) {
739 Message *mousemes = new Message();
740 mousemes->message = Message::MOUSE_SCROLL;
741 mousemes->from = NULL;
742 mousemes->to = BoxStack::getInstance();
743 mousemes->parameter = (0 & 0xFFFF) << 16 | (GET_WHEEL_DELTA_WPARAM(wparam) &0xFFFF);
744 mousemes->tag = (mpos.x & 0xFFFF) << 16 | (mpos.y & 0xFFFF);
745 command->postMessageFromOuterSpace(mousemes);
750 return DefWindowProc(wind, msg, wparam, lparam);
756 bool InitApp(HINSTANCE hinst,int cmdshow) {
760 wcs.style = CS_HREDRAW | CS_VREDRAW;
761 wcs.lpfnWndProc = WindowProc;
763 wcs.cbWndExtra = sizeof(DWORD);
764 wcs.hInstance = hinst;
767 wcs.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
768 wcs.lpszMenuName = NULL;
769 wcs.lpszClassName = "vomp";
770 acc=LoadAccelerators(hinst,MAKEINTRESOURCE(VOMPACCELERATOR));
771 if (!RegisterClass(&wcs))
773 flags =WS_VISIBLE | WS_POPUP | WS_CAPTION | WS_SYSMENU
774 |WS_MINIMIZEBOX | WS_SIZEBOX |WS_MAXIMIZEBOX;
775 RECT wnted={50,50,768+50,576+50};
776 AdjustWindowRect(&wnted,flags ,false);
777 win_main=CreateWindow("vomp","VOMP on Windows",flags, CW_USEDEFAULT,CW_USEDEFAULT,
778 wnted.right-wnted.left,wnted.bottom-wnted.top,NULL,NULL,hinst,NULL);
781 ShowWindow(win_main,SW_SHOWNORMAL);
782 UpdateWindow(win_main);
783 /* in order to handle letterboxing we use a child window */
785 child_wcs.style = CS_HREDRAW | CS_VREDRAW;
786 child_wcs.lpfnWndProc = WindowProc;
787 child_wcs.cbClsExtra = 0;
788 child_wcs.cbWndExtra = sizeof(DWORD);
789 child_wcs.hInstance = hinst;
790 child_wcs.hIcon = NULL;
791 child_wcs.hCursor = NULL;
792 child_wcs.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
793 child_wcs.lpszMenuName = NULL;
794 child_wcs.lpszClassName = "vomp_playback";
795 if (!RegisterClass(&child_wcs))
798 win=CreateWindow("vomp_playback","Vomp Playback Window",WS_VISIBLE | WS_CHILD |WS_CLIPCHILDREN,
799 0,0,768,576,win_main,NULL,hinst,NULL);
802 ShowWindow(win,SW_SHOWNORMAL);
804 if (remotefnc) {//at least windows XP
805 /* We want to support MCE Remote controls*/
806 RAWINPUTDEVICE remote_control_data[4];
807 ZeroMemory(remote_control_data,sizeof(remote_control_data));
808 remote_control_data[0].usUsagePage=0xFFBC;
809 remote_control_data[0].usUsage=0x88;
810 remote_control_data[0].dwFlags=0;
811 remote_control_data[1].usUsagePage=0x0C;
812 remote_control_data[1].usUsage=0x80;
813 remote_control_data[1].dwFlags=0;
814 remote_control_data[2].usUsagePage=0x0C;
815 remote_control_data[2].usUsage=0x01;
816 remote_control_data[2].dwFlags=0;
817 remote_control_data[3].usUsagePage=0x01;
818 remote_control_data[3].usUsage=0x80;
819 remote_control_data[3].dwFlags=0;
820 if (dynRegisterRawInputDevices(remote_control_data,4,sizeof(remote_control_data[0]))!=TRUE) {
821 MessageBox(0,"Registering remote control failed!","Aborting!",0);
833 // -------------------------------------------------------------------------------------------------------------------
835 void shutdown(int code)
839 boxstack->shutdown();
841 logger->log("Core", Log::NOTICE, "BoxStack module shut down");
844 if (command) // shut down command here in case views have posted messages
848 logger->log("Core", Log::NOTICE, "Command module shut down");
855 logger->log("Core", Log::NOTICE, "VDR module shut down");
862 logger->log("Core", Log::NOTICE, "OSD module shut down");
869 logger->log("Core", Log::NOTICE, "Audio module shut down");
876 logger->log("Core", Log::NOTICE, "Video module shut down");
883 logger->log("Core", Log::NOTICE, "Timers module shut down");
890 logger->log("Core", Log::NOTICE, "MTD module shut down");
897 logger->log("Core", Log::NOTICE, "LED module shut down");
904 logger->log("Core", Log::NOTICE, "Remote module shut down");
909 logger->log("Core", Log::NOTICE, "WOL module shut down");
914 logger->log("Core", Log::NOTICE, "Log module shutting down... bye!\n\n");
921 logger->log("Core", Log::NOTICE, "Sleeptimer module shut down");
927 // -------------------------------------------------------------------------------------------------------------------
929 ULLONG htonll(ULLONG a)
931 return (((ULLONG)htonl((ULONG)((a<<32)>> 32))<<32)
932 |(ULONG)htonl(((ULONG) (a >> 32))));
935 ULLONG ntohll(ULLONG a)