ponytracker/sources/samples/samples.c

38 lines
639 B
C

/**
* @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);
strcpy(tab[i]->chemin,chemin);
}
void supprimerSample(Sample* tab[], int i) {
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;
}