Skip to content

Commit

Permalink
correct OSC interface
Browse files Browse the repository at this point in the history
  • Loading branch information
gisogrimm committed May 20, 2024
1 parent b7f9fa9 commit 368dd3b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion plugins/src/tascar_ap_level2hsv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ class level2hsv_t : public TASCAR::audioplugin_base_t {
TASCAR::levelmeter_t* lmeter = NULL;
double currenttime = 0;
float* p_value = NULL;
float* p_sat = NULL;
float* p_hue = NULL;
};

level2hsv_t::level2hsv_t(const TASCAR::audioplugin_cfg_t& cfg)
Expand Down Expand Up @@ -107,6 +109,8 @@ level2hsv_t::level2hsv_t(const TASCAR::audioplugin_cfg_t& cfg)
lo_message_add_float(msg, 0.01);
auto oscmsgargv = lo_message_get_argv(msg);
p_value = &(oscmsgargv[2]->f);
p_hue = &(oscmsgargv[0]->f);
p_sat = &(oscmsgargv[1]->f);
thread = std::thread(&level2hsv_t::sendthread, this);
}

Expand Down Expand Up @@ -142,7 +146,10 @@ void level2hsv_t::sendthread()
l = std::min(1.0f,
std::max(0.0f, (l - lrange[0]) / (lrange[1] - lrange[0])));
*p_value = l;
lo_send_message(lo_addr, path.c_str(), msg);
*p_hue = hue;
*p_sat = saturation;
if(active)
lo_send_message(lo_addr, path.c_str(), msg);
has_data = false;
}
}
Expand Down

0 comments on commit 368dd3b

Please sign in to comment.