From c2816ab42b458c9c5202197b3df665340f57dddd Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 26 Dec 2020 15:00:50 +0100 Subject: Add clang-format suppression comments --- plugins/eg-fifths.lv2/fifths.c | 3 +++ plugins/eg-metro.lv2/metro.c | 7 +++++++ plugins/eg-midigate.lv2/midigate.c | 3 +++ plugins/eg-params.lv2/params.c | 13 +++++++++++++ plugins/eg-sampler.lv2/peaks.h | 3 +++ plugins/eg-sampler.lv2/sampler.c | 15 +++++++++++++++ plugins/eg-sampler.lv2/sampler_ui.c | 3 +++ plugins/eg-scope.lv2/examploscope.c | 3 +++ plugins/eg-scope.lv2/examploscope_ui.c | 6 ++++++ 9 files changed, 56 insertions(+) (limited to 'plugins') diff --git a/plugins/eg-fifths.lv2/fifths.c b/plugins/eg-fifths.lv2/fifths.c index f289026..bafd0d9 100644 --- a/plugins/eg-fifths.lv2/fifths.c +++ b/plugins/eg-fifths.lv2/fifths.c @@ -80,11 +80,14 @@ instantiate(const LV2_Descriptor* descriptor, } // Scan host features for URID map + // clang-format off const char* missing = lv2_features_query( features, LV2_LOG__log, &self->logger.log, false, LV2_URID__map, &self->map, 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); diff --git a/plugins/eg-metro.lv2/metro.c b/plugins/eg-metro.lv2/metro.c index eebad3e..6182a74 100644 --- a/plugins/eg-metro.lv2/metro.c +++ b/plugins/eg-metro.lv2/metro.c @@ -155,11 +155,14 @@ instantiate(const LV2_Descriptor* descriptor, } // Scan host features for URID map + // clang-format off const char* missing = lv2_features_query( features, LV2_LOG__log, &self->logger.log, false, LV2_URID__map, &self->map, 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); @@ -269,11 +272,15 @@ update_position(Metro* self, const LV2_Atom_Object* obj) LV2_Atom* beat = NULL; LV2_Atom* bpm = NULL; LV2_Atom* speed = NULL; + + // clang-format off lv2_atom_object_get(obj, uris->time_barBeat, &beat, uris->time_beatsPerMinute, &bpm, uris->time_speed, &speed, NULL); + // clang-format on + if (bpm && bpm->type == uris->atom_Float) { // Tempo changed, update BPM self->bpm = ((LV2_Atom_Float*)bpm)->body; diff --git a/plugins/eg-midigate.lv2/midigate.c b/plugins/eg-midigate.lv2/midigate.c index 4d1385e..5bffeea 100644 --- a/plugins/eg-midigate.lv2/midigate.c +++ b/plugins/eg-midigate.lv2/midigate.c @@ -67,11 +67,14 @@ instantiate(const LV2_Descriptor* descriptor, } // Scan host features for URID map + // clang-format off const char* missing = lv2_features_query( features, LV2_LOG__log, &self->logger.log, false, LV2_URID__map, &self->map, 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); diff --git a/plugins/eg-params.lv2/params.c b/plugins/eg-params.lv2/params.c index a302acb..eadd144 100644 --- a/plugins/eg-params.lv2/params.c +++ b/plugins/eg-params.lv2/params.c @@ -152,12 +152,15 @@ instantiate(const LV2_Descriptor* descriptor, } // Get host features + // clang-format off const char* missing = lv2_features_query( features, LV2_LOG__log, &self->log.log, false, LV2_URID__map, &self->map, true, LV2_URID__unmap, &self->unmap, false, NULL); + // clang-format on + lv2_log_logger_set_map(&self->log, self->map); if (missing) { lv2_log_error(&self->log, "Missing feature <%s>\n", missing); @@ -170,6 +173,7 @@ instantiate(const LV2_Descriptor* descriptor, lv2_atom_forge_init(&self->forge, self->map); // Initialise state dictionary + // clang-format off State* state = &self->state; state_map_init( self->props, self->map, self->map->handle, @@ -183,6 +187,7 @@ instantiate(const LV2_Descriptor* descriptor, EG_PARAMS_URI "#lfo", STATE_MAP_INIT(Float, &state->lfo), EG_PARAMS_URI "#spring", STATE_MAP_INIT(Float, &state->spring), NULL); + // clang-format on return (LV2_Handle)self; } @@ -418,11 +423,15 @@ run(LV2_Handle instance, uint32_t sample_count) const LV2_Atom_URID* subject = NULL; const LV2_Atom_URID* property = NULL; const LV2_Atom* value = NULL; + + // clang-format off lv2_atom_object_get(obj, uris->patch_subject, (const LV2_Atom**)&subject, uris->patch_property, (const LV2_Atom**)&property, uris->patch_value, &value, 0); + // clang-format on + if (!subject_is_plugin(self, subject)) { lv2_log_error(&self->log, "Set for unknown subject\n"); } else if (!property) { @@ -438,10 +447,14 @@ run(LV2_Handle instance, uint32_t sample_count) // Get the property of the get message const LV2_Atom_URID* subject = NULL; const LV2_Atom_URID* property = NULL; + + // clang-format off lv2_atom_object_get(obj, uris->patch_subject, (const LV2_Atom**)&subject, uris->patch_property, (const LV2_Atom**)&property, 0); + // clang-format on + if (!subject_is_plugin(self, subject)) { lv2_log_error(&self->log, "Get with unknown subject\n"); } else if (!property) { 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); diff --git a/plugins/eg-scope.lv2/examploscope.c b/plugins/eg-scope.lv2/examploscope.c index af0e302..b767508 100644 --- a/plugins/eg-scope.lv2/examploscope.c +++ b/plugins/eg-scope.lv2/examploscope.c @@ -95,11 +95,14 @@ 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, 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); diff --git a/plugins/eg-scope.lv2/examploscope_ui.c b/plugins/eg-scope.lv2/examploscope_ui.c index 32584a4..e9e0c6f 100644 --- a/plugins/eg-scope.lv2/examploscope_ui.c +++ b/plugins/eg-scope.lv2/examploscope_ui.c @@ -559,11 +559,14 @@ recv_raw_audio(EgScopeUI* ui, const LV2_Atom_Object* obj) { const LV2_Atom* chan_val = NULL; const LV2_Atom* data_val = NULL; + + // clang-format off const int n_props = lv2_atom_object_get( obj, ui->uris.channelID, &chan_val, ui->uris.audioData, &data_val, NULL); + // clang-format on if (n_props != 2 || chan_val->type != ui->uris.atom_Int || @@ -598,12 +601,15 @@ recv_ui_state(EgScopeUI* ui, const LV2_Atom_Object* obj) const LV2_Atom* spp_val = NULL; const LV2_Atom* amp_val = NULL; const LV2_Atom* rate_val = NULL; + + // clang-format off const int n_props = lv2_atom_object_get( obj, ui->uris.ui_spp, &spp_val, ui->uris.ui_amp, &_val, ui->uris.param_sampleRate, &rate_val, NULL); + // clang-format on if (n_props != 3 || spp_val->type != ui->uris.atom_Int || -- cgit v1.2.1