2 Copyright 2004-2005 Chris Tallon
3 Copyright 2012 Marten Richter
5 This file is part of VOMP.
7 VOMP is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 VOMP is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with VOMP. If not, see <https://www.gnu.org/licenses/>.
27 #define _WIN32_WINNT 0x501
31 #include "vompreswin.h"
42 #include "windowsosd.h"
44 #include "osdwinpixel.h"
46 #include "osdwinvector.h"
51 #include "vsleeptimer.h"
52 #include "messagequeue.h"
54 void sighandler(int signalReceived);
55 void shutdown(int code);
57 // Global variables --------------------------------------------------------------------------------------------------
71 Sleeptimer* sleeptimer;
72 std::string commandLineServer;
74 bool wnd_fullscreen=false;
75 bool wnd_topmost=false;
76 RECT wnd_fs_rect={20,20,768+20,576+20};
77 RECT wnd_fs_rect_client={0,0,768,576};
78 //OSVERSIONINFO windows_ver; //attempt to distigsh windows versions
84 typedef UINT (WINAPI *GETRAWINPUTDATAFNC) (HRAWINPUT,UINT,LPVOID,PUINT,UINT);
85 typedef UINT (WINAPI *REGISTERRAWINPUTDEVICEFNC) (PCRAWINPUTDEVICE,UINT,UINT);
87 GETRAWINPUTDATAFNC dynGetRawInputData=NULL;
88 REGISTERRAWINPUTDEVICEFNC dynRegisterRawInputDevices=NULL;
92 MessageQueue* messageQueue;
95 void MILLISLEEP(ULONG a)
102 int getClockRealTime(struct timespec *tp){
106 GetSystemTime(&systime);
107 SystemTimeToFileTime(&systime, (FILETIME*)&filetime);
108 tp->tv_sec = (filetime - WINDOWS_TIME_BASE_OFFSET) / (10 * 1000 * 1000);
109 tp->tv_nsec = ((filetime - WINDOWS_TIME_BASE_OFFSET) % (10 * 1000 * 1000)) * 100;
113 DWORD WINAPI controlthreadStart(void *arg)
119 void LoadRemoteFunctions() {
120 user32dll=LoadLibrary("user32.dll");
121 if (user32dll!=NULL) {
122 dynGetRawInputData=(GETRAWINPUTDATAFNC)GetProcAddress(user32dll,"GetRawInputData");
123 if (dynGetRawInputData!=NULL) {
124 dynRegisterRawInputDevices=(REGISTERRAWINPUTDEVICEFNC)GetProcAddress(user32dll,"RegisterRawInputDevices");
125 if (dynRegisterRawInputDevices!=NULL) {
132 bool InitApp(HINSTANCE hinst,int cmdshow);
134 HWND win_main;//global window handle
135 HWND win;//global child window handle
138 #define ERROR_MSG(str) MessageBox(win_main,str,"Error!",MB_OK|MB_ICONWARNING)
139 INT WINAPI WinMain( HINSTANCE hinst , HINSTANCE previnst, LPSTR cmdline, int cmdshow)
142 //On Windows we have to init a window, we use DXUT
143 LoadRemoteFunctions();
144 if (!InitApp(hinst,cmdshow)) return false;
145 //Starting Network support
147 int result = WSAStartup(MAKEWORD(2,2),&wsadat);
148 if (result!=NO_ERROR) {
149 ERROR_MSG("Initialising WinSocked: Error at WSAStartup()\n");
153 result= CoInitializeEx(NULL,COINIT_MULTITHREADED );//Initialize COM for DirectShow
155 ERROR_MSG("Initialising COM: Error at Coinitialize()\n");
162 // Init global vars ------------------------------------------------------------------------------------------------
165 remote = new InputMan();
167 timers = new Timers();
168 osd = new Osd_TYPE();
170 video = new VideoWin();
171 audio = new AudioWin();
172 boxstack = new BoxStack();
173 control = new Control();
175 sleeptimer = new Sleeptimer();
177 if (!logger || !remote || !led || !osd || !video || !audio || !boxstack || !control || !sleeptimer)
179 ERROR_MSG("Could not create objects. Memory problems?\n");
185 messageQueue = control;
187 // Get logging module started --------------------------------------------------------------------------------------
189 if (!logger->init(Log::DEBUG, "vompwin.log", true))
191 ERROR_MSG("Could not initialise log object. Aborting.\n");
197 logger->log("Core", Log::INFO, "Starting up...");
201 // Init modules ----------------------------------------------------------------------------------------------------
204 success = remote->init();
207 logger->log("Core", Log::INFO, "Remote module initialised");
211 logger->log("Core", Log::EMERG, "Remote module failed to initialise");
217 inputWin = remote->getInputWin();
219 success = led->init(0);
222 logger->log("Core", Log::INFO, "LED module initialised");
226 logger->log("Core", Log::EMERG, "LED module failed to initialise");
232 success = timers->init();
235 logger->log("Core", Log::INFO, "Timers module initialised");
239 logger->log("Core", Log::EMERG, "Timers module failed to initialise");
245 UCHAR videoFormat = Video::PAL; // PALNTSC FIXME.
247 success = video->init(videoFormat);
250 logger->log("Core", Log::INFO, "Video module initialised");
254 logger->log("Core", Log::EMERG, "Video module failed to initialise");
260 dynamic_cast<WindowsOsd*>(osd)->setWindow(win);
261 success = osd->init();
264 logger->log("Core", Log::INFO, "OSD module initialised");
268 logger->log("Core", Log::EMERG, "OSD module failed to initialise");
273 video->setDefaultAspect();
275 success = audio->init(Audio::MPEG2_PES);
278 logger->log("Core", Log::INFO, "Audio module initialised");
282 logger->log("Core", Log::EMERG, "Audio module failed to initialise");
288 success = vdr->init();
291 logger->log("Core", Log::INFO, "VDR module initialised");
295 logger->log("Core", Log::EMERG, "VDR module failed to initialise");
301 success = boxstack->init();
304 logger->log("Core", Log::INFO, "BoxStack module initialised");
308 logger->log("Core", Log::EMERG, "BoxStack module failed to initialise");
314 success = control->init();
317 logger->log("Core", Log::INFO, "Control module initialised");
321 logger->log("Core", Log::EMERG, "Control module failed to initialise");
327 // Other init ------------------------------------------------------------------------------------------------------
329 logger->log("Core", Log::NOTICE, "Startup successful");
331 // Run main loop ---------------------------------------------------------------------------------------------------
333 // Ok, all major device components and other bits are loaded and ready
334 lastmousemove=timeGetTime();
336 HANDLE controlthread;
337 controlthread= CreateThread(NULL, 0, controlthreadStart, NULL,0,
340 message.message=WM_NULL;
342 while(run && WaitForSingleObject(controlthread,0)==WAIT_TIMEOUT) {
343 if (PeekMessage(&message, NULL, 0,0,PM_REMOVE)!=0) {
344 if (TranslateAccelerator(win_main,acc,&message)==NULL) {
345 TranslateMessage(&message);
346 DispatchMessage(&message);
347 switch (message.message) {
349 run=false; //TODO post exit to control Messages
353 //Render, moved to OSD !
355 //((OsdWin*)osd)->Render();
358 // When that returns quit ------------------------------------------------------------------------------------------
359 WaitForSingleObject(controlthread,INFINITE);
362 if (user32dll) FreeModule(user32dll);
367 bool TranslateMousePosition(POINT *pos) {
370 ScreenToClient(win,pos);
371 GetClientRect(win,&clientrect);
372 if (!PtInRect(&clientrect,*pos)) return false;//Don't pass it further
373 pos->x=((double)pos->x)/((double) (clientrect.right-clientrect.left))
374 *((double)Video::getInstance()->getScreenWidth());
375 pos->y=((double)pos->y)/((double) (clientrect.bottom-clientrect.top))
376 *((double)Video::getInstance()->getScreenHeight());
383 void CalculateWindowSize(RECT * size,ULONG size_mode) {
386 DWORD adjheight,adjwidth;
387 if (!wnd_fullscreen) {
388 DWORD flags =WS_VISIBLE | WS_POPUP | WS_CAPTION | WS_SYSMENU
389 |WS_MINIMIZEBOX | WS_SIZEBOX |WS_MAXIMIZEBOX;
390 RECT wnted={50,50,150,150};
391 AdjustWindowRect(&wnted,flags ,false);
392 adjwidth=-wnted.left+wnted.right-100;
393 adjheight=-wnted.top+wnted.bottom-100;
395 adjwidth=adjheight=0;
397 width=size->right-size->left-adjwidth;
398 height=size->bottom-size->top-adjheight;
399 UCHAR mode=Video::PAL;
400 UCHAR aspect=Video::ASPECT4X3;
401 UCHAR tvsize=Video::ASPECT4X3;
403 mode=video->getMode();
404 aspect=((VideoWin*)video)->getAspectRatio();
405 tvsize=((VideoWin*)video)->getPseudoTVsize();
408 double aspectrt=4./3.;
409 if (tvsize==Video::ASPECT16X9) {
410 if (aspect==Video::ASPECT16X9) {
411 aspectrt=4./3.; //looks strange, but it is a 16:9 tv
412 } else if (aspect==Video::ASPECT4X3) {
413 aspectrt=4./3./(16./9.)*(4./3.); //I hope this is correct
415 } else if (tvsize==Video::ASPECT4X3) {
416 if (aspect==Video::ASPECT16X9) {
417 if (mode!=Video::NORMAL) {
422 } else if (aspect==Video::ASPECT4X3) {
426 if (!wnd_fullscreen) {
429 case WMSZ_BOTTOMRIGHT:
432 width=(ULONG)(((double)height)*aspectrt);
433 size->right=size->left+width+adjwidth;
435 case WMSZ_BOTTOMLEFT:
437 width=(ULONG)(((double)height)*aspectrt);
438 size->left=size->right-width-adjwidth;
442 height=(ULONG)(((double)width)/aspectrt);
443 size->bottom=size->top+height+adjheight;
446 MoveWindow(win,0,0,width,height,TRUE);
448 RECT newrect={0,0,width,height};
450 if ((ULONG)(((double)height)*aspectrt)>width) {
451 newlength=(ULONG)(((double)width)/aspectrt);
452 newrect.top+=(height-newlength)/2;
453 newrect.bottom-=(height-newlength);
455 newlength=(ULONG)(((double)height)*aspectrt);
456 newrect.left+=(width-newlength)/2;
457 newrect.right-=(width-newlength);
459 MoveWindow(win,newrect.left,newrect.top,newrect.right,newrect.bottom,TRUE);
464 void AdjustWindow() {
465 if (!wnd_fullscreen) {
467 GetWindowRect(win_main,&winrect);
468 CalculateWindowSize(&winrect,WMSZ_BOTTOM);
469 MoveWindow(win_main,winrect.left,
470 winrect.top,winrect.right-winrect.left,winrect.bottom-winrect.top,true);
473 GetWindowRect(win_main,&winrect);
474 CalculateWindowSize(&winrect,WMSZ_BOTTOM);
479 void ToggleFullscreen() {
480 if (wnd_fullscreen) {
481 wnd_fullscreen=false;
482 SetWindowLong(win_main,GWL_STYLE,WS_VISIBLE | WS_POPUP | WS_CAPTION | WS_SYSMENU
483 |WS_MINIMIZEBOX | WS_SIZEBOX |WS_MAXIMIZEBOX);
484 SetWindowPos(win_main,NULL,0,0,0,0,SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);
486 SetWindowPos(win_main,wnd_topmost?HWND_TOPMOST:HWND_TOP,wnd_fs_rect.left,wnd_fs_rect.top,
487 wnd_fs_rect.right-wnd_fs_rect.left,
488 wnd_fs_rect.bottom-wnd_fs_rect.top,
489 SWP_DRAWFRAME | SWP_FRAMECHANGED);
490 MoveWindow(win,wnd_fs_rect_client.left,wnd_fs_rect_client.top,
491 wnd_fs_rect_client.right-wnd_fs_rect_client.left,
492 wnd_fs_rect_client.bottom-wnd_fs_rect_client.top,TRUE);
495 GetWindowRect(win_main,&wnd_fs_rect);
496 GetWindowRect(win,&wnd_fs_rect_client);
497 SetWindowLong(win_main,GWL_STYLE,WS_VISIBLE | WS_POPUP );
498 SetWindowPos(win_main,NULL,0,0,0,0,SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);
499 HMONITOR monitor=MonitorFromWindow(win_main,MONITOR_DEFAULTTONEAREST);
501 moninfo.cbSize=sizeof(moninfo);
503 if (!GetMonitorInfo(monitor,&moninfo)) return ;
504 SetWindowPos(win_main,wnd_topmost?HWND_TOPMOST:HWND_TOP,moninfo.rcMonitor.left,moninfo.rcMonitor.top,
505 moninfo.rcMonitor.right,moninfo.rcMonitor.bottom,SWP_FRAMECHANGED);
514 void ToggleTopmost() {
515 wnd_topmost=!wnd_topmost;
516 SetWindowPos(win_main,wnd_topmost?HWND_TOPMOST:HWND_NOTOPMOST,0,0,
517 0,0,SWP_NOMOVE | SWP_NOSIZE);
520 void CursorUpdate() {
522 GetCursorPos(&cursorpos);
524 asswind=WindowFromPoint(cursorpos);
525 if (asswind!=win_main && asswind!=win) {
526 return ; //not our responsibility
528 if ((timeGetTime()-lastmousemove)<4000 || cmenu) {
529 SetCursor(LoadCursor(NULL,IDC_ARROW));
535 bool ContextMenu(HWND wind,int x,int y) {
538 ScreenToClient(wind,&p);
539 GetClientRect(wind,&clientrect);
540 if (!PtInRect(&clientrect,p)) return false;
541 ClientToScreen(wind,&p);
544 menu=LoadMenu(hinstance,MAKEINTRESOURCE(VOMPMENU));
545 popup=GetSubMenu(menu,0);
546 if (wnd_fullscreen) {
547 CheckMenuItem(popup,VOMP_FULL_SCREEN,MF_BYCOMMAND|MF_CHECKED);
549 CheckMenuItem(popup,VOMP_FULL_SCREEN,MF_BYCOMMAND|MF_UNCHECKED);
552 CheckMenuItem(popup,VOMP_TOPMOST,MF_BYCOMMAND|MF_CHECKED);
554 CheckMenuItem(popup,VOMP_TOPMOST,MF_BYCOMMAND|MF_UNCHECKED);
557 TrackPopupMenu(popup,TPM_RIGHTBUTTON|TPM_LEFTALIGN,x,y,0,wind, NULL);
565 LONG FAR PASCAL WindowProc(HWND wind, UINT msg, WPARAM wparam, LPARAM lparam)
571 logger->log("Core", Log::NOTICE, "Window closed, shutting down...");
576 CalculateWindowSize((RECT*) lparam,wparam);
580 int width = LOWORD(lparam);
581 int height = HIWORD(lparam);
583 if (wparam == SIZE_MAXIMIZED) {
586 } /*else if (wparam == SIZE_MINIMIZED) {
596 if (GetUpdateRect(wind, &r, FALSE)) {
597 BeginPaint(wind, &ps);
598 //Call Painting Mechanism
603 if (inputWin->ReceiveButtonVK(wparam)) {
604 return 0L; //We process that Key
606 return DefWindowProc(wind, msg, wparam, lparam);
611 if (inputWin->ReceiveButtonCH(wparam)) {
612 return 0L; //We process that Key
614 return DefWindowProc(wind, msg, wparam, lparam);
619 if (inputWin->ReceiveButtonAP(GET_APPCOMMAND_LPARAM(lparam))){
620 return TRUE; //yes we process that message
622 return DefWindowProc(wind, msg, wparam, lparam);
631 dynGetRawInputData((HRAWINPUT)lparam,RID_INPUT,NULL,&risize,sizeof(RAWINPUTHEADER));
632 lpit=(LPRAWINPUT)malloc(risize);
633 dynGetRawInputData((HRAWINPUT)lparam,RID_INPUT,lpit,&risize,sizeof(RAWINPUTHEADER));
635 if (lpit->header.dwType==RIM_TYPEHID && lpit->data.hid.dwSizeHid>=2) {
636 DWORD button=lpit->data.hid.bRawData[1] | (lpit->data.hid.bRawData[0]<< 8);
637 if (inputWin->ReceiveButtonRI(button)){
639 return 0; //yes we process that message
644 return DefWindowProc(wind, msg, wparam, lparam);
649 if (LOWORD(wparam)==VOMP_FULL_SCREEN) {
653 if (LOWORD(wparam)==VOMP_TOPMOST) {
657 if (inputWin->ReceiveButtonAP(LOWORD(wparam))){
658 return 0; //yes we process that message
660 return DefWindowProc(wind, msg, wparam, lparam);
665 if (((HANDLE)wparam)==win) {
669 return DefWindowProc(wind, msg, wparam, lparam);
673 if (wparam==SC_MAXIMIZE) {
676 } else if (wparam==SC_SCREENSAVE || wparam==SC_MONITORPOWER) {
679 return DefWindowProc(wind,msg,wparam, lparam);
684 lastmousemove=timeGetTime();
685 SetCursor(LoadCursor(NULL,IDC_ARROW));
686 SetTimer(wind,VOMP_CURSORUPDATE,4500,NULL);
687 POINT mpos={GET_X_LPARAM(lparam),GET_Y_LPARAM(lparam)};
688 ClientToScreen(wind,&mpos);
689 if (TranslateMousePosition(&mpos)) {
690 Message *mousemes=new Message();
691 mousemes->message=Message::MOUSE_MOVE;
693 mousemes->p_to = Message::MOUSE_RECEIVER;
694 mousemes->parameter=(mpos.x & 0xFFFF)<< 16| (mpos.y & 0xFFFF);
696 messageQueue->postMessage(mousemes);
700 //return DefWindowProc(wind,msg,wparam, lparam);
704 if (wparam==VOMP_CURSORUPDATE) {
708 return DefWindowProc(wind, msg, wparam, lparam);
712 if (!ContextMenu(wind,GET_X_LPARAM(lparam),GET_Y_LPARAM(lparam))) {
713 return DefWindowProc(wind, msg, wparam, lparam);
718 case WM_LBUTTONDOWN:{
719 POINT mpos={GET_X_LPARAM(lparam),GET_Y_LPARAM(lparam)};
720 ClientToScreen(wind,&mpos);
721 if (TranslateMousePosition(&mpos)) {
722 Message *mousemes=new Message();
723 mousemes->message=Message::MOUSE_LBDOWN;
725 mousemes->p_to = Message::MOUSE_RECEIVER;
726 mousemes->parameter=(mpos.x & 0xFFFF)<< 16| (mpos.y & 0xFFFF);
728 messageQueue->postMessage(mousemes);
732 POINT mpos = { GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam) };
733 ClientToScreen(wind, &mpos);
734 if (TranslateMousePosition(&mpos)) {
735 Message *mousemes = new Message();
736 mousemes->message = Message::MOUSE_SCROLL;
737 mousemes->from = NULL;
738 mousemes->p_to = Message::MOUSE_RECEIVER;
739 mousemes->parameter = (0 & 0xFFFF) << 16 | (GET_WHEEL_DELTA_WPARAM(wparam) &0xFFFF);
740 mousemes->tag = (mpos.x & 0xFFFF) << 16 | (mpos.y & 0xFFFF);
741 messageQueue->postMessage(mousemes);
746 return DefWindowProc(wind, msg, wparam, lparam);
752 bool InitApp(HINSTANCE hinst,int cmdshow) {
756 wcs.style = CS_HREDRAW | CS_VREDRAW;
757 wcs.lpfnWndProc = WindowProc;
759 wcs.cbWndExtra = sizeof(DWORD);
760 wcs.hInstance = hinst;
763 wcs.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
764 wcs.lpszMenuName = NULL;
765 wcs.lpszClassName = "vomp";
766 acc=LoadAccelerators(hinst,MAKEINTRESOURCE(VOMPACCELERATOR));
767 if (!RegisterClass(&wcs))
769 flags =WS_VISIBLE | WS_POPUP | WS_CAPTION | WS_SYSMENU
770 |WS_MINIMIZEBOX | WS_SIZEBOX |WS_MAXIMIZEBOX;
771 RECT wnted={50,50,768+50,576+50};
772 AdjustWindowRect(&wnted,flags ,false);
773 win_main=CreateWindow("vomp","VOMP on Windows",flags, CW_USEDEFAULT,CW_USEDEFAULT,
774 wnted.right-wnted.left,wnted.bottom-wnted.top,NULL,NULL,hinst,NULL);
777 ShowWindow(win_main,SW_SHOWNORMAL);
778 UpdateWindow(win_main);
779 /* in order to handle letterboxing we use a child window */
781 child_wcs.style = CS_HREDRAW | CS_VREDRAW;
782 child_wcs.lpfnWndProc = WindowProc;
783 child_wcs.cbClsExtra = 0;
784 child_wcs.cbWndExtra = sizeof(DWORD);
785 child_wcs.hInstance = hinst;
786 child_wcs.hIcon = NULL;
787 child_wcs.hCursor = NULL;
788 child_wcs.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
789 child_wcs.lpszMenuName = NULL;
790 child_wcs.lpszClassName = "vomp_playback";
791 if (!RegisterClass(&child_wcs))
794 win=CreateWindow("vomp_playback","Vomp Playback Window",WS_VISIBLE | WS_CHILD |WS_CLIPCHILDREN,
795 0,0,768,576,win_main,NULL,hinst,NULL);
798 ShowWindow(win,SW_SHOWNORMAL);
800 if (remotefnc) {//at least windows XP
801 /* We want to support MCE Remote controls*/
802 RAWINPUTDEVICE remote_control_data[4];
803 ZeroMemory(remote_control_data,sizeof(remote_control_data));
804 remote_control_data[0].usUsagePage=0xFFBC;
805 remote_control_data[0].usUsage=0x88;
806 remote_control_data[0].dwFlags=0;
807 remote_control_data[1].usUsagePage=0x0C;
808 remote_control_data[1].usUsage=0x80;
809 remote_control_data[1].dwFlags=0;
810 remote_control_data[2].usUsagePage=0x0C;
811 remote_control_data[2].usUsage=0x01;
812 remote_control_data[2].dwFlags=0;
813 remote_control_data[3].usUsagePage=0x01;
814 remote_control_data[3].usUsage=0x80;
815 remote_control_data[3].dwFlags=0;
816 if (dynRegisterRawInputDevices(remote_control_data,4,sizeof(remote_control_data[0]))!=TRUE) {
817 MessageBox(0,"Registering remote control failed!","Aborting!",0);
829 // -------------------------------------------------------------------------------------------------------------------
831 void shutdown(int code)
835 boxstack->shutdown();
837 logger->log("Core", Log::NOTICE, "BoxStack module shut down");
840 if (control) // shut down control here in case views have posted messages
844 logger->log("Core", Log::NOTICE, "Control module shut down");
851 logger->log("Core", Log::NOTICE, "VDR module shut down");
858 logger->log("Core", Log::NOTICE, "OSD module shut down");
865 logger->log("Core", Log::NOTICE, "Audio module shut down");
872 logger->log("Core", Log::NOTICE, "Video module shut down");
879 logger->log("Core", Log::NOTICE, "Timers module shut down");
886 logger->log("Core", Log::NOTICE, "LED module shut down");
893 logger->log("Core", Log::NOTICE, "Remote module shut down");
898 logger->log("Core", Log::NOTICE, "WOL module shut down");
903 logger->log("Core", Log::NOTICE, "Log module shutting down... bye!\n\n");
910 logger->log("Core", Log::NOTICE, "Sleeptimer module shut down");
916 // -------------------------------------------------------------------------------------------------------------------
918 ULLONG htonll(ULLONG a)
920 return (((ULLONG)htonl((ULONG)((a<<32)>> 32))<<32)
921 |(ULONG)htonl(((ULONG) (a >> 32))));
924 ULLONG ntohll(ULLONG a)
929 std::string tp2str(const std::chrono::time_point<std::chrono::system_clock>& tp)
931 auto tms = std::chrono::time_point_cast<std::chrono::milliseconds>(tp);
932 std::chrono::milliseconds e = tms.time_since_epoch();
933 long long c = e.count();
934 time_t tt = c / 1000;
936 auto stm = std::localtime(&tt);
937 std::stringstream ss;
938 ss << std::put_time(stm, "%T") << "." << std::setfill('0') << std::setw(3) << ttm;
942 const std::string& getCommandLineServer()
944 return commandLineServer;