[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Denemo-devel] deletescore()
From: |
Jeremiah Benham |
Subject: |
[Denemo-devel] deletescore() |
Date: |
Thu, 17 Feb 2011 15:07:52 -0600 |
I was looking through the code file.c and I noticed this function
deletescore on line 1162. importMidi use to call this in order to
replace the currnent movement. It was effective at doing this. When I
looked at the code the comments did not match up with what the function
was actually doing. The comments say that it does this:
/**
* Delete the movements of the given score and create a new one
* with one movement and empty music data, no title
* This is the action for the d-New command
*/
It does NOT delete all the movements. It deletes the current movement
only.
This is function is called here:
file.c: //deletescore (NULL, gui);
file.c: deletescore(NULL, gui);
file.c: deletescore(NULL, gui);
file.c:deletescore (GtkWidget * widget, DenemoGUI * gui)
lyparser.c: deletescore(NULL, Denemo.gui);
scoreops.c: deletescore (NULL, gui);
scorewizard.c: deletescore (NULL, gui);
scorewizard.c: deletescore (NULL, gui);
view.c: // deletescore(NULL, gui);
So perhaps this function needs to be renamed and/or the comments
rewritten.
The reason I am bringing this up is because in attempt to unify the
load/import behavior I saw this and then I looked at importXML. This is
a few things that it calls when opened with REPLACE_SCORE:
free_movements(gui);
deleteSchemeText();
later it calls (if ImportType is REPLACE_SCORE):
free_score (gui);
if(gui->movements)
g_list_free(gui->movements);/*FIXME free all the other si */
gui->movements = NULL;
init_score(gui->si, gui);
gui->si->currentstaffnum = 0;
ret = parseMovement(rootElem, ns, gui, type);
I want to clean some of this up. Should I rename deletescore or should
newly imported files use something else when ImportType is
REPLACE_SCORE. I was considering adding a boolean to the functions
arguments so that I can toggle force or not. If force then no
confirmation pop up will occur.
Jeremiah
- [Denemo-devel] deletescore(),
Jeremiah Benham <=