aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/eg-sampler.lv2
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-12-26 15:00:50 +0100
committerDavid Robillard <d@drobilla.net>2020-12-26 17:55:23 +0100
commitc2816ab42b458c9c5202197b3df665340f57dddd (patch)
tree1d367483a854d7117920f95b943fb01424b77529 /plugins/eg-sampler.lv2
parent64d4a4a46901b1b1ab4eaac4f3f57f8d353e42c5 (diff)
downloadlv2-c2816ab42b458c9c5202197b3df665340f57dddd.tar.xz
Add clang-format suppression comments
Diffstat (limited to 'plugins/eg-sampler.lv2')
-rw-r--r--plugins/eg-sampler.lv2/peaks.h3
-rw-r--r--plugins/eg-sampler.lv2/sampler.c15
-rw-r--r--plugins/eg-sampler.lv2/sampler_ui.c3
3 files changed, 21 insertions, 0 deletions
diff --git a/plugins/eg-sampler.lv2/peaks.h b/plugins/eg-sampler.lv2/peaks.h
index f3d2f04..39d56e7 100644
--- a/plugins/eg-sampler.lv2/peaks.h
+++ b/plugins/eg-sampler.lv2/peaks.h
@@ -231,11 +231,14 @@ peaks_receiver_receive(PeaksReceiver* receiver, const LV2_Atom_Object* update)
const LV2_Atom_Int* offset = NULL;
const LV2_Atom_Int* total = NULL;
const LV2_Atom_Vector* peaks = NULL;
+
+ // clang-format off
lv2_atom_object_get_typed(update,
uris->peaks_offset, &offset, uris->atom_Int,
uris->peaks_total, &total, uris->atom_Int,
uris->peaks_magnitudes, &peaks, uris->atom_Vector,
0);
+ // clang-format on
if (!offset || !total || !peaks ||
peaks->body.child_type != uris->atom_Float) {
diff --git a/plugins/eg-sampler.lv2/sampler.c b/plugins/eg-sampler.lv2/sampler.c
index 1a13a92..cd410d1 100644
--- a/plugins/eg-sampler.lv2/sampler.c
+++ b/plugins/eg-sampler.lv2/sampler.c
@@ -265,12 +265,15 @@ instantiate(const LV2_Descriptor* descriptor,
}
// Get host features
+ // clang-format off
const char* missing = lv2_features_query(
features,
LV2_LOG__log, &self->logger.log, false,
LV2_URID__map, &self->map, true,
LV2_WORKER__schedule, &self->schedule, true,
NULL);
+ // clang-format on
+
lv2_log_logger_set_map(&self->logger, self->map);
if (missing) {
lv2_log_error(&self->logger, "Missing feature <%s>\n", missing);
@@ -340,10 +343,14 @@ handle_event(Sampler* self, LV2_Atom_Event* ev)
// Get the property and value of the set message
const LV2_Atom* property = NULL;
const LV2_Atom* value = NULL;
+
+ // clang-format off
lv2_atom_object_get(obj,
uris->patch_property, &property,
uris->patch_value, &value,
0);
+ // clang-format on
+
if (!property) {
lv2_log_error(&self->logger, "Set message with no property\n");
return;
@@ -369,10 +376,14 @@ handle_event(Sampler* self, LV2_Atom_Event* ev)
} else if (obj->body.otype == uris->patch_Get && self->sample) {
const LV2_Atom_URID* accept = NULL;
const LV2_Atom_Int* n_peaks = NULL;
+
+ // clang-format off
lv2_atom_object_get_typed(
obj,
uris->patch_accept, &accept, uris->atom_URID,
peaks_uris->peaks_total, &n_peaks, peaks_uris->atom_Int, 0);
+ // clang-format on
+
if (accept && accept->body == peaks_uris->peaks_PeakUpdate) {
// Received a request for peaks, prepare for transmission
peaks_sender_start(&self->psend,
@@ -531,11 +542,15 @@ restore(LV2_Handle instance,
// Get host features
LV2_Worker_Schedule* schedule = NULL;
LV2_State_Map_Path* paths = NULL;
+
+ // clang-format off
const char* missing = lv2_features_query(
features,
LV2_STATE__mapPath, &paths, true,
LV2_WORKER__schedule, &schedule, false,
NULL);
+ // clang-format on
+
if (missing) {
lv2_log_error(&self->logger, "Missing feature <%s>\n", missing);
return LV2_STATE_ERR_NO_FEATURE;
diff --git a/plugins/eg-sampler.lv2/sampler_ui.c b/plugins/eg-sampler.lv2/sampler_ui.c
index 3070828..f733216 100644
--- a/plugins/eg-sampler.lv2/sampler_ui.c
+++ b/plugins/eg-sampler.lv2/sampler_ui.c
@@ -261,12 +261,15 @@ instantiate(const LV2UI_Descriptor* descriptor,
ui->did_init = false;
// Get host features
+ // clang-format off
const char* missing = lv2_features_query(
features,
LV2_LOG__log, &ui->logger.log , false,
LV2_URID__map, &ui->map, true,
LV2_UI__requestValue, &ui->request_value, false,
NULL);
+ // clang-format on
+
lv2_log_logger_set_map(&ui->logger, ui->map);
if (missing) {
lv2_log_error(&ui->logger, "Missing feature <%s>\n", missing);