/* structs.h */ /* Part of YAPS - abc to PostScript converter */ /* definitions of structures used to hold abc tune data */ /* The voice data structure also holds various state variables */ /* to allow processing of voice data as it is read in */ enum tail_type {nostem, single, startbeam, midbeam, endbeam}; struct fract { int num; int denom; }; struct key { char* name; int sharps; char map[7]; int mult[7]; }; struct atempo { int count; struct fract basenote; int relative; }; struct tuple { int n; int q; int r; }; struct chord { int ytop; int ybot; enum tail_type beaming; float stemlength; int stemup; int base; }; struct el { struct el* next; void* datum; }; struct llist { struct el* first; struct el* last; struct el* place; }; struct note { char* accents; char accidental; int mult; int octave; char pitch; int y; int base; int dots; int stemup; enum tail_type beaming; struct llist* syllables; struct llist* gchords; struct llist* instructions; struct fract len; float stemlength; }; struct feature { struct feature* next; featuretype type; float xleft, xright, ydown, yup; float x; void* item; }; struct slurtie { struct feature* begin; struct feature* end; }; enum cleftype {noclef, treble, soprano, mezzo, alto, tenor, baritone, bass}; enum linestate {header, midline, newline}; #define MAX_TIES 20 #define MAX_SLURS 20 struct voice { struct feature* first; struct feature* last; int voiceno; int octaveshift; int changetime; struct fract unitlen; struct fract tuplefactor; int tuplenotes; int inslur, ingrace; int inchord, chordcount; struct fract chord; struct fract barlen; struct fract barcount; int barno; int expect_repeat; int brokentype, brokenmult, brokenpending; int tiespending; struct feature* tie_place[MAX_TIES]; int tie_status[MAX_TIES]; int slurpending; int slurcount; struct slurtie* slur_place[MAX_SLURS]; struct feature* lastnote; struct feature* laststart; struct feature* lastend; struct feature* thisstart; struct feature* thisend; struct llist* gchords_pending; struct llist* instructions_pending; int tuple_pending; /* variables for assigning syllables to notes */ struct feature* linestart; struct feature* lineend; struct chord* thischord; struct feature* chordplace; enum linestate line; /* following fields are initially inherited from tune */ enum cleftype clef; struct key* keysig; struct fract meter; struct atempo* tempo; /* place used while printing to keep track of progress through voice */ struct feature* lineplace; int atlineend; struct feature* place; int inmusic; struct fract time; /* following are used to determine stem direction of beamed set */ struct feature* beamroot; struct feature* beamend; struct feature* gracebeamroot; struct feature* gracebeamend; int beammin, beammax; }; struct tune { int no; int octaveshift; struct llist title; char* composer; char* origin; char* parts; struct fract meter; struct key* keysig; struct atempo* tempo; struct llist voices; struct voice* cv; struct fract unitlen; enum cleftype clef; struct llist words; }; struct rest { struct fract len; struct llist* gchords; struct llist* instructions; }; /* list manipulation functions */ int init_llist(struct llist* l); struct llist* newlist(); int addtolist(struct llist* p, void* item); void* firstitem(struct llist* p); void* nextitem(struct llist* p); void freellist(struct llist* l);