[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Denemo-devel] copying the chord directives
From: |
Jeremiah Benham |
Subject: |
Re: [Denemo-devel] copying the chord directives |
Date: |
Fri, 17 Jul 2009 08:20:04 -0500 |
On Fri, 17 Jul 2009 10:10:38 +0100
Richard Shann <address@hidden> wrote:
> Jeremiah,
> I think you have introduced some bad code
>
> < thechord->directives = g_list_copy(g);
>
> if you are just adding and deleting notes there is no need to do
> anything about the directives attached to the chord, they won't be
> touched.
> It is those attached to the note you might want to preserve. But even
> in this case don't copy them, just detach them and re-connect to the
> new note.
> note->directives = NULL
> detaches a list from note (so that it doesn't get deleted when the
> note gets deleted) and then you can re-attach it to the new note
>
> newnote->directives = the value of note->directives before you
> detached it.
>
Yeah. I found the email you mentioned. You recommended doing this:
GList *g = ;
note->directives = NULL;
delete_note_from_chord(note);
add_note_to_chord(newnote);
newnote->directives = g;
> Is it clear - I sketched it in the earlier mail?
I removed any directive copying for the d-PutNoteName because it didn't
need it. It is but I was deleting all the notes first then putting new
ones up to replace them. I changed the code and pushed it to git but
now I realize that I have to copy the directives for each note. I
deleted the notes first so I did not get the notes being deleted
tangled up with the newly created ones.
Would it be bad to created a GList and append the selected notes
directives onto it? Then assign it to the newly created notes?
Jeremiah
> Richard
>
>
>
>
> _______________________________________________
> Denemo-devel mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/denemo-devel