Skip to content

Commit

Permalink
add addtime feature
Browse files Browse the repository at this point in the history
  • Loading branch information
gisogrimm committed May 27, 2024
1 parent c836206 commit 8566c79
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion plugins/src/tascarmod_systime.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class tascar_systime_t : public TASCAR::module_base_t {
std::string path = "/systime";
std::string secpath = "/seconds";
bool sendsessiontime = true;
double addtime = 0.0;
lo_message msg;
lo_message msgsec;
double* p_year;
Expand Down Expand Up @@ -61,6 +62,9 @@ tascar_systime_t::tascar_systime_t(const TASCAR::module_cfg_t& cfg)
secpath, "",
"OSC path where time stamps (seconds since midnight) are dispatched");
GET_ATTRIBUTE_BOOL(sendsessiontime, "Send session time in first data field");
GET_ATTRIBUTE(
addtime, "s",
"Add time to seconds since midnight, e.g., for time zone compensation");
msg = lo_message_new();
if(!msg)
throw TASCAR::ErrMsg("Unable to allocate OSC message");
Expand Down Expand Up @@ -128,7 +132,7 @@ void tascar_systime_t::update(uint32_t tp_frame, bool)
*p_sec = caltime.wSecond;
*p_sec += 0.001 * caltime.wMilliseconds;
#endif
*p_daysec = *p_sec + 60 * *p_min + 3600 * *p_hour;
*p_daysec = *p_sec + 60 * *p_min + 3600 * *p_hour + addtime;
if(!path.empty())
session->dispatch_data_message(path.c_str(), msg);
if(!secpath.empty())
Expand Down

0 comments on commit 8566c79

Please sign in to comment.