denemo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Denemo-devel] A Good Idea


From: Jeremiah Benham
Subject: Re: [Denemo-devel] A Good Idea
Date: Sat, 6 Mar 2010 21:16:44 -0600
User-agent: Mutt/1.5.20 (2009-06-14)

On Fri, Mar 05, 2010 at 09:58:36AM +0000, Richard Shann wrote:
> On Thu, 2010-03-04 at 15:05 -0600, Jeremiah Benham wrote:
> > 
> > On Mar 4, 2010, at 6:46 AM, Richard Shann <address@hidden>  
> > wrote:
> > 
> > >
> > > J. would you like to look at importmidi.c with a view to separating  
> > > out
> > > the file open/new score/new staff stuff from the core function that
> > > takes an smf_track and puts the smf_events into a given staff?
> > 
> > I am a bit confused here. You want seperated functions. The first  
> > loads the midi into smf structure in memory.
> given a filename, yes.

So would it cause problems to store the smf data in gui->si->smf upon loading 
it. Then would I add the events into the existing GList *midi_events in the 
DenemoStaff structure or would I create a gpointer that will later hold this 
track data. So it would be like readtrack() in importmidi.c but it would store 
into the staffstructure like this:
 
 DenemoStaff *curstaffstruct = (DenemoStaff *) gui->si->currentstaff->data;
 gint track_number=0;
 while (curstaffstruct){
   curstaffstruct->track_midi_events = smf_get_track_by_number(gui->si->smf, 
track_number++); 
   curstaffstruct = curstaffstruct->next;
 }


or do you want something like this:

 DenemoStaff *curstaffstruct = (DenemoStaff *) gui->si->currentstaff->data;
 gint track_number=0;
 smf_event_t *event;
 smf_track_t *selected_track;

 while (curstaffstruct){
   selected_track = smf_get_track_by_number(gui->si->smf, track_number++); 
   while ((event = smf_track_get_next_event(mididata->selected_track)) != NULL) 
     curstaffstruct->midi_events = g_list_append(curstaffstruct->midi_events, 
event);
                                        
   curstaffstruct = curstaffstruct->next;
 }


Jeremiah





reply via email to

[Prev in Thread] Current Thread [Next in Thread]