diff -urN ../../denemo-cvs/denemo/src/denemoui.xml ./src/denemoui.xml --- ../../denemo-cvs/denemo/src/denemoui.xml 2007-09-25 18:49:06.000000000 +0100 +++ ./src/denemoui.xml 2007-10-12 18:12:12.000000000 +0100 @@ -10,6 +10,7 @@ + @@ -44,17 +45,20 @@ --> + - - + + + + - - + + @@ -160,7 +164,7 @@ - + diff -urN ../../denemo-cvs/denemo/src/pitchentry.c ./src/pitchentry.c --- ../../denemo-cvs/denemo/src/pitchentry.c 2007-09-26 13:06:55.000000000 +0100 +++ ./src/pitchentry.c 2007-10-12 18:14:26.000000000 +0100 @@ -302,18 +302,16 @@ store = (curstaff->tone_store); measurenode *curmeasure = curstaff->measures; GList *store_el = NULL; - + // move cursor to start of current measure + si->currentobject = (objnode *) si->currentmeasure->data; + si->cursor_x = 0; + si->cursor_appending = !(gboolean)si->currentobject; + //calcmarkboundaries (si); measurenum = si->currentmeasurenum - 1; curmeasure = si->currentmeasure; if(curmeasure) { store_el = get_tones(store, measurenum); objnode *curobj = curmeasure->data; - - // start at currentobject - while(curobj!=si->currentobject) - curobj = curobj->next; - - while (curobj) { tone* thetone; @@ -333,7 +331,10 @@ ((chord*)theobj->object)->tone_node = store_el; modify_note((chord*)theobj->object, mid_c_offset, thetone->enshift, dclef); tone_stored=TRUE; + if(!si->cursor_appending) + cursorright(PR_gui); store_el = store_el->next; + }// tone available }// note available /* skip over non notes */ @@ -341,15 +342,10 @@ curobj = curobj->next; if(curobj) theobj = (DenemoObject *) curobj->data; - } - while(curobj && (theobj->type != CHORD || ((chord*)theobj->object)->notes==NULL)); - - + } while(curobj && + (theobj->type != CHORD || ((chord*)theobj->object)->notes==NULL)); if(tone_stored && curobj==NULL && curmeasure->next) ret = TRUE; - - - }// while objects in measure if(store_el && !PR_continuous) sound_click();//extra tones in measure @@ -403,19 +399,13 @@ thetone->octave = octave; thetone->valid = TRUE; #define store (((DenemoStaff*)gui->si->currentstaff->data)->tone_store) - /* if this measure has tones, but not on the currentobject then clear the tones, otherwise - the one being stored will not apply to the currentobject */ - if(gui->si->currentobject && !((chord*)((DenemoObject *)gui->si->currentobject->data)->object)->tone_node && store && g_list_nth(store,gui->si->currentmeasurenum - 1) && g_list_nth(store,gui->si->currentmeasurenum - 1)->data) - clear_tones_currentmeasure(NULL, gui); store = put_tone(store, gui->si->currentmeasurenum - 1, thetone); nextmeasure = apply_tones(gui->si); displayhelper (gui); if(PR_continuous && nextmeasure) { sound_click(); measureright(gui); - } - - /* gtk_widget_draw(gui->scorearea, NULL); */ + } #undef store } @@ -425,7 +415,6 @@ static void clear_tone_nodes(DenemoGUI *gui ) { DenemoScore *si = gui->si; DenemoStaff* curstaff = ((DenemoStaff*)si->currentstaff->data); - measurenode *curmeasure; for (curmeasure = curstaff->measures;curmeasure; curmeasure = curmeasure->next) { objnode *curobj = curmeasure->data; @@ -455,6 +444,7 @@ store = NULL; #undef store displayhelper(gui); + switch_back_to_main_window(); } /* @@ -489,23 +479,16 @@ GList *tone_node = thechord->tone_node; if(tone_node) { ((tone*)tone_node->data)->valid = FALSE; - thechord->tone_node = NULL; - /* move cursor back to where tone overlay starts, so that the overlay is placed on the same notes as before */ - gint leftshifts = 0; - while(si->currentobject->prev) { - cursorleft(PR_gui); - leftshifts++; - DenemoObject *theobj = (DenemoObject *)si->currentobject->data; - if((theobj->type == CHORD) && (((chord*)theobj->object)->notes!=NULL) && (((chord*)theobj->object)->tone_node == NULL)) { - cursorright(PR_gui); - leftshifts--; - break; - } - } + objnode *keep = si->currentobject; + gint keepx = si->cursor_x; + gboolean keepa = si->cursor_appending; apply_tones(si); /*restore the position of the cursor before the delete of the tone */ - while(leftshifts--) - cursorright(PR_gui); + si->currentobject = keep; + si->cursor_x = keepx; + si->cursor_appending = keepa; + calcmarkboundaries (si); + displayhelper (PR_gui); return TRUE; } else { @@ -726,10 +709,11 @@ switch_back_to_main_window(); } - -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 + // toggle PR_insert to show where the notes detected should go, and start correct entry mode +static void toggle_insert(GtkButton *button, DenemoGUI *gui) { + GtkAction *action; + action = gtk_ui_manager_get_action (gui->ui_manager, PR_insert?"/MainMenu/EntryMenu/TogglePitchless": "/MainMenu/EntryMenu/Replace"); + gtk_action_activate(action); PR_insert = !PR_insert; switch_back_to_main_window(); } @@ -773,7 +757,7 @@ 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); + G_CALLBACK (toggle_insert), gui); button = gtk_button_new_with_label("Clear"); gtk_box_pack_start (GTK_BOX (hbox2), button, @@ -801,10 +785,6 @@ gtk_box_pack_start (GTK_BOX (hbox2), spinner, TRUE, TRUE, 0); g_signal_connect (G_OBJECT (spinner), "value-changed", G_CALLBACK (change_click_volume), NULL); - - - - button = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(radio_button), "Insert Notes"); gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);/* no need for callback */ diff -urN ../../denemo-cvs/denemo/src/prefdialog.c ./src/prefdialog.c --- ../../denemo-cvs/denemo/src/prefdialog.c 2007-01-24 19:44:26.000000000 +0000 +++ ./src/prefdialog.c 2007-10-12 18:15:27.000000000 +0100 @@ -30,6 +30,7 @@ GtkWidget *checkclone; GtkWidget *checkautosave; GtkWidget *checknotationpalette; + GtkWidget *checkrhythmpalette; GtkWidget *checkarticulationpalette; GtkWidget *autosaveentry; GtkWidget *browserentry; @@ -133,6 +134,9 @@ prefs->notation_palette = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (cbdata->checknotationpalette)); + prefs->rhythm_palette = + gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON + (cbdata->checkrhythmpalette)); prefs->saveparts = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (cbdata->checkautosaveparts)); @@ -161,6 +165,7 @@ GtkWidget *texteditor; GtkWidget *denemopath; GtkWidget *checknotationpalette; + GtkWidget *checkrhythmpalette; GtkWidget *checkarticulationpalette; GtkWidget *notebook; GtkWidget *hbox; @@ -191,7 +196,7 @@ /* * Note entry settings */ - table = gtk_table_new (9, 2, FALSE); + table = gtk_table_new (13, 2, FALSE); gtk_container_set_border_width (GTK_CONTAINER (table), 12); gtk_table_set_row_spacings (GTK_TABLE (table), 8); gtk_table_set_col_spacings (GTK_TABLE (table), 8); @@ -230,7 +235,7 @@ (GtkAttachOptions) (0), 0, 0); checknotationpalette = - gtk_check_button_new_with_label (_("Display notataion toolbar")); + gtk_check_button_new_with_label (_("Display durations toolbar")); gtk_widget_set_sensitive (checknotationpalette, TRUE); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checknotationpalette), gui->prefs->notation_palette); @@ -247,8 +252,22 @@ (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); + + checkrhythmpalette = + gtk_check_button_new_with_label (_("Display rhythm pattern toolbar")); + gtk_widget_set_sensitive (checkrhythmpalette, TRUE); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkrhythmpalette), + gui->prefs->rhythm_palette); + gtk_table_attach (GTK_TABLE (table), checkrhythmpalette, 0, 2, 8, 9, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + + + + hbox = gtk_hbox_new (FALSE, 8); - gtk_table_attach (GTK_TABLE (table), hbox, 0, 2, 7, 8, + gtk_table_attach (GTK_TABLE (table), hbox, 0, 2, 10, 11, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); @@ -273,7 +292,7 @@ gtk_widget_set_sensitive (checkarticulationpalette, FALSE); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkautosaveparts), gui->prefs->saveparts); - gtk_table_attach(GTK_TABLE(table), checkautosaveparts, 0,2, 8,9, + gtk_table_attach(GTK_TABLE(table), checkautosaveparts, 0,2, 11,12, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0,0); /* @@ -440,6 +459,7 @@ cbdata.checkautosaveparts = checkautosaveparts; cbdata.checkarticulationpalette = checkarticulationpalette; cbdata.checknotationpalette = checknotationpalette; + cbdata.checkrhythmpalette = checkrhythmpalette; cbdata.checkclone = checkclone; cbdata.checkautosave = checkautosave; cbdata.autosaveentry = autosaveentry; diff -urN ../../denemo-cvs/denemo/src/prefops.c ./src/prefops.c --- ../../denemo-cvs/denemo/src/prefops.c 2007-08-22 10:50:05.000000000 +0100 +++ ./src/prefops.c 2007-10-12 18:15:58.000000000 +0100 @@ -111,8 +111,9 @@ ret->createclones = FALSE; ret->autosave = TRUE; ret->autosave_timeout = 5; - ret->notation_palette = FALSE; - ret->articulation_palette = FALSE; + ret->notation_palette = TRUE; + ret->articulation_palette = TRUE; + ret->rhythm_palette = TRUE; ret->history = g_queue_new (); /* Read values from systemwide preferences file */ @@ -332,6 +333,16 @@ xmlFree (tmp); } } + else if (0 == + xmlStrcmp (cur->name, (const xmlChar *) "rhythmpalette")) + { + xmlChar *tmp = xmlNodeListGetString (doc, cur->xmlChildrenNode, 1); + if(tmp) + { + prefs->rhythm_palette = atoi ((gchar *) tmp); + xmlFree (tmp); + } + } else if (0 == xmlStrcmp (cur->name, (const xmlChar *) "lilyversion")) { xmlChar *tmp = xmlNodeListGetString (doc, cur->xmlChildrenNode, 1); @@ -556,6 +567,8 @@ prefs->notation_palette); newXMLIntChild (child, (xmlChar *) "articulationpalette", prefs->articulation_palette); + newXMLIntChild (child, (xmlChar *) "rhythmpalette", + prefs->rhythm_palette); if (prefs->browser) xmlNewChild (child, NULL, (xmlChar *) "browser", (xmlChar *) prefs->browser->str);