2 * Copyright (C) 2017 Johannes Mueller <github@johannes-mueller.org>
3 * based on a-comp (C) 2016 Damien Zammit <damien@zamaudio.com>
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
24 #include <cairo/cairo.h>
25 #include "ardour/lv2_extensions.h"
28 #include "lv2/lv2plug.in/ns/lv2core/lv2.h"
30 #define RESET_PEAK_AFTER_SECONDS 3
32 #define AEXP_URI "urn:ardour:a-exp"
33 #define AEXP_STEREO_URI "urn:ardour:a-exp#stereo"
36 # define M_PI 3.14159265358979323846
41 #define isfinite_local(val) (bool)_finite((double)val)
43 #define isfinite_local isfinite
95 LV2_Inline_Display_Image_Surface surf;
97 cairo_surface_t* display;
98 LV2_Inline_Display* queue_draw;
101 /* ports pointers are only valid during run so we'll
102 * have to cache them for the display, besides
103 * we do want to check for changes
114 uint32_t peakdb_samples;
119 instantiate(const LV2_Descriptor* descriptor,
121 const char* bundle_path,
122 const LV2_Feature* const* features)
124 AExp* aexp = (AExp*)calloc(1, sizeof(AExp));
126 for (int i=0; features[i]; ++i) {
128 if (!strcmp(features[i]->URI, LV2_INLINEDISPLAY__queue_draw)) {
129 aexp->queue_draw = (LV2_Inline_Display*) features[i]->data;
135 aexp->tau = (1.0 - exp (-2.f * M_PI * 25.f / aexp->srate));
137 aexp->need_expose = true;
138 aexp->v_lvl_out = -70.f;
141 return (LV2_Handle)aexp;
145 connect_port(LV2_Handle instance,
149 AExp* aexp = (AExp*)instance;
151 switch ((PortIndex)port) {
153 aexp->attack = (float*)data;
156 aexp->release = (float*)data;
159 aexp->knee = (float*)data;
162 aexp->ratio = (float*)data;
165 aexp->thresdb = (float*)data;
168 aexp->makeup = (float*)data;
171 aexp->gainr = (float*)data;
174 aexp->outlevel = (float*)data;
177 aexp->inlevel = (float*)data;
180 aexp->sidechain = (float*)data;
183 aexp->enable = (float*)data;
191 connect_mono(LV2_Handle instance,
195 AExp* aexp = (AExp*)instance;
196 connect_port (instance, port, data);
198 switch ((PortIndex)port) {
200 aexp->input0 = (float*)data;
203 aexp->sc = (float*)data;
206 aexp->output0 = (float*)data;
214 connect_stereo(LV2_Handle instance,
218 AExp* aexp = (AExp*)instance;
219 connect_port (instance, port, data);
221 switch ((PortIndex)port) {
223 aexp->input0 = (float*)data;
226 aexp->input1 = (float*)data;
229 aexp->sc = (float*)data;
232 aexp->output0 = (float*)data;
235 aexp->output1 = (float*)data;
242 // Force already-denormal float value to zero
244 sanitize_denormal(float value) {
245 if (!isnormal(value)) {
253 return (exp(gdb/20.f*log(10.f)));
258 return (20.f*log10(g));
262 activate(LV2_Handle instance)
264 AExp* aexp = (AExp*)instance;
266 *(aexp->gainr) = 160.0f;
267 *(aexp->outlevel) = -45.0f;
268 *(aexp->inlevel) = -45.0f;
271 aexp->v_peakdb = -160.f;
272 aexp->peakdb_samples = 0;
277 run_mono(LV2_Handle instance, uint32_t n_samples)
279 AExp* aexp = (AExp*)instance;
281 const float* const input = aexp->input0;
282 const float* const sc = aexp->sc;
283 float* const output = aexp->output0;
285 float srate = aexp->srate;
286 float width = (6.f * *(aexp->knee)) + 0.01;
287 float attack_coeff = exp(-1000.f/(*(aexp->attack) * srate));
288 float release_coeff = exp(-1000.f/(*(aexp->release) * srate));
291 float lgaininp = 0.f;
297 int usesidechain = (*(aexp->sidechain) <= 0.f) ? 0 : 1;
303 float ratio = *aexp->ratio;
304 float thresdb = *aexp->thresdb;
305 float makeup = *aexp->makeup;
306 float makeup_target = from_dB(makeup);
307 float makeup_gain = aexp->makeup_gain;
309 const float tau = aexp->tau;
311 if (*aexp->enable <= 0) {
316 if (!aexp->was_disabled) {
318 aexp->was_disabled = true;
321 if (aexp->was_disabled) {
322 *aexp->gainr = 160.f;
323 aexp->was_disabled = false;
328 if (aexp->v_knee != *aexp->knee) {
329 aexp->v_knee = *aexp->knee;
330 aexp->need_expose = true;
333 if (aexp->v_ratio != ratio) {
334 aexp->v_ratio = ratio;
335 aexp->need_expose = true;
338 if (aexp->v_thresdb != thresdb) {
339 aexp->v_thresdb = thresdb;
340 aexp->need_expose = true;
343 if (aexp->v_makeup != makeup) {
344 aexp->v_makeup = makeup;
345 aexp->need_expose = true;
348 float in_peak_db = -160.f;
349 old_gainr = *aexp->gainr;
350 float max_gainr = 0.0;
352 for (i = 0; i < n_samples; i++) {
355 ingain = usesidechain ? fabs(sc0) : fabs(in0);
357 Lxg = (ingain==0.f) ? -160.f : to_dB(ingain);
358 Lxg = sanitize_denormal(Lxg);
360 if (Lxg > in_peak_db) {
364 if (2.f*(Lxg-thresdb) < -width) {
365 Lyg = thresdb + (Lxg-thresdb) * ratio;
366 Lyg = sanitize_denormal(Lyg);
367 } else if (2.f*(Lxg-thresdb) > width) {
370 Lyg = Lxg + (1.f-ratio)*(Lxg-thresdb-width/2.f)*(Lxg-thresdb-width/2.f)/(2.f*width);
373 current_gainr = Lxg - Lyg;
375 if (current_gainr > old_gainr) {
376 current_gainr = release_coeff*old_gainr + (1.f-release_coeff)*current_gainr;
377 } else if (current_gainr < old_gainr) {
378 current_gainr = attack_coeff*old_gainr + (1.f-attack_coeff)*current_gainr;
381 current_gainr = sanitize_denormal(current_gainr);
383 Lgain = from_dB(-current_gainr);
385 old_gainr = current_gainr;
387 *(aexp->gainr) = current_gainr;
388 if (current_gainr > max_gainr) {
389 max_gainr = current_gainr;
392 lgaininp = in0 * Lgain;
394 makeup_gain += tau * (makeup_target - makeup_gain) + 1e-12;
395 output[i] = lgaininp * makeup_gain;
397 max = (fabsf(output[i]) > max) ? fabsf(output[i]) : sanitize_denormal(max);
400 *(aexp->outlevel) = (max < 0.0056f) ? -45.f : to_dB(max);
401 *(aexp->inlevel) = in_peak_db;
402 aexp->makeup_gain = makeup_gain;
405 if (in_peak_db > aexp->v_peakdb) {
406 aexp->v_peakdb = in_peak_db;
407 aexp->peakdb_samples = 0;
409 aexp->peakdb_samples += n_samples;
410 if ((float)aexp->peakdb_samples/aexp->srate > RESET_PEAK_AFTER_SECONDS) {
411 aexp->v_peakdb = in_peak_db;
412 aexp->peakdb_samples = 0;
413 aexp->need_expose = true;
417 const float v_lvl_out = (max < 0.001f) ? -1600.f : to_dB(max);
418 const float v_lvl_in = in_peak_db;
420 if (fabsf (aexp->v_lvl_out - v_lvl_out) >= .1 ||
421 fabsf (aexp->v_lvl_in - v_lvl_in) >= .1 ||
422 fabsf (aexp->v_gainr - max_gainr) >= .1) {
423 // >= 0.1dB difference
424 aexp->need_expose = true;
425 aexp->v_lvl_in = v_lvl_in;
426 aexp->v_lvl_out = v_lvl_out;
427 aexp->v_gainr = max_gainr;
429 if (aexp->need_expose && aexp->queue_draw) {
430 aexp->need_expose = false;
431 aexp->queue_draw->queue_draw (aexp->queue_draw->handle);
438 run_stereo(LV2_Handle instance, uint32_t n_samples)
440 AExp* aexp = (AExp*)instance;
442 const float* const input0 = aexp->input0;
443 const float* const input1 = aexp->input1;
444 const float* const sc = aexp->sc;
445 float* const output0 = aexp->output0;
446 float* const output1 = aexp->output1;
448 float srate = aexp->srate;
449 float width = (6.f * *(aexp->knee)) + 0.01;
450 float attack_coeff = exp(-1000.f/(*(aexp->attack) * srate));
451 float release_coeff = exp(-1000.f/(*(aexp->release) * srate));
454 float lgaininp = 0.f;
455 float rgaininp = 0.f;
459 float old_gainr = *aexp->gainr;
461 int usesidechain = (*(aexp->sidechain) <= 0.f) ? 0 : 1;
469 float ratio = *aexp->ratio;
470 float thresdb = *aexp->thresdb;
471 float makeup = *aexp->makeup;
472 float makeup_target = from_dB(makeup);
473 float makeup_gain = aexp->makeup_gain;
475 const float tau = aexp->tau;
477 if (*aexp->enable <= 0) {
482 if (!aexp->was_disabled) {
484 aexp->was_disabled = true;
487 if (aexp->was_disabled) {
488 *aexp->gainr = 160.f;
489 aexp->was_disabled = false;
494 if (aexp->v_knee != *aexp->knee) {
495 aexp->v_knee = *aexp->knee;
496 aexp->need_expose = true;
499 if (aexp->v_ratio != ratio) {
500 aexp->v_ratio = ratio;
501 aexp->need_expose = true;
504 if (aexp->v_thresdb != thresdb) {
505 aexp->v_thresdb = thresdb;
506 aexp->need_expose = true;
509 if (aexp->v_makeup != makeup) {
510 aexp->v_makeup = makeup;
511 aexp->need_expose = true;
515 float in_peak_db = -160.f;
516 old_gainr = *aexp->gainr;
517 float max_gainr = 0.0;
519 for (i = 0; i < n_samples; i++) {
523 maxabslr = fmaxf(fabs(in0), fabs(in1));
524 ingain = usesidechain ? fabs(sc0) : maxabslr;
526 Lxg = (ingain==0.f) ? -160.f : to_dB(ingain);
527 Lxg = sanitize_denormal(Lxg);
529 if (Lxg > in_peak_db) {
533 if (2.f*(Lxg-thresdb) < -width) {
534 Lyg = thresdb + (Lxg-thresdb) * ratio;
535 Lyg = sanitize_denormal(Lyg);
536 } else if (2.f*(Lxg-thresdb) > width) {
539 Lyg = Lxg + (1.f-ratio)*(Lxg-thresdb-width/2.f)*(Lxg-thresdb-width/2.f)/(2.f*width);
542 current_gainr = Lxg - Lyg;
544 if (current_gainr > old_gainr) {
545 current_gainr = release_coeff*old_gainr + (1.f-release_coeff)*current_gainr;
546 } else if (current_gainr < old_gainr) {
547 current_gainr = attack_coeff*old_gainr + (1.f-attack_coeff)*current_gainr;
550 current_gainr = sanitize_denormal(current_gainr);
552 Lgain = from_dB(-current_gainr);
554 old_gainr = current_gainr;
556 *(aexp->gainr) = current_gainr;
557 if (current_gainr > max_gainr) {
558 max_gainr = current_gainr;
561 lgaininp = in0 * Lgain;
562 rgaininp = in1 * Lgain;
564 makeup_gain += tau * (makeup_target - makeup_gain) + 1e-12;
566 output0[i] = lgaininp * makeup_gain;
567 output1[i] = rgaininp * makeup_gain;
569 max = (fmaxf(fabs(output0[i]), fabs(output1[i])) > max) ? fmaxf(fabs(output0[i]), fabs(output1[i])) : sanitize_denormal(max);
572 *(aexp->outlevel) = (max < 0.0056f) ? -45.f : to_dB(max);
573 *(aexp->inlevel) = in_peak_db;
574 aexp->makeup_gain = makeup_gain;
577 if (in_peak_db > aexp->v_peakdb) {
578 aexp->v_peakdb = in_peak_db;
579 aexp->peakdb_samples = 0;
581 aexp->peakdb_samples += n_samples;
582 if ((float)aexp->peakdb_samples/aexp->srate > RESET_PEAK_AFTER_SECONDS) {
583 aexp->v_peakdb = in_peak_db;
584 aexp->peakdb_samples = 0;
585 aexp->need_expose = true;
589 const float v_lvl_out = (max < 0.001f) ? -1600.f : to_dB(max);
590 const float v_lvl_in = in_peak_db;
592 if (fabsf (aexp->v_lvl_out - v_lvl_out) >= .1 ||
593 fabsf (aexp->v_lvl_in - v_lvl_in) >= .1 ||
594 fabsf (aexp->v_gainr - max_gainr) >= .1) {
595 // >= 0.1dB difference
596 aexp->need_expose = true;
597 aexp->v_lvl_in = v_lvl_in;
598 aexp->v_lvl_out = v_lvl_out;
599 aexp->v_gainr = max_gainr;
601 if (aexp->need_expose && aexp->queue_draw) {
602 aexp->need_expose = false;
603 aexp->queue_draw->queue_draw (aexp->queue_draw->handle);
610 deactivate(LV2_Handle instance)
616 cleanup(LV2_Handle instance)
619 AExp* aexp = (AExp*)instance;
621 cairo_surface_destroy (aexp->display);
630 #define MIN(A,B) ((A) < (B)) ? (A) : (B)
635 exp_curve (const AExp* self, float xg) {
636 const float knee = self->v_knee;
637 const float ratio = self->v_ratio;
638 const float thresdb = self->v_thresdb;
639 const float makeup = self->v_makeup;
641 const float width = 6.f * knee + 0.01f;
644 if (2.f * (xg - thresdb) < -width) {
645 yg = thresdb + (xg - thresdb) * ratio;
646 } else if (2.f * (xg - thresdb) > width) {
649 yg = xg + (1.f - ratio) * (xg - thresdb - width / 2.f) * (xg - thresdb - width / 2.f) / (2.f * width);
659 render_inline_full (cairo_t* cr, const AExp* self)
661 const float w = self->w;
662 const float h = self->h;
664 const float makeup_thres = self->v_thresdb + self->v_makeup;
667 cairo_rectangle (cr, 0, 0, w, h);
668 cairo_set_source_rgba (cr, .2, .2, .2, 1.0);
671 cairo_set_line_width(cr, 1.0);
673 // draw grid 10dB steps
674 const double dash1[] = {1, 2};
675 const double dash2[] = {1, 3};
677 cairo_set_line_cap(cr, CAIRO_LINE_CAP_ROUND);
678 cairo_set_dash(cr, dash2, 2, 2);
679 cairo_set_source_rgba (cr, 0.5, 0.5, 0.5, 0.5);
681 for (uint32_t d = 1; d < 7; ++d) {
682 const float x = -.5 + floorf (w * (d * 10.f / 70.f));
683 const float y = -.5 + floorf (h * (d * 10.f / 70.f));
685 cairo_move_to (cr, x, 0);
686 cairo_line_to (cr, x, h);
689 cairo_move_to (cr, 0, y);
690 cairo_line_to (cr, w, y);
693 cairo_set_source_rgba (cr, 0.5, 0.5, 0.5, 1.0);
694 cairo_set_dash(cr, dash1, 2, 2);
695 if (self->v_thresdb < 0) {
696 const float y = -.5 + floorf (h * ((makeup_thres - 10.f) / -70.f));
697 cairo_move_to (cr, 0, y);
698 cairo_line_to (cr, w, y);
702 cairo_move_to (cr, 0, h);
703 cairo_line_to (cr, w, 0);
708 cairo_set_source_rgba (cr, 0.5, 0.5, 0.5, 0.5);
709 const float x = -.5 + floorf (w * (60.f / 70.f));
710 const float y = -.5 + floorf (h * (10.f / 70.f));
711 cairo_move_to (cr, x, 0);
712 cairo_line_to (cr, x, h);
714 cairo_move_to (cr, 0, y);
715 cairo_line_to (cr, w, y);
720 const float x = -.5 + floorf (w * (62.5f / 70.f));
721 const float y = -.5 + floorf (h * (10.0f / 70.f));
722 const float wd = floorf (w * (5.f / 70.f));
723 const float ht = floorf (h * (55.f / 70.f));
724 cairo_rectangle (cr, x, y, wd, ht);
727 const float h_gr = fminf (ht, floorf (h * self->v_gainr / 70.f));
728 cairo_set_source_rgba (cr, 0.95, 0.0, 0.0, 1.0);
729 cairo_rectangle (cr, x, y, wd, h_gr);
731 cairo_set_source_rgba (cr, 0.5, 0.5, 0.5, 0.5);
732 cairo_rectangle (cr, x, y, wd, ht);
733 cairo_set_source_rgba (cr, 0.75, 0.75, 0.75, 1.0);
738 cairo_set_source_rgba (cr, .8, .8, .8, 1.0);
739 cairo_move_to (cr, 0, h);
741 for (uint32_t x = 0; x < w; ++x) {
743 const float x_db = 70.f * (-1.f + x / (float)w) + 10.f;
744 const float y_db = exp_curve (self, x_db) - 10.f;
745 const float y = h * (y_db / -70.f);
746 cairo_line_to (cr, x, y);
748 cairo_stroke_preserve (cr);
750 cairo_line_to (cr, w, h);
751 cairo_close_path (cr);
754 // draw signal level & reduction/gradient
755 const float top = exp_curve (self, 0) - 10.f;
756 cairo_pattern_t* pat = cairo_pattern_create_linear (0.0, 0.0, 0.0, h);
757 if (top > makeup_thres - 10.f) {
758 cairo_pattern_add_color_stop_rgba (pat, 0.0, 0.8, 0.1, 0.1, 0.5);
759 cairo_pattern_add_color_stop_rgba (pat, top / -70.f, 0.8, 0.1, 0.1, 0.5);
761 if (self->v_knee > 0) {
762 cairo_pattern_add_color_stop_rgba (pat, ((makeup_thres -10.f) / -70.f), 0.7, 0.7, 0.2, 0.5);
763 cairo_pattern_add_color_stop_rgba (pat, ((makeup_thres - self->v_knee - 10.f) / -70.f), 0.5, 0.5, 0.5, 0.5);
765 cairo_pattern_add_color_stop_rgba (pat, ((makeup_thres - 10.f)/ -70.f), 0.7, 0.7, 0.2, 0.5);
766 cairo_pattern_add_color_stop_rgba (pat, ((makeup_thres - 10.01f) / -70.f), 0.5, 0.5, 0.5, 0.5);
768 cairo_pattern_add_color_stop_rgba (pat, 1.0, 0.5, 0.5, 0.5, 0.5);
770 // maybe cut off at x-position?
771 const float x = w * (self->v_lvl_in + 60) / 70.f;
772 const float y = x + h*self->v_makeup;
773 cairo_rectangle (cr, 0, h - y, x, y);
774 if (self->v_ratio > 1.0) {
775 cairo_set_source (cr, pat);
777 cairo_set_source_rgba (cr, 0.5, 0.5, 0.5, 0.5);
782 cairo_set_source_rgba (cr, .9f, .9f, .9f, 1.0);
783 cairo_set_line_width(cr, 1.0);
785 const float peak_x = w * (1.f - (10.f-self->v_peakdb)/70.f);
786 const float peak_y = h * (exp_curve (self, self->v_peakdb) - 10.f) / -70.f;
788 cairo_move_to(cr, peak_x, h);
789 cairo_line_to(cr, peak_x, peak_y);
792 cairo_pattern_destroy (pat); // TODO cache pattern
796 render_inline_only_bars (cairo_t* cr, const AExp* self)
798 const float w = self->w;
799 const float h = self->h;
801 cairo_rectangle (cr, 0, 0, w, h);
802 cairo_set_source_rgba (cr, .2, .2, .2, 1.0);
808 const float ht = 0.25f * h;
810 const float x1 = w*0.05;
811 const float wd = w - 2.0f*x1;
813 const float y1 = 0.17*h;
814 const float y2 = h - y1 - ht;
816 cairo_set_source_rgba (cr, 0.5, 0.5, 0.5, 0.5);
818 cairo_rectangle (cr, x1, y1, wd, ht);
821 cairo_rectangle (cr, x1, y2, wd, ht);
824 cairo_set_source_rgba (cr, 0.75, 0.0, 0.0, 1.0);
825 const float w_gr = (self->v_gainr > 60.f) ? wd : wd * self->v_gainr * (1.f/60.f);
826 cairo_rectangle (cr, x1+wd-w_gr, y2, w_gr, ht);
829 if (self->v_lvl_in > -60.f) {
830 if (self->v_lvl_out > 10.f) {
831 cairo_set_source_rgba (cr, 0.75, 0.0, 0.0, 1.0);
832 } else if (self->v_lvl_out > 0.f) {
833 cairo_set_source_rgba (cr, 0.66, 0.66, 0.0, 1.0);
835 cairo_set_source_rgba (cr, 0.0, 0.66, 0.0, 1.0);
837 const float w_g = (self->v_lvl_in > 10.f) ? wd : wd * (60.f+self->v_lvl_in) / 70.f;
838 cairo_rectangle (cr, x1, y1, w_g, ht);
842 cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 1.0);
844 const float tck = 0.33*ht;
846 cairo_set_line_width (cr, .5);
848 for (uint32_t d = 1; d < 7; ++d) {
849 const float x = x1 + (d * wd * (10.f / 70.f));
851 cairo_move_to (cr, x, y1);
852 cairo_line_to (cr, x, y1+tck);
854 cairo_move_to (cr, x, y1+ht);
855 cairo_line_to (cr, x, y1+ht-tck);
857 cairo_move_to (cr, x, y2);
858 cairo_line_to (cr, x, y2+tck);
860 cairo_move_to (cr, x, y2+ht);
861 cairo_line_to (cr, x, y2+ht-tck);
866 const float x_0dB = x1 + wd*(60.f/70.f);
868 cairo_move_to (cr, x_0dB, y1);
869 cairo_line_to (cr, x_0dB, y1+ht);
871 cairo_rectangle (cr, x1, y1, wd, ht);
872 cairo_rectangle (cr, x1, y2, wd, ht);
875 cairo_set_line_width (cr, 2.0);
877 // visualize threshold
878 const float tr = x1 + wd * (60.f+self->v_thresdb) / 70.f;
879 cairo_set_source_rgba (cr, 0.95, 0.95, 0.0, 1.0);
880 cairo_move_to (cr, tr, y1);
881 cairo_line_to (cr, tr, y1+ht);
885 const float reduced_0dB = self->v_thresdb * (1.f - 1.f/self->v_ratio);
886 const float rt = x1 + wd * (60.f+reduced_0dB) / 70.f;
887 cairo_set_source_rgba (cr, 0.95, 0.0, 0.0, 1.0);
888 cairo_move_to (cr, rt, y1);
889 cairo_line_to (cr, rt, y1+ht);
893 if (self->v_peakdb > -60.f) {
894 cairo_set_source_rgba (cr, 0.0, 1.0, 0.0, 1.0);
895 const float pk = (self->v_peakdb > 10.f) ? x1+wd : wd * (60.f+self->v_peakdb) / 70.f;
896 cairo_move_to (cr, pk, y1);
897 cairo_line_to (cr, pk, y1+ht);
903 static LV2_Inline_Display_Image_Surface *
904 render_inline (LV2_Handle instance, uint32_t w, uint32_t max_h)
906 AExp* self = (AExp*)instance;
908 uint32_t h = MIN (w, max_h);
913 if (!self->display || self->w != w || self->h != h) {
914 if (self->display) cairo_surface_destroy(self->display);
915 self->display = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, w, h);
920 cairo_t* cr = cairo_create (self->display);
923 render_inline_full (cr, self);
925 render_inline_only_bars (cr, self);
930 cairo_surface_flush (self->display);
931 self->surf.width = cairo_image_surface_get_width (self->display);
932 self->surf.height = cairo_image_surface_get_height (self->display);
933 self->surf.stride = cairo_image_surface_get_stride (self->display);
934 self->surf.data = cairo_image_surface_get_data (self->display);
941 extension_data(const char* uri)
944 static const LV2_Inline_Display_Interface display = { render_inline };
945 if (!strcmp(uri, LV2_INLINEDISPLAY__interface)) {
952 static const LV2_Descriptor descriptor_mono = {
963 static const LV2_Descriptor descriptor_stereo = {
975 const LV2_Descriptor*
976 lv2_descriptor(uint32_t index)
980 return &descriptor_mono;
982 return &descriptor_stereo;