static int RecomputeTotalLatencies(lua_State *L) { cud_t *cud = cud_check(L, 1); int rc = jack_recompute_total_latencies(cud->client); if(rc!=0) return luajack_strerror(L, rc); return 0; }
static int reorder_cb (void * ctxt_arg) { mfp_context * ctxt = (mfp_context *)ctxt_arg; jack_latency_range_t range; int portno; int lastval; int maxval; int num_inports = mfp_num_input_buffers(ctxt); int num_outports = mfp_num_output_buffers(ctxt); jack_recompute_total_latencies(ctxt->info.jack->client); maxval = 0; for (portno = 0; portno < num_inports; portno++) { jack_port_get_latency_range(g_array_index(ctxt->info.jack->input_ports, jack_port_t *, portno), JackCaptureLatency, & range); if (range.max > maxval) { maxval = range.max; } lastval = jack_port_get_total_latency(ctxt->info.jack->client, g_array_index(ctxt->info.jack->input_ports, jack_port_t *, portno)); if (lastval > maxval) { maxval = lastval; } } mfp_in_latency = 1000.0 * maxval / ctxt->samplerate; maxval = 0; for (portno = 0; portno < num_outports; portno++) { jack_port_get_latency_range(g_array_index(ctxt->info.jack->output_ports, jack_port_t *, portno), JackPlaybackLatency, & range); if (range.max > maxval) { maxval = range.max; } lastval = jack_port_get_total_latency(ctxt->info.jack->client, g_array_index(ctxt->info.jack->output_ports, jack_port_t *, portno)); if (lastval > maxval) { maxval = lastval; } } mfp_out_latency = 1000.0 * maxval / ctxt->samplerate; /* mfp_dsp_send_response_float(NULL, 1, 0.0); */ return 0; }
void Client::recompute_latencies ( void ) { jack_recompute_total_latencies( _client ); }