diff -urN ../denemo-cvs/denemo/ChangeLog ./ChangeLog --- ../denemo-cvs/denemo/ChangeLog 2007-09-08 12:48:01.000000000 +0100 +++ ./ChangeLog 2007-09-13 16:59:24.000000000 +0100 @@ -1,3 +1,22 @@ +2007-09-13 + * include/denemo/denemo.h dormant code for testing for bad frees. + * include/denemo/denemo_api.h change formal parameter name (cosmetic) + * include/denemo/denemo_objects.h addition of tone structure type. + changed the name of the fields tones, numtones in the chord structure to notes, numnotes as notes is a list of note* structures and I needed a name for the tone structure. + * + comments + * audiocapture.c header file from standard place - looks fishy? + * changenotehead.c, drawnotes.c, export*.c, importxml.c, lyparserfuncs.c, measureops.c, midi.c change of field names + * chordops.c,h change of field names, plus attempt to improve re-usability of modifying note code, (this has not really succeeded, modify_note is only changing some of the things that need to be changed to really modify a note) + * commandfuncs.c,h Improvements to highlighting rhythm pattern buttons. Inserting a rhythm pattern into the measure when entering just the rhythm of a piece (insert_rhythm_pattern). Making delete object act on tone store if active. + * draw.c When an tone store (aka overlay) is present, color notes blue. + * kbd_custom.c added insert_rhythm function to enter whole rhythms at a stroke. + * keyresponses.c improve highlighting of rhythm pattern buttons. Tidying code. + * pitchentry.c Implementation of tone store and application of tone store to overlay note rhythms with tones gotten from pitch recognition. + * pitchentry.h export delete_tone, which deletes the overlaid tone and hence reassigns the tones in the measure. + * utils.c field name change, and music_font markup function. + * view.c,h Use of music font for rhythm pattern buttons. Change name of RhythmKeymaprc to Rhythm.keymaprc to allow .keymaprc list code to work. + + 2007-09-08 * added missing RhythmKeymaprc diff -urN ../denemo-cvs/denemo/include/denemo/denemo_api.h ./include/denemo/denemo_api.h --- ../denemo-cvs/denemo/include/denemo/denemo_api.h 2007-08-02 20:13:08.000000000 +0100 +++ ./include/denemo/denemo_api.h 2007-09-13 14:59:41.000000000 +0100 @@ -26,7 +26,7 @@ void dnm_insertchord (DenemoScore *si, gint duration, input_mode mode, gboolean rest); void dnm_insertmeasures (DenemoScore *si, gint number); -void dnm_deleteobject (DenemoScore *gui); +void dnm_deleteobject (DenemoScore *si); void dnm_deletemeasure (DenemoScore *si); @@ -50,6 +50,13 @@ measurenode * dnm_addmeasures (DenemoScore * si, gint pos, guint nummeasures, gint all); /* create one DenemoObject of type not known to denemo otherwise * no object is associated. */ +void dnm_csoundplayback (GtkAction * action, DenemoGUI * gui); +void dnm_chooseorcfile (GtkWidget * widget, struct cs_callback *data); + +gchar * +dnm_get_temp_filename (const gchar * name); + + DenemoObject * dnm_newobj(DenemoObjType type); @@ -72,39 +79,4 @@ DenemoObject * dnm_newclefobj (enum clefs type); -/*** csound related stuff ***/ -void dnm_csoundplayback (GtkAction * action, DenemoGUI * gui); -void dnm_chooseorcfile (GtkWidget * widget, struct cs_callback *data); -int dnm_exportcsound(gchar *thefilename, DenemoScore *si, gint start, - gint end); -gchar dnm_pitch2char(int pitch); -float dnm_duration2time(int duration, int dots, int tempo); -float dnm_pitchtopch(gchar pitch, int enshift, int octave); -int dnm_write_stave(FILE *fp, DenemoStaff *curstaffstruct, gint i, gint start, gint end, - DenemoScore *si); -/*** barline related functions ***/ -void dnm_insert_barline (GtkAction * action, DenemoGUI *gui); -DenemoObject *dnm_newbarline(enum barline_type type); -void dnm_add_barline(GtkWidget *widget, gpointer data); -//enum barline_type barlinefromname (gchar * thetext); - -/*** bookmark related functions ***/ -void dnm_addbookmark(GtkAction *action,DenemoGUI *gui); -void dnm_gotobookmark(GtkAction *action, DenemoGUI *gui); - -/*** calculateposition related functions ***/ -//struct twoints -//dnm_find_xes_in_measure (DenemoScore *si, gint measurenum, -// gint time1, gint time2); -void dnm_find_xes_in_all_measures (DenemoScore *si); -void dnm_set_rightmeasurenum (DenemoScore *si); - -/*** utility related functions ***/ -gchar * -dnm_get_temp_filename (const gchar * name); - - - - - #endif //DENEMO_APIH diff -urN ../denemo-cvs/denemo/include/denemo/denemo.h ./include/denemo/denemo.h --- ../denemo-cvs/denemo/include/denemo/denemo.h 2007-01-24 20:10:05.000000000 +0000 +++ ./include/denemo/denemo.h 2007-09-13 14:24:32.000000000 +0100 @@ -55,6 +55,13 @@ #define g_malloc(a) g_malloc0(a) /* for extensible debuggable code */ +#if 0 + // use these to test for bad frees. +#define g_free +#define g_list_free +#define g_error_free +#define gtk_tree_path_free +#endif #ifdef __cplusplus } diff -urN ../denemo-cvs/denemo/include/denemo/denemo_objects.h ./include/denemo/denemo_objects.h --- ../denemo-cvs/denemo/include/denemo/denemo_objects.h 2007-08-02 20:05:00.000000000 +0100 +++ ./include/denemo/denemo_objects.h 2007-09-13 15:58:18.000000000 +0100 @@ -46,20 +46,20 @@ */ typedef struct note { - gint mid_c_offset; /**< This is used to define the note. A positive number is the number of half + gint mid_c_offset;/**< This is used to define (the pitch of) a note. + A positive number is the number of half steps above middle c. A negative number is below middle c.*/ - gint enshift; /**< Enharmonic shift. Should the note be sharpened 1 once 2 = twice or - flattened, -1 -2 etc. */ + gint enshift;/**< Enharmonic shift. Should the note be notated as sharp (1) double-sharp (2) or flat (-1) double-flat (-2) or natural (0). No other values are legal. */ gboolean reversealign; - gboolean showaccidental; /**< This tells denemo to show all possible accidentals */ + gboolean showaccidental;/**< This tells denemo to show all possible accidentals?? cautionary accidental?? */ gint position_of_accidental; /**< Holds number of pixels to the left of the notehead that the accidental should be drawn at. */ - gint y; /**< Holds y co-ordinate for drawing rather than recalculating it each + gint y; /**< Holds y co-ordinate for drawing rather than recalculating it each run through the drawing loop. */ enum headtype noteheadtype; /**< Holds note head type. */ gint x_off; /**< Holds x offset from default position. */ gint y_off; /**< Holds y offset from default position. */ - + } note; @@ -108,7 +108,11 @@ */ typedef struct chord { - GList *tones; /**< Holds pointers to actual note structures */ + GList *notes; /**< NULL if the chord is a rest + else Glist of the notes of the chord + (in order of mid_c_offset value) + notes->data fields are of type note* + */ GList *dynamics; /**< test for new dynamic handling */ gboolean has_dynamic; gint highestpitch; @@ -118,9 +122,9 @@ gint baseduration; /**< Duration of chord in ticks */ gint numdots; /**< Number of dots that are applied to the note */ gint sum_mid_c_offset; - gint numtones; + gint numnotes; - gboolean is_tied; + gboolean is_tied; gboolean is_stemup; gboolean is_reversealigned; gboolean slur_begin_p; /**< Is this note a beginning of a slur? */ @@ -131,22 +135,20 @@ gboolean diminuendo_end_p; gboolean hasanacc; gboolean is_grace; /**< Flag to show whether note is a grace note */ - gboolean struck_through; /**< Flag for a struck through stem */ + gboolean struck_through; /**< Flag for a struck through stem*/ gint stemy; /**< Stores the y position of the end of the stem */ GList *ornamentlist; - - /* Note highlighting flag if - * true change notes colour - */ - gboolean is_highlighted; /**< If set true changes the notes color */ + gboolean is_highlighted; /**< If set true changes the notes color */ GString *lyric; /**< Pointer to the lyrics applied to that chord */ - gboolean is_syllable; /**< Is the lyric a syllable? */ - gboolean center_lyric; /**< Should the lyrics be centered or should it be directly under the note - that it is attatched to? */ - gboolean is_figure; /**< The reason for using this boolean is to exploit + gboolean is_syllable; /**< Is the lyric a syllable? */ + gboolean center_lyric; /**< Should the lyrics be centered or + should it be directly under the note? + that it is attatched to? */ + + gboolean is_figure; /**< the reason for using this boolean is to exploit the fact that all the spacing and printing of figures can use the code for the CHORD type */ - gpointer figure; /**< When this chord is a bass note + gpointer figure; /**< when this chord is a bass note (figure !=NULL && is_figure==FALSE) this pointer points to an objnode in a FiguredBassStaff. That objnode's data is a DenemoObject of type CHORD. @@ -155,9 +157,10 @@ When this chord is_figure then figure is a GString* containing the figures in lilypond format. */ - gboolean is_fakechord; /**< This determines if the chord is a fake book style chord */ + GList *tone_node; /**< which tone this note was extracted from */ + gboolean is_fakechord; /**< This is the actual value of the fake chord if is_fakechord */ gpointer fakechord; /**< This is the actual value of the fake chord if is_fakechord */ - gpointer fakechord_extension; /**< This is the extension to the fake chord. It may be a 7, sus4, 9, 11,13 etc... */ + gpointer fakechord_extension; /**< This is the extension to the fake chord. It may be a 7, sus4, 9, 11, 13 etc... */ } chord; @@ -166,7 +169,7 @@ */ typedef struct tupopen { - gint numerator; + gint numerator; gint denominator; } tupopen; @@ -202,7 +205,6 @@ { gint time1; /**< This is the numerator for a time signature */ gint time2; /**< This is the denominator for a time signature */ - } timesig; @@ -211,7 +213,7 @@ */ typedef struct keysig { - gint number; /**< key number -7 to 7 for major/minor 0 to 40 for mode */ + gint number; /**< key number -7 to 7 for major/minor 0 to 40 for mode */ gint isminor; /**< Type of key 0-major 1-minor 2-mode */ gint mode; /**< Mode indicator */ gint accs[7]; @@ -227,16 +229,17 @@ dynamic; /** - * Enum defining barline types + * Enum defining barline types + * */ typedef enum barline_type { ORDINARY_BARLINE, DOUBLE_BARLINE, /**< Double Bar */ END_BARLINE, - OPENREPEAT_BARLINE, + OPENREPEAT_BARLINE, CLOSE_REPEAT, OPEN_CLOSE_REPEAT -}barline_type; +} barline_type; /** * Structure encapsulating a barline @@ -296,5 +299,18 @@ stemdirective; +/** + * a note and duration (e.g. obtained by pitch recognition) + * plus field to indicate if the tone is spurious + */ +typedef struct tone +{ + gint duration; + gint step; + gint octave; + gint enshift; + gboolean valid; +} +tone; #endif diff -urN ../denemo-cvs/denemo/include/denemo/denemo_types.h ./include/denemo/denemo_types.h --- ../denemo-cvs/denemo/include/denemo/denemo_types.h 2007-08-22 10:50:03.000000000 +0100 +++ ./include/denemo/denemo_types.h 2007-09-13 15:58:04.000000000 +0100 @@ -122,13 +122,13 @@ /**< Allots extra space for accidentals or reverse-aligned notes if * the stem is down */ gint space_before; /**< Used to specify how much space is needed before the object */ - gint minpixelsalloted; /**< Holds x co-ordinate relative to the beginning of the measure. */ - gint x; /**< used in mousing.c x position */ + gint minpixelsalloted; + gint x; /**< Holds x co-ordinate relative to the beginning of the measure. used in mousing.c */ gboolean isstart_beamgroup; /**< TRUE if object is the start of a beam group */ gboolean isend_beamgroup; /**< TRUE if this is the end of a beam group */ /* Mudelaobjunion u; has become a pointer*/ - gpointer object; - gboolean isinvisible; /**< If object is set TRUE it will be rendered white and will not be seen. If it is set FALSE then it will be black. */ + gpointer object; /**< the structures pointed to are given in denemo_objects.h */ + gboolean isinvisible; /**< If TRUE it will be rendered white and will not be seen. If it is set FALSE then it will be drawn normally. */ }DenemoObject; @@ -163,7 +163,7 @@ gint sclef; /**< Set initial clef see denemo_objects.h clefs */ gint skey; /**< Set the inital keysig. >0=sharps <0 = flats */ gint skey_isminor; /**< Values 0 = major, 1 = minor, 2 = mode */ - gint skeyaccs[7]; /**< Value used for current keysignature */ + gint skeyaccs[7]; /**< Value used for current keysignature -7=Cb... -1=F, 0=C, 1=G...7=C# in a chain of fifths */ gint stime1; /**< This is the initial timesig numerator */ gint stime2; /**< This is the initial timesig denominator */ gint leftmost_clefcontext; /**< The first clef used in a staff */ @@ -202,12 +202,15 @@ staff */ gint nummeasures; /**< Number of measures in the staff*/ - + GList *tone_store; /**< list of pitches and durations used a source for + the notes in this staff + the data are tone* */ + }DenemoStaff; /* The ->data part of each staffnode points to a staff structure */ -typedef GList staffnode; +typedef GList staffnode;/**< The ->data part of each staffnode points to a staff structure */ typedef staffnode *score; /* a pair of staffs, used to relate two staffs together */ @@ -455,9 +458,9 @@ /* support for INPUTNORMAL sub mode RHYTMIC */ gboolean rhythmicsubmode; - GList *rhythms;/* list of RhythmPattern s */ - GList *currhythm; /* currently in use element of rhythms */ - GList *rstep; /* step within RhythmPattern->rsteps, the current element of the current rhythm pattern */ + GList *rhythms;/**< list of RhythmPattern s */ + GList *currhythm; /**< currently in use element of rhythms */ + GList *rstep; /**< step within RhythmPattern->rsteps, the current element of the current rhythm pattern */ gboolean is_grace_mode; /* Is there a figured bass present, is so this relates the bass @@ -549,7 +552,7 @@ gint plugincounter; DenemoPrefs *prefs; /**< And the DenemoPrefs pointer */ GtkWidget* articulation_palette; /**< Articulation palette window */ - gboolean pitch_recognition;/* toggle pitch recognition off/on */ + gboolean pitch_recognition;/**< Whether pitch recognition off/on */ input_mode mode; /**< Input mode for Score */ GtkWidget *progressbar; DenemoScore *si; diff -urN ../denemo-cvs/denemo/keymaps/PR.keymaprc ./keymaps/PR.keymaprc --- ../denemo-cvs/denemo/keymaps/PR.keymaprc 1970-01-01 01:00:00.000000000 +0100 +++ ./keymaps/PR.keymaprc 2007-09-13 14:24:32.000000000 +0100 @@ -0,0 +1,1034 @@ + + + + Test + Adam Tee + + + CursorLeft + h + Shift+H + Left + KP_Left + + + CursorDown + Down + j + Shift+J + KP_Down + + + CursorUp + Up + KP_Up + k + Shift+K + + + CursorRight + Right + KP_Right + l + Shift+L + L + + + StaffUp + Ctrl+Up + Ctrl+k + + + StaffDown + Ctrl+j + Ctrl+Down + + + MeasureLeft + Ctrl+Left + Ctrl+h + + + MeasureRight + Ctrl+Right + Ctrl+l + + + ToNearestA + a + Shift+A + A + + + ToNearestB + b + Shift+B + B + + + ToNearestC + c + Shift+C + C + + + ToNearestD + d + Shift+D + D + + + ToNearestE + e + Shift+E + E + + + ToNearestF + f + Shift+F + F + + + ToNearestG + g + Shift+G + G + + + OctaveUp + apostrophe + + + OctaveDown + comma + + + InsertWholeNote + grave + 0 + KP_0 + + + InsertHalfNote + 1 + KP_1 + + + InsertQuarterNote + 2 + KP_2 + + + InsertEighthNote + 3 + KP_3 + + + InsertSixteenthNote + 4 + KP_4 + + + InsertThirtysecondNote + 5 + KP_5 + + + InsertSixtyfourthNote + 6 + KP_6 + + + InsertBlankWholeNote + + + InsertBlankHalfNote + + + InsertBlankQuarterNote + + + InsertBlankEighthNote + + + InsertBlankSixteenthNote + + + InsertBlankThirtysecondNote + + + InsertBlankSixtyfourthNote + + + ToggleRestMode + + + ToggleBlankMode + + + InsertWholeRest + Alt+grave + Alt+0 + Alt+KP_0 + Ctrl+KP_0 + + + InsertHalfRest + Alt+1 + Alt+KP_1 + Ctrl+KP_1 + + + InsertQuarterRest + Alt+2 + Alt+space + Alt+KP_2 + Ctrl+KP_2 + + + InsertEighthRest + Alt+3 + Alt+KP_3 + Ctrl+KP_3 + + + InsertSixteenthRest + Alt+4 + Alt+KP_4 + Ctrl+KP_4 + + + InsertThirtysecondRest + Alt+5 + Alt+KP_5 + Ctrl+KP_5 + + + InsertSixtyfourthRest + Alt+6 + Alt+KP_6 + Ctrl+KP_6 + + + InsertDuplet + Ctrl+0 + + + InsertTriplet + Ctrl+1 + + + StartTriplet + KP_7 + + + EndTuplet + KP_8 + + + InsertQuadtuplet + Ctrl+2 + + + InsertQuintuplet + Ctrl+3 + + + InsertSextuplet + Ctrl+5 + + + InsertSeptuplet + Ctrl+6 + + + AddTone + + + RemoveTone + Shift+Return + Shift+KP_Enter + Shift+KP_Add + + + Sharpen/StemDown + Shift+plus + numbersign + KP_Add + + + Flatten/StemUp + minus + KP_Subtract + + + AddDot + period + KP_Multiply + + + RemoveDot + Shift+greater + + + ToggleTie + + + DeleteObject + x + Delete + + + DeletePreviousObject + Shift+X + BackSpace + + + InsertMeasure + m + + + AppendMeasure + Shift+M + + + DeleteMeasure + Ctrl+Delete + Ctrl+x + + + ShrinkMeasures + Ctrl+Shift+Left + Ctrl+Shift+KP_4 + + + WidenMeasures + Ctrl+Shift+Right + Ctrl+Shift+KP_6 + + + ShorterStaffs + Ctrl+Shift+Up + Ctrl+Shift+KP_8 + + + TallerStaffs + Ctrl+Shift+Down + Ctrl+Shift+KP_2 + + + InsertTrebleClef + + + InsertBassClef + + + Insertg8clef + + + InsertAltoClef + + + InsertTenorClef + + + InsertSopranoClef + + + SetInitialTrebleClef + + + SetInitialBassClef + + + SetInitialg8clef + + + SetInitialAltoClef + + + SetInitialTenorClef + + + SetInitialSopranoClef + + + Insert22Time + + + Insert32Time + + + Insert42Time + + + Insert44Time + + + Insert34Time + + + Insert24Time + + + Insert64Time + + + Insert38Time + + + Insert68Time + + + Insert128Time + + + Insert98Time + + + Set22Time + + + Set32Time + + + Set42Time + + + Set44Time + + + Set34Time + + + Set24Time + + + Set64Time + + + Set38Time + + + Set68Time + + + Set128Time + + + Set98Time + + + InsertCmaj + + + InsertGmaj + + + InsertDmaj + + + InsertAmaj + + + InsertEmaj + + + InsertBmaj + + + InsertFSharpmaj + + + InsertCSharpmaj + + + InsertFmaj + + + InsertBflatmaj + + + InsertEflatmaj + + + InsertAflatmaj + + + InsertDflatmaj + + + InsertGflatmaj + + + InsertCflatmaj + + + InsertAmin + + + InsertEmin + + + InsertBmin + + + InsertFSharpmin + + + InsertCSharpmin + + + InsertGSharpmin + + + InsertDSharpmin + + + InsertASharpmin + + + InsertDmin + + + InsertGmin + + + InsertCmin + + + InsertFmin + + + InsertBflatmin + + + InsertEflatmin + + + InsertAflatmin + + + SetInitialCmaj + + + SetInitialGmaj + + + SetInitialDmaj + + + SetInitialAmaj + + + SetInitialEmaj + + + SetInitialBmaj + + + SetInitialFSharpmaj + + + SetInitialCSharpmaj + + + SetInitialFmaj + + + SetInitialBflatmaj + + + SetInitialEflatmaj + + + SetInitialAflatmaj + + + SetInitialDflatmaj + + + SetInitialGflatmaj + + + SetInitialCflatmaj + + + SetInitialAmin + + + SetInitialEmin + + + SetInitialBmin + + + SetInitialFSharpmin + + + SetInitialCSharpmin + + + SetInitialGSharpmin + + + SetInitialDSharpmin + + + SetInitialASharpmin + + + SetInitialDmin + + + SetInitialGmin + + + SetInitialCmin + + + SetInitialFmin + + + SetInitialBflatmin + + + SetInitialEflatmin + + + SetInitialAflatmin + + + SetMark + Ctrl+space + + + UnsetMark + Ctrl+Shift+space + + + ToggleBeginSlur + Shift+parenleft + + + ToggleEndSlur + Shift+parenright + + + ToggleStartCrescendo + + + ToggleEndCrescendo + + + ToggleStartDiminuendo + + + ToggleEndDiminuendo + + + ToggleAccent + + + ToggleFermata + Shift+asterisk + + + ToggleStaccato + + + ToggleTenuto + + + ToggleTrill + + + ToggleTurn + + + ToggleMordent + + + ToggleStaccatissimo + + + ToggleCoda + + + ToggleFlageolet + Shift+bar + + + ToggleOpen + backslash + + + TogglePrallMordent + z + + + TogglePrallPrall + Shift+Z + + + TogglePrall + Ctrl+Shift+bar + + + ToggleReverseTurn + Ctrl+backslash + + + ToggleSegno + Alt+backslash + + + ToggleSforzato + + + ToggleStopped + Alt+Shift+bar + + + ToggleThumb + Ctrl+z + + + ToggleUpprall + Ctrl+Shift+Z + + + ToggleArpeggio + + + SetGrace + + + PlayLocal + + + ForceCaution + + + ChangePitch + + + DoubleBar + + + EndBar + + + OpenRepeat + + + CloseRepeat + + + OpenCloseRepeat + + + FirstRhythm + + + NextRhythm + space + KP_Enter + + + AppendMesauresToScore + + + File + + + New + + + NewfromTemplate + + + NewWindow + + + Open + + + OpeninNewWindow + + + Save + + + SaveAs + + + SaveParts + + + ExportPDF + + + ScoreConfiguration + + + Print + + + Close + + + Quit + + + Edit + + + Undo + + + Redo + + + Copy + + + Cut + + + Paste + + + Scoreproperties + + + SaveSelection + + + Preferences + + + SetKeybindings + + + LoadPlugins + + + UnloadPlugins + + + ListPlugins + + + ListAvailablePlugins + + + View + + + Mode + + + Insert + + + Replace + + + Blank + + + Rest + + + Default + + + Staff + + + AddBeforeCurrentStaff... + + + AddAfterCurrentStaff... + + + AddinInitialPosition... + + + AddinLastPosition... + + + DeleteStaffBefore + + + DeleteStaff + Ctrl+Shift+Delete + Ctrl+Shift+X + + + DeleteStaffAfter + + + AddVoicetoCurrentStaff... + + + AddLyricStaff... + + + AddFiguredBassStaff... + + + AddChordstoStaff... + + + StaffProperties + + + Insert + + + Clef + + + SetClef + + + InsertClefChange + + + Key + + + InitialKey + + + InsertKeyChange + + + TimeSignature + + + InitialTimeSignature + + + InsertTimeSignatureChange + + + Notehead + + + InsertStemDirective + + + Lyrics + + + InsertLyric + + + EditLyric + + + EditFiguredBass + + + EditChords + + + InsertDynamic + + + InsertBarline + + + Navigation + + + GoToMeasure... + + + GoToBeginning + + + GoToEnd + + + GoToNextScore + + + Playback + + + Play + + + PlayusingCSound... + + + PlaybackProperties + + + Help + + + Help + + + About + + + Bookmarks + + + AddBookmark + + + GotoBookmark + + + + + + OpenRecent + + + Fullnote + + + Halfnote + + + Quarternote + + + Eightnote + + + Sixteenthnote + + + Fullrest + + + Halfrest + + + Quarterrest + + + Eightrest + + + Sixteenthrest + + + Createarhythm + + + Deletearhythm + + + + diff -urN ../denemo-cvs/denemo/keymaps/Rhythm.keymaprc ./keymaps/Rhythm.keymaprc --- ../denemo-cvs/denemo/keymaps/Rhythm.keymaprc 1970-01-01 01:00:00.000000000 +0100 +++ ./keymaps/Rhythm.keymaprc 2007-09-13 14:24:32.000000000 +0100 @@ -0,0 +1,1042 @@ + + + + Test + Adam Tee + + + CursorLeft + h + Shift+H + Left + KP_Left + + + CursorDown + Down + j + Shift+J + KP_Down + + + CursorUp + Up + KP_Up + k + Shift+K + + + CursorRight + Right + KP_Right + l + Shift+L + L + + + StaffUp + Ctrl+Up + Ctrl+k + + + StaffDown + Ctrl+j + Ctrl+Down + + + MeasureLeft + Ctrl+Left + Ctrl+h + + + MeasureRight + Ctrl+Right + Ctrl+l + + + ToNearestA + a + Shift+A + A + + + ToNearestB + b + Shift+B + B + + + ToNearestC + c + Shift+C + C + + + ToNearestD + d + Shift+D + D + + + ToNearestE + e + Shift+E + E + + + ToNearestF + f + Shift+F + F + + + ToNearestG + g + Shift+G + G + + + OctaveUp + apostrophe + + + OctaveDown + comma + + + InsertWholeNote + grave + 0 + KP_0 + + + InsertHalfNote + 1 + KP_1 + + + InsertQuarterNote + 2 + KP_2 + + + InsertEighthNote + 3 + KP_3 + + + InsertSixteenthNote + 4 + KP_4 + + + InsertThirtysecondNote + 5 + KP_5 + + + InsertSixtyfourthNote + 6 + KP_6 + + + InsertBlankWholeNote + + + InsertBlankHalfNote + + + InsertBlankQuarterNote + + + InsertBlankEighthNote + + + InsertBlankSixteenthNote + + + InsertBlankThirtysecondNote + + + InsertBlankSixtyfourthNote + + + ToggleRestMode + Escape + + + ToggleBlankMode + + + InsertWholeRest + Alt+grave + Alt+0 + Alt+KP_0 + Ctrl+KP_0 + + + InsertHalfRest + Alt+1 + Alt+KP_1 + Ctrl+KP_1 + + + InsertQuarterRest + Alt+2 + Alt+space + Alt+KP_2 + Ctrl+KP_2 + + + InsertEighthRest + Alt+3 + Alt+KP_3 + Ctrl+KP_3 + + + InsertSixteenthRest + Alt+4 + Alt+KP_4 + Ctrl+KP_4 + + + InsertThirtysecondRest + Alt+5 + Alt+KP_5 + Ctrl+KP_5 + + + InsertSixtyfourthRest + Ctrl+KP_7 + Ctrl+7 + Ctrl+9 + Ctrl+KP_9 + Shift+F6 + Alt+6 + Alt+KP_6 + Ctrl+KP_6 + + + InsertDuplet + Ctrl+0 + + + InsertTriplet + Ctrl+1 + + + StartTriplet + KP_7 + + + EndTuplet + KP_8 + + + InsertQuadtuplet + Ctrl+2 + + + InsertQuintuplet + Ctrl+3 + + + InsertSextuplet + Ctrl+5 + + + InsertSeptuplet + Ctrl+6 + + + AddTone + + + RemoveTone + Shift+Return + Shift+KP_Enter + Shift+KP_Add + + + Sharpen/StemDown + Shift+plus + numbersign + KP_Add + + + Flatten/StemUp + minus + KP_Subtract + + + AddDot + period + KP_Multiply + + + RemoveDot + Shift+greater + + + ToggleTie + equal + + + DeleteObject + x + Delete + + + DeletePreviousObject + Shift+X + BackSpace + + + InsertMeasure + m + + + AppendMeasure + Shift+M + + + DeleteMeasure + Ctrl+Delete + Ctrl+x + + + ShrinkMeasures + Ctrl+Shift+Left + Ctrl+Shift+KP_4 + + + WidenMeasures + Ctrl+Shift+Right + Ctrl+Shift+KP_6 + + + ShorterStaffs + Ctrl+Shift+Up + Ctrl+Shift+KP_8 + + + TallerStaffs + Ctrl+Shift+Down + Ctrl+Shift+KP_2 + + + InsertTrebleClef + + + InsertBassClef + + + Insertg8clef + + + InsertAltoClef + + + InsertTenorClef + + + InsertSopranoClef + + + SetInitialTrebleClef + + + SetInitialBassClef + + + SetInitialg8clef + + + SetInitialAltoClef + + + SetInitialTenorClef + + + SetInitialSopranoClef + + + Insert22Time + + + Insert32Time + + + Insert42Time + + + Insert44Time + + + Insert34Time + + + Insert24Time + + + Insert64Time + + + Insert38Time + + + Insert68Time + + + Insert128Time + + + Insert98Time + + + Set22Time + + + Set32Time + + + Set42Time + + + Set44Time + + + Set34Time + + + Set24Time + + + Set64Time + + + Set38Time + + + Set68Time + + + Set128Time + + + Set98Time + + + InsertCmaj + + + InsertGmaj + + + InsertDmaj + + + InsertAmaj + + + InsertEmaj + + + InsertBmaj + + + InsertFSharpmaj + + + InsertCSharpmaj + + + InsertFmaj + + + InsertBflatmaj + + + InsertEflatmaj + + + InsertAflatmaj + + + InsertDflatmaj + + + InsertGflatmaj + + + InsertCflatmaj + + + InsertAmin + + + InsertEmin + + + InsertBmin + + + InsertFSharpmin + + + InsertCSharpmin + + + InsertGSharpmin + + + InsertDSharpmin + + + InsertASharpmin + + + InsertDmin + + + InsertGmin + + + InsertCmin + + + InsertFmin + + + InsertBflatmin + + + InsertEflatmin + + + InsertAflatmin + + + SetInitialCmaj + + + SetInitialGmaj + + + SetInitialDmaj + + + SetInitialAmaj + + + SetInitialEmaj + + + SetInitialBmaj + + + SetInitialFSharpmaj + + + SetInitialCSharpmaj + + + SetInitialFmaj + + + SetInitialBflatmaj + + + SetInitialEflatmaj + + + SetInitialAflatmaj + + + SetInitialDflatmaj + + + SetInitialGflatmaj + + + SetInitialCflatmaj + + + SetInitialAmin + + + SetInitialEmin + + + SetInitialBmin + + + SetInitialFSharpmin + + + SetInitialCSharpmin + + + SetInitialGSharpmin + + + SetInitialDSharpmin + + + SetInitialASharpmin + + + SetInitialDmin + + + SetInitialGmin + + + SetInitialCmin + + + SetInitialFmin + + + SetInitialBflatmin + + + SetInitialEflatmin + + + SetInitialAflatmin + + + SetMark + Ctrl+space + + + UnsetMark + Ctrl+Shift+space + + + ToggleBeginSlur + Shift+parenleft + + + ToggleEndSlur + Shift+parenright + + + ToggleStartCrescendo + + + ToggleEndCrescendo + + + ToggleStartDiminuendo + + + ToggleEndDiminuendo + + + ToggleAccent + + + ToggleFermata + Shift+asterisk + + + ToggleStaccato + + + ToggleTenuto + + + ToggleTrill + + + ToggleTurn + + + ToggleMordent + + + ToggleStaccatissimo + + + ToggleCoda + + + ToggleFlageolet + Shift+bar + + + ToggleOpen + backslash + + + TogglePrallMordent + z + + + TogglePrallPrall + Shift+Z + + + TogglePrall + Ctrl+Shift+bar + + + ToggleReverseTurn + Ctrl+backslash + + + ToggleSegno + Alt+backslash + + + ToggleSforzato + + + ToggleStopped + Alt+Shift+bar + + + ToggleThumb + Ctrl+z + + + ToggleUpprall + Ctrl+Shift+Z + + + ToggleArpeggio + + + SetGrace + + + PlayLocal + + + ForceCaution + + + ChangePitch + + + DoubleBar + + + EndBar + + + OpenRepeat + + + CloseRepeat + + + OpenCloseRepeat + + + InsertRhythm + Return + + + NextRhythm + space + KP_Enter + + + AppendMesauresToScore + + + File + + + New + + + NewfromTemplate + + + NewWindow + + + Open + + + OpeninNewWindow + + + Save + + + SaveAs + + + SaveParts + + + ExportPDF + + + ScoreConfiguration + + + Print + + + Close + + + Quit + + + Edit + + + Undo + + + Redo + + + Copy + + + Cut + + + Paste + + + Scoreproperties + + + SaveSelection + + + Preferences + + + SetKeybindings + + + LoadPlugins + + + UnloadPlugins + + + ListPlugins + + + ListAvailablePlugins + + + View + + + Mode + + + Insert + + + Replace + + + Blank + + + Rest + + + Default + + + Staff + + + AddBeforeCurrentStaff... + + + AddAfterCurrentStaff... + + + AddinInitialPosition... + + + AddinLastPosition... + + + DeleteStaffBefore + + + DeleteStaff + Ctrl+Shift+Delete + Ctrl+Shift+X + + + DeleteStaffAfter + + + AddVoicetoCurrentStaff... + + + AddLyricStaff... + + + AddFiguredBassStaff... + + + AddChordstoStaff... + + + StaffProperties + + + Insert + + + Clef + + + SetClef + + + InsertClefChange + + + Key + + + InitialKey + + + InsertKeyChange + + + TimeSignature + + + InitialTimeSignature + + + InsertTimeSignatureChange + + + Notehead + + + InsertStemDirective + + + Lyrics + + + InsertLyric + + + EditLyric + + + EditFiguredBass + + + EditChords + + + InsertDynamic + + + InsertBarline + + + Navigation + + + GoToMeasure... + + + GoToBeginning + + + GoToEnd + + + GoToNextScore + + + Playback + + + Play + + + PlayusingCSound... + + + PlaybackProperties + + + Help + + + Help + + + About + + + Bookmarks + + + AddBookmark + + + GotoBookmark + + + + + + OpenRecent + + + Fullnote + + + Halfnote + + + Quarternote + + + Eightnote + + + Sixteenthnote + + + Fullrest + + + Halfrest + + + Quarterrest + + + Eightrest + + + Sixteenthrest + + + Createarhythm + + + Deletearhythm + + + + diff -urN ../denemo-cvs/denemo/keymaps/RhythmKeymaprc ./keymaps/RhythmKeymaprc --- ../denemo-cvs/denemo/keymaps/RhythmKeymaprc 2007-09-08 12:47:35.000000000 +0100 +++ ./keymaps/RhythmKeymaprc 1970-01-01 01:00:00.000000000 +0100 @@ -1,1042 +0,0 @@ - - - - Test - Adam Tee - - - CursorLeft - h - Shift+H - Left - KP_Left - - - CursorDown - Down - j - Shift+J - KP_Down - - - CursorUp - Up - KP_Up - k - Shift+K - - - CursorRight - Right - KP_Right - l - Shift+L - L - - - StaffUp - Ctrl+Up - Ctrl+k - - - StaffDown - Ctrl+j - Ctrl+Down - - - MeasureLeft - Ctrl+Left - Ctrl+h - - - MeasureRight - Ctrl+Right - Ctrl+l - - - ToNearestA - a - Shift+A - A - - - ToNearestB - b - Shift+B - B - - - ToNearestC - c - Shift+C - C - - - ToNearestD - d - Shift+D - D - - - ToNearestE - e - Shift+E - E - - - ToNearestF - f - Shift+F - F - - - ToNearestG - g - Shift+G - G - - - OctaveUp - apostrophe - - - OctaveDown - comma - - - InsertWholeNote - grave - 0 - KP_0 - - - InsertHalfNote - 1 - KP_1 - - - InsertQuarterNote - 2 - KP_2 - - - InsertEighthNote - 3 - KP_3 - - - InsertSixteenthNote - 4 - KP_4 - - - InsertThirtysecondNote - 5 - KP_5 - - - InsertSixtyfourthNote - 6 - KP_6 - - - InsertBlankWholeNote - - - InsertBlankHalfNote - - - InsertBlankQuarterNote - - - InsertBlankEighthNote - - - InsertBlankSixteenthNote - - - InsertBlankThirtysecondNote - - - InsertBlankSixtyfourthNote - - - ToggleRestMode - Escape - - - ToggleBlankMode - - - InsertWholeRest - Alt+grave - Alt+0 - Alt+KP_0 - Ctrl+KP_0 - - - InsertHalfRest - Alt+1 - Alt+KP_1 - Ctrl+KP_1 - - - InsertQuarterRest - Alt+2 - Alt+space - Alt+KP_2 - Ctrl+KP_2 - - - InsertEighthRest - Alt+3 - Alt+KP_3 - Ctrl+KP_3 - - - InsertSixteenthRest - Alt+4 - Alt+KP_4 - Ctrl+KP_4 - - - InsertThirtysecondRest - Alt+5 - Alt+KP_5 - Ctrl+KP_5 - - - InsertSixtyfourthRest - Ctrl+KP_7 - Ctrl+7 - Ctrl+9 - Ctrl+KP_9 - Shift+F6 - Alt+6 - Alt+KP_6 - Ctrl+KP_6 - - - InsertDuplet - Ctrl+0 - - - InsertTriplet - Ctrl+1 - - - StartTriplet - KP_7 - - - EndTuplet - KP_8 - - - InsertQuadtuplet - Ctrl+2 - - - InsertQuintuplet - Ctrl+3 - - - InsertSextuplet - Ctrl+5 - - - InsertSeptuplet - Ctrl+6 - - - AddTone - Return - - - RemoveTone - Shift+Return - Shift+KP_Enter - Shift+KP_Add - - - Sharpen/StemDown - Shift+plus - numbersign - KP_Add - - - Flatten/StemUp - minus - KP_Subtract - - - AddDot - period - KP_Multiply - - - RemoveDot - Shift+greater - - - ToggleTie - equal - - - DeleteObject - x - Delete - - - DeletePreviousObject - Shift+X - BackSpace - - - InsertMeasure - m - - - AppendMeasure - Shift+M - - - DeleteMeasure - Ctrl+Delete - Ctrl+x - - - ShrinkMeasures - Ctrl+Shift+Left - Ctrl+Shift+KP_4 - - - WidenMeasures - Ctrl+Shift+Right - Ctrl+Shift+KP_6 - - - ShorterStaffs - Ctrl+Shift+Up - Ctrl+Shift+KP_8 - - - TallerStaffs - Ctrl+Shift+Down - Ctrl+Shift+KP_2 - - - InsertTrebleClef - - - InsertBassClef - - - Insertg8clef - - - InsertAltoClef - - - InsertTenorClef - - - InsertSopranoClef - - - SetInitialTrebleClef - - - SetInitialBassClef - - - SetInitialg8clef - - - SetInitialAltoClef - - - SetInitialTenorClef - - - SetInitialSopranoClef - - - Insert22Time - - - Insert32Time - - - Insert42Time - - - Insert44Time - - - Insert34Time - - - Insert24Time - - - Insert64Time - - - Insert38Time - - - Insert68Time - - - Insert128Time - - - Insert98Time - - - Set22Time - - - Set32Time - - - Set42Time - - - Set44Time - - - Set34Time - - - Set24Time - - - Set64Time - - - Set38Time - - - Set68Time - - - Set128Time - - - Set98Time - - - InsertCmaj - - - InsertGmaj - - - InsertDmaj - - - InsertAmaj - - - InsertEmaj - - - InsertBmaj - - - InsertFSharpmaj - - - InsertCSharpmaj - - - InsertFmaj - - - InsertBflatmaj - - - InsertEflatmaj - - - InsertAflatmaj - - - InsertDflatmaj - - - InsertGflatmaj - - - InsertCflatmaj - - - InsertAmin - - - InsertEmin - - - InsertBmin - - - InsertFSharpmin - - - InsertCSharpmin - - - InsertGSharpmin - - - InsertDSharpmin - - - InsertASharpmin - - - InsertDmin - - - InsertGmin - - - InsertCmin - - - InsertFmin - - - InsertBflatmin - - - InsertEflatmin - - - InsertAflatmin - - - SetInitialCmaj - - - SetInitialGmaj - - - SetInitialDmaj - - - SetInitialAmaj - - - SetInitialEmaj - - - SetInitialBmaj - - - SetInitialFSharpmaj - - - SetInitialCSharpmaj - - - SetInitialFmaj - - - SetInitialBflatmaj - - - SetInitialEflatmaj - - - SetInitialAflatmaj - - - SetInitialDflatmaj - - - SetInitialGflatmaj - - - SetInitialCflatmaj - - - SetInitialAmin - - - SetInitialEmin - - - SetInitialBmin - - - SetInitialFSharpmin - - - SetInitialCSharpmin - - - SetInitialGSharpmin - - - SetInitialDSharpmin - - - SetInitialASharpmin - - - SetInitialDmin - - - SetInitialGmin - - - SetInitialCmin - - - SetInitialFmin - - - SetInitialBflatmin - - - SetInitialEflatmin - - - SetInitialAflatmin - - - SetMark - Ctrl+space - - - UnsetMark - Ctrl+Shift+space - - - ToggleBeginSlur - Shift+parenleft - - - ToggleEndSlur - Shift+parenright - - - ToggleStartCrescendo - - - ToggleEndCrescendo - - - ToggleStartDiminuendo - - - ToggleEndDiminuendo - - - ToggleAccent - - - ToggleFermata - Shift+asterisk - - - ToggleStaccato - - - ToggleTenuto - - - ToggleTrill - - - ToggleTurn - - - ToggleMordent - - - ToggleStaccatissimo - - - ToggleCoda - - - ToggleFlageolet - Shift+bar - - - ToggleOpen - backslash - - - TogglePrallMordent - z - - - TogglePrallPrall - Shift+Z - - - TogglePrall - Ctrl+Shift+bar - - - ToggleReverseTurn - Ctrl+backslash - - - ToggleSegno - Alt+backslash - - - ToggleSforzato - - - ToggleStopped - Alt+Shift+bar - - - ToggleThumb - Ctrl+z - - - ToggleUpprall - Ctrl+Shift+Z - - - ToggleArpeggio - - - SetGrace - - - PlayLocal - - - ForceCaution - - - ChangePitch - - - DoubleBar - - - EndBar - - - OpenRepeat - - - CloseRepeat - - - OpenCloseRepeat - - - FirstRhythm - - - NextRhythm - space - KP_Enter - - - AppendMesauresToScore - - - File - - - New - - - NewfromTemplate - - - NewWindow - - - Open - - - OpeninNewWindow - - - Save - - - SaveAs - - - SaveParts - - - ExportPDF - - - ScoreConfiguration - - - Print - - - Close - - - Quit - - - Edit - - - Undo - - - Redo - - - Copy - - - Cut - - - Paste - - - Scoreproperties - - - SaveSelection - - - Preferences - - - SetKeybindings - - - LoadPlugins - - - UnloadPlugins - - - ListPlugins - - - ListAvailablePlugins - - - View - - - Mode - - - Insert - - - Replace - - - Blank - - - Rest - - - Default - - - Staff - - - AddBeforeCurrentStaff... - - - AddAfterCurrentStaff... - - - AddinInitialPosition... - - - AddinLastPosition... - - - DeleteStaffBefore - - - DeleteStaff - Ctrl+Shift+Delete - Ctrl+Shift+X - - - DeleteStaffAfter - - - AddVoicetoCurrentStaff... - - - AddLyricStaff... - - - AddFiguredBassStaff... - - - AddChordstoStaff... - - - StaffProperties - - - Insert - - - Clef - - - SetClef - - - InsertClefChange - - - Key - - - InitialKey - - - InsertKeyChange - - - TimeSignature - - - InitialTimeSignature - - - InsertTimeSignatureChange - - - Notehead - - - InsertStemDirective - - - Lyrics - - - InsertLyric - - - EditLyric - - - EditFiguredBass - - - EditChords - - - InsertDynamic - - - InsertBarline - - - Navigation - - - GoToMeasure... - - - GoToBeginning - - - GoToEnd - - - GoToNextScore - - - Playback - - - Play - - - PlayusingCSound... - - - PlaybackProperties - - - Help - - - Help - - - About - - - Bookmarks - - - AddBookmark - - - GotoBookmark - - - - - - OpenRecent - - - Fullnote - - - Halfnote - - - Quarternote - - - Eightnote - - - Sixteenthnote - - - Fullrest - - - Halfrest - - - Quarterrest - - - Eightrest - - - Sixteenthrest - - - Createarhythm - - - Deletearhythm - - - - diff -urN ../denemo-cvs/denemo/pixmaps/icon-note-3dot.svg ./pixmaps/icon-note-3dot.svg --- ../denemo-cvs/denemo/pixmaps/icon-note-3dot.svg 1970-01-01 01:00:00.000000000 +0100 +++ ./pixmaps/icon-note-3dot.svg 2007-09-13 14:24:32.000000000 +0100 @@ -0,0 +1,92 @@ + + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff -urN ../denemo-cvs/denemo/src/audiocapture.c ./src/audiocapture.c --- ../denemo-cvs/denemo/src/audiocapture.c 2007-08-23 15:15:56.000000000 +0100 +++ ./src/audiocapture.c 2007-09-13 14:24:30.000000000 +0100 @@ -38,7 +38,7 @@ #include #include #include -#include "portaudio.h" +#include /* #define SAMPLE_RATE (17932) /* Test failure to open with this value. */ #define SAMPLE_RATE DENEMO_SAMPLE_RATE diff -urN ../denemo-cvs/denemo/src/changenotehead.c ./src/changenotehead.c --- ../denemo-cvs/denemo/src/changenotehead.c 2007-01-24 19:44:26.000000000 +0000 +++ ./src/changenotehead.c 2007-09-13 14:24:30.000000000 +0100 @@ -60,7 +60,7 @@ /* Lilypond's behavior is a bit anomalous here. It doesn't seem * to like giving chords non-standard noteheads. This is * just a default behavior for the time being. */ - ((note *) ((chord *) obj->object)->tones->data)->noteheadtype = + ((note *) ((chord *) obj->object)->notes->data)->noteheadtype = texttohead (notehead_string); } diff -urN ../denemo-cvs/denemo/src/chordops.c ./src/chordops.c --- ../denemo-cvs/denemo/src/chordops.c 2007-08-22 10:50:03.000000000 +0100 +++ ./src/chordops.c 2007-09-13 14:24:30.000000000 +0100 @@ -31,7 +31,7 @@ void newclefify (DenemoObject * thechord, gint dclef) { - g_list_foreach (((chord *) thechord->object)->tones, calcheight, + g_list_foreach (((chord *) thechord->object)->notes, calcheight, GINT_TO_POINTER (dclef)); ((chord *) thechord->object)->highesty = calculateheight (((chord *) thechord->object)->highestpitch, dclef); @@ -41,7 +41,7 @@ /** * This function goes through a chord and checks to see how its notes are - * laid out, and if it will have to push the display of any tones to the + * laid out, and if it will have to push the display of any notes to the * "wrong" side of the staff as a result */ void @@ -53,11 +53,11 @@ note *prevnote; ((chord *) thechord->object)->is_reversealigned = FALSE; - if (((chord *) thechord->object)->tones) + if (((chord *) thechord->object)->notes) if (((chord *) thechord->object)->is_stemup) { /* note clusters are painted left-right from bottom to top */ - previous = ((chord *) thechord->object)->tones; + previous = ((chord *) thechord->object)->notes; current = previous->next; prevnote = (note *) previous->data; prevnote->reversealign = FALSE; @@ -79,7 +79,7 @@ { /* the stem's down * note clusters are painted right-left from top to bottom */ - previous = g_list_last (((chord *) thechord->object)->tones); + previous = g_list_last (((chord *) thechord->object)->notes); current = previous->prev; prevnote = (note *) previous->data; prevnote->reversealign = FALSE; @@ -113,14 +113,14 @@ thechord->type = CHORD; thechord->isinvisible = FALSE; - newchord->tones = NULL; + newchord->notes = NULL; newchord->dynamics = NULL; newchord->highestpitch = G_MININT; newchord->lowestpitch = G_MAXINT; newchord->baseduration = baseduration; newchord->numdots = numdots; newchord->sum_mid_c_offset = 0; - newchord->numtones = 0; + newchord->numnotes = 0; newchord->is_tied = tied; newchord->is_reversealigned = FALSE; newchord->slur_begin_p = FALSE; @@ -176,7 +176,7 @@ void addornament (DenemoObject * obj, Ornament orn) { - if (obj && obj->type == CHORD && ((chord *) obj->object)->tones) + if (obj && obj->type == CHORD && ((chord *) obj->object)->notes) ((chord *) obj->object)->ornamentlist = insert_ornament_list (orn, ((chord *) obj->object)->ornamentlist); } @@ -212,6 +212,28 @@ return anote->mid_c_offset - bnote->mid_c_offset; } +/* modify the pitch of a note. + NB if the note belongs in a chord the chord may need modifying for + note order in the chord -does the containing chord hold other information that may need updating? +*/ +void modify_note(note *thenote, gint mid_c_offset, gint enshift, gint dclef) { + thenote->mid_c_offset = mid_c_offset; + thenote->enshift = enshift; + thenote->y = calculateheight (mid_c_offset, dclef); +} + +/* Allocate a new note structure initializing the fields + * caller must g_free + */ + +static note *new_note(gint mid_c_offset, gint enshift, gint dclef) { + note *newnote; + newnote = (note *) g_malloc0 (sizeof (note)); + modify_note(newnote, mid_c_offset, enshift, dclef); + newnote->reversealign = FALSE; + newnote->noteheadtype = DENEMO_NORMAL_NOTEHEAD; + return newnote; +} /** * Add tone to the current chord * The tone will not get added if it is @@ -223,18 +245,14 @@ note *newnote; if (!g_list_find_custom - (((chord *) thechord->object)->tones, GINT_TO_POINTER (mid_c_offset), + (((chord *) thechord->object)->notes, GINT_TO_POINTER (mid_c_offset), findcomparefunc)) { /* A-ha! The note isn't already in the chord */ - newnote = (note *) g_malloc0 (sizeof (note)); - newnote->mid_c_offset = mid_c_offset; - newnote->enshift = enshift; - newnote->reversealign = FALSE; - newnote->y = calculateheight (mid_c_offset, dclef); - newnote->noteheadtype = DENEMO_NORMAL_NOTEHEAD; - ((chord *) thechord->object)->tones = - g_list_insert_sorted (((chord *) thechord->object)->tones, newnote, + newnote = new_note(mid_c_offset, enshift, dclef); + + ((chord *) thechord->object)->notes = + g_list_insert_sorted (((chord *) thechord->object)->notes, newnote, insertcomparefunc); if (mid_c_offset > ((chord *) thechord->object)->highestpitch) { @@ -249,7 +267,7 @@ calculateheight (mid_c_offset, dclef); } ((chord *) thechord->object)->sum_mid_c_offset += mid_c_offset; - ((chord *) thechord->object)->numtones++; + ((chord *) thechord->object)->numnotes++; } } @@ -258,16 +276,16 @@ } /** * This function finds the node of the closest chord tone to n; in the - * case of equally distant chord tones, it'll select the higher tones + * case of equally distant chord notes, it'll select the higher notes * of the two */ /* I don't think that I could have quite done this with a g_list_find_custom */ GList * -findclosest (GList * tones, gint n) +findclosest (GList * notes, gint n) { - GList *cur_tnode = tones; + GList *cur_tnode = notes; GList *next_tnode; note *cur_tone; note *next_tone; @@ -310,7 +328,7 @@ GList *tnode; /* Tone node to remove */ note *tone; - tnode = findclosest (((chord *) thechord->object)->tones, mid_c_offset); + tnode = findclosest (((chord *) thechord->object)->notes, mid_c_offset); if (tnode) { tone = (note *) tnode->data; @@ -346,8 +364,8 @@ * actually free stuff */ g_free (tone); - ((chord *) thechord->object)->tones = - g_list_remove_link (((chord *) thechord->object)->tones, tnode); + ((chord *) thechord->object)->notes = + g_list_remove_link (((chord *) thechord->object)->notes, tnode); g_list_free_1 (tnode); } } @@ -361,7 +379,7 @@ { GList *tnode; /* Tone node to inflect */ note *tone; - tnode = findclosest (((chord *) thechord->object)->tones, mid_c_offset); + tnode = findclosest (((chord *) thechord->object)->notes, mid_c_offset); if (tnode) { tone = (note *) tnode->data; @@ -382,7 +400,7 @@ GList *tnode; /* Tone node to inflect */ note *tone; - tnode = findclosest (((chord *) thechord->object)->tones, mid_c_offset); + tnode = findclosest (((chord *) thechord->object)->notes, mid_c_offset); if (tnode) { tone = (note *) tnode->data; @@ -424,8 +442,8 @@ void freechord (DenemoObject * thechord) { - g_list_foreach (((chord *) thechord->object)->tones, freeit, NULL); - g_list_free (((chord *) thechord->object)->tones); + g_list_foreach (((chord *) thechord->object)->notes, freeit, NULL); + g_list_free (((chord *) thechord->object)->notes); g_free (thechord); } @@ -458,13 +476,13 @@ else clonedchord->dynamics = ((chord *) thechord->object)->dynamics; - clonedchord->tones = NULL; - for (curtone = ((chord *) thechord->object)->tones; + clonedchord->notes = NULL; + for (curtone = ((chord *) thechord->object)->notes; curtone; curtone = curtone->next) { newnote = (note *) g_malloc0 (sizeof (note)); memcpy (newnote, (note *) curtone->data, sizeof (note)); - clonedchord->tones = g_list_append (clonedchord->tones, newnote); + clonedchord->notes = g_list_append (clonedchord->notes, newnote); } ret->object = (chord *) clonedchord; /*#ifdef DEBUG diff -urN ../denemo-cvs/denemo/src/chordops.h ./src/chordops.h --- ../denemo-cvs/denemo/src/chordops.h 2007-08-22 10:50:03.000000000 +0100 +++ ./src/chordops.h 2007-09-13 14:24:30.000000000 +0100 @@ -18,6 +18,8 @@ DenemoObject *newchord (gint baseduration, gint numdots, int tied); +void modify_note (note *thenote, gint mid_c_offset, gint enshift, gint dclef); + void addtone (DenemoObject * mudelaobj, gint mid_c_offset, gint enshift, gint dclef); diff -urN ../denemo-cvs/denemo/src/commandfuncs.c ./src/commandfuncs.c --- ../denemo-cvs/denemo/src/commandfuncs.c 2007-08-22 10:50:03.000000000 +0100 +++ ./src/commandfuncs.c 2007-09-13 16:23:16.000000000 +0100 @@ -26,7 +26,7 @@ #include "exportxml.h" #include "prefops.h" #include "keyresponses.h" - +#include "view.h" /** * Macro to get the current DenemoObject */ @@ -49,19 +49,37 @@ return; if(gui->si->currhythm==NULL) gui->si->currhythm = g_list_last(gui->si->rhythms); +#if 0 gtk_widget_set_state(((RhythmPattern *)gui->si->currhythm->data)->button, GTK_STATE_NORMAL); +#else + + {GdkColor thecolor; + gdk_color_parse ("gray", &thecolor); + gtk_widget_modify_bg (gtk_tool_button_get_label_widget(GTK_WIDGET(((RhythmPattern *)gui->si->currhythm->data)->button)), GTK_STATE_NORMAL, &thecolor); + } + +#endif if(gui->si->currhythm->next) gui->si->currhythm = gui->si->currhythm->next; else gui->si->currhythm = gui->si->rhythms; #define g (gui->si->rstep) + g = ((RhythmPattern*)gui->si->currhythm->data)->rsteps; - + + +#define CURRP ((RhythmPattern *)gui->si->currhythm->data) if(((RhythmElement*)g->data)->icon) { - gtk_tool_button_set_label(((RhythmPattern *)gui->si->currhythm->data)->button,((RhythmElement*)g->data)->icon); + GtkWidget *label = LABEL(CURRP->button); + gtk_label_set_markup(label,((RhythmElement*)g->data)->icon); } - gtk_widget_set_state(((RhythmPattern *)gui->si->currhythm->data)->button, GTK_STATE_PRELIGHT); - g_print("selected active\n"); +#if 0 + gtk_widget_set_state(GTK_WIDGET(((RhythmPattern *)gui->si->currhythm->data)->button), GTK_STATE_PRELIGHT); +#else + highlight_rhythm((RhythmPattern *)gui->si->currhythm->data); +#endif + //g_print("selected active\n"); +#undef CURRP #undef g } @@ -427,7 +445,7 @@ } /** - * Move the cursor to a given note value + * Move the cursor to a given note value nearest the current cursor * */ void @@ -446,21 +464,47 @@ GList *h; do { if(g) { - for(h = ((RhythmElement*)g->data)->functions;h;h=h->next) { - ((GtkFunction)h->data)(gui), displayhelper(gui); + for(h = ((RhythmElement*)g->data)->functions;h;h=h->next) { + nextmeasure (gui->si, TRUE); + gui->si->cursoroffend = FALSE; + ((GtkFunction)h->data)(gui); + displayhelper(gui); } h = ((RhythmElement*)g->data)->functions; g = g->next;/* list is circular */ } } while(g!=start && modifier_code(h->data)); - +#define CURRP ((RhythmPattern *)gui->si->currhythm->data) if(((RhythmElement*)g->data)->icon) { - gtk_tool_button_set_label(((RhythmPattern *)gui->si->currhythm->data)->button,((RhythmElement*)g->data)->icon); + GtkWidget *label = LABEL(CURRP->button); + gtk_label_set_markup(label,((RhythmElement*)g->data)->icon); } } +#undef CURRP #undef g } +void +insert_rhythm_pattern(DenemoGUI *gui) { +#define g (gui->si->rstep) + if(gui->si->rhythmicsubmode && g) { + GList *start = g; + GList *h; + do { + if(g) { + for(h = ((RhythmElement*)g->data)->functions;h;h=h->next) { + nextmeasure (gui->si, TRUE); + gui->si->cursoroffend = FALSE; + ((GtkFunction)h->data)(gui); + displayhelper(gui); + } + h = ((RhythmElement*)g->data)->functions; + g = g->next;/* list is circular */ + } + } while(g!=start); + } +#undef g +} /** * badly named and incorrectly described (below) @@ -1107,6 +1151,17 @@ staffnode *curstaff; measurenode *curmeasure; g_print ("dnm_deleteobject undo/redo mode %d\n", si->undo_redo_mode); + + /* when tone_store is active, act on that, not the staff itself */ + + if (((DenemoStaff*)si->currentstaff->data)->tone_store) { + if(si->currentobject && + ((DenemoObject*)(si->currentobject->data))->type==CHORD){ + if(delete_tone(si, ((DenemoObject*)(si->currentobject->data))->object)) + return; + } + } + if (si->undo_redo_mode == UNDO) { diff -urN ../denemo-cvs/denemo/src/commandfuncs.h ./src/commandfuncs.h --- ../denemo-cvs/denemo/src/commandfuncs.h 2007-08-22 10:50:03.000000000 +0100 +++ ./src/commandfuncs.h 2007-09-13 15:00:19.000000000 +0100 @@ -146,5 +146,7 @@ void nextrhythm(DenemoGUI *gui); +void +insert_rhythm_pattern(DenemoGUI *gui); #endif /*COMMANDFUNCSH */ diff -urN ../denemo-cvs/denemo/src/draw.c ./src/draw.c --- ../denemo-cvs/denemo/src/draw.c 2007-08-22 10:50:04.000000000 +0100 +++ ./src/draw.c 2007-09-13 14:24:30.000000000 +0100 @@ -129,6 +129,11 @@ { GdkColor thecolor; const char *color = (mudelaitem->isinvisible) ? "white" : "black"; + + if(mudelaitem->type==CHORD && ((chord *) mudelaitem->object)->tone_node) + color = "blue"; + + gdk_color_parse (color, &thecolor); gdk_colormap_alloc_color (gdk_colormap_get_system (), &thecolor, TRUE, TRUE); diff -urN ../denemo-cvs/denemo/src/drawnotes.c ./src/drawnotes.c --- ../denemo-cvs/denemo/src/drawnotes.c 2007-01-24 19:44:26.000000000 +0000 +++ ./src/drawnotes.c 2007-09-13 14:24:30.000000000 +0100 @@ -318,13 +318,13 @@ if (mudelaitem->isinvisible) gc = gcs_yellowgc (); - if (!thechord.tones) /* We have a rest here */ + if (!thechord.notes) /* We have a rest here */ draw_rest (pixmap, gc, duration, thechord.numdots, xx, y); else { /* Draw the noteheads and accidentals */ - for (curnode = thechord.tones; curnode; curnode = curnode->next) + for (curnode = thechord.notes; curnode; curnode = curnode->next) draw_notehead (pixmap, gc, (note *) curnode->data, duration, thechord.numdots, xx, y, accs, thechord.is_stemup); diff -urN ../denemo-cvs/denemo/src/exportabc.c ./src/exportabc.c --- ../denemo-cvs/denemo/src/exportabc.c 2007-01-24 19:44:26.000000000 +0000 +++ ./src/exportabc.c 2007-09-13 14:24:31.000000000 +0100 @@ -215,11 +215,11 @@ determinelength (chordptr->baseduration, chordptr->numdots, defaultlength, &length); - if (chordptr->tones) /* it's a note or chord, not a rest */ + if (chordptr->notes) /* it's a note or chord, not a rest */ { /* If there's only one note, it's a note, not a chord. */ - gboolean ischord = chordptr->tones->next != NULL; + gboolean ischord = chordptr->notes->next != NULL; GList *curnotenode, *tmp; note *curnote; gchar notename; @@ -250,7 +250,7 @@ if (ischord) fprintf (fp, "["); - for (curnotenode = chordptr->tones; + for (curnotenode = chordptr->notes; curnotenode != NULL; curnotenode = curnotenode->next) { curnote = (note *) curnotenode->data; diff -urN ../denemo-cvs/denemo/src/exportcsound.c ./src/exportcsound.c --- ../denemo-cvs/denemo/src/exportcsound.c 2007-01-24 19:44:26.000000000 +0000 +++ ./src/exportcsound.c 2007-09-13 14:24:29.000000000 +0100 @@ -195,7 +195,7 @@ { case CHORD: - node = ((chord *) mudelaitem->object)->tones; + node = ((chord *) mudelaitem->object)->notes; duration = diff -urN ../denemo-cvs/denemo/src/exportlilypond.c ./src/exportlilypond.c --- ../denemo-cvs/denemo/src/exportlilypond.c 2007-08-22 10:50:04.000000000 +0100 +++ ./src/exportlilypond.c 2007-09-13 14:24:29.000000000 +0100 @@ -726,7 +726,7 @@ output_fakechord(si, &fakechords, pchord); /* end of fakechord stuff */ - if (!pchord->tones) + if (!pchord->notes) { /* A rest */ if (!curobj->isinvisible) { @@ -764,12 +764,12 @@ GList *tmpornament; if (!curobj->isinvisible) { - if (pchord->tones->next) + if (pchord->notes->next) { is_chordmode = TRUE; g_string_append_printf (ret, "<"); } - for (curtone = pchord->tones; curtone; curtone = curtone->next) + for (curtone = pchord->notes; curtone; curtone = curtone->next) { noteheadtype = ((note *) curtone->data)->noteheadtype; @@ -837,11 +837,11 @@ if (curtone->next) g_string_append_printf (ret, " "); } /* End chord loop */ - if (pchord->tones->next && pchord->has_dynamic) + if (pchord->notes->next && pchord->has_dynamic) { sprintf (temp, ">"); } - else if (pchord->tones->next) + else if (pchord->notes->next) g_string_append_printf (ret, ">"); } else diff -urN ../denemo-cvs/denemo/src/exportmidi.c ./src/exportmidi.c --- ../denemo-cvs/denemo/src/exportmidi.c 2007-01-24 19:44:26.000000000 +0000 +++ ./src/exportmidi.c 2007-09-13 14:24:29.000000000 +0100 @@ -1210,7 +1210,7 @@ fprintf (stderr, "duration is %s\n", fmt_ticks (duration)); - if (chordval.tones) + if (chordval.notes) { /************************** @@ -1237,7 +1237,7 @@ * begin chord read loop ************************/ - for (curtone = chordval.tones; curtone; + for (curtone = chordval.notes; curtone; curtone = curtone->next) { gint tmp = cur_volume; diff -urN ../denemo-cvs/denemo/src/exportxml.c ./src/exportxml.c --- ../denemo-cvs/denemo/src/exportxml.c 2007-01-24 19:44:26.000000000 +0000 +++ ./src/exportxml.c 2007-09-13 14:24:29.000000000 +0100 @@ -749,7 +749,7 @@ /* Output the root element, "rest" or "chord". */ - if (((chord *) curObj->object)->tones == NULL) + if (((chord *) curObj->object)->notes == NULL) { objElem = xmlNewChild (measureElem, ns, (xmlChar *) "rest", NULL); @@ -1078,11 +1078,11 @@ /* Output all the notes, if this isn't a rest. */ - if (((chord *) curObj->object)->tones != NULL) + if (((chord *) curObj->object)->notes != NULL) { parentElem = xmlNewChild (objElem, ns, (xmlChar *) "notes", NULL); - for (curNoteNode = ((chord *) curObj->object)->tones; + for (curNoteNode = ((chord *) curObj->object)->notes; curNoteNode != NULL; curNoteNode = curNoteNode->next) { diff -urN ../denemo-cvs/denemo/src/frogio.c ./src/frogio.c --- ../denemo-cvs/denemo/src/frogio.c 2007-02-23 21:23:53.000000000 +0000 +++ ./src/frogio.c 2007-09-13 14:24:30.000000000 +0100 @@ -264,11 +264,11 @@ { case CHORD: /* - * Found chord go through chord tones list outputting + * Found chord go through chord notes list outputting * the data for the note */ newnote = (note *) g_malloc (sizeof (note)); - node = ((chord *) mudelaitem->object)->tones; + node = ((chord *) mudelaitem->object)->notes; /*beat->beat = beat->beat + beat->prevduration; */ duration = durationtofloat (((chord *) mudelaitem->object)->baseduration, diff -urN ../denemo-cvs/denemo/src/frogparser.c ./src/frogparser.c --- ../denemo-cvs/denemo/src/frogparser.c 2007-07-10 01:34:43.000000000 +0100 +++ ./src/frogparser.c 2007-09-13 17:51:46.000000000 +0100 @@ -1,4 +1,4 @@ -/* A Bison parser, made by GNU Bison 2.2. */ +/* A Bison parser, made by GNU Bison 2.3. */ /* Skeleton implementation for Bison's Yacc-like parsers in C @@ -47,7 +47,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.2" +#define YYBISON_VERSION "2.3" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -253,7 +253,7 @@ struct p_slur t_slur; struct p_hairpin t_hairpin; } -/* Line 193 of yacc.c. */ +/* Line 187 of yacc.c. */ #line 258 "frogparser.tab.c" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ @@ -929,13 +929,13 @@ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void -yy_symbol_value_print (FILE *yyoutput, int yytype, const YYSTYPE * const yyvaluep) +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) #else static void yy_symbol_value_print (yyoutput, yytype, yyvaluep) FILE *yyoutput; int yytype; - const YYSTYPE * const yyvaluep; + YYSTYPE const * const yyvaluep; #endif { if (!yyvaluep) @@ -961,13 +961,13 @@ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void -yy_symbol_print (FILE *yyoutput, int yytype, const YYSTYPE * const yyvaluep) +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) #else static void yy_symbol_print (yyoutput, yytype, yyvaluep) FILE *yyoutput; int yytype; - const YYSTYPE * const yyvaluep; + YYSTYPE const * const yyvaluep; #endif { if (yytype < YYNTOKENS) @@ -1015,15 +1015,12 @@ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void -yy_reduce_print (YYSTYPE *yyvsp, - int yyrule) +yy_reduce_print (YYSTYPE *yyvsp, int yyrule) #else static void -yy_reduce_print (yyvsp, yyrule - ) +yy_reduce_print (yyvsp, yyrule) YYSTYPE *yyvsp; - - int yyrule; + int yyrule; #endif { int yynrhs = yyr2[yyrule]; @@ -1697,7 +1694,7 @@ currentbar = (yyvsp[(1) - (3)]. number ); if (!frogsi->currentmeasure->next) { - frogsi->currentmeasure = dnm_addmeasures + frogsi->currentmeasure = addmeasures (frogsi, frogsi->currentmeasurenum, 1,1); } else @@ -2362,7 +2359,7 @@ /* Line 1267 of yacc.c. */ -#line 2366 "frogparser.tab.c" +#line 2363 "frogparser.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -2571,7 +2568,8 @@ if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif - return yyresult; + /* Make sure YYID is used. */ + return YYID (yyresult); } @@ -2715,7 +2713,7 @@ addtone (newmudelaobj, notename, enharmonic, cleftype); if(notehead) { - newnote = (note *)((chord *)newmudelaobj->object)->tones->data; + newnote = (note *)((chord *)newmudelaobj->object)->notes->data; newnote->noteheadtype = setnoteheadtype (notehead); } theobj = g_list_insert (theobj, newmudelaobj, counter); @@ -2832,8 +2830,7 @@ frogsi->currentmeasure->data = g_list_append ((objnode *)frogsi->currentmeasure->data, newobj); } - dnm_setinitialkeysig((DenemoStaff *) frogsi->currentstaff->data, keynum, isminor); - //initkeyaccs (((DenemoStaff *) frogsi->currentstaff->data)->skeyaccs, keynum); + initkeyaccs (((DenemoStaff *) frogsi->currentstaff->data)->skeyaccs, keynum); } /* diff -urN ../denemo-cvs/denemo/src/frogparser.y ./src/frogparser.y --- ../denemo-cvs/denemo/src/frogparser.y 2007-01-31 20:13:46.000000000 +0000 +++ ./src/frogparser.y 2007-09-13 17:32:35.000000000 +0100 @@ -956,7 +956,7 @@ addtone (newmudelaobj, notename, enharmonic, cleftype); if(notehead) { - newnote = (note *)((chord *)newmudelaobj->object)->tones->data; + newnote = (note *)((chord *)newmudelaobj->object)->notes->data; newnote->noteheadtype = setnoteheadtype (notehead); } theobj = g_list_insert (theobj, newmudelaobj, counter); diff -urN ../denemo-cvs/denemo/src/importxml.c ./src/importxml.c --- ../denemo-cvs/denemo/src/importxml.c 2007-07-10 01:34:43.000000000 +0100 +++ ./src/importxml.c 2007-09-13 14:24:28.000000000 +0100 @@ -736,7 +736,7 @@ if (noteHeadType != DENEMO_NORMAL_NOTEHEAD) { /* FIXME: Is this the right note in the chord? */ - ((note *) ((chord *) chordObj->object)->tones->data)->noteheadtype = + ((note *) ((chord *) chordObj->object)->notes->data)->noteheadtype = (enum headtype) noteHeadType; } } diff -urN ../denemo-cvs/denemo/src/kbd-custom.c ./src/kbd-custom.c --- ../denemo-cvs/denemo/src/kbd-custom.c 2007-08-22 10:50:04.000000000 +0100 +++ ./src/kbd-custom.c 2007-09-13 14:24:30.000000000 +0100 @@ -349,8 +349,8 @@ {KBD_CATEGORY_OTHER, N_("CloseRepeat"), (GtkFunction) insert_closerepeat}, {KBD_CATEGORY_OTHER, N_("OpenCloseRepeat"), (GtkFunction) insert_opencloserepeat}, - {KBD_CATEGORY_OTHER, N_("FirstRhythm"), - (GtkFunction) nextrhythm/* temp should be edit first rhythm*/}, + {KBD_CATEGORY_OTHER, N_("InsertRhythm"), + (GtkFunction) insert_rhythm_pattern}, {KBD_CATEGORY_OTHER, N_("NextRhythm"), (GtkFunction) nextrhythm}, {KBD_CATEGORY_MEASURE, N_("AppendMesauresToScore"), diff -urN ../denemo-cvs/denemo/src/keyresponses.c ./src/keyresponses.c --- ../denemo-cvs/denemo/src/keyresponses.c 2007-08-22 10:50:05.000000000 +0100 +++ ./src/keyresponses.c 2007-09-13 14:24:28.000000000 +0100 @@ -12,7 +12,7 @@ #include "barline.h" #include "utils.h" #include "tupletops.h" - +#include "view.h" /** * keypress event callback * looks up the key press and executes the correct function @@ -48,24 +48,16 @@ ki->func.nocallback==(gpointer)insert_chord_4key || ki->func.nocallback==(gpointer)insert_chord_5key || ki->func.nocallback==(gpointer)insert_chord_6key -#if 0 - || - ki->func.nocallback==(gpointer)insert_rest_0key || - ki->func.nocallback==(gpointer)insert_rest_1key || - ki->func.nocallback==(gpointer)insert_rest_2key || - ki->func.nocallback==(gpointer)insert_rest_3key || - ki->func.nocallback==(gpointer)insert_rest_4key || - ki->func.nocallback==(gpointer)insert_rest_5key || - ki->func.nocallback==(gpointer)insert_rest_6key -#endif ) -{ -#define g (gui->si->rstep) + { +#define g (gui->si->rstep) + RhythmElement *relement = (RhythmElement*)g_malloc0(sizeof(RhythmElement)); relement->functions = g_list_append(NULL, (gpointer)ki->func.callback); if(gui->si->currhythm) { - gtk_widget_set_state(GTK_WIDGET(((RhythmPattern *)gui->si->currhythm->data)->button), GTK_STATE_NORMAL); + unhighlight_rhythm((RhythmPattern *)gui->si->currhythm->data); + } else if(g) { g_list_free(((RhythmElement*)g->data)->functions); g->next = g->prev = NULL; @@ -584,6 +576,7 @@ void deletepreviousobject(DenemoGUI * gui) { + /* remove the object preceding the cursor, within the current measure */ if (gui->si->cursor_x) { @@ -607,13 +600,16 @@ } } /* if you are following a rhythmic pattern then backup the pattern */ - if(gui->si->rhythmicsubmode) - { #define g (gui->si->rstep) + if(gui->si->rhythmicsubmode && g) + { +#define CURRP ((RhythmPattern *)gui->si->currhythm->data) g = g->prev; /* list is circular - should we stop at beginning? */ if(((RhythmElement*)g->data)->icon) { - gtk_tool_button_set_label(((RhythmPattern *)gui->si->currhythm->data)->button,((RhythmElement*)g->data)->icon); + GtkWidget *label = LABEL(CURRP->button); + gtk_label_set_markup(label,((RhythmElement*)g->data)->icon); } +#undef CURRP #undef g } } @@ -650,7 +646,7 @@ /* Equals - toggle whether this note is tied */ if (curmudelaobj && curmudelaobj->type == CHORD && - ((chord *) curmudelaobj->object)->tones) + ((chord *) curmudelaobj->object)->notes) { nextmeasure (gui->si, FALSE); object_insert (gui->si, dnm_clone_object (curmudelaobj)); @@ -681,7 +677,7 @@ /* Equals - toggle whether this note is tied */ addornament (curmudelaobj, D_ACCENT); /* if (curmudelaobj && curmudelaobj->type == CHORD && - ((chord *) curmudelaobj->object)->tones) + ((chord *) curmudelaobj->object)->notes) ((chord *)curmudelaobj->object)->ornamentlist = insert_ornament_list(D_ACCENT, ((chord *)curmudelaobj->object)->ornamentlist); */ diff -urN ../denemo-cvs/denemo/src/lylexer.c ./src/lylexer.c --- ../denemo-cvs/denemo/src/lylexer.c 2007-01-31 20:13:46.000000000 +0000 +++ ./src/lylexer.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,3105 +0,0 @@ -#line 2 "./lylexer.c" - -#line 4 "./lylexer.c" - -#define YY_INT_ALIGNED short int - -/* A lexical scanner generated by flex */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 33 -#if YY_FLEX_SUBMINOR_VERSION > 0 -#define FLEX_BETA -#endif - -/* First, we deal with platform-specific or compiler-specific issues. */ - -/* begin standard C headers. */ -#include -#include -#include -#include - -/* end standard C headers. */ - -/* flex integer type definitions */ - -#ifndef FLEXINT_H -#define FLEXINT_H - -/* C99 systems have . Non-C99 systems may or may not. */ - -#if __STDC_VERSION__ >= 199901L - -/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. - */ -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS 1 -#endif - -#include -typedef int8_t flex_int8_t; -typedef uint8_t flex_uint8_t; -typedef int16_t flex_int16_t; -typedef uint16_t flex_uint16_t; -typedef int32_t flex_int32_t; -typedef uint32_t flex_uint32_t; -#else -typedef signed char flex_int8_t; -typedef short int flex_int16_t; -typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; -typedef unsigned short int flex_uint16_t; -typedef unsigned int flex_uint32_t; -#endif /* ! C99 */ - -/* Limits of integral types. */ -#ifndef INT8_MIN -#define INT8_MIN (-128) -#endif -#ifndef INT16_MIN -#define INT16_MIN (-32767-1) -#endif -#ifndef INT32_MIN -#define INT32_MIN (-2147483647-1) -#endif -#ifndef INT8_MAX -#define INT8_MAX (127) -#endif -#ifndef INT16_MAX -#define INT16_MAX (32767) -#endif -#ifndef INT32_MAX -#define INT32_MAX (2147483647) -#endif -#ifndef UINT8_MAX -#define UINT8_MAX (255U) -#endif -#ifndef UINT16_MAX -#define UINT16_MAX (65535U) -#endif -#ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) -#endif - -#endif /* ! FLEXINT_H */ - -#ifdef __cplusplus - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -#if __STDC__ - -#define YY_USE_CONST - -#endif /* __STDC__ */ -#endif /* ! __cplusplus */ - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN (yy_start) = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START (((yy_start) - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE lyrestart(lyin ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#ifndef YY_BUF_SIZE -#define YY_BUF_SIZE 16384 -#endif - -/* The state buf must be large enough to hold one state per character in the main buffer. - */ -#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) - -#ifndef YY_TYPEDEF_YY_BUFFER_STATE -#define YY_TYPEDEF_YY_BUFFER_STATE -typedef struct yy_buffer_state *YY_BUFFER_STATE; -#endif - -extern int lyleng; - -extern FILE *lyin, *lyout; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - - /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires - * access to the local variable yy_act. Since yyless() is a macro, it would break - * existing scanners that call yyless() from OUTSIDE lylex. - * One obvious solution it to make yy_act a global. I tried that, and saw - * a 5% performance hit in a non-lylineno scanner, because yy_act is - * normally declared as a register variable-- so it is not worth it. - */ - #define YY_LESS_LINENO(n) \ - do { \ - int yyl;\ - for ( yyl = n; yyl < lyleng; ++yyl )\ - if ( lytext[yyl] == '\n' )\ - --lylineno;\ - }while(0) - -/* Return all but the first "n" matched characters back to the input stream. */ -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up lytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - *yy_cp = (yy_hold_char); \ - YY_RESTORE_YY_MORE_OFFSET \ - (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up lytext again */ \ - } \ - while ( 0 ) - -#define unput(c) yyunput( c, (yytext_ptr) ) - -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ - -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef unsigned int yy_size_t; -#endif - -#ifndef YY_STRUCT_YY_BUFFER_STATE -#define YY_STRUCT_YY_BUFFER_STATE -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; - -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via lyrestart()), so that the user can continue scanning by - * just pointing lyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - - }; -#endif /* !YY_STRUCT_YY_BUFFER_STATE */ - -/* Stack of input buffers. */ -static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ -static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ -static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - * - * Returns the top of the stack, or NULL. - */ -#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ - ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ - : NULL) - -/* Same as previous macro, but useful when we know that the buffer stack is not - * NULL or when we need an lvalue. For internal use only. - */ -#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] - -/* yy_hold_char holds the character lost when lytext is formed. */ -static char yy_hold_char; -static int yy_n_chars; /* number of characters read into yy_ch_buf */ -int lyleng; - -/* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; -static int yy_init = 0; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow lywrap()'s to do buffer switches - * instead of setting up a fresh lyin. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void lyrestart (FILE *input_file ); -void ly_switch_to_buffer (YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE ly_create_buffer (FILE *file,int size ); -void ly_delete_buffer (YY_BUFFER_STATE b ); -void ly_flush_buffer (YY_BUFFER_STATE b ); -void lypush_buffer_state (YY_BUFFER_STATE new_buffer ); -void lypop_buffer_state (void ); - -static void lyensure_buffer_stack (void ); -static void ly_load_buffer_state (void ); -static void ly_init_buffer (YY_BUFFER_STATE b,FILE *file ); - -#define YY_FLUSH_BUFFER ly_flush_buffer(YY_CURRENT_BUFFER ) - -YY_BUFFER_STATE ly_scan_buffer (char *base,yy_size_t size ); -YY_BUFFER_STATE ly_scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE ly_scan_bytes (yyconst char *bytes,int len ); - -void *lyalloc (yy_size_t ); -void *lyrealloc (void *,yy_size_t ); -void lyfree (void * ); - -#define yy_new_buffer ly_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! YY_CURRENT_BUFFER ){ \ - lyensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - ly_create_buffer(lyin,YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! YY_CURRENT_BUFFER ){\ - lyensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - ly_create_buffer(lyin,YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) - -/* Begin user sect3 */ - -#define lywrap(n) 1 -#define YY_SKIP_YYWRAP - -typedef unsigned char YY_CHAR; - -FILE *lyin = (FILE *) 0, *lyout = (FILE *) 0; - -typedef int yy_state_type; - -extern int lylineno; - -int lylineno = 1; - -extern char *lytext; -#define yytext_ptr lytext - -static yy_state_type yy_get_previous_state (void ); -static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); -static int yy_get_next_buffer (void ); -static void yy_fatal_error (yyconst char msg[] ); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up lytext. - */ -#define YY_DO_BEFORE_ACTION \ - (yytext_ptr) = yy_bp; \ - lyleng = (size_t) (yy_cp - yy_bp); \ - (yy_hold_char) = *yy_cp; \ - *yy_cp = '\0'; \ - (yy_c_buf_p) = yy_cp; - -#define YY_NUM_RULES 76 -#define YY_END_OF_BUFFER 77 -/* This struct is not used in this scanner, - but its presence is necessary. */ -struct yy_trans_info - { - flex_int32_t yy_verify; - flex_int32_t yy_nxt; - }; -static yyconst flex_int16_t yy_accept[296] = - { 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 9, 9, 12, 12, - 15, 15, 0, 0, 77, 73, 8, 8, 1, 46, - 31, 30, 73, 72, 73, 73, 70, 73, 73, 67, - 73, 71, 75, 76, 1, 66, 8, 1, 61, 31, - 30, 66, 62, 66, 60, 63, 57, 25, 66, 65, - 23, 24, 26, 8, 1, 22, 75, 75, 55, 56, - 8, 1, 51, 31, 30, 56, 53, 56, 56, 55, - 56, 45, 43, 40, 25, 73, 23, 24, 26, 39, - 38, 37, 48, 48, 1, 49, 50, 9, 9, 1, - - 10, 9, 12, 12, 1, 13, 14, 15, 15, 1, - 16, 17, 32, 33, 33, 1, 34, 8, 30, 28, - 5, 6, 2, 0, 0, 69, 69, 70, 35, 36, - 67, 74, 29, 68, 68, 68, 68, 68, 64, 0, - 60, 57, 29, 58, 58, 58, 58, 58, 22, 20, - 0, 21, 0, 0, 0, 55, 0, 53, 55, 54, - 54, 54, 54, 54, 0, 44, 40, 41, 41, 41, - 41, 41, 48, 47, 9, 9, 10, 10, 11, 12, - 15, 32, 33, 7, 4, 69, 29, 27, 68, 68, - 68, 68, 68, 59, 58, 58, 58, 58, 20, 0, - - 0, 52, 54, 54, 54, 54, 54, 42, 41, 41, - 41, 41, 41, 68, 68, 68, 68, 58, 58, 58, - 58, 0, 0, 54, 54, 54, 54, 41, 41, 41, - 41, 68, 68, 68, 68, 58, 58, 58, 58, 0, - 0, 54, 54, 54, 54, 41, 41, 41, 41, 68, - 68, 68, 68, 58, 58, 58, 58, 0, 0, 54, - 54, 54, 54, 41, 41, 41, 41, 68, 68, 0, - 58, 58, 21, 54, 54, 41, 41, 19, 68, 3, - 19, 58, 19, 54, 19, 41, 68, 58, 54, 41, - 18, 18, 18, 18, 0 - - } ; - -static yyconst flex_int32_t yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 2, 2, 3, 4, - 2, 3, 5, 2, 2, 2, 1, 1, 1, 1, - 1, 1, 1, 2, 1, 2, 2, 2, 2, 1, - 2, 3, 6, 7, 8, 9, 10, 2, 11, 12, - 13, 14, 15, 2, 16, 17, 18, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 20, 21, 22, - 14, 23, 6, 2, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 25, 24, 24, 24, 24, 24, 24, 24, 24, - 2, 26, 2, 27, 28, 29, 30, 24, 31, 32, - - 33, 24, 24, 24, 34, 24, 24, 35, 36, 37, - 38, 39, 24, 40, 41, 42, 43, 24, 24, 24, - 44, 24, 45, 46, 47, 2, 2, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 - } ; - -static yyconst flex_int32_t yy_meta[48] = - { 0, - 1, 1, 2, 3, 4, 1, 5, 1, 6, 7, - 1, 8, 9, 1, 1, 1, 1, 1, 10, 1, - 1, 1, 1, 11, 11, 5, 1, 12, 1, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 13, 1, 13 - } ; - -static yyconst flex_int16_t yy_base[324] = - { 0, - 0, 0, 44, 46, 51, 0, 96, 104, 130, 0, - 177, 0, 82, 90, 221, 225, 229, 231, 238, 241, - 111, 115, 245, 249, 914, 915, 255, 259, 262, 915, - 915, 265, 227, 915, 221, 894, 254, 890, 888, 0, - 280, 915, 915, 915, 915, 915, 276, 287, 915, 915, - 290, 251, 915, 895, 107, 915, 0, 0, 291, 915, - 0, 0, 915, 294, 298, 902, 283, 328, 0, 915, - 303, 331, 915, 915, 334, 305, 256, 886, 884, 0, - 361, 915, 322, 0, 0, 397, 0, 0, 915, 915, - 915, 915, 0, 0, 0, 915, 336, 859, 858, 857, - - 319, 0, 0, 0, 0, 915, 915, 0, 0, 0, - 915, 915, 0, 341, 348, 351, 915, 354, 371, 915, - 899, 915, 915, 883, 265, 882, 881, 352, 915, 915, - 0, 915, 376, 0, 862, 868, 867, 866, 915, 876, - 342, 0, 379, 885, 378, 247, 380, 414, 886, 871, - 404, 915, 442, 445, 448, 0, 872, 346, 0, 0, - 853, 859, 858, 857, 867, 393, 0, 0, 814, 817, - 816, 815, 0, 915, 792, 0, 367, 407, 915, 0, - 0, 0, 415, 834, 915, 793, 452, 915, 0, 755, - 727, 729, 717, 736, 433, 415, 434, 449, 915, 468, - - 476, 707, 0, 694, 680, 689, 672, 581, 0, 568, - 554, 563, 556, 559, 555, 555, 558, 451, 452, 456, - 458, 479, 498, 555, 551, 551, 554, 551, 547, 547, - 550, 539, 538, 546, 539, 453, 461, 465, 467, 505, - 517, 535, 534, 542, 535, 530, 529, 537, 530, 537, - 526, 530, 520, 486, 485, 468, 525, 532, 537, 534, - 523, 527, 540, 531, 520, 515, 546, 514, 494, 551, - 478, 507, 556, 481, 474, 459, 446, 0, 383, 915, - 407, 489, 0, 370, 0, 305, 300, 497, 202, 195, - 0, 218, 0, 0, 915, 601, 614, 627, 640, 653, - - 666, 679, 692, 696, 708, 118, 716, 727, 740, 753, - 110, 766, 779, 792, 805, 818, 830, 843, 856, 869, - 873, 106, 91 - } ; - -static yyconst flex_int16_t yy_def[324] = - { 0, - 295, 1, 296, 296, 295, 5, 296, 296, 295, 9, - 295, 11, 11, 11, 297, 297, 298, 298, 299, 299, - 300, 300, 301, 301, 295, 295, 295, 295, 295, 295, - 295, 302, 303, 295, 295, 295, 295, 295, 295, 304, - 305, 295, 295, 295, 295, 295, 295, 295, 295, 295, - 302, 303, 295, 295, 295, 295, 306, 306, 307, 295, - 306, 306, 295, 295, 295, 308, 303, 309, 310, 295, - 295, 295, 295, 295, 302, 303, 295, 295, 295, 310, - 305, 295, 295, 311, 311, 305, 311, 311, 295, 295, - 295, 295, 312, 312, 312, 295, 295, 313, 313, 313, - - 314, 315, 316, 316, 316, 295, 295, 317, 317, 317, - 295, 295, 318, 295, 295, 295, 295, 295, 302, 295, - 319, 295, 295, 295, 295, 295, 295, 295, 295, 295, - 304, 295, 320, 321, 321, 321, 321, 321, 295, 295, - 295, 306, 320, 307, 307, 307, 307, 307, 308, 295, - 309, 295, 309, 309, 309, 310, 295, 295, 310, 322, - 322, 322, 322, 322, 295, 295, 311, 323, 323, 323, - 323, 323, 312, 295, 313, 315, 314, 314, 295, 316, - 317, 318, 295, 319, 295, 295, 320, 295, 321, 321, - 321, 321, 321, 295, 307, 307, 307, 307, 295, 309, - - 309, 295, 322, 322, 322, 322, 322, 295, 323, 323, - 323, 323, 323, 321, 321, 321, 321, 307, 307, 307, - 307, 309, 309, 322, 322, 322, 322, 323, 323, 323, - 323, 321, 321, 321, 321, 307, 307, 307, 307, 309, - 309, 322, 322, 322, 322, 323, 323, 323, 323, 321, - 321, 321, 321, 307, 307, 307, 307, 309, 309, 322, - 322, 322, 322, 323, 323, 323, 323, 321, 321, 295, - 307, 307, 295, 322, 322, 323, 323, 321, 321, 295, - 307, 307, 322, 322, 323, 323, 321, 307, 322, 323, - 321, 307, 322, 323, 0, 295, 295, 295, 295, 295, - - 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, - 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, - 295, 295, 295 - } ; - -static yyconst flex_int16_t yy_nxt[963] = - { 0, - 26, 26, 27, 28, 29, 26, 30, 31, 32, 33, - 26, 26, 26, 34, 26, 35, 36, 26, 37, 34, - 26, 38, 39, 40, 40, 41, 26, 26, 26, 40, - 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, - 40, 40, 40, 40, 42, 26, 42, 44, 45, 44, - 45, 46, 46, 47, 28, 48, 46, 49, 50, 51, - 52, 46, 46, 46, 46, 46, 53, 46, 54, 55, - 56, 46, 46, 46, 57, 58, 59, 60, 46, 46, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 61, 62, 57, 57, 57, 46, 63, 46, 64, 28, - - 65, 209, 66, 90, 91, 67, 64, 28, 65, 92, - 66, 90, 91, 67, 109, 110, 203, 92, 109, 110, - 167, 68, 111, 112, 140, 141, 111, 112, 142, 68, - 69, 70, 71, 28, 72, 69, 73, 74, 75, 76, - 69, 70, 70, 70, 70, 69, 70, 70, 77, 69, - 70, 78, 79, 80, 80, 81, 70, 80, 69, 80, - 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 70, 70, 70, 26, 26, 27, - 28, 29, 26, 82, 31, 32, 33, 26, 26, 26, - 26, 26, 26, 26, 26, 83, 26, 26, 38, 39, - - 84, 85, 86, 26, 26, 26, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 87, 88, 84, 84, - 84, 26, 89, 26, 94, 95, 295, 96, 94, 95, - 122, 96, 99, 100, 99, 100, 294, 124, 101, 125, - 101, 104, 105, 293, 104, 105, 97, 114, 115, 116, - 97, 114, 115, 116, 122, 295, 117, 118, 118, 118, - 117, 118, 118, 118, 118, 118, 118, 120, 120, 120, - 127, 123, 128, 157, 158, 102, 196, 102, 118, 118, - 118, 127, 106, 125, 107, 106, 122, 107, 133, 118, - 118, 118, 120, 120, 120, 123, 118, 118, 118, 143, - - 118, 118, 118, 134, 134, 118, 118, 118, 122, 134, - 134, 134, 134, 135, 136, 137, 134, 134, 138, 134, - 134, 134, 134, 134, 145, 146, 147, 123, 178, 148, - 152, 152, 152, 118, 118, 118, 120, 120, 120, 165, - 166, 291, 174, 183, 183, 183, 174, 290, 153, 123, - 183, 183, 183, 183, 183, 183, 118, 118, 118, 140, - 141, 174, 154, 157, 158, 179, 155, 159, 127, 133, - 128, 159, 174, 120, 120, 120, 295, 174, 188, 188, - 188, 188, 188, 188, 160, 160, 295, 159, 295, 159, - 160, 160, 160, 160, 161, 162, 163, 160, 160, 164, - - 160, 160, 160, 160, 160, 133, 152, 152, 152, 197, - 165, 166, 289, 295, 195, 295, 178, 183, 183, 183, - 168, 168, 295, 295, 153, 287, 168, 168, 168, 168, - 169, 170, 171, 168, 168, 172, 168, 168, 168, 168, - 168, 295, 295, 198, 152, 152, 152, 152, 152, 152, - 152, 152, 152, 179, 188, 188, 188, 295, 219, 295, - 295, 295, 153, 218, 295, 153, 295, 220, 153, 295, - 152, 152, 152, 295, 200, 295, 295, 201, 152, 152, - 152, 152, 152, 152, 286, 236, 295, 221, 153, 237, - 239, 285, 238, 295, 295, 254, 153, 295, 256, 153, - - 152, 152, 152, 255, 272, 295, 257, 152, 152, 152, - 281, 222, 284, 283, 223, 295, 240, 271, 153, 152, - 152, 152, 270, 270, 270, 153, 257, 270, 270, 270, - 241, 288, 279, 295, 152, 152, 152, 153, 292, 273, - 273, 273, 270, 270, 270, 282, 278, 258, 270, 270, - 270, 277, 153, 270, 270, 270, 259, 153, 270, 270, - 270, 267, 276, 275, 263, 274, 269, 253, 268, 267, - 266, 265, 264, 259, 263, 262, 261, 260, 253, 252, - 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, - 235, 234, 233, 232, 231, 280, 230, 229, 228, 208, - - 280, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 93, 93, 93, 93, 93, 93, - 93, 93, 93, 93, 93, 93, 93, 98, 98, 98, - 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, - 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, - 103, 103, 103, 108, 108, 108, 108, 108, 108, 108, - 108, 108, 108, 108, 108, 108, 113, 113, 113, 113, - 113, 113, 113, 113, 113, 113, 113, 113, 113, 119, - 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, - 119, 119, 121, 121, 121, 121, 121, 121, 121, 121, - - 121, 121, 121, 121, 121, 131, 131, 131, 132, 132, - 227, 132, 132, 132, 132, 132, 132, 132, 132, 132, - 132, 144, 226, 225, 224, 202, 144, 149, 149, 149, - 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, - 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, - 151, 151, 151, 156, 194, 217, 156, 156, 156, 156, - 156, 156, 216, 156, 156, 156, 173, 173, 173, 173, - 215, 173, 173, 173, 173, 173, 173, 173, 173, 175, - 175, 175, 175, 175, 175, 214, 175, 175, 175, 175, - 175, 175, 177, 177, 177, 177, 177, 177, 177, 177, - - 177, 177, 177, 177, 177, 176, 176, 176, 176, 176, - 176, 186, 176, 176, 176, 176, 176, 176, 180, 180, - 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, - 181, 181, 181, 181, 181, 181, 181, 185, 176, 181, - 181, 181, 181, 182, 213, 212, 211, 182, 182, 182, - 210, 182, 182, 182, 182, 182, 184, 184, 184, 184, - 184, 184, 184, 184, 184, 184, 184, 184, 184, 187, - 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, - 187, 187, 189, 189, 189, 208, 207, 206, 205, 204, - 202, 199, 150, 295, 194, 193, 192, 191, 190, 186, - - 126, 126, 185, 176, 176, 176, 130, 129, 150, 139, - 130, 129, 126, 295, 25, 295, 295, 295, 295, 295, - 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, - 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, - 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, - 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, - 295, 295 - } ; - -static yyconst flex_int16_t yy_chk[963] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 3, 3, 4, - 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 7, 7, - - 7, 323, 7, 13, 13, 7, 8, 8, 8, 13, - 8, 14, 14, 8, 21, 21, 322, 14, 22, 22, - 311, 7, 21, 21, 55, 55, 22, 22, 306, 8, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 15, 15, 292, 15, 16, 16, - 33, 16, 17, 17, 18, 18, 290, 35, 17, 35, - 18, 19, 19, 289, 20, 20, 15, 23, 23, 23, - 16, 24, 24, 24, 52, 146, 23, 27, 27, 27, - 24, 28, 28, 28, 29, 29, 29, 32, 32, 32, - 37, 33, 37, 77, 77, 17, 146, 18, 47, 47, - 47, 125, 19, 125, 19, 20, 67, 20, 41, 48, - 48, 48, 51, 51, 51, 52, 64, 64, 64, 59, - - 65, 65, 65, 41, 41, 71, 71, 71, 76, 41, - 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, - 41, 41, 41, 41, 59, 59, 59, 67, 101, 59, - 68, 68, 68, 72, 72, 72, 75, 75, 75, 83, - 83, 287, 97, 114, 114, 114, 97, 286, 68, 76, - 115, 115, 115, 116, 116, 116, 118, 118, 118, 141, - 141, 97, 68, 158, 158, 101, 68, 81, 128, 81, - 128, 81, 97, 119, 119, 119, 177, 97, 133, 133, - 133, 143, 143, 143, 81, 81, 145, 81, 147, 81, - 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, - - 81, 81, 81, 81, 81, 86, 151, 151, 151, 147, - 166, 166, 284, 177, 145, 281, 178, 183, 183, 183, - 86, 86, 148, 196, 151, 279, 86, 86, 86, 86, - 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, - 86, 195, 197, 148, 153, 153, 153, 154, 154, 154, - 155, 155, 155, 178, 187, 187, 187, 198, 196, 218, - 219, 236, 153, 195, 220, 154, 221, 197, 155, 237, - 200, 200, 200, 238, 154, 239, 256, 155, 201, 201, - 201, 222, 222, 222, 277, 218, 271, 198, 200, 219, - 221, 276, 220, 255, 254, 236, 201, 282, 238, 222, - - 223, 223, 223, 237, 256, 288, 239, 240, 240, 240, - 271, 200, 275, 274, 201, 272, 222, 254, 223, 241, - 241, 241, 253, 253, 253, 240, 255, 257, 257, 257, - 223, 282, 269, 257, 258, 258, 258, 241, 288, 259, - 259, 259, 263, 263, 263, 272, 268, 240, 267, 267, - 267, 266, 258, 270, 270, 270, 241, 259, 273, 273, - 273, 265, 264, 262, 261, 260, 252, 251, 250, 249, - 248, 247, 246, 258, 245, 244, 243, 242, 235, 234, - 233, 232, 231, 230, 229, 228, 227, 226, 225, 224, - 217, 216, 215, 214, 213, 270, 212, 211, 210, 208, - - 273, 296, 296, 296, 296, 296, 296, 296, 296, 296, - 296, 296, 296, 296, 297, 297, 297, 297, 297, 297, - 297, 297, 297, 297, 297, 297, 297, 298, 298, 298, - 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, - 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, - 299, 299, 299, 300, 300, 300, 300, 300, 300, 300, - 300, 300, 300, 300, 300, 300, 301, 301, 301, 301, - 301, 301, 301, 301, 301, 301, 301, 301, 301, 302, - 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, - 302, 302, 303, 303, 303, 303, 303, 303, 303, 303, - - 303, 303, 303, 303, 303, 304, 304, 304, 305, 305, - 207, 305, 305, 305, 305, 305, 305, 305, 305, 305, - 305, 307, 206, 205, 204, 202, 307, 308, 308, 308, - 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, - 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, - 309, 309, 309, 310, 194, 193, 310, 310, 310, 310, - 310, 310, 192, 310, 310, 310, 312, 312, 312, 312, - 191, 312, 312, 312, 312, 312, 312, 312, 312, 313, - 313, 313, 313, 313, 313, 190, 313, 313, 313, 313, - 313, 313, 314, 314, 314, 314, 314, 314, 314, 314, - - 314, 314, 314, 314, 314, 315, 315, 315, 315, 315, - 315, 186, 315, 315, 315, 315, 315, 315, 316, 316, - 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, - 317, 317, 317, 317, 317, 317, 317, 184, 175, 317, - 317, 317, 317, 318, 172, 171, 170, 318, 318, 318, - 169, 318, 318, 318, 318, 318, 319, 319, 319, 319, - 319, 319, 319, 319, 319, 319, 319, 319, 319, 320, - 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, - 320, 320, 321, 321, 321, 165, 164, 163, 162, 161, - 157, 150, 149, 144, 140, 138, 137, 136, 135, 127, - - 126, 124, 121, 100, 99, 98, 79, 78, 66, 54, - 39, 38, 36, 25, 295, 295, 295, 295, 295, 295, - 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, - 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, - 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, - 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, - 295, 295 - } ; - -/* Table of booleans, true if rule could match eol. */ -static yyconst flex_int32_t yy_rule_can_match_eol[77] = - { 0, -0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, - 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; - -static yy_state_type yy_last_accepting_state; -static char *yy_last_accepting_cpos; - -extern int ly_flex_debug; -int ly_flex_debug = 0; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -char *lytext; -#line 1 "./lylexer.l" -#line 2 "./lylexer.l" -/* - lexer.l -- implement the Flex lexer - - source file of the LilyPond music typesetter - - (c) 1996--2000 Han-Wen Nienhuys - Jan Nieuwenhuizen - Modified as a front end GUI for lilypond: - - (c) 2003-2005 Richard Shann -*/ - - - -#include -#include -#include -#include /* for strlen */ -#include -#include -#include "lyparserfuncs.h" - - -#include "lyparser.h" - -#define YYText() lytext - -/* the lexer allocates an GList aka objnode with a mudelaobject as data - for each token as it recognises it and sets the mudelaobject type to - be the type of the token by invoking the macro RETURN quoted strings - - these are just storing the user_text and returning token STRING_ - */ - -extern YYLTYPE lylloc; -#define YY_USER_ACTION { \ - lylloc.first_line=lylineno; \ - lylval.generic.user_string = g_strconcat(input_text?input_text:"",\ - (gchar *) lytext, NULL);\ - g_free(input_text);input_text=NULL;\ -} -#define RETURN(token) {lylval.generic.type = token;return token;} -#define UNDO_YY_USER_ACTION {input_text = lylval.generic.user_string;} -#define YY_NO_UNPUT 1 -#define YY_NO_TOP_STATE 1 - -/* discard the str stored in input_text by YY_USER_ACTION */ -static void remove_from_input (gchar *str); - -/* for skipping over the body of { } blocks not of interest to denemo */ -static int open_brace_count; -/* for skipping over parenthetisized scheme */ -static int open_paren_count; - - - - -static char escaped_char(char a); -static void -scan_fraction (gchar *str, struct twoints *pt); - - -extern GHashTable* name_value_pairs; -extern GHashTable* scm_identifiers; -int scan_escaped_word (gchar *); - -int scan_bare_word (gchar *); - -static nodeglist * lookup_identifier (gchar *); -static nodegstr* lookup_scm_identifier(gchar *str); -static gboolean lookup_pitch(gchar *str); -static int lookup_enshift(gchar *str); - -static GString *quoted_string; /* somewhere to accumulate a quoted string in - the lexer - the whole user text is being - stored here as I am not interpreting the - actual contents inside the quotes*/ - - -/* -RH 7 fix (?) -*/ -#define isatty HORRIBLEKLUDGE -static gchar *input_text; -static void start_main_input (void) { - return; -} - -static gboolean main_input_b_; - - -#define start_quote() \ - yy_push_state (quote);\ - quoted_string=g_string_new(lytext) -#define end_quote() \ - pop_state (); \ - g_free(lylval.gstr.user_string); \ - quoted_string = g_string_append(quoted_string, lytext); \ - lylval.gstr.user_string = quoted_string->str; \ - lylval.gstr.gstr = g_string_new(quoted_string->str); \ - g_string_free(quoted_string, FALSE); - -static void remove_from_input (gchar *str) { -int len = strlen(str); -*(lylval.generic.user_string + strlen(lylval.generic.user_string)-len) = 0; -input_text = lylval.generic.user_string; -} -/* to debug put this below with the options %option debug */ - - - - - - - - - - - - -#line 914 "./lylexer.c" - -#define INITIAL 0 -#define version 1 -#define chords 2 -#define incl 3 -#define lyrics 4 -#define notes 5 -#define figures 6 -#define quote 7 -#define longcomment 8 -#define body 9 -#define parens 10 -#define scheme 11 - -#ifndef YY_NO_UNISTD_H -/* Special case for "unistd.h", since it is non-ANSI. We include it way - * down here because we want the user's section 1 to have been scanned first. - * The user has a chance to override it with an option. - */ -#include -#endif - -#ifndef YY_EXTRA_TYPE -#define YY_EXTRA_TYPE void * -#endif - -static int yy_init_globals (void ); - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int lywrap (void ); -#else -extern int lywrap (void ); -#endif -#endif - - static void yyunput (int c,char *buf_ptr ); - -#ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ); -#endif - -#ifndef YY_NO_INPUT - -#ifdef __cplusplus -static int yyinput (void ); -#else -static int input (void ); -#endif - -#endif - - static int yy_start_stack_ptr = 0; - static int yy_start_stack_depth = 0; - static int *yy_start_stack = NULL; - - static void yy_push_state (int new_state ); - - static void yy_pop_state (void ); - - static int yy_top_state (void ); - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO (void) fwrite( lytext, lyleng, 1, lyout ) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ - { \ - int c = '*'; \ - size_t n; \ - for ( n = 0; n < max_size && \ - (c = getc( lyin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( lyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else \ - { \ - errno=0; \ - while ( (result = fread(buf, 1, max_size, lyin))==0 && ferror(lyin)) \ - { \ - if( errno != EINTR) \ - { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(lyin); \ - } \ - }\ -\ - -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* end tables serialization structures and prototypes */ - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL_IS_OURS 1 - -extern int lylex (void); - -#define YY_DECL int lylex (void) -#endif /* !YY_DECL */ - -/* Code executed at the beginning of each rule, after lytext and lyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - YY_USER_ACTION - -/** The main scanner function which does all the work. - */ -YY_DECL -{ - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - -#line 159 "./lylexer.l" - - - -#line 1092 "./lylexer.c" - - if ( !(yy_init) ) - { - (yy_init) = 1; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! (yy_start) ) - (yy_start) = 1; /* first start state */ - - if ( ! lyin ) - lyin = stdin; - - if ( ! lyout ) - lyout = stdout; - - if ( ! YY_CURRENT_BUFFER ) { - lyensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - ly_create_buffer(lyin,YY_BUF_SIZE ); - } - - ly_load_buffer_state( ); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_cp = (yy_c_buf_p); - - /* Support of lytext. */ - *yy_cp = (yy_hold_char); - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = (yy_start); -yy_match: - do - { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 296 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - ++yy_cp; - } - while ( yy_current_state != 295 ); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - -yy_find_action: - yy_act = yy_accept[yy_current_state]; - - YY_DO_BEFORE_ACTION; - - if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) - { - int yyl; - for ( yyl = 0; yyl < lyleng; ++yyl ) - if ( lytext[yyl] == '\n' ) - - lylineno++; -; - } - -do_action: /* This label is used only to access EOF actions. */ - - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = (yy_hold_char); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; - -case 1: -YY_RULE_SETUP -#line 162 "./lylexer.l" -{ - // windows-suck-suck-suck -} - YY_BREAK - -case 2: -YY_RULE_SETUP -#line 167 "./lylexer.l" -{ - UNDO_YY_USER_ACTION; - yy_push_state (longcomment); - } - YY_BREAK -case 3: -/* rule 3 can match eol */ -YY_RULE_SETUP -#line 171 "./lylexer.l" -{ - UNDO_YY_USER_ACTION; - open_brace_count = 1; - yy_push_state (body); - } - YY_BREAK -case 4: -/* rule 4 can match eol */ -#line 179 "./lylexer.l" -case 5: -/* rule 5 can match eol */ -#line 180 "./lylexer.l" -case 6: -/* rule 6 can match eol */ -#line 181 "./lylexer.l" -case 7: -/* rule 7 can match eol */ -YY_RULE_SETUP -#line 181 "./lylexer.l" -{ - UNDO_YY_USER_ACTION; - } - YY_BREAK -case 8: -/* rule 8 can match eol */ -YY_RULE_SETUP -#line 184 "./lylexer.l" -{ - UNDO_YY_USER_ACTION; - } - YY_BREAK - - -case 9: -/* rule 9 can match eol */ -#line 191 "./lylexer.l" -case 10: -/* rule 10 can match eol */ -YY_RULE_SETUP -#line 191 "./lylexer.l" -{ - UNDO_YY_USER_ACTION; - } - YY_BREAK -case 11: -YY_RULE_SETUP -#line 194 "./lylexer.l" -{ - UNDO_YY_USER_ACTION; - pop_state (); - } - YY_BREAK -case YY_STATE_EOF(longcomment): -#line 198 "./lylexer.l" -{ - g_error ("EOF found inside a comment"); - /* if (! close_input ()) - yyterminate (); can't move this, since it actually rets a YY_NULL */ - } - YY_BREAK - - -case 12: -/* rule 12 can match eol */ -YY_RULE_SETUP -#line 205 "./lylexer.l" -{ - UNDO_YY_USER_ACTION; - } - YY_BREAK -case 13: -YY_RULE_SETUP -#line 208 "./lylexer.l" -{ - UNDO_YY_USER_ACTION; - open_brace_count++; - } - YY_BREAK -case 14: -YY_RULE_SETUP -#line 212 "./lylexer.l" -{ - if (--open_brace_count == 0) { - UNDO_YY_USER_ACTION; - pop_state (); - } else { - UNDO_YY_USER_ACTION; - } - } - YY_BREAK - - -case 15: -/* rule 15 can match eol */ -YY_RULE_SETUP -#line 224 "./lylexer.l" -{ - UNDO_YY_USER_ACTION; - } - YY_BREAK -case 16: -YY_RULE_SETUP -#line 227 "./lylexer.l" -{ - UNDO_YY_USER_ACTION; - open_paren_count++; - } - YY_BREAK -case 17: -YY_RULE_SETUP -#line 231 "./lylexer.l" -{ - - if (--open_paren_count == 0) { - pop_state (); - pop_state (); /* pop scheme state as well */ - RETURN (SCM_T); - } else { - UNDO_YY_USER_ACTION; - } - - } - YY_BREAK - -case 18: -YY_RULE_SETUP -#line 244 "./lylexer.l" -{ - if (!main_input_b_) - { - start_main_input (); - main_input_b_ = TRUE; - } - else - g_error ("\\maininput disallowed outside init files"); -} - YY_BREAK -case 19: -YY_RULE_SETUP -#line 254 "./lylexer.l" -{ - /* ignore include files */ - UNDO_YY_USER_ACTION; - yy_push_state (incl); -} - YY_BREAK -case 20: -/* rule 20 can match eol */ -YY_RULE_SETUP -#line 259 "./lylexer.l" -{ /* got the include file name */ - UNDO_YY_USER_ACTION; - pop_state (); -} - YY_BREAK -case 21: -/* rule 21 can match eol */ -YY_RULE_SETUP -#line 263 "./lylexer.l" -{ /* got the include identifier */ - UNDO_YY_USER_ACTION; -} - YY_BREAK -case 22: -/* rule 22 can match eol */ -YY_RULE_SETUP -#line 266 "./lylexer.l" -{ // backup rule - parser_error ("Missing end quote", lylineno); -} - YY_BREAK -case 23: -YY_RULE_SETUP -#line 269 "./lylexer.l" -{ - RETURN (RESTNAME); -} - YY_BREAK -case 24: -YY_RULE_SETUP -#line 272 "./lylexer.l" -{ - RETURN (SKIPNAME); -} - YY_BREAK -case 25: -YY_RULE_SETUP -#line 275 "./lylexer.l" -{ - RETURN (MULTI_MEASURE_REST); -} - YY_BREAK -case 26: -YY_RULE_SETUP -#line 278 "./lylexer.l" -{ - remove_from_input(lytext); -} - YY_BREAK -case 27: -/* rule 27 can match eol */ -YY_RULE_SETUP -#line 282 "./lylexer.l" -{ - *(lytext+strlen(lytext)-1) = '\0'; - return scan_escaped_word (lytext + 2); -} - YY_BREAK -case 28: -/* rule 28 can match eol */ -YY_RULE_SETUP -#line 286 "./lylexer.l" -{ - *(lytext+strlen(lytext)-1) = '\0'; - return scan_bare_word (lytext + 1); -} - YY_BREAK -case 29: -YY_RULE_SETUP -#line 290 "./lylexer.l" -{ // backup rule - g_error ("white expected"); - exit (1); -} - YY_BREAK -case 30: -YY_RULE_SETUP -#line 294 "./lylexer.l" -{ // backup rule - g_error ("white expected"); - exit (1); -} - YY_BREAK -case 31: -YY_RULE_SETUP -#line 299 "./lylexer.l" -{ - UNDO_YY_USER_ACTION; - yy_push_state (scheme); - } - YY_BREAK - -case 32: -YY_RULE_SETUP -#line 305 "./lylexer.l" -{ - UNDO_YY_USER_ACTION; - } - YY_BREAK -case 33: -/* rule 33 can match eol */ -YY_RULE_SETUP -#line 308 "./lylexer.l" -{ - pop_state(); - RETURN (SCM_T); - } - YY_BREAK -case 34: -YY_RULE_SETUP -#line 312 "./lylexer.l" -{ - UNDO_YY_USER_ACTION; - open_paren_count = 1; - yy_push_state (parens); - } - YY_BREAK - - -case 35: -YY_RULE_SETUP -#line 320 "./lylexer.l" -{ - return DOUBLE_ANGLE_OPEN; - } - YY_BREAK -case 36: -YY_RULE_SETUP -#line 323 "./lylexer.l" -{ - return DOUBLE_ANGLE_CLOSE; - } - YY_BREAK - - -case 37: -YY_RULE_SETUP -#line 329 "./lylexer.l" -{ - RETURN (FIGURE_SPACE); - } - YY_BREAK -case 38: -YY_RULE_SETUP -#line 332 "./lylexer.l" -{ - RETURN (FIGURE_CLOSE); - } - YY_BREAK -case 39: -YY_RULE_SETUP -#line 335 "./lylexer.l" -{ - RETURN (FIGURE_OPEN); - } - YY_BREAK - - -case 40: -YY_RULE_SETUP -#line 340 "./lylexer.l" -{ - return scan_bare_word (YYText ()); - } - YY_BREAK -case 41: -YY_RULE_SETUP -#line 344 "./lylexer.l" -{ - return scan_escaped_word (YYText () + 1); - } - YY_BREAK -case 42: -YY_RULE_SETUP -#line 347 "./lylexer.l" -{ - scan_fraction(lytext, &lylval.t.t); - RETURN (FRACTION); - } - YY_BREAK -case 43: -YY_RULE_SETUP -#line 352 "./lylexer.l" -{ - lylval.i.i = atoi (YYText ()); - RETURN (DIGIT); - } - YY_BREAK -case 44: -YY_RULE_SETUP -#line 356 "./lylexer.l" -{ - lylval.i.i = atoi (YYText ()); - RETURN (UNSIGNED); - } - YY_BREAK -case 45: -YY_RULE_SETUP -#line 361 "./lylexer.l" -{ - start_quote (); - } - YY_BREAK - -case 46: -YY_RULE_SETUP -#line 366 "./lylexer.l" -{ - start_quote (); - -} - YY_BREAK - -case 47: -YY_RULE_SETUP -#line 371 "./lylexer.l" -{ - g_string_append_c (quoted_string, escaped_char (*(lytext+1))); - } - YY_BREAK -case 48: -/* rule 48 can match eol */ -YY_RULE_SETUP -#line 374 "./lylexer.l" -{ - g_string_append (quoted_string, lytext); - } - YY_BREAK -case 49: -YY_RULE_SETUP -#line 377 "./lylexer.l" -{ - end_quote(); - RETURN (STRING_); - } - YY_BREAK -case 50: -YY_RULE_SETUP -#line 381 "./lylexer.l" -{ - g_string_append (quoted_string, lytext); - } - YY_BREAK - - -case 51: -YY_RULE_SETUP -#line 387 "./lylexer.l" -{ - start_quote (); - } - YY_BREAK -case 52: -YY_RULE_SETUP -#line 390 "./lylexer.l" -{ - scan_fraction(lytext, &lylval.t.t); - RETURN (FRACTION); - } - YY_BREAK -case 53: -YY_RULE_SETUP -#line 394 "./lylexer.l" -{ - lylval.i.i = atoi (YYText ()); - RETURN (UNSIGNED); - } - YY_BREAK -case 54: -YY_RULE_SETUP -#line 398 "./lylexer.l" -{ - return scan_escaped_word (YYText () + 1); - } - YY_BREAK -case 55: -YY_RULE_SETUP -#line 401 "./lylexer.l" -{ - - if (!strcmp(lytext, "__")) - RETURN (EXTENDER); - if (!strcmp(lytext, "--")) - RETURN (HYPHEN); - lylval.gstr.gstr = g_string_new(lytext); - RETURN (STRING_); - } - YY_BREAK -case 56: -YY_RULE_SETUP -#line 410 "./lylexer.l" -{ - RETURN (*lytext); - } - YY_BREAK - - -case 57: -YY_RULE_SETUP -#line 415 "./lylexer.l" -{ - return scan_bare_word (YYText ()); - } - YY_BREAK -case 58: -YY_RULE_SETUP -#line 418 "./lylexer.l" -{ - return scan_escaped_word (YYText () + 1); - } - YY_BREAK -case 59: -YY_RULE_SETUP -#line 421 "./lylexer.l" -{ - scan_fraction(lytext, &lylval.t.t); - RETURN (FRACTION); - } - YY_BREAK -case 60: -YY_RULE_SETUP -#line 425 "./lylexer.l" -{ - lylval.i.i = atoi (YYText ()); - RETURN (UNSIGNED); - } - YY_BREAK -case 61: -YY_RULE_SETUP -#line 429 "./lylexer.l" -{ - start_quote (); - } - YY_BREAK -case 62: -YY_RULE_SETUP -#line 432 "./lylexer.l" -{ - RETURN (CHORD_MINUS); - } - YY_BREAK -case 63: -YY_RULE_SETUP -#line 435 "./lylexer.l" -{ - RETURN (CHORD_COLON); - } - YY_BREAK -case 64: -YY_RULE_SETUP -#line 438 "./lylexer.l" -{ - RETURN (CHORD_BASS); - } - YY_BREAK -case 65: -YY_RULE_SETUP -#line 441 "./lylexer.l" -{ - RETURN (CHORD_CARET); - } - YY_BREAK -case 66: -YY_RULE_SETUP -#line 444 "./lylexer.l" -{ - RETURN (*lytext); - } - YY_BREAK - -case YY_STATE_EOF(INITIAL): -case YY_STATE_EOF(version): -case YY_STATE_EOF(chords): -case YY_STATE_EOF(incl): -case YY_STATE_EOF(lyrics): -case YY_STATE_EOF(notes): -case YY_STATE_EOF(figures): -case YY_STATE_EOF(quote): -case YY_STATE_EOF(body): -case YY_STATE_EOF(parens): -case YY_STATE_EOF(scheme): -#line 449 "./lylexer.l" -{ - set_trailing_white_space(input_text); - g_free(input_text);input_text=NULL;/* note that YY_USER_ACTION has not been run */ - yyterminate (); -} - YY_BREAK -case 67: -YY_RULE_SETUP -#line 456 "./lylexer.l" -{ - return scan_bare_word (YYText ()); -} - YY_BREAK -case 68: -YY_RULE_SETUP -#line 459 "./lylexer.l" -{ - return scan_escaped_word (YYText () + 1); -} - YY_BREAK -case 69: -YY_RULE_SETUP -#line 462 "./lylexer.l" -{ - double r; - int cnv=sscanf (YYText (), "%lf", &r); - g_assert (cnv == 1); - lylval.r.r = r; - RETURN (REAL); -} - YY_BREAK -case 70: -YY_RULE_SETUP -#line 470 "./lylexer.l" -{ - lylval.i.i = atoi (YYText ()); - RETURN (UNSIGNED); -} - YY_BREAK -case 71: -YY_RULE_SETUP -#line 475 "./lylexer.l" -{ - - RETURN (*lytext); -} - YY_BREAK -case 72: -YY_RULE_SETUP -#line 479 "./lylexer.l" -{ - char c = YYText ()[0]; - - RETURN (c); -} - YY_BREAK -case 73: -YY_RULE_SETUP -#line 485 "./lylexer.l" -{ - RETURN (*lytext); -} - YY_BREAK -case 74: -YY_RULE_SETUP -#line 489 "./lylexer.l" -{ - char c= *(lytext+1); - - switch (c) { - case '>': - RETURN (E_BIGGER); - case '<': - RETURN (E_SMALLER); - case '!': - RETURN (E_EXCLAMATION); - case '(': - RETURN (E_OPEN); - case ')': - RETURN (E_CLOSE); - case '[': - RETURN (E_LEFTSQUARE); - case ']': - RETURN (E_RIGHTSQUARE); - case '~': - RETURN (E_TILDE); - case '\\': - RETURN (E_BACKSLASH); - default: - RETURN (E_CHAR); - } -} - YY_BREAK -case 75: -YY_RULE_SETUP -#line 516 "./lylexer.l" -{ - g_error("invalid character: `%c'", *lytext); - RETURN (*lytext); -} - YY_BREAK -case 76: -YY_RULE_SETUP -#line 521 "./lylexer.l" -YY_FATAL_ERROR( "flex scanner jammed" ); - YY_BREAK -#line 1839 "./lylexer.c" - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = (yy_hold_char); - YY_RESTORE_YY_MORE_OFFSET - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed lyin at a new source and called - * lylex(). If so, then we have to assure - * consistency between YY_CURRENT_BUFFER and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - YY_CURRENT_BUFFER_LVALUE->yy_input_file = lyin; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++(yy_c_buf_p); - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_END_OF_FILE: - { - (yy_did_buffer_switch_on_eof) = 0; - - if ( lywrap( ) ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * lytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = - (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - (yy_c_buf_p) = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ -} /* end of lylex */ - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ -static int yy_get_next_buffer (void) -{ - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = (yytext_ptr); - register int number_to_move, i; - int ret_val; - - if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; - - else - { - int num_to_read = - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER; - - int yy_c_buf_p_offset = - (int) ((yy_c_buf_p) - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - lyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - - number_to_move - 1; - - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), num_to_read ); - - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - if ( (yy_n_chars) == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - lyrestart(lyin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - (yy_n_chars) += number_to_move; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; - - (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; - - return ret_val; -} - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - - static yy_state_type yy_get_previous_state (void) -{ - register yy_state_type yy_current_state; - register char *yy_cp; - - yy_current_state = (yy_start); - - for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 2); - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 296 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - } - - return yy_current_state; -} - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) -{ - register int yy_is_jam; - register char *yy_cp = (yy_c_buf_p); - - register YY_CHAR yy_c = 2; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 296 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 295); - - return yy_is_jam ? 0 : yy_current_state; -} - - static void yyunput (int c, register char * yy_bp ) -{ - register char *yy_cp; - - yy_cp = (yy_c_buf_p); - - /* undo effects of setting up lytext */ - *yy_cp = (yy_hold_char); - - if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register int number_to_move = (yy_n_chars) + 2; - register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ - YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; - register char *source = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; - - while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; - - if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - - if ( c == '\n' ){ - --lylineno; - } - - (yytext_ptr) = yy_bp; - (yy_hold_char) = *yy_cp; - (yy_c_buf_p) = yy_cp; -} - -#ifndef YY_NO_INPUT -#ifdef __cplusplus - static int yyinput (void) -#else - static int input (void) -#endif - -{ - int c; - - *(yy_c_buf_p) = (yy_hold_char); - - if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - /* This was really a NUL. */ - *(yy_c_buf_p) = '\0'; - - else - { /* need more input */ - int offset = (yy_c_buf_p) - (yytext_ptr); - ++(yy_c_buf_p); - - switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - lyrestart(lyin ); - - /*FALLTHROUGH*/ - - case EOB_ACT_END_OF_FILE: - { - if ( lywrap( ) ) - return EOF; - - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = (yytext_ptr) + offset; - break; - } - } - } - - c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ - *(yy_c_buf_p) = '\0'; /* preserve lytext */ - (yy_hold_char) = *++(yy_c_buf_p); - - if ( c == '\n' ) - - lylineno++; -; - - return c; -} -#endif /* ifndef YY_NO_INPUT */ - -/** Immediately switch to a different input stream. - * @param input_file A readable stream. - * - * @note This function does not reset the start condition to @c INITIAL . - */ - void lyrestart (FILE * input_file ) -{ - - if ( ! YY_CURRENT_BUFFER ){ - lyensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - ly_create_buffer(lyin,YY_BUF_SIZE ); - } - - ly_init_buffer(YY_CURRENT_BUFFER,input_file ); - ly_load_buffer_state( ); -} - -/** Switch to a different input buffer. - * @param new_buffer The new input buffer. - * - */ - void ly_switch_to_buffer (YY_BUFFER_STATE new_buffer ) -{ - - /* TODO. We should be able to replace this entire function body - * with - * lypop_buffer_state(); - * lypush_buffer_state(new_buffer); - */ - lyensure_buffer_stack (); - if ( YY_CURRENT_BUFFER == new_buffer ) - return; - - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - YY_CURRENT_BUFFER_LVALUE = new_buffer; - ly_load_buffer_state( ); - - /* We don't actually know whether we did this switch during - * EOF (lywrap()) processing, but the only time this flag - * is looked at is after lywrap() is called, so it's safe - * to go ahead and always set it. - */ - (yy_did_buffer_switch_on_eof) = 1; -} - -static void ly_load_buffer_state (void) -{ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - lyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; - (yy_hold_char) = *(yy_c_buf_p); -} - -/** Allocate and initialize an input buffer state. - * @param file A readable stream. - * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * - * @return the allocated buffer state. - */ - YY_BUFFER_STATE ly_create_buffer (FILE * file, int size ) -{ - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) lyalloc(sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in ly_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) lyalloc(b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in ly_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - ly_init_buffer(b,file ); - - return b; -} - -/** Destroy the buffer. - * @param b a buffer created with ly_create_buffer() - * - */ - void ly_delete_buffer (YY_BUFFER_STATE b ) -{ - - if ( ! b ) - return; - - if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - lyfree((void *) b->yy_ch_buf ); - - lyfree((void *) b ); -} - -/* Initializes or reinitializes a buffer. - * This function is sometimes called more than once on the same buffer, - * such as during a lyrestart() or at EOF. - */ - static void ly_init_buffer (YY_BUFFER_STATE b, FILE * file ) - -{ - int oerrno = errno; - - ly_flush_buffer(b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - - /* If b is the current buffer, then ly_init_buffer was _probably_ - * called from lyrestart() or through yy_get_next_buffer. - * In that case, we don't want to reset the lineno or column. - */ - if (b != YY_CURRENT_BUFFER){ - b->yy_bs_lineno = 1; - b->yy_bs_column = 0; - } - - b->yy_is_interactive = 0; - - errno = oerrno; -} - -/** Discard all buffered characters. On the next scan, YY_INPUT will be called. - * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * - */ - void ly_flush_buffer (YY_BUFFER_STATE b ) -{ - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == YY_CURRENT_BUFFER ) - ly_load_buffer_state( ); -} - -/** Pushes the new state onto the stack. The new state becomes - * the current state. This function will allocate the stack - * if necessary. - * @param new_buffer The new state. - * - */ -void lypush_buffer_state (YY_BUFFER_STATE new_buffer ) -{ - if (new_buffer == NULL) - return; - - lyensure_buffer_stack(); - - /* This block is copied from ly_switch_to_buffer. */ - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - /* Only push if top exists. Otherwise, replace top. */ - if (YY_CURRENT_BUFFER) - (yy_buffer_stack_top)++; - YY_CURRENT_BUFFER_LVALUE = new_buffer; - - /* copied from ly_switch_to_buffer. */ - ly_load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; -} - -/** Removes and deletes the top of the stack, if present. - * The next element becomes the new top. - * - */ -void lypop_buffer_state (void) -{ - if (!YY_CURRENT_BUFFER) - return; - - ly_delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - if ((yy_buffer_stack_top) > 0) - --(yy_buffer_stack_top); - - if (YY_CURRENT_BUFFER) { - ly_load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; - } -} - -/* Allocates the stack if it does not exist. - * Guarantees space for at least one push. - */ -static void lyensure_buffer_stack (void) -{ - int num_to_alloc; - - if (!(yy_buffer_stack)) { - - /* First allocation is just for 2 elements, since we don't know if this - * scanner will even need a stack. We use 2 instead of 1 to avoid an - * immediate realloc on the next call. - */ - num_to_alloc = 1; - (yy_buffer_stack) = (struct yy_buffer_state**)lyalloc - (num_to_alloc * sizeof(struct yy_buffer_state*) - ); - - memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - - (yy_buffer_stack_max) = num_to_alloc; - (yy_buffer_stack_top) = 0; - return; - } - - if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ - - /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; - - num_to_alloc = (yy_buffer_stack_max) + grow_size; - (yy_buffer_stack) = (struct yy_buffer_state**)lyrealloc - ((yy_buffer_stack), - num_to_alloc * sizeof(struct yy_buffer_state*) - ); - - /* zero only the new slots.*/ - memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); - (yy_buffer_stack_max) = num_to_alloc; - } -} - -/** Setup the input buffer state to scan directly from a user-specified character buffer. - * @param base the character buffer - * @param size the size in bytes of the character buffer - * - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE ly_scan_buffer (char * base, yy_size_t size ) -{ - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) lyalloc(sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in ly_scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - ly_switch_to_buffer(b ); - - return b; -} - -/** Setup the input buffer state to scan a string. The next call to lylex() will - * scan from a @e copy of @a str. - * @param str a NUL-terminated string to scan - * - * @return the newly allocated buffer state object. - * @note If you want to scan bytes that may contain NUL values, then use - * ly_scan_bytes() instead. - */ -YY_BUFFER_STATE ly_scan_string (yyconst char * __yystr ) -{ - - return ly_scan_bytes(__yystr,strlen(__yystr) ); -} - -/** Setup the input buffer state to scan the given bytes. The next call to lylex() will - * scan from a @e copy of @a bytes. - * @param bytes the byte buffer to scan - * @param len the number of bytes in the buffer pointed to by @a bytes. - * - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE ly_scan_bytes (yyconst char * yybytes, int _yybytes_len ) -{ - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = _yybytes_len + 2; - buf = (char *) lyalloc(n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in ly_scan_bytes()" ); - - for ( i = 0; i < _yybytes_len; ++i ) - buf[i] = yybytes[i]; - - buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - - b = ly_scan_buffer(buf,n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in ly_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; -} - - static void yy_push_state (int new_state ) -{ - if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) ) - { - yy_size_t new_size; - - (yy_start_stack_depth) += YY_START_STACK_INCR; - new_size = (yy_start_stack_depth) * sizeof( int ); - - if ( ! (yy_start_stack) ) - (yy_start_stack) = (int *) lyalloc(new_size ); - - else - (yy_start_stack) = (int *) lyrealloc((void *) (yy_start_stack),new_size ); - - if ( ! (yy_start_stack) ) - YY_FATAL_ERROR( - "out of memory expanding start-condition stack" ); - } - - (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START; - - BEGIN(new_state); -} - - static void yy_pop_state (void) -{ - if ( --(yy_start_stack_ptr) < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); - - BEGIN((yy_start_stack)[(yy_start_stack_ptr)]); -} - - static int yy_top_state (void) -{ - return (yy_start_stack)[(yy_start_stack_ptr) - 1]; -} - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -static void yy_fatal_error (yyconst char* msg ) -{ - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); -} - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up lytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - lytext[lyleng] = (yy_hold_char); \ - (yy_c_buf_p) = lytext + yyless_macro_arg; \ - (yy_hold_char) = *(yy_c_buf_p); \ - *(yy_c_buf_p) = '\0'; \ - lyleng = yyless_macro_arg; \ - } \ - while ( 0 ) - -/* Accessor methods (get/set functions) to struct members. */ - -/** Get the current line number. - * - */ -int lyget_lineno (void) -{ - - return lylineno; -} - -/** Get the input stream. - * - */ -FILE *lyget_in (void) -{ - return lyin; -} - -/** Get the output stream. - * - */ -FILE *lyget_out (void) -{ - return lyout; -} - -/** Get the length of the current token. - * - */ -int lyget_leng (void) -{ - return lyleng; -} - -/** Get the current token. - * - */ - -char *lyget_text (void) -{ - return lytext; -} - -/** Set the current line number. - * @param line_number - * - */ -void lyset_lineno (int line_number ) -{ - - lylineno = line_number; -} - -/** Set the input stream. This does not discard the current - * input buffer. - * @param in_str A readable stream. - * - * @see ly_switch_to_buffer - */ -void lyset_in (FILE * in_str ) -{ - lyin = in_str ; -} - -void lyset_out (FILE * out_str ) -{ - lyout = out_str ; -} - -int lyget_debug (void) -{ - return ly_flex_debug; -} - -void lyset_debug (int bdebug ) -{ - ly_flex_debug = bdebug ; -} - -static int yy_init_globals (void) -{ - /* Initialization is the same as for the non-reentrant scanner. - * This function is called from lylex_destroy(), so don't allocate here. - */ - - /* We do not touch lylineno unless the option is enabled. */ - lylineno = 1; - - (yy_buffer_stack) = 0; - (yy_buffer_stack_top) = 0; - (yy_buffer_stack_max) = 0; - (yy_c_buf_p) = (char *) 0; - (yy_init) = 0; - (yy_start) = 0; - - (yy_start_stack_ptr) = 0; - (yy_start_stack_depth) = 0; - (yy_start_stack) = NULL; - -/* Defined in main.c */ -#ifdef YY_STDINIT - lyin = stdin; - lyout = stdout; -#else - lyin = (FILE *) 0; - lyout = (FILE *) 0; -#endif - - /* For future reference: Set errno on error, since we are called by - * lylex_init() - */ - return 0; -} - -/* lylex_destroy is for both reentrant and non-reentrant scanners. */ -int lylex_destroy (void) -{ - - /* Pop the buffer stack, destroying each element. */ - while(YY_CURRENT_BUFFER){ - ly_delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - lypop_buffer_state(); - } - - /* Destroy the stack itself. */ - lyfree((yy_buffer_stack) ); - (yy_buffer_stack) = NULL; - - /* Destroy the start condition stack. */ - lyfree((yy_start_stack) ); - (yy_start_stack) = NULL; - - /* Reset the globals. This is important in a non-reentrant scanner so the next time - * lylex() is called, initialization will occur. */ - yy_init_globals( ); - - return 0; -} - -/* - * Internal utility routines. - */ - -#ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) -{ - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; -} -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s ) -{ - register int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; -} -#endif - -void *lyalloc (yy_size_t size ) -{ - return (void *) malloc( size ); -} - -void *lyrealloc (void * ptr, yy_size_t size ) -{ - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); -} - -void lyfree (void * ptr ) -{ - free( (char *) ptr ); /* see lyrealloc() for (char *) cast */ -} - -#define YYTABLES_NAME "yytables" - -#line 521 "./lylexer.l" - - -void -push_note_state () -{ - yy_push_state (notes); -} - -void -push_figuredbass_state () -{ - yy_push_state (figures); -} - -void -push_chord_state () -{ - yy_push_state (chords); -} - -void -push_lyric_state () -{ - yy_push_state (lyrics); -} - -void -pop_state () -{ - yy_pop_state (); -} - - -int -scan_escaped_word (gchar * str) -{ - nodeglist *sid; /* a definition of an identifier already turned into a - typed glist by the parser encountering an assignment */ - nodegstr *scm_str; - int look = lookup_keyword (str); - if (look != -1) - { - RETURN (look); /* this is many of the tokens eg /times and so on */ - } - sid = lookup_identifier (str); /* there follows all the things that can have - been defined using the = syntax */ - if (sid) - { - lylval.id.id = sid->branch; - RETURN (sid->type); - } - - scm_str = lookup_scm_identifier (str); - if (scm_str) - { - lylval.gstr.type = scm_str->type; - lylval.gstr.gstr = g_string_new (scm_str->gstr->str); - return scm_str->type; - } - - if ((YYSTATE != notes) && (YYSTATE != chords)) - { -#ifdef LATER - /* SCM pitch = scm_hashq_get_handle (pitchname_tab_, str); - some sort of lookup of pitchnames to yield a pitch object to be - stored in lylval */ - - if (gh_pair_p (pitch)) - { - lylval.id.id = ly_cdr (pitch); - RETURN (NOTENAME_PITCH); - } -#endif - } - parser_error (g_strdup_printf - ("scan escaped word: Unknown escaped string: `\\%s'", str), - lylineno); - - lylval.gstr.gstr = g_string_new (lytext); - RETURN (STRING_); -} - -/* scan_bare_word takes a string and if in chords or notes it tries to - interpret the word as a notename of one sort or another eg - NOTENAME_PITCH etc. It uses tables for notes pitchname_tab_ - and chordmodifier_tab_ which I will need to create similar - things for (ultimately they can be changed by the include file). - My lylval should have a field for the str and another for - the pitchname in some binary form ready to be attached to a - mudelaobject... - Otherwise it returns a STRING_ token. */ -int -scan_bare_word (gchar * str) -{ - - if ((YYSTATE == notes) || (YYSTATE == chords)) - { - if (lookup_pitch (str)) - { - lylval.t.t.a = *str - 'a'; - lylval.t.t.b = lookup_enshift (str + 1); - RETURN ((YYSTATE != chords) ? NOTENAME_PITCH : TONICNAME_PITCH); - } - } -#ifdef LATER - else if ((pitch = scm_hashq_get_handle (chordmodifier_tab_, str)) != - SCM_BOOL_F) - { - - lylval.id.id = ly_cdr (pitch); - - RETURN (CHORDMODIFIER_PITCH); - } - -#endif - lylval.gstr.gstr = g_string_new (lytext); - RETURN (STRING_); -} - -gboolean -note_state_b () -{ - return YY_START == notes; -} - -gboolean -chord_state_b () -{ - return YY_START == chords; -} - -gboolean -lyric_state_b () -{ - return YY_START == lyrics; -} - -gboolean -figure_state_b () -{ - return YY_START == figures; -} - -void -reset_initial_lexer_state () -{ - while (YY_START != INITIAL) - yy_pop_state (); - -} - -/* 1.3.146 == removal of ; -Lilypond_version oldest_version ("1.3.146"); - */ - - - -static void -scan_fraction (gchar * str, struct twoints *pt) -{ - char *slash = index (lytext, '/'); - sscanf (lytext, "%d", &pt->a); - if (slash) - sscanf (slash + 1, "%d", &pt->b); - else - pt->b = 1; -} - - -static nodeglist * -lookup_identifier (gchar * str) -{ - return (nodeglist *) g_hash_table_lookup (name_value_pairs, str); -} - -static nodegstr * -lookup_scm_identifier (gchar * str) -{ - return (nodegstr *) g_hash_table_lookup (scm_identifiers, str); -} - - - -static gboolean -lookup_pitch (gchar * str) -{ - if (*str < 'a' || *str > 'g') - return FALSE; - if (lookup_enshift (str + 1) == BAD_ENSHIFT) - return FALSE; - return TRUE; -} - -static int -lookup_enshift (gchar * str) -{ - if (*str == 0) - return 0; - if (!strcmp (str, "es")) - return -1; - if (!strcmp (str, "is")) - return 1; - if (!strcmp (str, "eses")) - return -2; - if (!strcmp (str, "isis")) - return 2; - return BAD_ENSHIFT; -} - -static char -escaped_char (char c) -{ - switch (c) - { - case 'n': - return '\n'; - case 't': - return '\t'; - case '\'': - case '\"': - case '\\': - return c; - } - return 0; -} - - - diff -urN ../denemo-cvs/denemo/src/lyparser.c ./src/lyparser.c --- ../denemo-cvs/denemo/src/lyparser.c 2007-08-22 10:50:05.000000000 +0100 +++ ./src/lyparser.c 2007-09-13 17:51:46.000000000 +0100 @@ -3692,7 +3692,7 @@ addtone ( mud, (yyvsp[(1) - (5)].n).n.mid_c_offset, (yyvsp[(1) - (5)].n).n.enshift, 0);/*FIXME should be using $1.n directly */ -#define no ((note*)((((chord *)mud->object)->tones)->data)) +#define no ((note*)((((chord *)mud->object)->notes)->data)) if ((yyvsp[(3) - (5)].i).i % 2) { no->showaccidental = TRUE; @@ -4766,7 +4766,7 @@ appearing after a note - it turns it into a rest the duration is on the chord structure, the pitch on the note structure. - print *(note*)(((DenemoObject*)(((GList*)(((staff*)si->thescore->data)->measures->data))->data))->u.chordval.tones.data) + print *(note*)(((DenemoObject*)(((GList*)(((staff*)si->thescore->data)->measures->data))->data))->u.chordval.notes.data) */ DenemoObject *mud = newchord( (yyvsp[(5) - (6)].f).t1.a, (yyvsp[(5) - (6)].f).t1.b, 0); @@ -4779,7 +4779,7 @@ addtone( mud, (yyvsp[(1) - (6)].n).n.mid_c_offset, (yyvsp[(1) - (6)].n).n.enshift, 0);/*FIXME should be using $1.n directly */ -#define no ((note*)((((chord *)mud->object)->tones)->data)) +#define no ((note*)((((chord *)mud->object)->notes)->data)) if ((yyvsp[(3) - (6)].i).i % 2) { no->showaccidental = TRUE; ((chord *)mud->object)->hasanacc = TRUE; @@ -4814,7 +4814,7 @@ case 232: #line 2146 "./lyparser.y" { - /* denemo wants a chord with no tones */ + /* denemo wants a chord with no notes */ DenemoObject *mud = newchord( (yyvsp[(2) - (2)].f).t1.a, (yyvsp[(2) - (2)].f).t1.b,0); mud->user_string = g_strconcat((yyvsp[(1) - (2)].generic).user_string, (yyvsp[(2) - (2)].f).user_string, NULL); @@ -4825,7 +4825,7 @@ case 233: #line 2153 "./lyparser.y" { - /* denemo wants a chord with no tones */ + /* denemo wants a chord with no notes */ DenemoObject *mud = newchord( (yyvsp[(2) - (2)].f).t1.a, (yyvsp[(2) - (2)].f).t1.b,0); mud->type = SKIPNAME; mud->user_string = g_strconcat((yyvsp[(1) - (2)].generic).user_string, (yyvsp[(2) - (2)].f).user_string, NULL); diff -urN ../denemo-cvs/denemo/src/lyparserfuncs.c ./src/lyparserfuncs.c --- ../denemo-cvs/denemo/src/lyparserfuncs.c 2007-07-10 01:34:43.000000000 +0100 +++ ./src/lyparserfuncs.c 2007-09-13 14:24:29.000000000 +0100 @@ -552,7 +552,7 @@ return g; } -/* put separate chords into a tones list of a chord and return that, +/* put separate chords into a notes list of a chord and return that, * amalgamating the user_strings */ static DenemoObject * @@ -583,10 +583,10 @@ addtone ((DenemoObject *) firstchord->data, ((note *) (((chord *) (((DenemoObject *) g->data)->object))-> - tones->data))->mid_c_offset, + notes->data))->mid_c_offset, ((note *) (((chord *) (((DenemoObject *) g->data)->object))-> - tones->data))->enshift, 0); + notes->data))->enshift, 0); } /* FIXME memory leak */ } return (DenemoObject *) firstchord->data; @@ -595,7 +595,7 @@ /* RECURSIVE: generate_chords_and_sequentials() * called within a SEQUENTIAL it detects <> and { } music. * The <> are chords are in lilypond style ie SIMULTANEOUS nodes - * this function turns them into tones lists + * this function turns them into notes lists * belonging to a chord structure in denemo style * the { } are things like repeats etc, inline these * Note we don't cope with new contexts being created... @@ -910,7 +910,7 @@ } curobj = (DenemoObject *) curobjnode->data; if (curobj->type == CHORD - && ( (chord *) curobj->object)->numtones + && ( (chord *) curobj->object)->numnotes && ! is_tied ((chord *) curobj->object)) { if (ntype (glyric) == LYRICS) diff -urN ../denemo-cvs/denemo/src/lyparser.h ./src/lyparser.h --- ../denemo-cvs/denemo/src/lyparser.h 2007-08-22 10:50:05.000000000 +0100 +++ ./src/lyparser.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,356 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.3. */ - -/* Skeleton interface for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - DENEMO_MEASURES = 258, - TEXT = 259, - staffcontext = 260, - voicecontext = 261, - lyricscontext = 262, - figuredbasscontext = 263, - endcontext = 264, - MUSICMODE = 265, - TONEOPTION = 266, - DYNAMICMARK = 267, - AUTOCHANGE = 268, - ALIAS = 269, - APPLY = 270, - ARPEGGIO = 271, - DYNAMICSCRIPT = 272, - ACCEPTS = 273, - ALTERNATIVE = 274, - BAR = 275, - BREAK = 276, - BREATHE = 277, - CHORDMODIFIERS = 278, - CHORDS = 279, - CHAR_T = 280, - CLEF_ = 281, - CM_T = 282, - CONSISTS = 283, - SEQUENTIAL = 284, - SIMULTANEOUS = 285, - GROBDESCRIPTIONS = 286, - CONSISTSEND = 287, - DENIES = 288, - DURATION = 289, - EXTENDER = 290, - FIGURES = 291, - FIGURE_OPEN = 292, - FIGURE_CLOSE = 293, - FIGURE_BRACKET_CLOSE = 294, - FIGURE_BRACKET_OPEN = 295, - GLISSANDO = 296, - GRACE = 297, - HEADER = 298, - HYPHEN = 299, - IN_T = 300, - INVALID = 301, - KEY = 302, - LYRICS = 303, - MARK = 304, - MARKUP = 305, - MULTI_MEASURE_REST = 306, - MIDI = 307, - MM_T = 308, - PITCH = 309, - DEFAULT = 310, - NAME = 311, - PITCHNAMES = 312, - NOTES = 313, - PAPER = 314, - PARTIAL_ = 315, - PENALTY = 316, - PROPERTY = 317, - OVERRIDE = 318, - SET = 319, - REVERT = 320, - PT_T = 321, - RELATIVE = 322, - REMOVE = 323, - REPEAT = 324, - ADDLYRICS = 325, - PARTCOMBINE = 326, - SCORE = 327, - SCRIPT = 328, - SKIP = 329, - SPANREQUEST = 330, - STYLESHEET = 331, - COMMANDSPANREQUEST = 332, - TEMPO = 333, - OUTPUTPROPERTY = 334, - TIME_T = 335, - TIMES = 336, - TRANSLATOR = 337, - TRANSPOSE = 338, - TYPE = 339, - UNSET = 340, - CONTEXT = 341, - LAYOUT = 342, - LYRICSTO = 343, - LYRICMODE = 344, - NEWCONTEXT = 345, - LILYVERSION = 346, - DRUM_PITCH = 347, - MUSIC_FUNCTION = 348, - REST = 349, - DOUBLE_ANGLE_CLOSE = 350, - DOUBLE_ANGLE_OPEN = 351, - E_CHAR = 352, - E_EXCLAMATION = 353, - E_SMALLER = 354, - E_BIGGER = 355, - E_OPEN = 356, - E_CLOSE = 357, - E_LEFTSQUARE = 358, - E_RIGHTSQUARE = 359, - E_TILDE = 360, - E_BACKSLASH = 361, - CHORD_BASS = 362, - CHORD_COLON = 363, - CHORD_MINUS = 364, - CHORD_CARET = 365, - FIGURE_SPACE = 366, - DIGIT = 367, - NOTENAME_PITCH = 368, - TONICNAME_PITCH = 369, - CHORDMODIFIER_PITCH = 370, - DURATION_IDENTIFIER = 371, - FRACTION = 372, - IDENTIFIER = 373, - SCORE_IDENTIFIER = 374, - MUSIC_OUTPUT_DEF_IDENTIFIER = 375, - NUMBER_IDENTIFIER = 376, - REQUEST_IDENTIFIER = 377, - MUSIC_IDENTIFIER = 378, - TRANSLATOR_IDENTIFIER = 379, - STRING_IDENTIFIER = 380, - SCM_IDENTIFIER = 381, - RESTNAME = 382, - SKIPNAME = 383, - STRING_ = 384, - SCM_T = 385, - UNSIGNED = 386, - REAL = 387, - UNARY_MINUS = 388 - }; -#endif -/* Tokens. */ -#define DENEMO_MEASURES 258 -#define TEXT 259 -#define staffcontext 260 -#define voicecontext 261 -#define lyricscontext 262 -#define figuredbasscontext 263 -#define endcontext 264 -#define MUSICMODE 265 -#define TONEOPTION 266 -#define DYNAMICMARK 267 -#define AUTOCHANGE 268 -#define ALIAS 269 -#define APPLY 270 -#define ARPEGGIO 271 -#define DYNAMICSCRIPT 272 -#define ACCEPTS 273 -#define ALTERNATIVE 274 -#define BAR 275 -#define BREAK 276 -#define BREATHE 277 -#define CHORDMODIFIERS 278 -#define CHORDS 279 -#define CHAR_T 280 -#define CLEF_ 281 -#define CM_T 282 -#define CONSISTS 283 -#define SEQUENTIAL 284 -#define SIMULTANEOUS 285 -#define GROBDESCRIPTIONS 286 -#define CONSISTSEND 287 -#define DENIES 288 -#define DURATION 289 -#define EXTENDER 290 -#define FIGURES 291 -#define FIGURE_OPEN 292 -#define FIGURE_CLOSE 293 -#define FIGURE_BRACKET_CLOSE 294 -#define FIGURE_BRACKET_OPEN 295 -#define GLISSANDO 296 -#define GRACE 297 -#define HEADER 298 -#define HYPHEN 299 -#define IN_T 300 -#define INVALID 301 -#define KEY 302 -#define LYRICS 303 -#define MARK 304 -#define MARKUP 305 -#define MULTI_MEASURE_REST 306 -#define MIDI 307 -#define MM_T 308 -#define PITCH 309 -#define DEFAULT 310 -#define NAME 311 -#define PITCHNAMES 312 -#define NOTES 313 -#define PAPER 314 -#define PARTIAL_ 315 -#define PENALTY 316 -#define PROPERTY 317 -#define OVERRIDE 318 -#define SET 319 -#define REVERT 320 -#define PT_T 321 -#define RELATIVE 322 -#define REMOVE 323 -#define REPEAT 324 -#define ADDLYRICS 325 -#define PARTCOMBINE 326 -#define SCORE 327 -#define SCRIPT 328 -#define SKIP 329 -#define SPANREQUEST 330 -#define STYLESHEET 331 -#define COMMANDSPANREQUEST 332 -#define TEMPO 333 -#define OUTPUTPROPERTY 334 -#define TIME_T 335 -#define TIMES 336 -#define TRANSLATOR 337 -#define TRANSPOSE 338 -#define TYPE 339 -#define UNSET 340 -#define CONTEXT 341 -#define LAYOUT 342 -#define LYRICSTO 343 -#define LYRICMODE 344 -#define NEWCONTEXT 345 -#define LILYVERSION 346 -#define DRUM_PITCH 347 -#define MUSIC_FUNCTION 348 -#define REST 349 -#define DOUBLE_ANGLE_CLOSE 350 -#define DOUBLE_ANGLE_OPEN 351 -#define E_CHAR 352 -#define E_EXCLAMATION 353 -#define E_SMALLER 354 -#define E_BIGGER 355 -#define E_OPEN 356 -#define E_CLOSE 357 -#define E_LEFTSQUARE 358 -#define E_RIGHTSQUARE 359 -#define E_TILDE 360 -#define E_BACKSLASH 361 -#define CHORD_BASS 362 -#define CHORD_COLON 363 -#define CHORD_MINUS 364 -#define CHORD_CARET 365 -#define FIGURE_SPACE 366 -#define DIGIT 367 -#define NOTENAME_PITCH 368 -#define TONICNAME_PITCH 369 -#define CHORDMODIFIER_PITCH 370 -#define DURATION_IDENTIFIER 371 -#define FRACTION 372 -#define IDENTIFIER 373 -#define SCORE_IDENTIFIER 374 -#define MUSIC_OUTPUT_DEF_IDENTIFIER 375 -#define NUMBER_IDENTIFIER 376 -#define REQUEST_IDENTIFIER 377 -#define MUSIC_IDENTIFIER 378 -#define TRANSLATOR_IDENTIFIER 379 -#define STRING_IDENTIFIER 380 -#define SCM_IDENTIFIER 381 -#define RESTNAME 382 -#define SKIPNAME 383 -#define STRING_ 384 -#define SCM_T 385 -#define UNSIGNED 386 -#define REAL 387 -#define UNARY_MINUS 388 - - - - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE -#line 204 "./lyparser.y" -{ - nodemin minimal; - nodegeneric generic; - nodec c; - nodei i; - node2i t; - node4i f; - nodeb b; - noden n; - nodeid id; - - nodegstr gstr; - nodemus music; - noder r; - - - nodeglist *branch; - GList *scm; -} -/* Line 1489 of yacc.c. */ -#line 335 "lyparser.tab.h" - YYSTYPE; -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - -extern YYSTYPE lylval; - -#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED -typedef struct YYLTYPE -{ - int first_line; - int first_column; - int last_line; - int last_column; -} YYLTYPE; -# define yyltype YYLTYPE /* obsolescent; will be withdrawn */ -# define YYLTYPE_IS_DECLARED 1 -# define YYLTYPE_IS_TRIVIAL 1 -#endif - -extern YYLTYPE lylloc; diff -urN ../denemo-cvs/denemo/src/lyparser.y ./src/lyparser.y --- ../denemo-cvs/denemo/src/lyparser.y 2007-08-22 10:50:05.000000000 +0100 +++ ./src/lyparser.y 2007-09-13 17:32:46.000000000 +0100 @@ -1340,7 +1340,7 @@ addtone ( mud, $1.n.mid_c_offset, $1.n.enshift, 0);/*FIXME should be using $1.n directly */ -#define no ((note*)((((chord *)mud->object)->tones)->data)) +#define no ((note*)((((chord *)mud->object)->notes)->data)) if ($3.i % 2) { no->showaccidental = TRUE; @@ -2104,7 +2104,7 @@ appearing after a note - it turns it into a rest the duration is on the chord structure, the pitch on the note structure. - print *(note*)(((DenemoObject*)(((GList*)(((staff*)si->thescore->data)->measures->data))->data))->u.chordval.tones.data) + print *(note*)(((DenemoObject*)(((GList*)(((staff*)si->thescore->data)->measures->data))->data))->u.chordval.notes.data) */ DenemoObject *mud = newchord( $5.t1.a, $5.t1.b, 0); @@ -2117,7 +2117,7 @@ addtone( mud, $1.n.mid_c_offset, $1.n.enshift, 0);/*FIXME should be using $1.n directly */ -#define no ((note*)((((chord *)mud->object)->tones)->data)) +#define no ((note*)((((chord *)mud->object)->notes)->data)) if ($3.i % 2) { no->showaccidental = TRUE; ((chord *)mud->object)->hasanacc = TRUE; @@ -2144,14 +2144,14 @@ $$ = g_list_append (NULL,mud); } | RESTNAME optional_notemode_duration { - /* denemo wants a chord with no tones */ + /* denemo wants a chord with no notes */ DenemoObject *mud = newchord( $2.t1.a, $2.t1.b,0); mud->user_string = g_strconcat($1.user_string, $2.user_string, NULL); $$ = g_list_append(NULL,mud); } | SKIPNAME optional_notemode_duration { - /* denemo wants a chord with no tones */ + /* denemo wants a chord with no notes */ DenemoObject *mud = newchord( $2.t1.a, $2.t1.b,0); mud->type = SKIPNAME; mud->user_string = g_strconcat($1.user_string, $2.user_string, NULL); diff -urN ../denemo-cvs/denemo/src/measureops.c ./src/measureops.c --- ../denemo-cvs/denemo/src/measureops.c 2007-07-10 01:34:43.000000000 +0100 +++ ./src/measureops.c 2007-09-13 14:24:30.000000000 +0100 @@ -333,7 +333,7 @@ * staves that have a fixed stem direction inefficiently, but this was * the easiest way to add things to the existing code. */ -void +static void setsdir (objnode * starter, objnode * ender, gint beamgroup_sum, gint beamgroup_number, gint beamgroup_highest, gint beamgroup_lowest, gint clef, gint stem_directive) @@ -429,7 +429,7 @@ for (; curobjnode; prevobj = theobj, curobjnode = curobjnode->next) { theobj = (DenemoObject *) curobjnode->data; - isrest = (theobj->type == CHORD) && !((chord *) theobj->object)->tones; + isrest = (theobj->type == CHORD) && !((chord *) theobj->object)->notes; if (theobj->type != CHORD || isrest) { /* A non-chord or rest always breaks up a beam group */ @@ -514,7 +514,7 @@ { chordval = *(chord *) theobj->object; beamgroup_sum += chordval.sum_mid_c_offset; - beamgroup_number += g_list_length (chordval.tones); + beamgroup_number += g_list_length (chordval.notes); beamgroup_highest = MAX (beamgroup_highest, chordval.highestpitch); beamgroup_lowest = MIN (beamgroup_lowest, chordval.lowestpitch); } @@ -557,12 +557,12 @@ column_widths[i] = 0; } - /* First pass through tones: assign accidentals to numerical + /* First pass through notes: assign accidentals to numerical columns: 0 -> closest to noteheads, ACCS_TOO_CLOSE - 1 -> furthest away. Store this value in position_of_accidental, though it will be replaced fairly quickly. */ - for (current = g_list_last (chordval.tones); + for (current = g_list_last (chordval.notes); current; current = current->prev) { current_note = (note *) current->data; @@ -578,14 +578,14 @@ } } - /* Second pass: go through the tones again and replace + /* Second pass: go through the notes again and replace position_of_accidental with a more useful value. */ column_positions[0] = (column_widths[0] + additional_space + EXTRABACKOFF); for (i = 1; i < ACCS_TOO_CLOSE; i++) column_positions[i] = (column_positions[i - 1] + column_widths[i] + EXTRABACKOFF); - for (current = chordval.tones; current; current = current->next) + for (current = chordval.notes; current; current = current->next) { current_note = (note *) current->data; if (current_note->showaccidental) @@ -633,7 +633,7 @@ memset (contradicted, 0, SEVENGINTS); /* First loop through chord - looks for conflicting values * for the same note */ - for (curtone = ((chord *) theobj->object)->tones; curtone; + for (curtone = ((chord *) theobj->object)->notes; curtone; curtone = curtone->next) { thetone = (note *) curtone->data; @@ -653,7 +653,7 @@ } /* End first loop through chord */ /* Now loop through the chord again, setting note->showaccidental * appropriately */ - for (curtone = ((chord *) theobj->object)->tones; curtone; + for (curtone = ((chord *) theobj->object)->notes; curtone; curtone = curtone->next) { thetone = (note *) curtone->data; @@ -701,7 +701,7 @@ GList *curtone; note *thetone; - for (curtone = ((chord *) theobj->object)->tones; curtone; + for (curtone = ((chord *) theobj->object)->notes; curtone; curtone = curtone->next) { thetone = (note *) curtone->data; diff -urN ../denemo-cvs/denemo/src/midi.c ./src/midi.c --- ../denemo-cvs/denemo/src/midi.c 2007-01-24 19:44:26.000000000 +0000 +++ ./src/midi.c 2007-09-13 14:24:30.000000000 +0100 @@ -190,20 +190,20 @@ GList *tone; SEQ_START_TIMER (); /* - g_list_foreach (chord_to_play.tones, - (GFunc) playtone, chord_to_play.tones); + g_list_foreach (chord_to_play.notes, + (GFunc) playtone, chord_to_play.notes); */ - tone = chord_to_play.tones; + tone = chord_to_play.notes; while (tone) { - playtone (tone->data, chord_to_play.tones, prognum); + playtone (tone->data, chord_to_play.notes, prognum); tone = tone->next; } SEQ_DELTA_TIME (50); - g_list_foreach (chord_to_play.tones, - (GFunc) stoptone, chord_to_play.tones); + g_list_foreach (chord_to_play.notes, + (GFunc) stoptone, chord_to_play.notes); if (shouldremove) gtk_timeout_remove (ttag); ttag = gtk_timeout_add (1000, close_seqfd, NULL); diff -urN ../denemo-cvs/denemo/src/pitchentry.c ./src/pitchentry.c --- ../denemo-cvs/denemo/src/pitchentry.c 2007-08-23 15:15:57.000000000 +0100 +++ ./src/pitchentry.c 2007-09-13 15:00:47.000000000 +0100 @@ -17,7 +17,8 @@ static GtkWidget *PR_window = NULL;/* a top level window for controlling pitch-recognition entry. We do not create one of these for each view (ie each DenemoGUI object, ie each score) because there is only one audio input source being used, so we would have to cope with resource contention issues, there is just no point. */ -DenemoGUI *PR_gui; /* the gui for which the pitch recognition has been set up */ +static DenemoGUI *PR_gui; /* the gui for which the pitch recognition has been set up */ +static gboolean PR_insert; /* whether the notes should be inserted directly in the score or put in a list for controlled insertion */ static GtkWidget *PR_notelabel = NULL; static GtkWidget *PR_deviation = NULL; static guint PR_timer;// timer id @@ -269,6 +270,170 @@ +static GList *get_tones(GList *tone_store, gint measurenum) { + GList *g = g_list_nth(tone_store, measurenum); + if(g) + return g->data; + return NULL; +} + +/* apply the tones in the currentstaff to the notes of the currentstaff */ + +static void apply_tones(DenemoScore *si) { +#define curstaff ((DenemoStaff*)si->currentstaff->data) + GList *store; + gint measurenum; + store = (curstaff->tone_store); + measurenode *curmeasure = curstaff->measures; + GList *store_el; + for (measurenum=0;curmeasure; curmeasure = curmeasure->next, measurenum++) { + store_el = get_tones(store, measurenum); + objnode *curobj = curmeasure->data; + for (; curobj && store_el; curobj = curobj->next) + { + tone* thetone; + while(store_el && (thetone = (tone*)store_el->data) && + !thetone->valid) + store_el = store_el->next; + + DenemoObject *theobj = (DenemoObject *) curobj->data; + if(theobj->type == CHORD && ((chord*)theobj->object)->notes /* not a rest */) { + find_leftmost_staffcontext (curstaff, si); + if(thetone==NULL || store_el==NULL) + ((chord*)theobj->object)->tone_node = NULL; + else { + int dclef = curstaff->leftmost_clefcontext; + int mid_c_offset = thetone->step; //FIXME octave??? + ((chord*)theobj->object)->tone_node = store_el; + modify_note(((chord*)theobj->object)->notes->data, mid_c_offset, thetone->enshift, dclef); + ((chord *) theobj->object)->sum_mid_c_offset = mid_c_offset;//Damned difficult to track this down - will not work if there are >1 notes in chord + ((chord *) theobj->object)->highestpitch = mid_c_offset; + ((chord *) theobj->object)->highesty = + calculateheight (mid_c_offset, dclef); + ((chord *) theobj->object)->lowestpitch = mid_c_offset; + ((chord *) theobj->object)->lowesty = + calculateheight (mid_c_offset, dclef); + store_el = store_el->next; + } + } + } + showwhichaccidentals ((objnode *) si->currentmeasure->data, + si->curmeasurekey, si->curmeasureaccs); + } + g_print("the number of measures is %d\n", g_list_length(si->measurewidths)); + + + +} + + +/* + * enter_note_in_score + * enters the note FOUND in the score gui->si at octave OCTAVE steps above/below mid-c + */ +static void enter_note_in_score (DenemoGUI *gui, notepitch * found, gint octave) { + //printf("Cursor_y %d and staffletter = %d\n", gui->si->cursor_y, gui->si->staffletter_y); + gui->si->cursor_y = gui->si->staffletter_y = found->spec.step; + gui->si->cursor_y += 7*octave; + shiftcursor(gui, found->spec.step); + setenshift(gui->si, found->spec.alteration); + displayhelper (gui); +} + + + + + +static GList * put_tone(GList *store, gint measurenum, tone *thetone) { + // extend store if too small + gint i = measurenum + 1 - g_list_length(store); + for(;i>0;i--) { + store = g_list_append(store,NULL); + } + GList *g = g_list_nth(store, measurenum); + if(g) + g->data = g_list_append(g->data, thetone); + return store; +} + + +/* + * enter_tone_in_store + * enters the note FOUND as a tone in the tone store + */ +static void enter_tone_in_store (DenemoGUI *gui, notepitch * found, gint octave) { + tone *thetone = (tone*)g_malloc0(sizeof(tone)); + g_print("tone %p\n", thetone); + thetone->enshift = found->spec.alteration; + thetone->step = found->spec.step + 7*octave; + thetone->octave = octave; + thetone->valid = TRUE; +#define store (((DenemoStaff*)gui->si->currentstaff->data)->tone_store) + store = put_tone(store, gui->si->currentmeasurenum - 1, thetone); + apply_tones(gui->si); + displayhelper (gui); + /* gtk_widget_draw(gui->scorearea, NULL); */ +#undef store +} + + +static void clear_tone_nodes(DenemoGUI *gui ) { + // FIXME menory leak, free the curstaff->tone_store + DenemoScore *si = gui->si; +#define curstaff ((DenemoStaff*)si->currentstaff->data) + measurenode *curmeasure; + for (curmeasure = curstaff->measures;curmeasure; curmeasure = curmeasure->next) { + objnode *curobj = curmeasure->data; + for (; curobj; curobj = curobj->next) + { + DenemoObject *theobj = (DenemoObject *) curobj->data; + if(theobj->type == CHORD) { + ((chord*)theobj->object)->tone_node = NULL; + } + } + } +} + +static void free_tones(GList *tones) { + if(tones){ + g_list_foreach(tones,freeit,NULL); + g_list_free(tones); + } +} + + // clear gui->si->currentstaff->data->tone_store +static void clear_tone_store(GtkButton *button, DenemoGUI *gui ) { +#define store (((DenemoStaff*)gui->si->currentstaff->data)->tone_store) + + g_list_foreach (store, free_tones, NULL); + clear_tone_nodes(gui); + g_list_free(store); + store = NULL; +#undef store + displayhelper(gui); +} + + +gboolean delete_tone(DenemoScore *si, chord *thechord) { + GList *tone_node = thechord->tone_node; + if(tone_node) { + ((tone*)tone_node->data)->valid = FALSE; + thechord->tone_node = NULL; + apply_tones(si);// FIXME applies to whole of staff rather than measure + displayhelper (PR_gui); + return TRUE; + } else { + return FALSE; + } + +} + + + +static void apply_tone_store(GtkButton *button, DenemoGUI *gui ) { + apply_tones(gui->si); + displayhelper (gui); +} /* return note for the passed pitch, or NULL if not a good note; * @param pitch, the pitch being enquired about @@ -304,7 +469,7 @@ } /* look for a new note played into audio input, if - present insert it into the score */ + present insert it into the score/store */ gint pitchentry(DenemoGUI *gui) { static gint last_step=-1, last_alteration, last_octave; if(PR_window==NULL) @@ -316,7 +481,6 @@ temperament *t = (temperament*)PR_temperament; gint octave; gdouble note = get_pitch(); - static guint gap = 0; note *= transposition_required; if((notelowest_pitch)) @@ -360,28 +524,15 @@ //printf("Enter the score area to insert notes!"); return TRUE; } - + // Enter the note in the score - - //printf("Cursor_y %d and staffletter = %d\n", gui->si->cursor_y, gui->si->staffletter_y); - gui->si->cursor_y = gui->si->staffletter_y = found->spec.step; - gui->si->cursor_y += 7*octave; - shiftcursor(gui, found->spec.step); - setenshift(gui->si, found->spec.alteration); - displayhelper (gui); - gap = 0; + if(PR_insert) + enter_note_in_score(gui, found, octave); + else + enter_tone_in_store(gui, found, octave); }//note found } -#if 0 - else { - gap++; - printf("%d\n",gap); - if(gap>10) - gap=0, - last_step = -1; - } -#endif return TRUE; } @@ -466,12 +617,23 @@ } static void change_timer_rate(GtkSpinButton *widget, DenemoGUI *gui){ PR_time = (guint)gtk_spin_button_get_value(widget); - start_pitch_recognition(gui); + start_pitch_recognition(gui);//FIXME do not call the whole of start_pitch_recognition, just the timer setting bit??? } +static void toggle_insert(GtkButton *button) { + // switch the button to read Collect Notes/Insert Notes + // toggle PR_insert to show where the notes detected should go + PR_insert = !PR_insert; + +} + static void create_pitch_recognition_window(DenemoGUI *gui) { + GtkWidget *hbox, *hbox2; + GtkWidget *button; + GtkWidget *frame; + GtkWidget *label; if(PR_window) { g_warning("unexpected call"); return; @@ -486,12 +648,40 @@ gtk_container_border_width (GTK_CONTAINER (main_vbox), 1); gtk_container_add (GTK_CONTAINER (PR_window), main_vbox); - GtkWidget *frame = gtk_frame_new( "Enharmonic selection"); + frame = gtk_frame_new( "Mode"); gtk_container_add (GTK_CONTAINER (main_vbox), frame); - GtkWidget *hbox = gtk_hbox_new (FALSE, 1); + hbox = gtk_hbox_new (FALSE, 1); gtk_container_add (GTK_CONTAINER (frame), hbox); - GtkWidget *label = gtk_label_new(""); - GtkWidget *button = gtk_button_new_with_label("flatten"); + frame = gtk_frame_new( "Overlay Pitches"); + gtk_container_add (GTK_CONTAINER (hbox), frame); + hbox2 = gtk_hbox_new (FALSE, 1); + + gtk_container_add (GTK_CONTAINER (frame), hbox2); + GtkWidget *radio_button = gtk_radio_button_new_with_label(NULL, "Overlay Pitches"); + gtk_box_pack_start (GTK_BOX (hbox2), radio_button, + TRUE, TRUE, 0); + g_signal_connect (G_OBJECT (radio_button), "toggled", + G_CALLBACK (toggle_insert), NULL); + + button = gtk_button_new_with_label("Clear"); + gtk_box_pack_start (GTK_BOX (hbox2), button, + TRUE, TRUE, 0); + g_signal_connect (G_OBJECT (button), "clicked", + G_CALLBACK (clear_tone_store), gui); + + + button = gtk_radio_button_new_with_label_from_widget(radio_button, "Insert Notes"); + gtk_box_pack_start (GTK_BOX (hbox), button, + TRUE, TRUE, 0);/* no need for callback */ + + + + frame = gtk_frame_new( "Enharmonic selection"); + gtk_container_add (GTK_CONTAINER (main_vbox), frame); + hbox = gtk_hbox_new (FALSE, 1); + gtk_container_add (GTK_CONTAINER (frame), hbox); + label = gtk_label_new(""); + button = gtk_button_new_with_label("flatten"); gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0); g_signal_connect (G_OBJECT (button), "clicked", @@ -527,7 +717,7 @@ hbox = gtk_hbox_new (FALSE, 1); gtk_container_add (GTK_CONTAINER (frame), hbox); - GtkWidget *hbox2 = gtk_hbox_new (FALSE, 1); + hbox2 = gtk_hbox_new (FALSE, 1); gtk_box_pack_start (GTK_BOX (hbox), hbox2, TRUE, TRUE, 0); label = gtk_label_new("Silence"); @@ -666,19 +856,7 @@ } -#if 0 -static void read_PRkeymap(DenemoGUI *gui) { - PR_oldkeymap = gui->prefs->the_keymap; - if(PR_rhythmkeymap==NULL) - PR_rhythmkeymap = - gui->prefs->the_keymap = create_keymap ("RhythmKeymaprc"); - gui->prefs->the_keymap = PR_rhythmkeymap; - - gchar *localrc = g_build_filename (locatedotdenemo (), "PRkeymaprc", NULL); - load_xml_keymap (localrc, gui->prefs->the_keymap); -} -#endif gint setup_pitch_recognition(DenemoGUI *gui){ if(PR_window) { gtk_window_present(GTK_WINDOW(PR_window)); @@ -725,16 +903,18 @@ void start_pitch_recognition(DenemoGUI *gui) { if(PR_timer) g_source_remove(PR_timer); - PR_timer = g_timeout_add (PR_time, (GSourceFunc)pitchentry, gui); - if(PR_timer==0) - g_error("Timer id 0 - if valid the code needs re-writing (documentation not clear)"); - gtk_widget_add_events (gui->scorearea, GDK_LEAVE_NOTIFY_MASK | GDK_ENTER_NOTIFY_MASK); - PR_enter = g_signal_connect (G_OBJECT (gui->scorearea), "enter-notify-event", - G_CALLBACK (scorearea_set_active), (gpointer)gui); - PR_leave = g_signal_connect (G_OBJECT (gui->scorearea), "leave-notify-event", - G_CALLBACK (scorearea_set_inactive), (gpointer)gui); - PR_gui = gui; + + PR_timer = g_timeout_add (PR_time, (GSourceFunc)pitchentry, gui); + if(PR_timer==0) + g_error("Timer id 0 - if valid the code needs re-writing (documentation not clear)"); + gtk_widget_add_events (gui->scorearea, GDK_LEAVE_NOTIFY_MASK | GDK_ENTER_NOTIFY_MASK); + PR_enter = g_signal_connect (G_OBJECT (gui->scorearea), "enter-notify-event", + G_CALLBACK (scorearea_set_active), (gpointer)gui); + PR_leave = g_signal_connect (G_OBJECT (gui->scorearea), "leave-notify-event", + G_CALLBACK (scorearea_set_inactive), (gpointer)gui); + PR_gui = gui; } + gboolean pitch_recognition_system_active(void) { return PR_window!=NULL; } diff -urN ../denemo-cvs/denemo/src/pitchentry.h ./src/pitchentry.h --- ../denemo-cvs/denemo/src/pitchentry.h 2007-08-23 15:15:57.000000000 +0100 +++ ./src/pitchentry.h 2007-09-13 14:24:29.000000000 +0100 @@ -20,4 +20,5 @@ gint stop_pitch_recognition(void); void start_pitch_recognition(DenemoGUI *gui); gboolean pitch_recognition_system_active(void); +gboolean delete_tone(DenemoGUI *gui, chord *thechord); #endif //PITCHENTRY_H diff -urN ../denemo-cvs/denemo/src/utils.c ./src/utils.c --- ../denemo-cvs/denemo/src/utils.c 2007-08-22 10:50:05.000000000 +0100 +++ ./src/utils.c 2007-09-13 14:24:30.000000000 +0100 @@ -174,7 +174,7 @@ chordval = *(chord *) theobj->object; baseduration = chordval.baseduration; headtype = MIN (baseduration, 2); - if (chordval.tones) + if (chordval.notes) { /* if (theobj->isstart_beamgroup && theobj->isend_beamgroup && chordval.is_stemup) @@ -200,7 +200,7 @@ theobj->minpixelsalloted += 6; theobj->space_before = 0; if (chordval.hasanacc) - for (tnode = chordval.tones; tnode; tnode = tnode->next) + for (tnode = chordval.notes; tnode; tnode = tnode->next) { thetone = (note *) tnode->data; if (thetone->showaccidental) @@ -605,3 +605,10 @@ #endif /* not G_OS_WIN32 */ g_spawn_close_pid (pid); } + +/* markup the passed string to be in the denemo music font +* caller must free the returned string +*/ +gchar * music_font(gchar *str) { + return g_strdup_printf("%s", str); +} diff -urN ../denemo-cvs/denemo/src/utils.h ./src/utils.h --- ../denemo-cvs/denemo/src/utils.h 2007-01-24 19:44:26.000000000 +0000 +++ ./src/utils.h 2007-09-13 14:24:30.000000000 +0100 @@ -108,5 +108,7 @@ void kill_process (GPid pid); +gchar * music_font(gchar *str); + #endif /* UTILS_H */ diff -urN ../denemo-cvs/denemo/src/view.c ./src/view.c --- ../denemo-cvs/denemo/src/view.c 2007-08-22 10:50:05.000000000 +0100 +++ ./src/view.c 2007-09-13 16:58:02.000000000 +0100 @@ -329,15 +329,21 @@ */ void select_rhythm_pattern(GtkToolButton *toolbutton, RhythmPattern *r) { +#define CURRP ((RhythmPattern *)r->gui->si->currhythm->data) + if(r->gui->si->currhythm && CURRP) + unhighlight_rhythm(CURRP); + r->gui->si->currhythm = g_list_find(r->gui->si->rhythms, r); r->gui->si->rstep = r->rsteps; #define g (r->gui->si->rstep) + if(((RhythmElement*)g->data)->icon) { - gtk_tool_button_set_label(((RhythmPattern *)r->gui->si->currhythm->data)->button,((RhythmElement*)g->data)->icon); + GtkWidget *label = LABEL(CURRP->button); + gtk_label_set_markup(GTK_LABEL(label),((RhythmElement*)g->data)->icon); } - gtk_widget_set_state(GTK_WIDGET(((RhythmPattern *)r->gui->si->currhythm->data)->button), GTK_STATE_ACTIVE); - g_print("selected active\n"); - + highlight_rhythm(CURRP); + +#undef CURRP #undef g } @@ -394,8 +400,6 @@ if(r->rsteps==NULL){ last_data = NULL; } - - #define GDK_BackSpace 0xFF08 /* to save including gdkkeysyms.h */ if (event->key.keyval == GDK_BackSpace) { if(r->rsteps) { @@ -478,11 +482,9 @@ entry = gtk_entry_new (); + gtk_widget_modify_font(entry, pango_font_description_from_string ("Denemo 14")); g_signal_connect (GTK_OBJECT (entry), "key_press_event", G_CALLBACK (translate_rhythm), r); - - - gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), entry, TRUE, TRUE, 0); gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE); @@ -494,21 +496,24 @@ if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) { - const gchar *pattern = gtk_entry_get_text (GTK_ENTRY (entry)); + gchar *pattern = (gchar*)gtk_entry_get_text (GTK_ENTRY (entry));//FIXME free pattern? + gchar *labelstr = music_font(pattern); g_print("rsteps is %p entry is %s\n", r->rsteps, pattern); - gtk_tool_button_set_label(r->button,pattern); + GtkWidget *label = LABEL(r->button); + gtk_label_set_markup(GTK_LABEL(label), labelstr); + g_free(labelstr); /* fill the r->rsteps with icons for each step */ GList *g; gint i; RhythmElement *el; for(g=r->rsteps, i=0;g;g=g->next, i+=g_list_length(el->functions)) { el = (RhythmElement*)g->data; - +#define highlight(c) ((c)+20) gchar *fmt; - fmt = g_strdup_printf("%%.%ds<%c>%s",i,*(pattern+i),pattern+i+1); - g_printf("format string %s\n", fmt); - el->icon = g_strdup_printf(fmt, pattern); - g_print("el->icon = %s\n", el->icon); + fmt = g_strdup_printf("%%.%ds%c%s",i,highlight(*(pattern+i)),pattern+i+1); + //g_printf("format string %s\n", fmt); + el->icon = music_font(g_strdup_printf(fmt, pattern));//FIXME memory leak + //g_print("el->icon = %s\n", el->icon); g_free(fmt); } @@ -523,6 +528,21 @@ gtk_widget_destroy (dialog); } +static void color_rhythm_button(RhythmPattern *r, const gchar *color) { + + GdkColor thecolor; + gdk_color_parse (color, &thecolor); + gtk_widget_modify_bg (gtk_tool_button_get_label_widget(GTK_TOOL_BUTTON(r->button)), GTK_STATE_NORMAL, &thecolor); + +} +void highlight_rhythm(RhythmPattern *r) { + color_rhythm_button(r, "green"); +} + +void unhighlight_rhythm(RhythmPattern *r) { + color_rhythm_button(r, "gray"); +} + /* * take user input for a rhythmic pattern to be placed * as a button on the rhythm toolbar @@ -530,47 +550,43 @@ static void create_rhythm_cb (GtkAction * action, DenemoGUI * gui) { - -GSList*g = gtk_action_get_proxies(action); - -#if 0 - if(g && g->data) { - static GtkWidget *label_widget; - if(label_widget==NULL) { - label_widget = gtk_label_new(NULL); - gtk_tool_button_set_label_widget(g->data, label_widget); - gtk_widget_show(label_widget); - } - if(label_widget){ - gtk_label_set_markup (GTK_LABEL (label_widget),"Create a rhythm"); - } - } -#endif - if(g && g->data) { - /* make one rhythm */ - RhythmPattern *r = (RhythmPattern*)g_malloc0(sizeof(RhythmPattern)); - r->gui = gui; - GtkToolButton *button = (GtkToolButton *)gtk_tool_button_new(NULL, NULL); - r->button = button; - rhythm_edit(gui, r); - if(r->rsteps==NULL) - { - gtk_widget_destroy(GTK_WIDGET(button)); - g_free(r); - } else - { - GtkWidget *toolbar = gtk_widget_get_parent(g->data); - gtk_toolbar_insert(GTK_TOOLBAR(toolbar), GTK_TOOL_ITEM(button), -1); - gtk_widget_show(GTK_WIDGET(button)); - gui->si->rstep = r->rsteps; - gui->si->rhythms = g_list_append(gui->si->rhythms , r); - gui->si->currhythm = g_list_last(gui->si->rhythms); - //gui->si->rhythmicsubmode = (gboolean)gui->si->rhythms; - g_signal_connect (G_OBJECT (button), "clicked", - G_CALLBACK (select_rhythm_pattern), (gpointer)r); - } - } - + GSList*g = gtk_action_get_proxies(action); + if(g && g->data) { + /* make one rhythm */ + RhythmPattern *r = (RhythmPattern*)g_malloc0(sizeof(RhythmPattern)); + r->gui = gui; + GtkToolButton *button = (GtkToolButton *)gtk_tool_button_new(NULL, NULL); + /* gtk_button_set_relief(button, GTK_RELIEF_HALF); */ + GtkWidget *label = gtk_label_new(NULL); + gtk_label_set_use_markup (GTK_LABEL (label), TRUE); + GtkWidget *ev = gtk_event_box_new(); + + gtk_container_add (GTK_CONTAINER(ev), label); + gtk_tool_button_set_label_widget (button, ev); + r->button = button; + rhythm_edit(gui, r); + if(r->rsteps==NULL) + { + gtk_widget_destroy(GTK_WIDGET(button)); + g_free(r); + } else + { + GtkWidget *toolbar = gtk_widget_get_parent(g->data); + gtk_toolbar_insert(GTK_TOOLBAR(toolbar), GTK_TOOL_ITEM(button), -1); + gtk_widget_show_all(GTK_WIDGET(button)); + gui->si->rstep = r->rsteps; + gui->si->rhythms = g_list_append(gui->si->rhythms , r); + + if(gui->si->currhythm) + unhighlight_rhythm((RhythmPattern *)gui->si->currhythm->data); + gui->si->currhythm = g_list_last(gui->si->rhythms); + highlight_rhythm((RhythmPattern *)gui->si->currhythm->data); + + //gui->si->rhythmicsubmode = (gboolean)gui->si->rhythms; + g_signal_connect (G_OBJECT (button), "clicked", + G_CALLBACK (select_rhythm_pattern), (gpointer)r); + } + } } /* * delete a rhythmic pattern and its button @@ -600,8 +616,10 @@ if(gui->si->currhythm == NULL) gui->si->rstep = NULL;/* gui->si->rhythmicsubmode = FALSE */ - else + else { + highlight_rhythm(gui->si->currhythm->data); gui->si->rstep = ((RhythmPattern *)gui->si->currhythm->data)->rsteps; + } } @@ -905,7 +923,7 @@ { if(rhythm_keymap==NULL){ - rhythm_keymap = create_keymap ("RhythmKeymaprc"); + rhythm_keymap = create_keymap ("Rhythm.keymaprc"); //printf("CREATED keymap\n"); } gui->prefs->the_keymap = rhythm_keymap; diff -urN ../denemo-cvs/denemo/src/view.h ./src/view.h --- ../denemo-cvs/denemo/src/view.h 2007-07-10 01:34:43.000000000 +0100 +++ ./src/view.h 2007-09-13 14:24:30.000000000 +0100 @@ -61,4 +61,13 @@ DenemoGUI *gui; GtkWidget *menu; }; + + +/* tool_buttons cannot be visually separated from the toolbar, which is ok for icons but not so good for pure text; to separate them we put the label of the tool_button into an event box and decorate that. This macro gets the label out. */ +#define LABEL(a) (gtk_bin_get_child(GTK_BIN(gtk_tool_button_get_label_widget((a))))) + +void highlight_rhythm(RhythmPattern *r); +void unhighlight_rhythm(RhythmPattern *r); + + #endif