Le 30/03/2015 03:11, Henry So Jr. a écrit : > I have decided that unions are not worth it. The memory savings go away > unless you have more than four char-sized types (which we don't). > > I think I'll leave these multi-purpose fields and their corresponding > defines alone. > > That said, I do think this is a code smell. If this were an OO > language, I'd definitely do this polymorphically. While such is > possible with C, we'd need a pretty heavy framework (a la gtk) to make > it even remotely comprehensible.
I'm not sure I totally understand the problems you encountered, but if I understood correctly, this is an inherent problem with the way gabc builds internal structure of a syllable, by: * first building a list of notes, but with informations relative to glyphs * then build the glyphs on top of the notes, moving glyph informations contained in notes in the glyph themselves * above all, the fact that some fields specific to some glyph types are stored in fields where they don't belong in the first pass (typically pitch for some bars) I think the cleanest solution to this would be to have a new type in the first pass, that would be a union of note and glyph_level_infos, and then build everything on top of that, but it's quite a lot of work... so maybe a glyph_level_infos pointer in the gregorio_note structure that would be NULL in the final structure but that would contain clean glyph_level information in the first pass of gabc would be good? I'm not sure I managed to express myself correctly, tell me if it's too blur (and if it relates at all to your problems). Thank you, -- Elie _______________________________________________ Gregorio-devel mailing list [email protected] https://mail.gna.org/listinfo/gregorio-devel
