2014-04-01 13:48:39 +02:00
|
|
|
#ifndef _motif_h
|
|
|
|
#define _motif_h
|
|
|
|
|
2014-03-29 17:47:13 +01:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
2014-04-01 21:31:20 +02:00
|
|
|
#define DEFNBRTMP 16
|
|
|
|
|
2014-03-29 17:47:13 +01:00
|
|
|
typedef struct _note{
|
2014-04-01 13:48:39 +02:00
|
|
|
int note;
|
|
|
|
int octave;
|
|
|
|
int instrument;
|
|
|
|
int volume;
|
|
|
|
int effet;
|
|
|
|
} Note;
|
2014-03-29 17:47:13 +01:00
|
|
|
|
2014-04-06 20:08:43 +02:00
|
|
|
typedef Note Portee[];
|
|
|
|
|
|
|
|
typedef Portee* Mesure[];
|
2014-03-29 17:47:13 +01:00
|
|
|
|
2014-04-01 13:48:39 +02:00
|
|
|
typedef struct _motif{
|
2014-04-06 20:08:43 +02:00
|
|
|
char nom[10];
|
2014-04-01 13:48:39 +02:00
|
|
|
int nbrTmp;
|
2014-04-06 20:08:43 +02:00
|
|
|
Mesure* motif;
|
2014-04-01 21:31:20 +02:00
|
|
|
struct _motif* suivant;
|
2014-04-01 13:48:39 +02:00
|
|
|
} Motif;
|
|
|
|
|
|
|
|
int getIdMotif(Motif* m);
|
2014-03-29 17:47:13 +01:00
|
|
|
|
2014-04-06 20:08:43 +02:00
|
|
|
void ajouterMotif(Motif** pliste, int nbrTmp, int nbrPortees);
|
2014-04-01 21:31:20 +02:00
|
|
|
|
|
|
|
void definirNomMotif(Motif* m, char* nom);
|
2014-03-29 17:47:13 +01:00
|
|
|
|
2014-04-01 21:31:20 +02:00
|
|
|
// void definirNbrTmp(Motif* m, int nbrTmp);
|
|
|
|
// C'est chiant de changer le nomre de temps en cours de route,
|
|
|
|
// donc on le fera après le proto.
|
2014-04-01 13:48:39 +02:00
|
|
|
|
2014-04-03 12:16:16 +02:00
|
|
|
void supprimerMotif(Motif** cellule, int nbrPortees); // cellule correspond à l'adresse de l'élément de la liste (avec &)
|
2014-03-29 18:00:23 +01:00
|
|
|
|
2014-04-01 13:48:39 +02:00
|
|
|
void definirNote(Motif* m, int portee, int tmp, int note);
|
|
|
|
|
2014-04-01 14:11:27 +02:00
|
|
|
void definirOctave(Motif* m, int portee, int tmp, int octave);
|
2014-04-01 13:48:39 +02:00
|
|
|
|
2014-04-01 14:11:27 +02:00
|
|
|
void definirInstrument(Motif* m, int portee, int tmp, int intrument);
|
2014-04-01 13:48:39 +02:00
|
|
|
|
2014-04-01 14:11:27 +02:00
|
|
|
void definirVolume(Motif* m, int portee, int tmp, int volume);
|
2014-04-01 13:48:39 +02:00
|
|
|
|
2014-04-01 14:11:27 +02:00
|
|
|
void definirEffet(Motif* m, int portee, int tmp, int effet);
|
2014-03-29 18:00:23 +01:00
|
|
|
|
2014-04-01 14:11:27 +02:00
|
|
|
void supprimerNote(Motif* m, int portee, int tmp);
|
2014-04-01 13:48:39 +02:00
|
|
|
|
2014-04-06 20:24:35 +02:00
|
|
|
// Maintenant, voici les getters (qui intéressent entre autres Majora)
|
|
|
|
|
|
|
|
int getNote(Motif* m, int portee, int tmp);
|
|
|
|
|
|
|
|
int getOctave(Motif* m, int portee, int tmp);
|
|
|
|
|
|
|
|
int getInstrument(Motif* m, int portee, int tmp);
|
|
|
|
|
|
|
|
int getVolume(Motif* m, int portee, int tmp);
|
|
|
|
|
|
|
|
int getEffet(Motif* m, int portee, int tmp);
|
|
|
|
|
2014-04-03 12:16:16 +02:00
|
|
|
#endif
|