From 4153a582dc21156c92a570da0f0089d545e57948 Mon Sep 17 00:00:00 2001 From: Raspbeguy Date: Wed, 21 May 2014 18:08:47 +0200 Subject: [PATCH] =?UTF-8?q?Syst=C3=A8me=20de=20lecture=20op=C3=A9rationnel?= =?UTF-8?q?=20:)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/Makefile | 10 ++- sources/instruments/instruments.c | 19 ++++- sources/instruments/instruments.h | 10 ++- sources/lecture/lecture.c | 42 +++++++---- sources/lecture/lecture.h | 4 +- sources/main.c | 116 +++++++++++++++++++----------- sources/mainTest/Makefile | 14 ++-- sources/mainTest/maintest.c | 6 +- sources/mainTest/ponytracker | Bin 0 -> 21024 bytes sources/melodie/melodie.c | 4 +- sources/melodie/melodie.h | 2 +- sources/samples/samples.c | 9 +-- sources/samples/samples.h | 2 +- 13 files changed, 152 insertions(+), 86 deletions(-) create mode 100755 sources/mainTest/ponytracker diff --git a/sources/Makefile b/sources/Makefile index 0d944c6..8414ba7 100644 --- a/sources/Makefile +++ b/sources/Makefile @@ -1,7 +1,7 @@ all : ponytracker clean -ponytracker : main.o lecture.o motifs.o melodie.o - gcc -std=c99 -L'fmod/lib' -lfmodex -Wall main.o lecture.o motifs.o melodie.o -o ponytracker `pkg-config --cflags --libs gtk+-3.0 gmodule-2.0` +ponytracker : main.o lecture.o motifs.o melodie.o samples.o instruments.o + gcc -std=c99 -L'fmod/lib' -lfmodex -Wall main.o lecture.o motifs.o melodie.o instruments.o samples.o -o ponytracker `pkg-config --cflags --libs gtk+-3.0 gmodule-2.0` main.o : main.c gcc -std=c99 -Wall -c main.c `pkg-config --cflags --libs gtk+-3.0 gmodule-2.0` @@ -15,5 +15,11 @@ melodie.o : melodie/melodie.c melodie/melodie.h lecture.o : lecture/lecture.c lecture/lecture.h gcc -std=c99 -Wall -c lecture/lecture.c +samples.o : samples/samples.c samples/samples.h + gcc -std=c99 -Wall -c samples/samples.c + +instruments.o : instruments/instruments.c instruments/instruments.h + gcc -std=c99 -Wall -c instruments/instruments.c + clean : rm -f *.o diff --git a/sources/instruments/instruments.c b/sources/instruments/instruments.c index 5e123b2..9f7d324 100644 --- a/sources/instruments/instruments.c +++ b/sources/instruments/instruments.c @@ -19,7 +19,11 @@ void supprimerInstrument(Instrument* tab[], int i){ free(tab[i]); } -int getVolume(Instrument* inst) { +char* getChemin(Instrument* inst) { + return inst->sample->chemin; +} + +int getVolumeInst(Instrument* inst) { return inst->volume; } @@ -30,11 +34,16 @@ int getBalance(Instrument* inst) { char* getNomInst(Instrument* inst) { return inst->nom; } -void setVolume(Instrument* inst, int volume) { + +Sample* getSample(Instrument* inst) { + return inst->sample; +} + +void setVolumeInst(Instrument* inst, int volume) { inst->volume = volume; } -void setBalance(Instrument* inst, int balance) { +void setBalanceInst(Instrument* inst, int balance) { inst->balance = balance; } @@ -42,6 +51,10 @@ void setNomInst(Instrument* inst, char* nom) { strcpy(inst->nom,nom); } +void setSample(Instrument* inst, Sample* smpl){ + inst->sample = smpl; +} + float rapportPitch(Instrument* inst, int note, int octave){ float freq = 440*pow(2,(octave-3)+(note-11)*(1.0/12.0)); return freq/(inst->sample->hauteur_ref); diff --git a/sources/instruments/instruments.h b/sources/instruments/instruments.h index ee98d8e..75256f3 100644 --- a/sources/instruments/instruments.h +++ b/sources/instruments/instruments.h @@ -36,18 +36,24 @@ void ajouterInstrument(Instrument* tab[], int i); void supprimerInstrument(Instrument* tab[], int i); -int getVolume(Instrument* inst); +char* getChemin(Instrument* inst); -int getBalance(Instrument* inst); +int getVolumeInst(Instrument* inst); + +int getBalanceInst(Instrument* inst); char* getNomInst(Instrument* inst); +Sample* getSample(Instrument* inst); + void setVolume(Instrument* inst, int volume); void setBalance(Instrument* inst, int balance); void setNomInst(Instrument* inst, char* nom); +void setSample(Instrument* inst, Sample* smpl); + /* * Cette fonction prend une note et une octave en paramètre et renvoie la valeur à entrer dans le pitch shifter. */ diff --git a/sources/lecture/lecture.c b/sources/lecture/lecture.c index f631051..128a00c 100644 --- a/sources/lecture/lecture.c +++ b/sources/lecture/lecture.c @@ -10,6 +10,7 @@ #include "lecture.h" +/* void lireTick (FMOD_SYSTEM* system, Motif* m, int tmp, FMOD_SOUND* sample[], FMOD_CHANNEL* chan[], int nbrPortees, int tempo) { // On va lire les ticks (plus petite division temporelle de la playlist) de haut en bas //int tempsPrecedent = SDL_GetTicks(); @@ -33,16 +34,16 @@ void lireTick (FMOD_SYSTEM* system, Motif* m, int tmp, FMOD_SOUND* sample[], FMO } } } - /* while (SDL_GetTicks() - tempsPrecedent < 125) {} // Si 125 ms se sont écoulées (il faudra régler ce temps sur le tempo) - tempsPrecedent = tempsPrecedent + 125; - Avouez que ce serait con qu'on ait besoin de SDL juste pour la temporisation - alors qu'on peut utiliser la fonction native usleep pour ça, et beaucoup plus simplement. */ + while (SDL_GetTicks() - tempsPrecedent < 125) {} // Si 125 ms se sont écoulées (il faudra régler ce temps sur le tempo) + tempsPrecedent = tempsPrecedent + 125; + Avouez que ce serait con qu'on ait besoin de SDL juste pour la temporisation + alors qu'on peut utiliser la fonction native usleep pour ça, et beaucoup plus simplement. usleep(60000000/tempo); } +*/ - -void lecture (int nombreChaines, int tempo, Motif* melodie[]) { +void lecture (int nombreChaines, int nombreInst, int tempo, Instrument* inst[], Motif* melodie[]) { FMOD_SYSTEM *system; @@ -57,8 +58,20 @@ void lecture (int nombreChaines, int tempo, Motif* melodie[]) { FMOD_CHANNEL **chan = malloc(nombreChaines*sizeof(FMOD_CHANNEL*)); // On ouvre le nombre de chaines nécessaires dans le mixer - FMOD_SOUND *sample[5]; // On charge les samples avec un message d'erreur en cas d'échec + FMOD_SOUND **sample = malloc(nombreInst*sizeof(FMOD_SOUND*)); + + // On charge les samples avec un message d'erreur en cas d'échec + + for (int k = 0; k < nombreInst; k++) { + resultat = FMOD_System_CreateStream(system, getChemin(inst[k]), FMOD_SOFTWARE | FMOD_2D | FMOD_LOOP_NORMAL, 0, &sample[0]); + if (resultat != FMOD_OK) + { + fprintf(stderr, "Impossible de lire le fichier audio\n"); + exit(EXIT_FAILURE); + } + } + /* resultat = FMOD_System_CreateStream(system, "lecture/0.wav", FMOD_SOFTWARE | FMOD_2D | FMOD_LOOP_NORMAL, 0, &sample[0]); if (resultat != FMOD_OK) { @@ -93,6 +106,7 @@ void lecture (int nombreChaines, int tempo, Motif* melodie[]) { fprintf(stderr, "Impossible de lire le fichier audio\n"); exit(EXIT_FAILURE); } + */ //Lecture des motifs @@ -105,21 +119,21 @@ void lecture (int nombreChaines, int tempo, Motif* melodie[]) { // DÉBUT DU COPIER COLLER POTENTIELLEMENT FOIREUX - m = melodie[courant] - for (int chaine = 0; chaine < nombreChaines; chaine++) { // On va lire les chaines une à une par numéro croissant + m = melodie[courant]; + for (int chaine = 0; chaine < nombreChaines; chaine++) { // On va lire les chaines une à une par numéro croissant if (m != NULL) { - if (getInstrument(m,0,tmp) == -1) FMOD_Channel_Stop(chan[chaine]); // Si la note est un silence, la chaine s'arrête + if (getInstrument(m,0,i) == -1) FMOD_Channel_Stop(chan[chaine]); // Si la note est un silence, la chaine s'arrête else { - if (getNote(m,0,tmp) != 0) { + if (getNote(m,0,i) != -1) { FMOD_Channel_Stop(chan[chaine]); - FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sample[getInstrument(m,chaine,tmp)], 0, &chan[chaine]); + FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sample[getInstrument(m,chaine,i)], 0, &chan[chaine]); //Ici on va s'occuper du pitch FMOD_DSP *pitch; FMOD_System_CreateDSPByType(system, FMOD_DSP_TYPE_PITCHSHIFT, &pitch); - FMOD_DSP_SetParameter(pitch, FMOD_DSP_PITCHSHIFT_PITCH, 2.0); + FMOD_DSP_SetParameter(pitch, FMOD_DSP_PITCHSHIFT_PITCH, rapportPitch(inst[getInstrument(m,0,i)],getNote(m,0,i),4)); FMOD_Channel_AddDSP(chan[chaine], pitch, 0); // C'est quoi chan1 ??? Je l'ai remplacé par chan[1], vu que chan1 est as déclaré... // On va passer une bonne journée... } @@ -140,7 +154,7 @@ void lecture (int nombreChaines, int tempo, Motif* melodie[]) { } //On relache le système FMOD - for (int i = 0; i <= nombreChaines; i++) { + for (int i = 0; i < nombreInst; i++) { FMOD_Sound_Release(sample[i]); } FMOD_System_Close(system); diff --git a/sources/lecture/lecture.h b/sources/lecture/lecture.h index 670d332..baeb5e5 100644 --- a/sources/lecture/lecture.h +++ b/sources/lecture/lecture.h @@ -13,7 +13,7 @@ #define _LECTURE_H #include "../melodie/melodie.h" -// #include "../instruments/instrument.h" +#include "../instruments/instruments.h" // #include // #include #include @@ -29,6 +29,6 @@ @param[in] tempo : vitesse de lecture @param[in] melodie[] : tableau ordonné des motifs */ -void lecture(int nbrChaines, int tempo, Motif* melodie[]); +void lecture(int nbrChaines, int nombreInst, int tempo, Instrument* inst[], Motif* melodie[]); #endif diff --git a/sources/main.c b/sources/main.c index 3039e98..e09a099 100644 --- a/sources/main.c +++ b/sources/main.c @@ -24,6 +24,8 @@ #include "motifs/motifs.h" #include "melodie/melodie.h" +#include "samples/samples.h" +#include "instruments/instruments.h" #include "lecture/lecture.h" //#include //#include @@ -31,6 +33,8 @@ #define DEF_NBR_TMP 16 #define MAX_PATTERNS 256 +#define NBR_INST 10 +#define NBR_SMPL 5 // Fonctions de débug @@ -46,87 +50,112 @@ void afficherMotif(Motif* m, int nbrPortees){ // Fin des fonctions de débug -void debut(Motif* melodie[], Motif* liste, int nbrPortees){ +void debut(Motif* melodie[], Instrument* inst[], Sample* smpl[], Motif* liste, int nbrPortees){ ajouterMotif(&liste, DEF_NBR_TMP, nbrPortees); Motif* m = liste; + int i; + // My Little Pony. + + for (i = 0; i < DEF_NBR_TMP; i++) { + definirNote(m,0,i,-1); + } + definirNote(m,0,0,1); - definirInstrument(m,0,0,1); + definirInstrument(m,0,0,0); definirInstrument(m,0,2,-1); - definirNote(m,0,4,1); + definirNote(m,0,4,0); definirInstrument(m,0,4,0); definirNote(m,0,5,1); - definirInstrument(m,0,5,1); + definirInstrument(m,0,5,0); definirInstrument(m,0,6,-1); - definirNote(m,0,7,1); - definirInstrument(m,0,7,2); + definirNote(m,0,7,3); + definirInstrument(m,0,7,0); definirInstrument(m,0,8,-1); definirNote(m,0,9,1); - definirInstrument(m,0,9,1); + definirInstrument(m,0,9,0); definirInstrument(m,0,12,-1); ajouterMotif(&liste, DEF_NBR_TMP, nbrPortees); Motif* n = liste; // I used to wonder what friendship could be. - definirNote(n,0,1,1); - definirInstrument(n,0,1,3); - definirNote(n,0,2,1); - definirInstrument(n,0,2,3); - definirNote(n,0,3,1); - definirInstrument(n,0,3,3); - definirNote(n,0,4,1); - definirInstrument(n,0,4,3); + + for (i = 0; i < DEF_NBR_TMP; i++) { + definirNote(n,0,i,-1); + } + + definirNote(n,0,1,5); + definirInstrument(n,0,1,0); + definirNote(n,0,2,5); + definirInstrument(n,0,2,0); + definirNote(n,0,3,5); + definirInstrument(n,0,3,0); + definirNote(n,0,4,5); + definirInstrument(n,0,4,0); definirInstrument(n,0,5,-1); definirNote(n,0,6,1); - definirInstrument(n,0,6,1); - definirNote(n,0,7,1); - definirInstrument(n,0,7,2); + definirInstrument(n,0,6,0); + definirNote(n,0,7,3); + definirInstrument(n,0,7,0); definirInstrument(n,0,8,-1); definirNote(n,0,9,1); - definirInstrument(n,0,9,1); + definirInstrument(n,0,9,0); definirInstrument(n,0,10,-1); - definirNote(n,0,11,1); - definirInstrument(n,0,11,3); + definirNote(n,0,11,5); + definirInstrument(n,0,11,0); definirInstrument(n,0,12,-1); - definirNote(n,0,13,1); - definirInstrument(n,0,13,2); + definirNote(n,0,13,3); + definirInstrument(n,0,13,0); definirInstrument(n,0,14,-1); definirNote(n,0,15,1); - definirInstrument(n,0,15,1); + definirInstrument(n,0,15,0); ajouterMotif(&liste, DEF_NBR_TMP, nbrPortees); Motif* p = liste; // Until you all shared its magic with me. - definirNote(p,0,0,1); - definirInstrument(p,0,0,3); - definirNote(p,0,1,1); - definirInstrument(p,0,1,4); + + for (i = 0; i < DEF_NBR_TMP; i++) { + definirNote(p,0,i,-1); + } + + definirNote(p,0,0,5); + definirInstrument(p,0,0,0); + definirNote(p,0,1,8); + definirInstrument(p,0,1,0); definirInstrument(p,0,2,-1); - definirNote(p,0,3,1); - definirInstrument(p,0,3,4); + definirNote(p,0,3,8); + definirInstrument(p,0,3,0); definirInstrument(p,0,4,-1); - definirNote(p,0,5,1); - definirInstrument(p,0,5,3); + definirNote(p,0,5,5); + definirInstrument(p,0,5,0); definirInstrument(p,0,6,-1); - definirNote(p,0,7,1); - definirInstrument(p,0,7,2); + definirNote(p,0,7,3); + definirInstrument(p,0,7,0); definirInstrument(p,0,8,-1); definirNote(p,0,9,1); - definirInstrument(p,0,9,1); - definirNote(p,0,10,1); - definirInstrument(p,0,10,3); + definirInstrument(p,0,9,0); + definirNote(p,0,10,5); + definirInstrument(p,0,10,0); definirInstrument(p,0,11,-1); - definirNote(p,0,12,1); - definirInstrument(p,0,12,2); + definirNote(p,0,12,3); + definirInstrument(p,0,12,0); definirInstrument(p,0,14,-1); ajouterMotifVirtuel(melodie,0,m); ajouterMotifVirtuel(melodie,1,n); ajouterMotifVirtuel(melodie,2,m); ajouterMotifVirtuel(melodie,3,p); + + // Définir les instruments les samples + + ajouterSample(smpl,0,"lecture/0.wav"); + setHauteur(smpl[0],440.0); + + ajouterInstrument(inst,0); + setSample(inst[0],smpl[0]); } int main( int argc, char *argv[] ){ @@ -206,11 +235,14 @@ void lancerLecture () { Motif* melodie[MAX_PATTERNS] = {NULL}; Motif* liste = NULL; + Instrument* inst[NBR_INST] = {NULL}; + Sample* smpl[NBR_SMPL] = {NULL}; + int nbrPortees = 1; - courant = 0; + //courant = 0; taille = 0; - debut(melodie, liste, nbrPortees); - lecture(nbrPortees,480,melodie); + debut(melodie, inst, smpl, liste, nbrPortees); + lecture(nbrPortees,1,480,inst,melodie); } void quitter () diff --git a/sources/mainTest/Makefile b/sources/mainTest/Makefile index 6fdfbd5..0a3ebc0 100644 --- a/sources/mainTest/Makefile +++ b/sources/mainTest/Makefile @@ -1,19 +1,19 @@ all : ponytracker clean ponytracker : maintest.o lecture.o motifs.o melodie.o - gcc -std=c99 -L'fmod/lib' -lfmodex64 -Wall maintest.o lecture.o motifs.o melodie.o -o ponytracker `pkg-config --cflags --libs gtk+-3.0 gmodule-2.0` + gcc -std=c99 -L'../fmod/lib' -lfmodex64 -Wall maintest.o lecture.o motifs.o melodie.o -o ponytracker `pkg-config --cflags --libs gtk+-3.0 gmodule-2.0` maintest.o : maintest.c gcc -std=c99 -Wall -c maintest.c `pkg-config --cflags --libs gtk+-3.0 gmodule-2.0` -motifs.o : motifs/motifs.c motifs/motifs.h - gcc -std=c99 -Wall -c motifs/motifs.c +motifs.o : ../motifs/motifs.c ../motifs/motifs.h + gcc -std=c99 -Wall -c ../motifs/motifs.c -melodie.o : melodie/melodie.c melodie/melodie.h - gcc -std=c99 -Wall -c melodie/melodie.c +melodie.o : ../melodie/melodie.c ../melodie/melodie.h + gcc -std=c99 -Wall -c ../melodie/melodie.c -lecture.o : lecture/lecture.c lecture/lecture.h - gcc -std=c99 -Wall -c lecture/lecture.c +lecture.o : ../lecture/lecture.c ../lecture/lecture.h + gcc -std=c99 -Wall -c ../lecture/lecture.c clean : rm -f *.o diff --git a/sources/mainTest/maintest.c b/sources/mainTest/maintest.c index e94445a..1073bcd 100644 --- a/sources/mainTest/maintest.c +++ b/sources/mainTest/maintest.c @@ -141,7 +141,7 @@ int main( int argc, char *argv[] ){ // insérer code GTK ici GtkBuilder *monBuilder; GtkWidget *maFenetre; - char *str; + char *str = NULL; gtk_init( &argc, &argv ); @@ -155,7 +155,7 @@ int main( int argc, char *argv[] ){ GtkLabel *labelNote = (GtkLabel*) gtk_builder_get_object(monBuilder,"button16"); if (getNote(m,0,0)==0) str="Do"; else if (getNote(m,0,0)==1) str="Re"; - gtk_label_set_text(labelNote, str); + gtk_label_set_text(labelNote, str); gtk_widget_show_all (maFenetre); gtk_main(); @@ -283,7 +283,7 @@ void lancerLecture () Motif* melodie[MAX_PATTERNS] = {NULL}; Motif* liste = NULL; int nbrPortees = 1; - courant = 0; + int courant = 0; taille = 0; debut(melodie, liste, nbrPortees); lecture(nbrPortees,480,melodie); diff --git a/sources/mainTest/ponytracker b/sources/mainTest/ponytracker new file mode 100755 index 0000000000000000000000000000000000000000..16e71f77032e4f16cf0a2476adb3eef278825f81 GIT binary patch literal 21024 zcmeHP4R9RAm7dj4FvgAqu@e$5uuzB?h;7+maIg(h@WKczBmBd0RJdg=jjWAVT4lA1 zZ7vEjwt&fc6NT8|5a4td;3$qEN#PvW5HLDIahn8(R-zm#;v^!4(S2Wc z&+P0-GLT%=-BoE+)BWD-_g=q#{ko^SXI9Vu>9_BmU>Jd7!{{h74C74P*%J+;(+C1G zjF00safico)mMgY2(7w?)WR!Jh)#%6&m2?`4zCGazow8y%2yWB42{D!qZIdtba6PG zv^FL4yncN>Gtn3nzw}APL%bxi)Vem8-*JQrLSJ=BksKlbfX{~PPJ@| zwlsvJEsb%B7xqWZe5H?l&Wrf*u5j3D3O6Pq&6eWw+qX;WyGbh{j#!)YVw~KGwuHmW ztJhR}*boo0iRGH+#EZrmC)DfobvWD-3%6}(7@*1p0(0h+Cs*viOU(BxCay zJF#;PWH}$1SEzB%X9DpK;Jgq7E~OG=kJ08fHm4G`u8qv@Ej_u$gWj zO{a#_Yez&m7CmNW+2J!F+Xr3eK$jhQ9o(f{(%GTmp{K{j#=!D@uz;adGUQN;W*8az zG8wiW4BmL4vFwcHhN11PGBcr(J#wOg#ipGavDc!`VHj;cC*Jrd9vL)jFY7UBwH?aA zvYh>#z4nm(Y`XT4cneDtFOw=9VBvsRi}mV0sey~DJuqU7;$oRg$11?sqtt``kgJSz zRg)-pnYrW4Gj9U3QeH^Ux%3YeR65|&xf;&vsVt<^QfcHamp-jPPlrp#hTNk^e9W<@ zkY4BV^J$iM!eY?PO#8?_`X5dg8)s_;+BWI$LD({AKP$fMYNxmMaFf6i@s>-MF4nFb z6gL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)Qzf*FZI>X*m z5|RhlcwJJ|pjvr*ao(`UVS4vf)Oc0kx@bZ+_ehEHp_OstF+O^WH@l9HB4Xns9>8>Nhr2ASzOuAPg z$uj9$O^8X?8mP5m@rI~n94_IhcAN1tXzE=<4kkG!BQjYFsQWr31M84v*C8BwPU{JD z%2>;liI-jX?e4HdNd|W0k z=W7Lg$|x^n>vl(q{}Uhx8h+=eQge|%kOmf(PEZ=RpZ@g74iEu9@Kb`#z(aLGaApH zqxkt1CGGA0l)`_h@tnrr()dkUUjV$aeR$)?`etc7r}48i-hrurH7E*5+t(9>k~eFt`A@C!>{+@8+`b!KKwo({yiVgSC?LU{?mu^> z!{_+$3w(IB55LBT|FsXl(T6ws@R-7#dBE7}!~b64Xob4=`tX;1_?teQGZ)(H%FpuQ zr~B}QK76SUzuJf2Bwiksg*UW)rN+*P=%aeo%~<+zvQ4&mna6P36xzjm|E93m}iONkP6l%4sm5%uTJs=tWq3A zuXr3(uc5+v!Rf6-lXQzTCf7C&w_XQw%b-mKRHN5mqRl)!qBLF%E#0pl1Vf`t9 z5$1;ja)}sjHn6zIa#ZeIxEv1q*Ue#fVXTcV#9c4DWMzrslgpC@&)%)zph0fh3MlI6L6X#| zg9P2ZoW}Gf&e^@GZJWDa!v-1~wMn*BAWyoVI?hhKpvc*$Ia~08Ld2T0_b#Aw(=7?U z-L|C3ZMKAb`)f&4;mBhGLTX1X3;bJYFVWpYJ6qLov)ZFNn^R|3>TE~Ho$eUMe*=Ev BD@OnT literal 0 HcmV?d00001 diff --git a/sources/melodie/melodie.c b/sources/melodie/melodie.c index f3d6db4..c28826b 100644 --- a/sources/melodie/melodie.c +++ b/sources/melodie/melodie.c @@ -12,9 +12,9 @@ void afficherMotifActuel(){ // TODO } -void definirCourant(int i){ +/* void definirCourant(int i){ courant = i; -} +}*/ void ajouterMotifVirtuel(Motif* melodie[], int ind, Motif* m){ for (int i = taille; i > ind; i--) { diff --git a/sources/melodie/melodie.h b/sources/melodie/melodie.h index 9e57830..322d80d 100644 --- a/sources/melodie/melodie.h +++ b/sources/melodie/melodie.h @@ -17,7 +17,7 @@ void afficherListeMotifs(); void afficherMotifActuel(); -void definirCourant(int i); +//void definirCourant(int i); void ajouterMotifVirtuel(Motif* melodie[], int ind, Motif* m); diff --git a/sources/samples/samples.c b/sources/samples/samples.c index 47147de..2ee9508 100644 --- a/sources/samples/samples.c +++ b/sources/samples/samples.c @@ -13,15 +13,10 @@ void ajouterSample(Sample* tab[], int i, char* chemin) { tab[i] = calloc(1,sizeof(Sample)); sprintf(tab[i]->nom,"Sample %d",i); + strcpy(tab[i]->chemin,chemin); } -void supprimerSample(Sample* tab[], int i, Poubelle** poub) { - if (!(doitEtreSauvegarde(tab, i))) { - Poubelle* p = malloc(sizeof(Poubelle)); - strcpy(p->chemin, tab[i]->chemin); - p->suiv = *poub; - *poub = p; - } +void supprimerSample(Sample* tab[], int i) { free(tab[i]); } diff --git a/sources/samples/samples.h b/sources/samples/samples.h index 3d79945..d216653 100644 --- a/sources/samples/samples.h +++ b/sources/samples/samples.h @@ -30,7 +30,7 @@ typedef struct _sample{ void ajouterSample(Sample* tab[], int i, char* chemin); -void supprimerSample(Sample* tab[], int i, Poubelle** poub); +void supprimerSample(Sample* tab[], int i); //void setResampling(Sample* sample, int deb, int fin);