Keyboard control: print start time

This commit is contained in:
Martin Pulec
2017-07-11 10:27:46 +02:00
parent 49e8f02d16
commit 421e1f62f2
2 changed files with 5 additions and 0 deletions

View File

@@ -101,6 +101,7 @@ keyboard_control::keyboard_control() :
m_started(false),
m_locked_against_changes(true)
{
m_start_time = time(NULL);
}
ADD_TO_PARAM(disable_keyboard_control, "disable-keyboard-control", "* disable-keyboard-control\n"
@@ -212,6 +213,7 @@ void keyboard_control::run()
usage();
break;
case 'i':
cout << "\n";
info();
break;
case '\n':
@@ -281,6 +283,7 @@ after_protected:
void keyboard_control::info()
{
cout << "Start time: " << asctime(localtime(&m_start_time));
cout << "Verbosity level: " << log_level << (log_level == LOG_LEVEL_INFO ? " (default)" : "") << "\n";
cout << "Locked against changes: " << (m_locked_against_changes ? "true" : "false") << "\n";
cout << "Audio playback delay: " << get_audio_delay() << " ms\n";

View File

@@ -39,6 +39,7 @@
#define keyboard_control_h_
#include <thread>
#include <ctime>
#ifdef HAVE_TERMIOS_H
#include "termios.h"
@@ -65,6 +66,7 @@ private:
#endif
bool m_started;
bool m_locked_against_changes;
std::time_t m_start_time;
};
#endif // keyboard_control_h_