diff --git a/.gitignore b/.gitignore index 1806343..de81d93 100644 --- a/.gitignore +++ b/.gitignore @@ -16,4 +16,5 @@ documentation/latex/refman.log documentation/latex/refman.pdf documentation/latex/refman.toc sources/motifs/.motifs.c.swp -sources/motifs/.motifs.h.swp \ No newline at end of file +sources/motifs/.motifs.h.swp +sources/motifs/motifs.o \ No newline at end of file diff --git a/sources/motifs/motifs.c b/sources/motifs/motifs.c index c4943ae..ea69e91 100644 --- a/sources/motifs/motifs.c +++ b/sources/motifs/motifs.c @@ -13,8 +13,10 @@ void ajouterMotif(int nbrPortees, int nbrTmp){ Motif* m = malloc(sizeof(Motif)); m->nbrTmp = nbrTmp; m->suivant = liste; - m->motif = malloc(nbrPortees*sizeof(portee)); - m->nom = strcat("Motif %d", getIdMotif(m)); + m->motif = malloc(nbrPortees*sizeof(Portee)); + char* nombre = NULL; + sprintf(nombre,"%d",getIdMotif(m)); + m->nom = strcat("Motif ", nombre); int i; for (i=0; imotif[i] = calloc(nbrTmp,sizeof(Note)); @@ -38,25 +40,25 @@ void supprimerMotif(Motif** cellule){ } void definirNote(Motif* m, int portee, int tmp, int note){ - m->Motif[portee][tmp]->note = note; + m->motif[portee][tmp]->note = note; } -void definirOctave(Motif m, int portee, int tmp, int octave){ - m->Motif[portee][tmp]->octave = octave; +void definirOctave(Motif* m, int portee, int tmp, int octave){ + m->motif[portee][tmp]->octave = octave; } -void definirInstrument(Motif m, int portee, int tmp, int intrument){ - m->Motif[portee][tmp]->instrument = instrument; +void definirInstrument(Motif* m, int portee, int tmp, int instrument){ + m->motif[portee][tmp]->instrument = instrument; } -void definirVolume(Motif m, int portee, int tmp, int volume){ - m->Motif[portee][tmp]->volume = volume; +void definirVolume(Motif* m, int portee, int tmp, int volume){ + m->motif[portee][tmp]->volume = volume; } -void definirEffet(Motif m, int portee, int tmp, int effet){ - m->Motif[portee][tmp]->effet = effet; +void definirEffet(Motif* m, int portee, int tmp, int effet){ + m->motif[portee][tmp]->effet = effet; } -void supprimerNote(Motif m, int portee, int tmp){ +void supprimerNote(Motif* m, int portee, int tmp){ m->motif[portee][tmp]->note = 0; } \ No newline at end of file diff --git a/sources/motifs/motifs.h b/sources/motifs/motifs.h index c793894..fc296e4 100644 --- a/sources/motifs/motifs.h +++ b/sources/motifs/motifs.h @@ -18,14 +18,14 @@ typedef struct _motif{ char* nom; int nbrTmp; Portee* motif; - struct _motif suivant; + struct _motif* suivant; } Motif; Motif* liste = NULL; int nbrTmp = 16; -int nbrMotif = 16; +int nbrPortees = 4; int getIdMotif(Motif* m); @@ -33,18 +33,18 @@ void ajouterMotif(int nbrPortees, int nbrTmp); void definirNomMotif(char* nom, Motif* m); -void supprimerMotif(Liste** cellule, int nbrPortees); // cellule correspond à l'adresse de l'élément de la liste (avec &) +void supprimerMotif(Motif** cellule); // cellule correspond à l'adresse de l'élément de la liste (avec &) void definirNote(Motif* m, int portee, int tmp, int note); -void definirOctave(Motif m, int portee, int tmp, int octave) +void definirOctave(Motif* m, int portee, int tmp, int octave); -void definirInstrument(Motif m, int portee, int tmp, int intrument); +void definirInstrument(Motif* m, int portee, int tmp, int intrument); -void definirVolume(Motif m, int portee, int tmp, int volume); +void definirVolume(Motif* m, int portee, int tmp, int volume); -void definirEffet(Motif m, int portee, int tmp, int effet); +void definirEffet(Motif* m, int portee, int tmp, int effet); -void supprimerNote(Motif m, int portee, int tmp); +void supprimerNote(Motif* m, int portee, int tmp); #endif \ No newline at end of file