2014-05-15 19:04:42 +02:00
|
|
|
/**
|
|
|
|
* @file samples.c
|
|
|
|
*
|
|
|
|
* Implémentation de samples.h
|
|
|
|
*
|
|
|
|
* @version 1
|
|
|
|
* @author Guy
|
|
|
|
* @date Mai 2014
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "samples.h"
|
|
|
|
|
|
|
|
void ajouterSample(Sample* tab[], int i, char* chemin) {
|
|
|
|
tab[i] = calloc(1,sizeof(Sample));
|
|
|
|
sprintf(tab[i]->nom,"Sample %d",i);
|
2014-05-21 18:08:47 +02:00
|
|
|
strcpy(tab[i]->chemin,chemin);
|
2014-05-15 19:04:42 +02:00
|
|
|
}
|
|
|
|
|
2014-05-21 18:08:47 +02:00
|
|
|
void supprimerSample(Sample* tab[], int i) {
|
2014-05-15 19:04:42 +02:00
|
|
|
free(tab[i]);
|
|
|
|
}
|
|
|
|
|
|
|
|
void setNom(Sample* sample, char nom[]) {
|
|
|
|
strcpy(sample->nom,nom);
|
|
|
|
}
|
|
|
|
|
|
|
|
void setHauteur(Sample* sample, float hauteur) {
|
|
|
|
sample->hauteur_ref = hauteur;
|
|
|
|
}
|
|
|
|
|
|
|
|
char* getNom(Sample* sample) {
|
|
|
|
return sample->nom;
|
|
|
|
}
|
|
|
|
|
|
|
|
float getHauteur(Sample* sample) {
|
|
|
|
return sample->hauteur_ref;
|
|
|
|
}
|