commit e97792a76d11c31b0ee2b4410a69bfa7eccc2500
parent 2a46c89da10c7b09428c83d79a27462a78ad9da8
Author: nibo <nibo@relim.de>
Date: Mon, 17 Feb 2025 09:50:51 +0100
Rename [notes] config section to [notation_systems]
Diffstat:
2 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/lorid_config.5 b/lorid_config.5
@@ -9,7 +9,7 @@ Run
.RB ` lorid
.BR --print-default-config `
for an example config.
-.SS [notes]
+.SS [notation_systems]
In this section you can define custom notation systems
beside the predefined notation systems which are:
.BR \(dqcommon\(dq ,
@@ -47,7 +47,7 @@ notation_system = String
=> default value: "common"
.RS 4
-Specify a predefined or custom notation system from the [notes] section.
+Specify a predefined or custom notation system from the [notation_systems] section.
When parsing chordpro text only chords from this selected notation system are recognized. Notice that unrecognized chords are only problematic if you want to transpose them or show their chord diagram.
.RE
.SS [output]
@@ -58,7 +58,7 @@ notation_system = String
=> default value: "common"
.RS 4
-Specify a predefined or custom notation system from the [notes] section.
+Specify a predefined or custom notation system from the [notation_systems] section.
When generating the PDF file chords from this selected notation system will be printed.
.RE
@@ -260,7 +260,7 @@ Clicking on the corresponding text tries to open the provided href in a browser.
.EX
# ~/.config/lorid/config.toml
-[notes]
+[notation_systems]
mycustom = [
{ note = "C", sharp = "C#", },
{ note = "D", sharp = "D#", flat = "Db" },
diff --git a/src/config.c b/src/config.c
@@ -302,7 +302,7 @@ config_notes_load(toml_table_t *notes, const char *system)
toml_array_t *arr = toml_table_array(notes, system);
int arr_len = toml_array_len(arr);
if (arr_len != 7) {
- util_log(LOG_ERR, "Custom notation system '%s' in [notes] has to have exactly 7 items. For an example see `lorid --print-default-config`.", system);
+ util_log(LOG_ERR, "Custom notation system '%s' in [notation_systems] has to have exactly 7 items. For an example see `lorid --print-default-config`.", system);
free(notes);
return NULL;
}
@@ -321,7 +321,7 @@ config_notes_load(toml_table_t *notes, const char *system)
if (value.ok) {
custom_notes[i]->sharp = value.u.s;
if (i == 2 || i == 6) {
- util_log(LOG_ERR, "Custom notation system '%s' in [notes] can't have sharp value at array index '%d'.", system, i);
+ util_log(LOG_ERR, "Custom notation system '%s' in [notation_systems] can't have sharp value at array index '%d'.", system, i);
goto CLEAN;
}
}
@@ -329,7 +329,7 @@ config_notes_load(toml_table_t *notes, const char *system)
if (value.ok) {
custom_notes[i]->flat = value.u.s;
if (i == 0 || i == 3) {
- util_log(LOG_ERR, "Custom notation system '%s' in [notes] can't have flat value at array index '%d'.", system, i);
+ util_log(LOG_ERR, "Custom notation system '%s' in [notation_systems] can't have flat value at array index '%d'.", system, i);
goto CLEAN;
}
}
@@ -494,7 +494,7 @@ void
config_print_default(void)
{
struct Config *config = config_load_default();
- printf("[notes]\n");
+ printf("[notation_systems]\n");
config_notes_print_as_toml(NS_COMMON);
config_notes_print_as_toml(NS_GERMAN);
config_notes_print_as_toml(NS_SCANDINAVIAN);
@@ -928,9 +928,9 @@ config_load(const char *filepath)
if (value.ok) {
notation_system = config_notation_system_parse(value.u.s);
if (notation_system == NS_CUSTOM) {
- notes = toml_table_table(table, "notes");
+ notes = toml_table_table(table, "notation_systems");
if (!notes) {
- util_log(LOG_ERR, "Custom notes '%s' has no corresponding definition in [notes].", value.u.s);
+ util_log(LOG_ERR, "Custom notation system '%s' has no corresponding definition in [notation_systems].", value.u.s);
return NULL;
}
custom_notes = config_notes_load(notes, value.u.s);
@@ -939,7 +939,7 @@ config_load(const char *filepath)
config->output->notes = custom_notes;
} else {
LOG_DEBUG("config_notes_load failed.");
- util_log(LOG_ERR, "Couldn't load custom notes '%s' from [notes] section.", value.u.s);
+ util_log(LOG_ERR, "Couldn't load custom notation system '%s' from [notation_systems] section.", value.u.s);
return NULL;
}
} else {
@@ -1006,9 +1006,9 @@ config_load(const char *filepath)
if (value.ok) {
notation_system = config_notation_system_parse(value.u.s);
if (notation_system == NS_CUSTOM) {
- notes = toml_table_table(table, "notes");
+ notes = toml_table_table(table, "notation_systems");
if (!notes) {
- util_log(LOG_ERR, "Custom notes '%s' has no corresponding definition in [notes].", value.u.s);
+ util_log(LOG_ERR, "Custom notation system '%s' has no corresponding definition in [notation_systems].", value.u.s);
return NULL;
}
custom_notes = config_notes_load(notes, value.u.s);
@@ -1017,7 +1017,7 @@ config_load(const char *filepath)
config->parser->notes = custom_notes;
} else {
LOG_DEBUG("config_notes_load failed.");
- util_log(LOG_ERR, "Couldn't load custom notes '%s' from [notes] section.", value.u.s);
+ util_log(LOG_ERR, "Couldn't load custom notation system '%s' from [notation_systems] section.", value.u.s);
return NULL;
}
} else {