commit 6a77d284828b5a0c83268dc4b4c93d28729def18
parent 11224f296021397c5dad29011fea403127125bdd
Author: nibo <nibo@relim.de>
Date: Mon, 27 Jan 2025 13:44:10 +0100
Rename 'system' to 'notation_system'
Diffstat:
3 files changed, 16 insertions(+), 47 deletions(-)
diff --git a/chordpro.c b/chordpro.c
@@ -13,13 +13,6 @@
#include "util.h"
#include "chord_diagram.h"
-static const char *text_types[] = {
- "chord", "annotation", "chorus",
- "footer", "grid", "tab", "toc", "toc_title", "text",
- "title", "subtitle", "label", "comment",
- "comment_italic", "comment_box"
-};
-
static const char *font_families[] = { "normal", "sans", "serif", "monospace" };
static const char *font_styles[] = { "normal", "oblique", "italic" };
static const char *font_weights[] = { "normal", "bold" };
@@ -256,30 +249,6 @@ cho_debug_chord_print(struct ChoChord *chord)
printf("---- END CHORD ------\n");
}
-static void
-presence_print(struct ChoStylePresence *presence)
-{
- printf("---- BEGIN PRESENCE ----\n");
- printf("font.name %d\n", presence->font.name);
- printf("font.family %d\n", presence->font.family);
- printf("font.style %d\n", presence->font.style);
- printf("font.weight %d\n", presence->font.weight);
- printf("font.size %d\n", presence->font.size);
- printf("foreground_color %d\n", presence->foreground_color);
- printf("background_color %d\n", presence->background_color);
- printf("underline_style %d\n", presence->underline_style);
- printf("underline_color %d\n", presence->underline_color);
- printf("overline_style %d\n", presence->overline_style);
- printf("overline_color %d\n", presence->overline_color);
- printf("strikethrough %d\n", presence->strikethrough);
- printf("strikethrough_color %d\n", presence->strikethrough_color);
- printf("boxed %d\n", presence->boxed);
- printf("boxed_color %d\n", presence->boxed_color);
- printf("rise %d\n", presence->rise);
- printf("href %d\n", presence->href);
- printf("---- END PRESENCE ------\n");
-}
-
#endif /* DEBUG */
void
diff --git a/config.c b/config.c
@@ -429,7 +429,7 @@ config_load_default(void)
config->output->page_no = emalloc(sizeof(struct ConfigPageNo));
config->output->page_no->show = true;
config->output->page_no->align = A_CENTER;
- config->output->system = NS_COMMON;
+ config->output->notation_system = NS_COMMON;
config->output->start_song_on_new_page = true;
config->output->styles = emalloc(TT_LENGTH * sizeof(struct ChoStyle *));
@@ -482,7 +482,7 @@ config_load_default(void)
config->output->notes = config_notes_new_default(NS_COMMON);
config->parser = emalloc(sizeof(struct ConfigParser));
config->parser->chords = emalloc(sizeof(struct ConfigChords));
- config->parser->chords->system = NS_COMMON;
+ config->parser->chords->notation_system = NS_COMMON;
config->parser->chords->mode = PM_STRICT;
config->parser->notes = config_notes_new_default(NS_COMMON);
return config;
@@ -503,10 +503,10 @@ config_print_default(void)
printf("[parser]\n");
printf("[parser.chords]\n");
printf("mode = \"%s\"\n", config_parse_mode_to_config_string(config->parser->chords->mode));
- printf("system = \"%s\"\n\n", config_notation_system_to_config_string(config->parser->chords->system));
+ printf("notation_system = \"%s\"\n\n", config_notation_system_to_config_string(config->parser->chords->notation_system));
printf("[output]\n");
- printf("system = \"%s\"\n", config_notation_system_to_config_string(config->output->system));
+ printf("notation_system = \"%s\"\n", config_notation_system_to_config_string(config->output->notation_system));
printf("start_song_on_new_page = %s\n\n", config->output->start_song_on_new_page ? "true" : "false");
printf("[output.toc]\n");
printf("show = %s\n", config->output->toc->show ? "true" : "false");
@@ -877,7 +877,7 @@ config_load(const char *filepath)
if (output) {
toml_table_t *styles, *notes, *chorus, *diagram, *toc, *page_no;
toml_value_t value;
- enum NotationSystem system;
+ enum NotationSystem notation_system;
enum Instrument instrument;
enum Alignment align;
struct Note **custom_notes;
@@ -922,10 +922,10 @@ config_load(const char *filepath)
free(value.u.s);
}
}
- value = toml_table_string(output, "system");
+ value = toml_table_string(output, "notation_system");
if (value.ok) {
- system = config_notation_system_parse(value.u.s);
- if (system == NS_CUSTOM) {
+ notation_system = config_notation_system_parse(value.u.s);
+ if (notation_system == NS_CUSTOM) {
notes = toml_table_table(table, "notes");
if (!notes) {
util_log(LOG_ERR, "Custom notes '%s' has no corresponding definition in [notes].", value.u.s);
@@ -942,7 +942,7 @@ config_load(const char *filepath)
}
} else {
config_notes_free(config->output->notes);
- config->output->notes = config_notes_new_default(system);
+ config->output->notes = config_notes_new_default(notation_system);
}
free(value.u.s);
}
@@ -998,12 +998,12 @@ config_load(const char *filepath)
if (chords) {
toml_table_t *notes;
toml_value_t value;
- enum NotationSystem system;
+ enum NotationSystem notation_system;
struct Note **custom_notes;
- value = toml_table_string(chords, "system");
+ value = toml_table_string(chords, "notation_system");
if (value.ok) {
- system = config_notation_system_parse(value.u.s);
- if (system == NS_CUSTOM) {
+ notation_system = config_notation_system_parse(value.u.s);
+ if (notation_system == NS_CUSTOM) {
notes = toml_table_table(table, "notes");
if (!notes) {
util_log(LOG_ERR, "Custom notes '%s' has no corresponding definition in [notes].", value.u.s);
@@ -1020,7 +1020,7 @@ config_load(const char *filepath)
}
} else {
config_notes_free(config->parser->notes);
- config->parser->notes = config_notes_new_default(system);
+ config->parser->notes = config_notes_new_default(notation_system);
}
free(value.u.s);
}
diff --git a/config.h b/config.h
@@ -43,7 +43,7 @@ struct Note {
};
struct ConfigChords {
- enum NotationSystem system;
+ enum NotationSystem notation_system;
enum ParseMode mode;
};
@@ -79,7 +79,7 @@ struct ConfigOutput {
struct ConfigPageNo *page_no;
struct ChoStyle **styles; // TODO: Make array of size 7
struct Note **notes;
- enum NotationSystem system;
+ enum NotationSystem notation_system;
bool start_song_on_new_page;
};