summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2023-05-26 17:26:04 -0700
committerVito Caputo <vcaputo@pengaru.com>2023-05-26 18:09:39 -0700
commit5c6b03565e09a5624ae5e6a1036df611358528c7 (patch)
treef17e82578172733c37f189b72b032f0f15229546 /src
parent45e9139ba2abfe79b8072d9b038d8c018a83b8da (diff)
til_settings: drop settings->label from generated label
Since these are ultimately intended for use in path construction, it's redundant to include the settings->label in the generated label. Instead what's really useful is just the subscript part: /module/compose/layers/layers[0]/drizzle/viscosity Becomes: /module/compose/layers/[0]/drizzle/viscosity which is far better. It may seem silly to have both the positional subscript *and* the module name, as in why not just have: /module/compose/layers/drizzle/viscosity But there's a need ot handle potential collisions like so: /module/compose/layers/[0]/drizzle/viscosity /module/compose/layers/[1]/stars /module/compose/layers/[2]/drizzle/viscosity So then maybe you think; ok, why have the module name? just use the positional subscript since that alone prevents the collisions. Result: /module/compose/layers/[0]/viscosity ... /module/compose/layers/[2]/viscosity Well, now we've lost useful context. The viscosity setting recurs on multiple modules, and we don't know just at a glance what we're working with anymore. Hence, why there's both. The module name in the path makes things substantially more self-explanatory. These paths will likely be what you're looking at as the labels of tracks in a multitrack sequencer like GNU Rocket. So this decision is likely affecting the UX at that level in the fullness of time.
Diffstat (limited to 'src')
-rw-r--r--src/til_settings.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/til_settings.c b/src/til_settings.c
index 7bd39c3..0a1a3d5 100644
--- a/src/til_settings.c
+++ b/src/til_settings.c
@@ -563,13 +563,13 @@ int til_settings_label_setting(const til_settings_t *settings, const til_setting
*/
for (unsigned i = 0; i < settings->num; i++) {
if (settings->entries[i] == setting) {
- size_t len = snprintf(NULL, 0, "%s[%u]", settings->label, i) + 1;
+ size_t len = snprintf(NULL, 0, "[%u]", i) + 1;
label = calloc(1, len);
if (!label)
return -ENOMEM;
- snprintf(label, len, "%s[%u]", settings->label, i);
+ snprintf(label, len, "[%u]", i);
*res_label = label;
return 0;
© All Rights Reserved