From 878b253c7620ff82afc26dea96047e350f3c9be5 Mon Sep 17 00:00:00 2001 From: bnnm Date: Sun, 6 Feb 2022 13:14:42 +0100 Subject: [PATCH] txth: extra usable fields just in case --- src/meta/txth.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/meta/txth.c b/src/meta/txth.c index f1e44f0e..8f746f00 100644 --- a/src/meta/txth.c +++ b/src/meta/txth.c @@ -1062,6 +1062,7 @@ static int parse_keyval(STREAMFILE* sf_, txth_header* txth, const char* key, cha /* apply */ if (!txth->data_size_set) { + //TODO: this doesn't work when using name_table + subsongs, since values are pre-read /* with subsongs we want to clamp data_size from this subsong start to next subsong start */ txth->next_offset = txth->data_size; if (txth->subsong_count > 1 && txth->target_subsong < txth->subsong_count) { @@ -1919,6 +1920,7 @@ static int parse_num(STREAMFILE* sf, txth_header* txth, const char* val, uint32_ else if ((n = is_string_field(val,"sample_rate"))) value = txth->sample_rate; else if ((n = is_string_field(val,"start_offset"))) value = txth->start_offset; else if ((n = is_string_field(val,"data_size"))) value = txth->data_size; + else if ((n = is_string_field(val,"padding_size"))) value = txth->padding_size; else if ((n = is_string_field(val,"num_samples"))) value = txth->num_samples; else if ((n = is_string_field(val,"loop_start_sample"))) value = txth->loop_start_sample; else if ((n = is_string_field(val,"loop_start"))) value = txth->loop_start_sample; @@ -1932,7 +1934,16 @@ static int parse_num(STREAMFILE* sf, txth_header* txth, const char* val, uint32_ else if ((n = is_string_field(val,"subfile_size"))) value = txth->subfile_size; else if ((n = is_string_field(val,"base_offset"))) value = txth->base_offset; else if ((n = is_string_field(val,"coef_offset"))) value = txth->coef_offset; + else if ((n = is_string_field(val,"coef_spacing"))) value = txth->coef_spacing; else if ((n = is_string_field(val,"hist_offset"))) value = txth->hist_offset; + else if ((n = is_string_field(val,"hist_spacing"))) value = txth->hist_spacing; + else if ((n = is_string_field(val,"chunk_count"))) value = txth->chunk_count; + else if ((n = is_string_field(val,"chunk_start"))) value = txth->chunk_start; + else if ((n = is_string_field(val,"chunk_size"))) value = txth->chunk_size; + else if ((n = is_string_field(val,"chunk_size_offset"))) value = txth->chunk_size_offset; + else if ((n = is_string_field(val,"chunk_number"))) value = txth->chunk_number; + else if ((n = is_string_field(val,"chunk_data_size"))) value = txth->chunk_data_size; + else if ((n = is_string_field(val,"chunk_header_size"))) value = txth->chunk_header_size; //todo whatever, improve else if ((n = is_string_field(val,"name_value"))) value = txth->name_values[0]; else if ((n = is_string_field(val,"name_value1"))) value = txth->name_values[0];