diff -urN ../denemo-cvs/denemo/include/denemo/denemo_types.h denemo/include/denemo/denemo_types.h
--- ../denemo-cvs/denemo/include/denemo/denemo_types.h 2007-10-04 19:44:40.000000000 +0100
+++ denemo/include/denemo/denemo_types.h 2007-10-09 14:42:06.000000000 +0100
@@ -89,11 +89,15 @@
* Enumeration for Denemo's input mode
*/
typedef enum input_mode {
- INPUTNORMAL,
- INPUTREST,
- INPUTBLANK,
- REPLACE,
- TRAVERSE
+#define MODE_MASK (~(INPUTCLASSIC|INPUTEDIT|INPUTINSERT))
+ INPUTCLASSIC = 1<<0, /* classic mode */
+ INPUTEDIT = 1<<1, /* edit mode */
+ INPUTINSERT = 1<<2, /* insert mode */
+#define ENTRY_TYPE_MASK (~(INPUTNORMAL|INPUTREST|INPUTBLANK))
+ INPUTNORMAL = 1<<3, /* entry type notes */
+ INPUTREST = 1<<4, /* entry type rests */
+ INPUTBLANK = 1<<5,/* entry type non-printing rests */
+ TRAVERSE = 1<<6 /* read-only */
}input_mode;
/**
@@ -269,8 +273,8 @@
gboolean lilyentrystyle;
gboolean createclones;
gboolean articulation_palette; /**< This switch makes the articulation pallete visable */
- gboolean notation_palette; /**< This switch makes the notation pallete visable */
- gboolean rhythm_palette; /**< This option makes the rhythm pallete visable */
+ gboolean notation_palette; /**< This switch makes the duration toolbar visable */
+ gboolean rhythm_palette; /**< This option makes the rhythm toolbar visable */
gboolean saveparts; /**< Automatically save parts*/
gboolean autosave; /**< Auto save data */
gint autosave_timeout;
@@ -312,13 +316,6 @@
}LilypondHeaderInfo;
-typedef enum
-{
- RSM_OFF = 0,
- RSM_OVERLAY = 1<<0,
- RSM_RHYTHM = 1<<1
-
-} RhythmicSubmode;
typedef enum
{
@@ -464,8 +461,7 @@
* operation */
gint curmeasure_stem_directive;
- /* support for INPUTNORMAL sub mode RHYTMIC */
- RhythmicSubmode rhythmicsubmode;
+ /* support for rhythm patterns */
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 */
diff -urN ../denemo-cvs/denemo/src/commandfuncs.c denemo/src/commandfuncs.c
--- ../denemo-cvs/denemo/src/commandfuncs.c 2007-10-04 19:44:40.000000000 +0100
+++ denemo/src/commandfuncs.c 2007-10-09 14:43:49.000000000 +0100
@@ -43,7 +43,7 @@
* is easy to alternate rhythms.
*/
void nextrhythm(DenemoGUI *gui) {
- if(!gui->si->rhythmicsubmode)
+ if(!(gui->mode&(INPUTEDIT)))
return;
if(!gui->si->rhythms)
return;
@@ -456,7 +456,8 @@
gui->si->staffletter_y = note_value;
gui->si->cursor_y = jumpcursor (gui->si->cursor_y, oldstaffletter_y,
gui->si->staffletter_y);
- if((gui->si->rhythmicsubmode & RSM_OVERLAY) && gui->si->currentobject) {
+ /* in edit mode edit the current note name */
+ if((gui->mode & INPUTEDIT) && gui->si->currentobject) {
DenemoObject *theobj = (DenemoObject *)(gui->si->currentobject->data);
if(theobj->type == CHORD && ((chord*)theobj->object)->notes) {
DenemoStaff *curstaff = ((DenemoStaff*)gui->si->currentstaff->data);
@@ -468,9 +469,9 @@
gui->si->curmeasurekey, gui->si->curmeasureaccs);
}
} else
- /* in rhythmicsubmode we insert a note using the next step of the rhythm pattern */
+ /* in INSERT or EDIT mode we insert a note using the next step of the rhythm pattern */
#define g (gui->si->rstep)
- if(gui->si->rhythmicsubmode && g) {
+ if((gui->mode&(INPUTEDIT|INPUTINSERT)) && g) {
GList *start = g;
GList *h;
do {
@@ -495,18 +496,23 @@
#undef g
}
+
void
insert_rhythm_pattern(DenemoGUI *gui) {
#define g (gui->si->rstep)
- if(gui->si->rhythmicsubmode && g) {
+ if((gui->mode&(INPUTEDIT)) && 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;
+ gui->si->cursoroffend = FALSE;
+ if(!code_is_a_duration(modifier_code(h->data)))
+ cursorleft(gui);
((GtkFunction)h->data)(gui);
+ if(!code_is_a_duration(modifier_code(h->data)))
+ cursorright(gui);
displayhelper(gui);
}
h = ((RhythmElement*)g->data)->functions;
@@ -583,6 +589,12 @@
int prognum;
DenemoStaff *curstaffstruct;
+ if((mode & INPUTEDIT) && !si->cursor_appending) {
+ changeduration(si, duration);
+ return;
+ }
+
+
/* First, check to see if the insertion'll cause the cursor to
* jump to the next measure. (Denemo will implicitly create it
* if it doesn't exist already.) */
@@ -594,13 +606,13 @@
/* Now actually create the chord */
mudela_obj_new = newchord (duration, 0, 0);
- if (mode == INPUTBLANK && (rest != TRUE))
+ if ( (mode & INPUTBLANK) && (rest != TRUE))
{
addtone (mudela_obj_new, si->cursor_y,
si->cursoraccs[si->staffletter_y], si->cursorclef);
mudela_obj_new->isinvisible = TRUE;
}
- else if (mode == INPUTNORMAL && (rest != TRUE))
+ else if ((mode & INPUTNORMAL) && (rest != TRUE))
addtone (mudela_obj_new, si->cursor_y, si->cursoraccs[si->staffletter_y],
si->cursorclef);
@@ -714,11 +726,11 @@
}
/**
- * Change a tone either in a chord or individual note
- * alternatively remove it from a chord
- *
+ * If REMOVE delete the note closest to si->cursor_y in a ~si->currentobject
+ * else add a tone at si->cursor_y to the ~si->currentobject
+ * FIXME ~si->currentobject in this comment means the thing gotten by the macro declaremudelaobj. This macro is a horrible hack induced by trying to be clever with tuplets - enforcing pairing of begin/end. tonechange
* @param si pointer to the scoreinfo structure
- * @param remove whether to remove tone or not
+ * @param remove whether to remove note or not
*/
void
tonechange (DenemoScore * si, gboolean remove)
diff -urN ../denemo-cvs/denemo/src/denemoui.xml denemo/src/denemoui.xml
--- ../denemo-cvs/denemo/src/denemoui.xml 2007-10-04 19:44:40.000000000 +0100
+++ denemo/src/denemoui.xml 2007-10-06 17:11:43.000000000 +0100
@@ -10,6 +10,7 @@
+
@@ -44,17 +45,20 @@
-->