From 71a7b6cf25d0ae21840ed68111beb6d3044e712c Mon Sep 17 00:00:00 2001 From: Mika Date: Wed, 21 May 2014 20:39:42 +0200 Subject: [PATCH] Maj main et interface --- sources/mainTest/boutondemerdes.c | 1360 ++++++++++++++++++++++++ sources/mainTest/maintest.c | 321 +++--- sources/mainTest/ponytrackertest.glade | 48 +- 3 files changed, 1534 insertions(+), 195 deletions(-) create mode 100644 sources/mainTest/boutondemerdes.c diff --git a/sources/mainTest/boutondemerdes.c b/sources/mainTest/boutondemerdes.c new file mode 100644 index 0000000..8bfc6af --- /dev/null +++ b/sources/mainTest/boutondemerdes.c @@ -0,0 +1,1360 @@ +void fenetreNote0_0 ( int argc, char *argv[] ) +{ + GtkWidget *maFenetreNote = GTK_WIDGET( gtk_builder_get_object( monBuilder, "ajoutnote0_0")); + + gtk_widget_show_all (maFenetreNote); +} + +void remplissageNote0_0 (GtkWidget *widget, gpointer *data){ + + GtkEntry *entryNote = (GtkEntry*) gtk_builder_get_object(monBuilder,"combonote0_0"); + GtkEntry *entryOctave = (GtkEntry*) gtk_builder_get_object(monBuilder,"combooctave0_0"); + GtkEntry *entryInstrument = (GtkEntry*) gtk_builder_get_object(monBuilder,"comboinstrument0_0"); + GtkEntry *entryVolume = (GtkEntry*) gtk_builder_get_object(monBuilder,"combovolume0_0"); + GtkEntry *entryEffet = (GtkEntry*) gtk_builder_get_object(monBuilder,"comboeffet0_0"); + + const char *strnote = gtk_entry_get_text(GTK_ENTRY(entryNote)); + const char *stroctave = gtk_entry_get_text(GTK_ENTRY(entryOctave)); + const char *strinstrument = gtk_entry_get_text(GTK_ENTRY(entryInstrument)); + const char *strvolume = gtk_entry_get_text(GTK_ENTRY(entryVolume)); + const char *streffet = gtk_entry_get_text(GTK_ENTRY(entryEffet)); + + if (strcmp(Do,strnote)==0) definirNote(m,0,0,1); + else + if (strcmp(DoD,strnote)==0) definirNote(m,0,0,2); + else + if (strcmp(Re,strnote)==0) definirNote(m,0,0,3); + else + if (strcmp(ReD,strnote)==0) definirNote(m,0,0,4); + else + if (strcmp(Mi,strnote)==0) definirNote(m,0,0,5); + else + if (strcmp(Fa,strnote)==0) definirNote(m,0,0,6); + else + if (strcmp(FaD,strnote)==0) definirNote(m,0,0,7); + else + if (strcmp(Sol,strnote)==0) definirNote(m,0,0,8); + else + if (strcmp(SolD,strnote)==0) definirNote(m,0,0,9); + else + if (strcmp(La,strnote)==0) definirNote(m,0,0,10); + else + if (strcmp(LaD,strnote)==0) definirNote(m,0,0,11); + else + if (strcmp(Si,strnote)==0) definirNote(m,0,0,12); + + if (strcmp(N1,stroctave)==0) definirOctave(m,0,0,1); + else + if (strcmp(N2,stroctave)==0) definirOctave(m,0,0,2); + else + if (strcmp(N3,stroctave)==0) definirOctave(m,0,0,3); + else + if (strcmp(N4,stroctave)==0) definirOctave(m,0,0,4); + else + if (strcmp(N5,stroctave)==0) definirOctave(m,0,0,5); + + if (strcmp(N1,strinstrument)==0) definirInstrument(m,0,0,1); + else + if (strcmp(N2,strinstrument)==0) definirInstrument(m,0,0,2); + else + if (strcmp(N3,strinstrument)==0) definirInstrument(m,0,0,3); + else + if (strcmp(N4,strinstrument)==0) definirInstrument(m,0,0,4); + else + if (strcmp(N5,strinstrument)==0) definirInstrument(m,0,0,5); + + if (strcmp(N1,strvolume)==0) definirVolume(m,0,0,1); + else + if (strcmp(N2,strvolume)==0) definirVolume(m,0,0,2); + else + if (strcmp(N3,strvolume)==0) definirVolume(m,0,0,3); + else + if (strcmp(N4,strvolume)==0) definirVolume(m,0,0,4); + else + if (strcmp(N5,strvolume)==0) definirVolume(m,0,0,5); + + if (strcmp(N1,streffet)==0) definirEffet(m,0,0,1); + else + if (strcmp(N2,streffet)==0) definirEffet(m,0,0,2); + else + if (strcmp(N3,streffet)==0) definirEffet(m,0,0,3); + else + if (strcmp(N4,streffet)==0) definirEffet(m,0,0,4); + else + if (strcmp(N5,streffet)==0) definirEffet(m,0,0,5); +} +void fenetreNote0_1 ( int argc, char *argv[] ) +{ + GtkWidget *maFenetreNote = GTK_WIDGET( gtk_builder_get_object( monBuilder, "ajoutnote0_1")); + + gtk_widget_show_all (maFenetreNote); +} + +void remplissageNote0_1 (GtkWidget *widget, gpointer *data){ + + GtkEntry *entryNote = (GtkEntry*) gtk_builder_get_object(monBuilder,"combonote0_1"); + GtkEntry *entryOctave = (GtkEntry*) gtk_builder_get_object(monBuilder,"combooctave0_1"); + GtkEntry *entryInstrument = (GtkEntry*) gtk_builder_get_object(monBuilder,"comboinstrument0_1"); + GtkEntry *entryVolume = (GtkEntry*) gtk_builder_get_object(monBuilder,"combovolume0_1"); + GtkEntry *entryEffet = (GtkEntry*) gtk_builder_get_object(monBuilder,"comboeffet0_1"); + + const char *strnote = gtk_entry_get_text(GTK_ENTRY(entryNote)); + const char *stroctave = gtk_entry_get_text(GTK_ENTRY(entryOctave)); + const char *strinstrument = gtk_entry_get_text(GTK_ENTRY(entryInstrument)); + const char *strvolume = gtk_entry_get_text(GTK_ENTRY(entryVolume)); + const char *streffet = gtk_entry_get_text(GTK_ENTRY(entryEffet)); + + if (strcmp(Do,strnote)==0) definirNote(m,0,1,1); + else + if (strcmp(DoD,strnote)==0) definirNote(m,0,1,2); + else + if (strcmp(Re,strnote)==0) definirNote(m,0,1,3); + else + if (strcmp(ReD,strnote)==0) definirNote(m,0,1,4); + else + if (strcmp(Mi,strnote)==0) definirNote(m,0,1,5); + else + if (strcmp(Fa,strnote)==0) definirNote(m,0,1,6); + else + if (strcmp(FaD,strnote)==0) definirNote(m,0,1,7); + else + if (strcmp(Sol,strnote)==0) definirNote(m,0,1,8); + else + if (strcmp(SolD,strnote)==0) definirNote(m,0,1,9); + else + if (strcmp(La,strnote)==0) definirNote(m,0,1,10); + else + if (strcmp(LaD,strnote)==0) definirNote(m,0,1,11); + else + if (strcmp(Si,strnote)==0) definirNote(m,0,1,12); + + if (strcmp(N1,stroctave)==0) definirOctave(m,0,1,1); + else + if (strcmp(N2,stroctave)==0) definirOctave(m,0,1,2); + else + if (strcmp(N3,stroctave)==0) definirOctave(m,0,1,3); + else + if (strcmp(N4,stroctave)==0) definirOctave(m,0,1,4); + else + if (strcmp(N5,stroctave)==0) definirOctave(m,0,1,5); + + if (strcmp(N1,strinstrument)==0) definirInstrument(m,0,1,1); + else + if (strcmp(N2,strinstrument)==0) definirInstrument(m,0,1,2); + else + if (strcmp(N3,strinstrument)==0) definirInstrument(m,0,1,3); + else + if (strcmp(N4,strinstrument)==0) definirInstrument(m,0,1,4); + else + if (strcmp(N5,strinstrument)==0) definirInstrument(m,0,1,5); + + if (strcmp(N1,strvolume)==0) definirVolume(m,0,1,1); + else + if (strcmp(N2,strvolume)==0) definirVolume(m,0,1,2); + else + if (strcmp(N3,strvolume)==0) definirVolume(m,0,1,3); + else + if (strcmp(N4,strvolume)==0) definirVolume(m,0,1,4); + else + if (strcmp(N5,strvolume)==0) definirVolume(m,0,1,5); + + if (strcmp(N1,streffet)==0) definirEffet(m,0,1,1); + else + if (strcmp(N2,streffet)==0) definirEffet(m,0,1,2); + else + if (strcmp(N3,streffet)==0) definirEffet(m,0,1,3); + else + if (strcmp(N4,streffet)==0) definirEffet(m,0,1,4); + else + if (strcmp(N5,streffet)==0) definirEffet(m,0,1,5); +} +void fenetreNote0_2 ( int argc, char *argv[] ) +{ + GtkWidget *maFenetreNote = GTK_WIDGET( gtk_builder_get_object( monBuilder, "ajoutnote0_2")); + + gtk_widget_show_all (maFenetreNote); +} + +void remplissageNote0_2 (GtkWidget *widget, gpointer *data){ + + GtkEntry *entryNote = (GtkEntry*) gtk_builder_get_object(monBuilder,"combonote0_2"); + GtkEntry *entryOctave = (GtkEntry*) gtk_builder_get_object(monBuilder,"combooctave0_2"); + GtkEntry *entryInstrument = (GtkEntry*) gtk_builder_get_object(monBuilder,"comboinstrument0_2"); + GtkEntry *entryVolume = (GtkEntry*) gtk_builder_get_object(monBuilder,"combovolume0_2"); + GtkEntry *entryEffet = (GtkEntry*) gtk_builder_get_object(monBuilder,"comboeffet0_2"); + + const char *strnote = gtk_entry_get_text(GTK_ENTRY(entryNote)); + const char *stroctave = gtk_entry_get_text(GTK_ENTRY(entryOctave)); + const char *strinstrument = gtk_entry_get_text(GTK_ENTRY(entryInstrument)); + const char *strvolume = gtk_entry_get_text(GTK_ENTRY(entryVolume)); + const char *streffet = gtk_entry_get_text(GTK_ENTRY(entryEffet)); + + if (strcmp(Do,strnote)==0) definirNote(m,0,2,1); + else + if (strcmp(DoD,strnote)==0) definirNote(m,0,2,2); + else + if (strcmp(Re,strnote)==0) definirNote(m,0,2,3); + else + if (strcmp(ReD,strnote)==0) definirNote(m,0,2,4); + else + if (strcmp(Mi,strnote)==0) definirNote(m,0,2,5); + else + if (strcmp(Fa,strnote)==0) definirNote(m,0,2,6); + else + if (strcmp(FaD,strnote)==0) definirNote(m,0,2,7); + else + if (strcmp(Sol,strnote)==0) definirNote(m,0,2,8); + else + if (strcmp(SolD,strnote)==0) definirNote(m,0,2,9); + else + if (strcmp(La,strnote)==0) definirNote(m,0,2,10); + else + if (strcmp(LaD,strnote)==0) definirNote(m,0,2,11); + else + if (strcmp(Si,strnote)==0) definirNote(m,0,2,12); + + if (strcmp(N1,stroctave)==0) definirOctave(m,0,2,1); + else + if (strcmp(N2,stroctave)==0) definirOctave(m,0,2,2); + else + if (strcmp(N3,stroctave)==0) definirOctave(m,0,2,3); + else + if (strcmp(N4,stroctave)==0) definirOctave(m,0,2,4); + else + if (strcmp(N5,stroctave)==0) definirOctave(m,0,2,5); + + if (strcmp(N1,strinstrument)==0) definirInstrument(m,0,2,1); + else + if (strcmp(N2,strinstrument)==0) definirInstrument(m,0,2,2); + else + if (strcmp(N3,strinstrument)==0) definirInstrument(m,0,2,3); + else + if (strcmp(N4,strinstrument)==0) definirInstrument(m,0,2,4); + else + if (strcmp(N5,strinstrument)==0) definirInstrument(m,0,2,5); + + if (strcmp(N1,strvolume)==0) definirVolume(m,0,2,1); + else + if (strcmp(N2,strvolume)==0) definirVolume(m,0,2,2); + else + if (strcmp(N3,strvolume)==0) definirVolume(m,0,2,3); + else + if (strcmp(N4,strvolume)==0) definirVolume(m,0,2,4); + else + if (strcmp(N5,strvolume)==0) definirVolume(m,0,2,5); + + if (strcmp(N1,streffet)==0) definirEffet(m,0,2,1); + else + if (strcmp(N2,streffet)==0) definirEffet(m,0,2,2); + else + if (strcmp(N3,streffet)==0) definirEffet(m,0,2,3); + else + if (strcmp(N4,streffet)==0) definirEffet(m,0,2,4); + else + if (strcmp(N5,streffet)==0) definirEffet(m,0,2,5); +} +void fenetreNote0_3 ( int argc, char *argv[] ) +{ + GtkWidget *maFenetreNote = GTK_WIDGET( gtk_builder_get_object( monBuilder, "ajoutnote0_3")); + + gtk_widget_show_all (maFenetreNote); +} + +void remplissageNote0_3 (GtkWidget *widget, gpointer *data){ + + GtkEntry *entryNote = (GtkEntry*) gtk_builder_get_object(monBuilder,"combonote0_3"); + GtkEntry *entryOctave = (GtkEntry*) gtk_builder_get_object(monBuilder,"combooctave0_3"); + GtkEntry *entryInstrument = (GtkEntry*) gtk_builder_get_object(monBuilder,"comboinstrument0_3"); + GtkEntry *entryVolume = (GtkEntry*) gtk_builder_get_object(monBuilder,"combovolume0_3"); + GtkEntry *entryEffet = (GtkEntry*) gtk_builder_get_object(monBuilder,"comboeffet0_3"); + + const char *strnote = gtk_entry_get_text(GTK_ENTRY(entryNote)); + const char *stroctave = gtk_entry_get_text(GTK_ENTRY(entryOctave)); + const char *strinstrument = gtk_entry_get_text(GTK_ENTRY(entryInstrument)); + const char *strvolume = gtk_entry_get_text(GTK_ENTRY(entryVolume)); + const char *streffet = gtk_entry_get_text(GTK_ENTRY(entryEffet)); + + if (strcmp(Do,strnote)==0) definirNote(m,0,3,1); + else + if (strcmp(DoD,strnote)==0) definirNote(m,0,3,2); + else + if (strcmp(Re,strnote)==0) definirNote(m,0,3,3); + else + if (strcmp(ReD,strnote)==0) definirNote(m,0,3,4); + else + if (strcmp(Mi,strnote)==0) definirNote(m,0,3,5); + else + if (strcmp(Fa,strnote)==0) definirNote(m,0,3,6); + else + if (strcmp(FaD,strnote)==0) definirNote(m,0,3,7); + else + if (strcmp(Sol,strnote)==0) definirNote(m,0,3,8); + else + if (strcmp(SolD,strnote)==0) definirNote(m,0,3,9); + else + if (strcmp(La,strnote)==0) definirNote(m,0,3,10); + else + if (strcmp(LaD,strnote)==0) definirNote(m,0,3,11); + else + if (strcmp(Si,strnote)==0) definirNote(m,0,3,12); + + if (strcmp(N1,stroctave)==0) definirOctave(m,0,3,1); + else + if (strcmp(N2,stroctave)==0) definirOctave(m,0,3,2); + else + if (strcmp(N3,stroctave)==0) definirOctave(m,0,3,3); + else + if (strcmp(N4,stroctave)==0) definirOctave(m,0,3,4); + else + if (strcmp(N5,stroctave)==0) definirOctave(m,0,3,5); + + if (strcmp(N1,strinstrument)==0) definirInstrument(m,0,3,1); + else + if (strcmp(N2,strinstrument)==0) definirInstrument(m,0,3,2); + else + if (strcmp(N3,strinstrument)==0) definirInstrument(m,0,3,3); + else + if (strcmp(N4,strinstrument)==0) definirInstrument(m,0,3,4); + else + if (strcmp(N5,strinstrument)==0) definirInstrument(m,0,3,5); + + if (strcmp(N1,strvolume)==0) definirVolume(m,0,3,1); + else + if (strcmp(N2,strvolume)==0) definirVolume(m,0,3,2); + else + if (strcmp(N3,strvolume)==0) definirVolume(m,0,3,3); + else + if (strcmp(N4,strvolume)==0) definirVolume(m,0,3,4); + else + if (strcmp(N5,strvolume)==0) definirVolume(m,0,3,5); + + if (strcmp(N1,streffet)==0) definirEffet(m,0,3,1); + else + if (strcmp(N2,streffet)==0) definirEffet(m,0,3,2); + else + if (strcmp(N3,streffet)==0) definirEffet(m,0,3,3); + else + if (strcmp(N4,streffet)==0) definirEffet(m,0,3,4); + else + if (strcmp(N5,streffet)==0) definirEffet(m,0,3,5); +} +void fenetreNote0_4 ( int argc, char *argv[] ) +{ + GtkWidget *maFenetreNote = GTK_WIDGET( gtk_builder_get_object( monBuilder, "ajoutnote0_4")); + + gtk_widget_show_all (maFenetreNote); +} + +void remplissageNote0_4 (GtkWidget *widget, gpointer *data){ + + GtkEntry *entryNote = (GtkEntry*) gtk_builder_get_object(monBuilder,"combonote0_4"); + GtkEntry *entryOctave = (GtkEntry*) gtk_builder_get_object(monBuilder,"combooctave0_4"); + GtkEntry *entryInstrument = (GtkEntry*) gtk_builder_get_object(monBuilder,"comboinstrument0_4"); + GtkEntry *entryVolume = (GtkEntry*) gtk_builder_get_object(monBuilder,"combovolume0_4"); + GtkEntry *entryEffet = (GtkEntry*) gtk_builder_get_object(monBuilder,"comboeffet0_4"); + + const char *strnote = gtk_entry_get_text(GTK_ENTRY(entryNote)); + const char *stroctave = gtk_entry_get_text(GTK_ENTRY(entryOctave)); + const char *strinstrument = gtk_entry_get_text(GTK_ENTRY(entryInstrument)); + const char *strvolume = gtk_entry_get_text(GTK_ENTRY(entryVolume)); + const char *streffet = gtk_entry_get_text(GTK_ENTRY(entryEffet)); + + if (strcmp(Do,strnote)==0) definirNote(m,0,4,1); + else + if (strcmp(DoD,strnote)==0) definirNote(m,0,4,2); + else + if (strcmp(Re,strnote)==0) definirNote(m,0,4,3); + else + if (strcmp(ReD,strnote)==0) definirNote(m,0,4,4); + else + if (strcmp(Mi,strnote)==0) definirNote(m,0,4,5); + else + if (strcmp(Fa,strnote)==0) definirNote(m,0,4,6); + else + if (strcmp(FaD,strnote)==0) definirNote(m,0,4,7); + else + if (strcmp(Sol,strnote)==0) definirNote(m,0,4,8); + else + if (strcmp(SolD,strnote)==0) definirNote(m,0,4,9); + else + if (strcmp(La,strnote)==0) definirNote(m,0,4,10); + else + if (strcmp(LaD,strnote)==0) definirNote(m,0,4,11); + else + if (strcmp(Si,strnote)==0) definirNote(m,0,4,12); + + if (strcmp(N1,stroctave)==0) definirOctave(m,0,4,1); + else + if (strcmp(N2,stroctave)==0) definirOctave(m,0,4,2); + else + if (strcmp(N3,stroctave)==0) definirOctave(m,0,4,3); + else + if (strcmp(N4,stroctave)==0) definirOctave(m,0,4,4); + else + if (strcmp(N5,stroctave)==0) definirOctave(m,0,4,5); + + if (strcmp(N1,strinstrument)==0) definirInstrument(m,0,4,1); + else + if (strcmp(N2,strinstrument)==0) definirInstrument(m,0,4,2); + else + if (strcmp(N3,strinstrument)==0) definirInstrument(m,0,4,3); + else + if (strcmp(N4,strinstrument)==0) definirInstrument(m,0,4,4); + else + if (strcmp(N5,strinstrument)==0) definirInstrument(m,0,4,5); + + if (strcmp(N1,strvolume)==0) definirVolume(m,0,4,1); + else + if (strcmp(N2,strvolume)==0) definirVolume(m,0,4,2); + else + if (strcmp(N3,strvolume)==0) definirVolume(m,0,4,3); + else + if (strcmp(N4,strvolume)==0) definirVolume(m,0,4,4); + else + if (strcmp(N5,strvolume)==0) definirVolume(m,0,4,5); + + if (strcmp(N1,streffet)==0) definirEffet(m,0,4,1); + else + if (strcmp(N2,streffet)==0) definirEffet(m,0,4,2); + else + if (strcmp(N3,streffet)==0) definirEffet(m,0,4,3); + else + if (strcmp(N4,streffet)==0) definirEffet(m,0,4,4); + else + if (strcmp(N5,streffet)==0) definirEffet(m,0,4,5); +} +void fenetreNote0_5 ( int argc, char *argv[] ) +{ + GtkWidget *maFenetreNote = GTK_WIDGET( gtk_builder_get_object( monBuilder, "ajoutnote0_5")); + + gtk_widget_show_all (maFenetreNote); +} + +void remplissageNote0_5 (GtkWidget *widget, gpointer *data){ + + GtkEntry *entryNote = (GtkEntry*) gtk_builder_get_object(monBuilder,"combonote0_5"); + GtkEntry *entryOctave = (GtkEntry*) gtk_builder_get_object(monBuilder,"combooctave0_5"); + GtkEntry *entryInstrument = (GtkEntry*) gtk_builder_get_object(monBuilder,"comboinstrument0_5"); + GtkEntry *entryVolume = (GtkEntry*) gtk_builder_get_object(monBuilder,"combovolume0_5"); + GtkEntry *entryEffet = (GtkEntry*) gtk_builder_get_object(monBuilder,"comboeffet0_5"); + + const char *strnote = gtk_entry_get_text(GTK_ENTRY(entryNote)); + const char *stroctave = gtk_entry_get_text(GTK_ENTRY(entryOctave)); + const char *strinstrument = gtk_entry_get_text(GTK_ENTRY(entryInstrument)); + const char *strvolume = gtk_entry_get_text(GTK_ENTRY(entryVolume)); + const char *streffet = gtk_entry_get_text(GTK_ENTRY(entryEffet)); + + if (strcmp(Do,strnote)==0) definirNote(m,0,5,1); + else + if (strcmp(DoD,strnote)==0) definirNote(m,0,5,2); + else + if (strcmp(Re,strnote)==0) definirNote(m,0,5,3); + else + if (strcmp(ReD,strnote)==0) definirNote(m,0,5,4); + else + if (strcmp(Mi,strnote)==0) definirNote(m,0,5,5); + else + if (strcmp(Fa,strnote)==0) definirNote(m,0,5,6); + else + if (strcmp(FaD,strnote)==0) definirNote(m,0,5,7); + else + if (strcmp(Sol,strnote)==0) definirNote(m,0,5,8); + else + if (strcmp(SolD,strnote)==0) definirNote(m,0,5,9); + else + if (strcmp(La,strnote)==0) definirNote(m,0,5,10); + else + if (strcmp(LaD,strnote)==0) definirNote(m,0,5,11); + else + if (strcmp(Si,strnote)==0) definirNote(m,0,5,12); + + if (strcmp(N1,stroctave)==0) definirOctave(m,0,5,1); + else + if (strcmp(N2,stroctave)==0) definirOctave(m,0,5,2); + else + if (strcmp(N3,stroctave)==0) definirOctave(m,0,5,3); + else + if (strcmp(N4,stroctave)==0) definirOctave(m,0,5,4); + else + if (strcmp(N5,stroctave)==0) definirOctave(m,0,5,5); + + if (strcmp(N1,strinstrument)==0) definirInstrument(m,0,5,1); + else + if (strcmp(N2,strinstrument)==0) definirInstrument(m,0,5,2); + else + if (strcmp(N3,strinstrument)==0) definirInstrument(m,0,5,3); + else + if (strcmp(N4,strinstrument)==0) definirInstrument(m,0,5,4); + else + if (strcmp(N5,strinstrument)==0) definirInstrument(m,0,5,5); + + if (strcmp(N1,strvolume)==0) definirVolume(m,0,5,1); + else + if (strcmp(N2,strvolume)==0) definirVolume(m,0,5,2); + else + if (strcmp(N3,strvolume)==0) definirVolume(m,0,5,3); + else + if (strcmp(N4,strvolume)==0) definirVolume(m,0,5,4); + else + if (strcmp(N5,strvolume)==0) definirVolume(m,0,5,5); + + if (strcmp(N1,streffet)==0) definirEffet(m,0,5,1); + else + if (strcmp(N2,streffet)==0) definirEffet(m,0,5,2); + else + if (strcmp(N3,streffet)==0) definirEffet(m,0,5,3); + else + if (strcmp(N4,streffet)==0) definirEffet(m,0,5,4); + else + if (strcmp(N5,streffet)==0) definirEffet(m,0,5,5); +} +void fenetreNote0_6 ( int argc, char *argv[] ) +{ + GtkWidget *maFenetreNote = GTK_WIDGET( gtk_builder_get_object( monBuilder, "ajoutnote0_6")); + + gtk_widget_show_all (maFenetreNote); +} + +void remplissageNote0_6 (GtkWidget *widget, gpointer *data){ + + GtkEntry *entryNote = (GtkEntry*) gtk_builder_get_object(monBuilder,"combonote0_6"); + GtkEntry *entryOctave = (GtkEntry*) gtk_builder_get_object(monBuilder,"combooctave0_6"); + GtkEntry *entryInstrument = (GtkEntry*) gtk_builder_get_object(monBuilder,"comboinstrument0_6"); + GtkEntry *entryVolume = (GtkEntry*) gtk_builder_get_object(monBuilder,"combovolume0_6"); + GtkEntry *entryEffet = (GtkEntry*) gtk_builder_get_object(monBuilder,"comboeffet0_6"); + + const char *strnote = gtk_entry_get_text(GTK_ENTRY(entryNote)); + const char *stroctave = gtk_entry_get_text(GTK_ENTRY(entryOctave)); + const char *strinstrument = gtk_entry_get_text(GTK_ENTRY(entryInstrument)); + const char *strvolume = gtk_entry_get_text(GTK_ENTRY(entryVolume)); + const char *streffet = gtk_entry_get_text(GTK_ENTRY(entryEffet)); + + if (strcmp(Do,strnote)==0) definirNote(m,0,6,1); + else + if (strcmp(DoD,strnote)==0) definirNote(m,0,6,2); + else + if (strcmp(Re,strnote)==0) definirNote(m,0,6,3); + else + if (strcmp(ReD,strnote)==0) definirNote(m,0,6,4); + else + if (strcmp(Mi,strnote)==0) definirNote(m,0,6,5); + else + if (strcmp(Fa,strnote)==0) definirNote(m,0,6,6); + else + if (strcmp(FaD,strnote)==0) definirNote(m,0,6,7); + else + if (strcmp(Sol,strnote)==0) definirNote(m,0,6,8); + else + if (strcmp(SolD,strnote)==0) definirNote(m,0,6,9); + else + if (strcmp(La,strnote)==0) definirNote(m,0,6,10); + else + if (strcmp(LaD,strnote)==0) definirNote(m,0,6,11); + else + if (strcmp(Si,strnote)==0) definirNote(m,0,6,12); + + if (strcmp(N1,stroctave)==0) definirOctave(m,0,6,1); + else + if (strcmp(N2,stroctave)==0) definirOctave(m,0,6,2); + else + if (strcmp(N3,stroctave)==0) definirOctave(m,0,6,3); + else + if (strcmp(N4,stroctave)==0) definirOctave(m,0,6,4); + else + if (strcmp(N5,stroctave)==0) definirOctave(m,0,6,5); + + if (strcmp(N1,strinstrument)==0) definirInstrument(m,0,6,1); + else + if (strcmp(N2,strinstrument)==0) definirInstrument(m,0,6,2); + else + if (strcmp(N3,strinstrument)==0) definirInstrument(m,0,6,3); + else + if (strcmp(N4,strinstrument)==0) definirInstrument(m,0,6,4); + else + if (strcmp(N5,strinstrument)==0) definirInstrument(m,0,6,5); + + if (strcmp(N1,strvolume)==0) definirVolume(m,0,6,1); + else + if (strcmp(N2,strvolume)==0) definirVolume(m,0,6,2); + else + if (strcmp(N3,strvolume)==0) definirVolume(m,0,6,3); + else + if (strcmp(N4,strvolume)==0) definirVolume(m,0,6,4); + else + if (strcmp(N5,strvolume)==0) definirVolume(m,0,6,5); + + if (strcmp(N1,streffet)==0) definirEffet(m,0,6,1); + else + if (strcmp(N2,streffet)==0) definirEffet(m,0,6,2); + else + if (strcmp(N3,streffet)==0) definirEffet(m,0,6,3); + else + if (strcmp(N4,streffet)==0) definirEffet(m,0,6,4); + else + if (strcmp(N5,streffet)==0) definirEffet(m,0,6,5); +} +void fenetreNote0_7 ( int argc, char *argv[] ) +{ + GtkWidget *maFenetreNote = GTK_WIDGET( gtk_builder_get_object( monBuilder, "ajoutnote0_7")); + + gtk_widget_show_all (maFenetreNote); +} + +void remplissageNote0_7 (GtkWidget *widget, gpointer *data){ + + GtkEntry *entryNote = (GtkEntry*) gtk_builder_get_object(monBuilder,"combonote0_7"); + GtkEntry *entryOctave = (GtkEntry*) gtk_builder_get_object(monBuilder,"combooctave0_7"); + GtkEntry *entryInstrument = (GtkEntry*) gtk_builder_get_object(monBuilder,"comboinstrument0_7"); + GtkEntry *entryVolume = (GtkEntry*) gtk_builder_get_object(monBuilder,"combovolume0_7"); + GtkEntry *entryEffet = (GtkEntry*) gtk_builder_get_object(monBuilder,"comboeffet0_7"); + + const char *strnote = gtk_entry_get_text(GTK_ENTRY(entryNote)); + const char *stroctave = gtk_entry_get_text(GTK_ENTRY(entryOctave)); + const char *strinstrument = gtk_entry_get_text(GTK_ENTRY(entryInstrument)); + const char *strvolume = gtk_entry_get_text(GTK_ENTRY(entryVolume)); + const char *streffet = gtk_entry_get_text(GTK_ENTRY(entryEffet)); + + if (strcmp(Do,strnote)==0) definirNote(m,0,7,1); + else + if (strcmp(DoD,strnote)==0) definirNote(m,0,7,2); + else + if (strcmp(Re,strnote)==0) definirNote(m,0,7,3); + else + if (strcmp(ReD,strnote)==0) definirNote(m,0,7,4); + else + if (strcmp(Mi,strnote)==0) definirNote(m,0,7,5); + else + if (strcmp(Fa,strnote)==0) definirNote(m,0,7,6); + else + if (strcmp(FaD,strnote)==0) definirNote(m,0,7,7); + else + if (strcmp(Sol,strnote)==0) definirNote(m,0,7,8); + else + if (strcmp(SolD,strnote)==0) definirNote(m,0,7,9); + else + if (strcmp(La,strnote)==0) definirNote(m,0,7,10); + else + if (strcmp(LaD,strnote)==0) definirNote(m,0,7,11); + else + if (strcmp(Si,strnote)==0) definirNote(m,0,7,12); + + if (strcmp(N1,stroctave)==0) definirOctave(m,0,7,1); + else + if (strcmp(N2,stroctave)==0) definirOctave(m,0,7,2); + else + if (strcmp(N3,stroctave)==0) definirOctave(m,0,7,3); + else + if (strcmp(N4,stroctave)==0) definirOctave(m,0,7,4); + else + if (strcmp(N5,stroctave)==0) definirOctave(m,0,7,5); + + if (strcmp(N1,strinstrument)==0) definirInstrument(m,0,7,1); + else + if (strcmp(N2,strinstrument)==0) definirInstrument(m,0,7,2); + else + if (strcmp(N3,strinstrument)==0) definirInstrument(m,0,7,3); + else + if (strcmp(N4,strinstrument)==0) definirInstrument(m,0,7,4); + else + if (strcmp(N5,strinstrument)==0) definirInstrument(m,0,7,5); + + if (strcmp(N1,strvolume)==0) definirVolume(m,0,7,1); + else + if (strcmp(N2,strvolume)==0) definirVolume(m,0,7,2); + else + if (strcmp(N3,strvolume)==0) definirVolume(m,0,7,3); + else + if (strcmp(N4,strvolume)==0) definirVolume(m,0,7,4); + else + if (strcmp(N5,strvolume)==0) definirVolume(m,0,7,5); + + if (strcmp(N1,streffet)==0) definirEffet(m,0,7,1); + else + if (strcmp(N2,streffet)==0) definirEffet(m,0,7,2); + else + if (strcmp(N3,streffet)==0) definirEffet(m,0,7,3); + else + if (strcmp(N4,streffet)==0) definirEffet(m,0,7,4); + else + if (strcmp(N5,streffet)==0) definirEffet(m,0,7,5); +} +void fenetreNote0_8 ( int argc, char *argv[] ) +{ + GtkWidget *maFenetreNote = GTK_WIDGET( gtk_builder_get_object( monBuilder, "ajoutnote0_8")); + + gtk_widget_show_all (maFenetreNote); +} + +void remplissageNote0_8 (GtkWidget *widget, gpointer *data){ + + GtkEntry *entryNote = (GtkEntry*) gtk_builder_get_object(monBuilder,"combonote0_8"); + GtkEntry *entryOctave = (GtkEntry*) gtk_builder_get_object(monBuilder,"combooctave0_8"); + GtkEntry *entryInstrument = (GtkEntry*) gtk_builder_get_object(monBuilder,"comboinstrument0_8"); + GtkEntry *entryVolume = (GtkEntry*) gtk_builder_get_object(monBuilder,"combovolume0_8"); + GtkEntry *entryEffet = (GtkEntry*) gtk_builder_get_object(monBuilder,"comboeffet0_8"); + + const char *strnote = gtk_entry_get_text(GTK_ENTRY(entryNote)); + const char *stroctave = gtk_entry_get_text(GTK_ENTRY(entryOctave)); + const char *strinstrument = gtk_entry_get_text(GTK_ENTRY(entryInstrument)); + const char *strvolume = gtk_entry_get_text(GTK_ENTRY(entryVolume)); + const char *streffet = gtk_entry_get_text(GTK_ENTRY(entryEffet)); + + if (strcmp(Do,strnote)==0) definirNote(m,0,8,1); + else + if (strcmp(DoD,strnote)==0) definirNote(m,0,8,2); + else + if (strcmp(Re,strnote)==0) definirNote(m,0,8,3); + else + if (strcmp(ReD,strnote)==0) definirNote(m,0,8,4); + else + if (strcmp(Mi,strnote)==0) definirNote(m,0,8,5); + else + if (strcmp(Fa,strnote)==0) definirNote(m,0,8,6); + else + if (strcmp(FaD,strnote)==0) definirNote(m,0,8,7); + else + if (strcmp(Sol,strnote)==0) definirNote(m,0,8,8); + else + if (strcmp(SolD,strnote)==0) definirNote(m,0,8,9); + else + if (strcmp(La,strnote)==0) definirNote(m,0,8,10); + else + if (strcmp(LaD,strnote)==0) definirNote(m,0,8,11); + else + if (strcmp(Si,strnote)==0) definirNote(m,0,8,12); + + if (strcmp(N1,stroctave)==0) definirOctave(m,0,8,1); + else + if (strcmp(N2,stroctave)==0) definirOctave(m,0,8,2); + else + if (strcmp(N3,stroctave)==0) definirOctave(m,0,8,3); + else + if (strcmp(N4,stroctave)==0) definirOctave(m,0,8,4); + else + if (strcmp(N5,stroctave)==0) definirOctave(m,0,8,5); + + if (strcmp(N1,strinstrument)==0) definirInstrument(m,0,8,1); + else + if (strcmp(N2,strinstrument)==0) definirInstrument(m,0,8,2); + else + if (strcmp(N3,strinstrument)==0) definirInstrument(m,0,8,3); + else + if (strcmp(N4,strinstrument)==0) definirInstrument(m,0,8,4); + else + if (strcmp(N5,strinstrument)==0) definirInstrument(m,0,8,5); + + if (strcmp(N1,strvolume)==0) definirVolume(m,0,8,1); + else + if (strcmp(N2,strvolume)==0) definirVolume(m,0,8,2); + else + if (strcmp(N3,strvolume)==0) definirVolume(m,0,8,3); + else + if (strcmp(N4,strvolume)==0) definirVolume(m,0,8,4); + else + if (strcmp(N5,strvolume)==0) definirVolume(m,0,8,5); + + if (strcmp(N1,streffet)==0) definirEffet(m,0,8,1); + else + if (strcmp(N2,streffet)==0) definirEffet(m,0,8,2); + else + if (strcmp(N3,streffet)==0) definirEffet(m,0,8,3); + else + if (strcmp(N4,streffet)==0) definirEffet(m,0,8,4); + else + if (strcmp(N5,streffet)==0) definirEffet(m,0,8,5); +} +void fenetreNote0_9 ( int argc, char *argv[] ) +{ + GtkWidget *maFenetreNote = GTK_WIDGET( gtk_builder_get_object( monBuilder, "ajoutnote0_9")); + + gtk_widget_show_all (maFenetreNote); +} + +void remplissageNote0_9 (GtkWidget *widget, gpointer *data){ + + GtkEntry *entryNote = (GtkEntry*) gtk_builder_get_object(monBuilder,"combonote0_9"); + GtkEntry *entryOctave = (GtkEntry*) gtk_builder_get_object(monBuilder,"combooctave0_9"); + GtkEntry *entryInstrument = (GtkEntry*) gtk_builder_get_object(monBuilder,"comboinstrument0_9"); + GtkEntry *entryVolume = (GtkEntry*) gtk_builder_get_object(monBuilder,"combovolume0_9"); + GtkEntry *entryEffet = (GtkEntry*) gtk_builder_get_object(monBuilder,"comboeffet0_9"); + + const char *strnote = gtk_entry_get_text(GTK_ENTRY(entryNote)); + const char *stroctave = gtk_entry_get_text(GTK_ENTRY(entryOctave)); + const char *strinstrument = gtk_entry_get_text(GTK_ENTRY(entryInstrument)); + const char *strvolume = gtk_entry_get_text(GTK_ENTRY(entryVolume)); + const char *streffet = gtk_entry_get_text(GTK_ENTRY(entryEffet)); + + if (strcmp(Do,strnote)==0) definirNote(m,0,9,1); + else + if (strcmp(DoD,strnote)==0) definirNote(m,0,9,2); + else + if (strcmp(Re,strnote)==0) definirNote(m,0,9,3); + else + if (strcmp(ReD,strnote)==0) definirNote(m,0,9,4); + else + if (strcmp(Mi,strnote)==0) definirNote(m,0,9,5); + else + if (strcmp(Fa,strnote)==0) definirNote(m,0,9,6); + else + if (strcmp(FaD,strnote)==0) definirNote(m,0,9,7); + else + if (strcmp(Sol,strnote)==0) definirNote(m,0,9,8); + else + if (strcmp(SolD,strnote)==0) definirNote(m,0,9,9); + else + if (strcmp(La,strnote)==0) definirNote(m,0,9,10); + else + if (strcmp(LaD,strnote)==0) definirNote(m,0,9,11); + else + if (strcmp(Si,strnote)==0) definirNote(m,0,9,12); + + if (strcmp(N1,stroctave)==0) definirOctave(m,0,9,1); + else + if (strcmp(N2,stroctave)==0) definirOctave(m,0,9,2); + else + if (strcmp(N3,stroctave)==0) definirOctave(m,0,9,3); + else + if (strcmp(N4,stroctave)==0) definirOctave(m,0,9,4); + else + if (strcmp(N5,stroctave)==0) definirOctave(m,0,9,5); + + if (strcmp(N1,strinstrument)==0) definirInstrument(m,0,9,1); + else + if (strcmp(N2,strinstrument)==0) definirInstrument(m,0,9,2); + else + if (strcmp(N3,strinstrument)==0) definirInstrument(m,0,9,3); + else + if (strcmp(N4,strinstrument)==0) definirInstrument(m,0,9,4); + else + if (strcmp(N5,strinstrument)==0) definirInstrument(m,0,9,5); + + if (strcmp(N1,strvolume)==0) definirVolume(m,0,9,1); + else + if (strcmp(N2,strvolume)==0) definirVolume(m,0,9,2); + else + if (strcmp(N3,strvolume)==0) definirVolume(m,0,9,3); + else + if (strcmp(N4,strvolume)==0) definirVolume(m,0,9,4); + else + if (strcmp(N5,strvolume)==0) definirVolume(m,0,9,5); + + if (strcmp(N1,streffet)==0) definirEffet(m,0,9,1); + else + if (strcmp(N2,streffet)==0) definirEffet(m,0,9,2); + else + if (strcmp(N3,streffet)==0) definirEffet(m,0,9,3); + else + if (strcmp(N4,streffet)==0) definirEffet(m,0,9,4); + else + if (strcmp(N5,streffet)==0) definirEffet(m,0,9,5); +} +void fenetreNote0_0 ( int argc, char *argv[] ) +{ + GtkWidget *maFenetreNote = GTK_WIDGET( gtk_builder_get_object( monBuilder, "ajoutnote0_0")); + + gtk_widget_show_all (maFenetreNote); +} + +void remplissageNote0_0 (GtkWidget *widget, gpointer *data){ + + GtkEntry *entryNote = (GtkEntry*) gtk_builder_get_object(monBuilder,"combonote0_0"); + GtkEntry *entryOctave = (GtkEntry*) gtk_builder_get_object(monBuilder,"combooctave0_0"); + GtkEntry *entryInstrument = (GtkEntry*) gtk_builder_get_object(monBuilder,"comboinstrument0_0"); + GtkEntry *entryVolume = (GtkEntry*) gtk_builder_get_object(monBuilder,"combovolume0_0"); + GtkEntry *entryEffet = (GtkEntry*) gtk_builder_get_object(monBuilder,"comboeffet0_0"); + + const char *strnote = gtk_entry_get_text(GTK_ENTRY(entryNote)); + const char *stroctave = gtk_entry_get_text(GTK_ENTRY(entryOctave)); + const char *strinstrument = gtk_entry_get_text(GTK_ENTRY(entryInstrument)); + const char *strvolume = gtk_entry_get_text(GTK_ENTRY(entryVolume)); + const char *streffet = gtk_entry_get_text(GTK_ENTRY(entryEffet)); + + if (strcmp(Do,strnote)==0) definirNote(m,0,0,1); + else + if (strcmp(DoD,strnote)==0) definirNote(m,0,0,2); + else + if (strcmp(Re,strnote)==0) definirNote(m,0,0,3); + else + if (strcmp(ReD,strnote)==0) definirNote(m,0,0,4); + else + if (strcmp(Mi,strnote)==0) definirNote(m,0,0,5); + else + if (strcmp(Fa,strnote)==0) definirNote(m,0,0,6); + else + if (strcmp(FaD,strnote)==0) definirNote(m,0,0,7); + else + if (strcmp(Sol,strnote)==0) definirNote(m,0,0,8); + else + if (strcmp(SolD,strnote)==0) definirNote(m,0,0,9); + else + if (strcmp(La,strnote)==0) definirNote(m,0,0,10); + else + if (strcmp(LaD,strnote)==0) definirNote(m,0,0,11); + else + if (strcmp(Si,strnote)==0) definirNote(m,0,0,12); + + if (strcmp(N1,stroctave)==0) definirOctave(m,0,0,1); + else + if (strcmp(N2,stroctave)==0) definirOctave(m,0,0,2); + else + if (strcmp(N3,stroctave)==0) definirOctave(m,0,0,3); + else + if (strcmp(N4,stroctave)==0) definirOctave(m,0,0,4); + else + if (strcmp(N5,stroctave)==0) definirOctave(m,0,0,5); + + if (strcmp(N1,strinstrument)==0) definirInstrument(m,0,0,1); + else + if (strcmp(N2,strinstrument)==0) definirInstrument(m,0,0,2); + else + if (strcmp(N3,strinstrument)==0) definirInstrument(m,0,0,3); + else + if (strcmp(N4,strinstrument)==0) definirInstrument(m,0,0,4); + else + if (strcmp(N5,strinstrument)==0) definirInstrument(m,0,0,5); + + if (strcmp(N1,strvolume)==0) definirVolume(m,0,0,1); + else + if (strcmp(N2,strvolume)==0) definirVolume(m,0,0,2); + else + if (strcmp(N3,strvolume)==0) definirVolume(m,0,0,3); + else + if (strcmp(N4,strvolume)==0) definirVolume(m,0,0,4); + else + if (strcmp(N5,strvolume)==0) definirVolume(m,0,0,5); + + if (strcmp(N1,streffet)==0) definirEffet(m,0,0,1); + else + if (strcmp(N2,streffet)==0) definirEffet(m,0,0,2); + else + if (strcmp(N3,streffet)==0) definirEffet(m,0,0,3); + else + if (strcmp(N4,streffet)==0) definirEffet(m,0,0,4); + else + if (strcmp(N5,streffet)==0) definirEffet(m,0,0,5); +} +void fenetreNote0_0 ( int argc, char *argv[] ) +{ + GtkWidget *maFenetreNote = GTK_WIDGET( gtk_builder_get_object( monBuilder, "ajoutnote0_0")); + + gtk_widget_show_all (maFenetreNote); +} + +void remplissageNote0_0 (GtkWidget *widget, gpointer *data){ + + GtkEntry *entryNote = (GtkEntry*) gtk_builder_get_object(monBuilder,"combonote0_0"); + GtkEntry *entryOctave = (GtkEntry*) gtk_builder_get_object(monBuilder,"combooctave0_0"); + GtkEntry *entryInstrument = (GtkEntry*) gtk_builder_get_object(monBuilder,"comboinstrument0_0"); + GtkEntry *entryVolume = (GtkEntry*) gtk_builder_get_object(monBuilder,"combovolume0_0"); + GtkEntry *entryEffet = (GtkEntry*) gtk_builder_get_object(monBuilder,"comboeffet0_0"); + + const char *strnote = gtk_entry_get_text(GTK_ENTRY(entryNote)); + const char *stroctave = gtk_entry_get_text(GTK_ENTRY(entryOctave)); + const char *strinstrument = gtk_entry_get_text(GTK_ENTRY(entryInstrument)); + const char *strvolume = gtk_entry_get_text(GTK_ENTRY(entryVolume)); + const char *streffet = gtk_entry_get_text(GTK_ENTRY(entryEffet)); + + if (strcmp(Do,strnote)==0) definirNote(m,0,0,1); + else + if (strcmp(DoD,strnote)==0) definirNote(m,0,0,2); + else + if (strcmp(Re,strnote)==0) definirNote(m,0,0,3); + else + if (strcmp(ReD,strnote)==0) definirNote(m,0,0,4); + else + if (strcmp(Mi,strnote)==0) definirNote(m,0,0,5); + else + if (strcmp(Fa,strnote)==0) definirNote(m,0,0,6); + else + if (strcmp(FaD,strnote)==0) definirNote(m,0,0,7); + else + if (strcmp(Sol,strnote)==0) definirNote(m,0,0,8); + else + if (strcmp(SolD,strnote)==0) definirNote(m,0,0,9); + else + if (strcmp(La,strnote)==0) definirNote(m,0,0,10); + else + if (strcmp(LaD,strnote)==0) definirNote(m,0,0,11); + else + if (strcmp(Si,strnote)==0) definirNote(m,0,0,12); + + if (strcmp(N1,stroctave)==0) definirOctave(m,0,0,1); + else + if (strcmp(N2,stroctave)==0) definirOctave(m,0,0,2); + else + if (strcmp(N3,stroctave)==0) definirOctave(m,0,0,3); + else + if (strcmp(N4,stroctave)==0) definirOctave(m,0,0,4); + else + if (strcmp(N5,stroctave)==0) definirOctave(m,0,0,5); + + if (strcmp(N1,strinstrument)==0) definirInstrument(m,0,0,1); + else + if (strcmp(N2,strinstrument)==0) definirInstrument(m,0,0,2); + else + if (strcmp(N3,strinstrument)==0) definirInstrument(m,0,0,3); + else + if (strcmp(N4,strinstrument)==0) definirInstrument(m,0,0,4); + else + if (strcmp(N5,strinstrument)==0) definirInstrument(m,0,0,5); + + if (strcmp(N1,strvolume)==0) definirVolume(m,0,0,1); + else + if (strcmp(N2,strvolume)==0) definirVolume(m,0,0,2); + else + if (strcmp(N3,strvolume)==0) definirVolume(m,0,0,3); + else + if (strcmp(N4,strvolume)==0) definirVolume(m,0,0,4); + else + if (strcmp(N5,strvolume)==0) definirVolume(m,0,0,5); + + if (strcmp(N1,streffet)==0) definirEffet(m,0,0,1); + else + if (strcmp(N2,streffet)==0) definirEffet(m,0,0,2); + else + if (strcmp(N3,streffet)==0) definirEffet(m,0,0,3); + else + if (strcmp(N4,streffet)==0) definirEffet(m,0,0,4); + else + if (strcmp(N5,streffet)==0) definirEffet(m,0,0,5); +} +void fenetreNote0_0 ( int argc, char *argv[] ) +{ + GtkWidget *maFenetreNote = GTK_WIDGET( gtk_builder_get_object( monBuilder, "ajoutnote0_0")); + + gtk_widget_show_all (maFenetreNote); +} + +void remplissageNote0_0 (GtkWidget *widget, gpointer *data){ + + GtkEntry *entryNote = (GtkEntry*) gtk_builder_get_object(monBuilder,"combonote0_0"); + GtkEntry *entryOctave = (GtkEntry*) gtk_builder_get_object(monBuilder,"combooctave0_0"); + GtkEntry *entryInstrument = (GtkEntry*) gtk_builder_get_object(monBuilder,"comboinstrument0_0"); + GtkEntry *entryVolume = (GtkEntry*) gtk_builder_get_object(monBuilder,"combovolume0_0"); + GtkEntry *entryEffet = (GtkEntry*) gtk_builder_get_object(monBuilder,"comboeffet0_0"); + + const char *strnote = gtk_entry_get_text(GTK_ENTRY(entryNote)); + const char *stroctave = gtk_entry_get_text(GTK_ENTRY(entryOctave)); + const char *strinstrument = gtk_entry_get_text(GTK_ENTRY(entryInstrument)); + const char *strvolume = gtk_entry_get_text(GTK_ENTRY(entryVolume)); + const char *streffet = gtk_entry_get_text(GTK_ENTRY(entryEffet)); + + if (strcmp(Do,strnote)==0) definirNote(m,0,0,1); + else + if (strcmp(DoD,strnote)==0) definirNote(m,0,0,2); + else + if (strcmp(Re,strnote)==0) definirNote(m,0,0,3); + else + if (strcmp(ReD,strnote)==0) definirNote(m,0,0,4); + else + if (strcmp(Mi,strnote)==0) definirNote(m,0,0,5); + else + if (strcmp(Fa,strnote)==0) definirNote(m,0,0,6); + else + if (strcmp(FaD,strnote)==0) definirNote(m,0,0,7); + else + if (strcmp(Sol,strnote)==0) definirNote(m,0,0,8); + else + if (strcmp(SolD,strnote)==0) definirNote(m,0,0,9); + else + if (strcmp(La,strnote)==0) definirNote(m,0,0,10); + else + if (strcmp(LaD,strnote)==0) definirNote(m,0,0,11); + else + if (strcmp(Si,strnote)==0) definirNote(m,0,0,12); + + if (strcmp(N1,stroctave)==0) definirOctave(m,0,0,1); + else + if (strcmp(N2,stroctave)==0) definirOctave(m,0,0,2); + else + if (strcmp(N3,stroctave)==0) definirOctave(m,0,0,3); + else + if (strcmp(N4,stroctave)==0) definirOctave(m,0,0,4); + else + if (strcmp(N5,stroctave)==0) definirOctave(m,0,0,5); + + if (strcmp(N1,strinstrument)==0) definirInstrument(m,0,0,1); + else + if (strcmp(N2,strinstrument)==0) definirInstrument(m,0,0,2); + else + if (strcmp(N3,strinstrument)==0) definirInstrument(m,0,0,3); + else + if (strcmp(N4,strinstrument)==0) definirInstrument(m,0,0,4); + else + if (strcmp(N5,strinstrument)==0) definirInstrument(m,0,0,5); + + if (strcmp(N1,strvolume)==0) definirVolume(m,0,0,1); + else + if (strcmp(N2,strvolume)==0) definirVolume(m,0,0,2); + else + if (strcmp(N3,strvolume)==0) definirVolume(m,0,0,3); + else + if (strcmp(N4,strvolume)==0) definirVolume(m,0,0,4); + else + if (strcmp(N5,strvolume)==0) definirVolume(m,0,0,5); + + if (strcmp(N1,streffet)==0) definirEffet(m,0,0,1); + else + if (strcmp(N2,streffet)==0) definirEffet(m,0,0,2); + else + if (strcmp(N3,streffet)==0) definirEffet(m,0,0,3); + else + if (strcmp(N4,streffet)==0) definirEffet(m,0,0,4); + else + if (strcmp(N5,streffet)==0) definirEffet(m,0,0,5); +} +void fenetreNote0_0 ( int argc, char *argv[] ) +{ + GtkWidget *maFenetreNote = GTK_WIDGET( gtk_builder_get_object( monBuilder, "ajoutnote0_0")); + + gtk_widget_show_all (maFenetreNote); +} + +void remplissageNote0_0 (GtkWidget *widget, gpointer *data){ + + GtkEntry *entryNote = (GtkEntry*) gtk_builder_get_object(monBuilder,"combonote0_0"); + GtkEntry *entryOctave = (GtkEntry*) gtk_builder_get_object(monBuilder,"combooctave0_0"); + GtkEntry *entryInstrument = (GtkEntry*) gtk_builder_get_object(monBuilder,"comboinstrument0_0"); + GtkEntry *entryVolume = (GtkEntry*) gtk_builder_get_object(monBuilder,"combovolume0_0"); + GtkEntry *entryEffet = (GtkEntry*) gtk_builder_get_object(monBuilder,"comboeffet0_0"); + + const char *strnote = gtk_entry_get_text(GTK_ENTRY(entryNote)); + const char *stroctave = gtk_entry_get_text(GTK_ENTRY(entryOctave)); + const char *strinstrument = gtk_entry_get_text(GTK_ENTRY(entryInstrument)); + const char *strvolume = gtk_entry_get_text(GTK_ENTRY(entryVolume)); + const char *streffet = gtk_entry_get_text(GTK_ENTRY(entryEffet)); + + if (strcmp(Do,strnote)==0) definirNote(m,0,0,1); + else + if (strcmp(DoD,strnote)==0) definirNote(m,0,0,2); + else + if (strcmp(Re,strnote)==0) definirNote(m,0,0,3); + else + if (strcmp(ReD,strnote)==0) definirNote(m,0,0,4); + else + if (strcmp(Mi,strnote)==0) definirNote(m,0,0,5); + else + if (strcmp(Fa,strnote)==0) definirNote(m,0,0,6); + else + if (strcmp(FaD,strnote)==0) definirNote(m,0,0,7); + else + if (strcmp(Sol,strnote)==0) definirNote(m,0,0,8); + else + if (strcmp(SolD,strnote)==0) definirNote(m,0,0,9); + else + if (strcmp(La,strnote)==0) definirNote(m,0,0,10); + else + if (strcmp(LaD,strnote)==0) definirNote(m,0,0,11); + else + if (strcmp(Si,strnote)==0) definirNote(m,0,0,12); + + if (strcmp(N1,stroctave)==0) definirOctave(m,0,0,1); + else + if (strcmp(N2,stroctave)==0) definirOctave(m,0,0,2); + else + if (strcmp(N3,stroctave)==0) definirOctave(m,0,0,3); + else + if (strcmp(N4,stroctave)==0) definirOctave(m,0,0,4); + else + if (strcmp(N5,stroctave)==0) definirOctave(m,0,0,5); + + if (strcmp(N1,strinstrument)==0) definirInstrument(m,0,0,1); + else + if (strcmp(N2,strinstrument)==0) definirInstrument(m,0,0,2); + else + if (strcmp(N3,strinstrument)==0) definirInstrument(m,0,0,3); + else + if (strcmp(N4,strinstrument)==0) definirInstrument(m,0,0,4); + else + if (strcmp(N5,strinstrument)==0) definirInstrument(m,0,0,5); + + if (strcmp(N1,strvolume)==0) definirVolume(m,0,0,1); + else + if (strcmp(N2,strvolume)==0) definirVolume(m,0,0,2); + else + if (strcmp(N3,strvolume)==0) definirVolume(m,0,0,3); + else + if (strcmp(N4,strvolume)==0) definirVolume(m,0,0,4); + else + if (strcmp(N5,strvolume)==0) definirVolume(m,0,0,5); + + if (strcmp(N1,streffet)==0) definirEffet(m,0,0,1); + else + if (strcmp(N2,streffet)==0) definirEffet(m,0,0,2); + else + if (strcmp(N3,streffet)==0) definirEffet(m,0,0,3); + else + if (strcmp(N4,streffet)==0) definirEffet(m,0,0,4); + else + if (strcmp(N5,streffet)==0) definirEffet(m,0,0,5); +} +void fenetreNote0_0 ( int argc, char *argv[] ) +{ + GtkWidget *maFenetreNote = GTK_WIDGET( gtk_builder_get_object( monBuilder, "ajoutnote0_0")); + + gtk_widget_show_all (maFenetreNote); +} + +void remplissageNote0_0 (GtkWidget *widget, gpointer *data){ + + GtkEntry *entryNote = (GtkEntry*) gtk_builder_get_object(monBuilder,"combonote0_0"); + GtkEntry *entryOctave = (GtkEntry*) gtk_builder_get_object(monBuilder,"combooctave0_0"); + GtkEntry *entryInstrument = (GtkEntry*) gtk_builder_get_object(monBuilder,"comboinstrument0_0"); + GtkEntry *entryVolume = (GtkEntry*) gtk_builder_get_object(monBuilder,"combovolume0_0"); + GtkEntry *entryEffet = (GtkEntry*) gtk_builder_get_object(monBuilder,"comboeffet0_0"); + + const char *strnote = gtk_entry_get_text(GTK_ENTRY(entryNote)); + const char *stroctave = gtk_entry_get_text(GTK_ENTRY(entryOctave)); + const char *strinstrument = gtk_entry_get_text(GTK_ENTRY(entryInstrument)); + const char *strvolume = gtk_entry_get_text(GTK_ENTRY(entryVolume)); + const char *streffet = gtk_entry_get_text(GTK_ENTRY(entryEffet)); + + if (strcmp(Do,strnote)==0) definirNote(m,0,0,1); + else + if (strcmp(DoD,strnote)==0) definirNote(m,0,0,2); + else + if (strcmp(Re,strnote)==0) definirNote(m,0,0,3); + else + if (strcmp(ReD,strnote)==0) definirNote(m,0,0,4); + else + if (strcmp(Mi,strnote)==0) definirNote(m,0,0,5); + else + if (strcmp(Fa,strnote)==0) definirNote(m,0,0,6); + else + if (strcmp(FaD,strnote)==0) definirNote(m,0,0,7); + else + if (strcmp(Sol,strnote)==0) definirNote(m,0,0,8); + else + if (strcmp(SolD,strnote)==0) definirNote(m,0,0,9); + else + if (strcmp(La,strnote)==0) definirNote(m,0,0,10); + else + if (strcmp(LaD,strnote)==0) definirNote(m,0,0,11); + else + if (strcmp(Si,strnote)==0) definirNote(m,0,0,12); + + if (strcmp(N1,stroctave)==0) definirOctave(m,0,0,1); + else + if (strcmp(N2,stroctave)==0) definirOctave(m,0,0,2); + else + if (strcmp(N3,stroctave)==0) definirOctave(m,0,0,3); + else + if (strcmp(N4,stroctave)==0) definirOctave(m,0,0,4); + else + if (strcmp(N5,stroctave)==0) definirOctave(m,0,0,5); + + if (strcmp(N1,strinstrument)==0) definirInstrument(m,0,0,1); + else + if (strcmp(N2,strinstrument)==0) definirInstrument(m,0,0,2); + else + if (strcmp(N3,strinstrument)==0) definirInstrument(m,0,0,3); + else + if (strcmp(N4,strinstrument)==0) definirInstrument(m,0,0,4); + else + if (strcmp(N5,strinstrument)==0) definirInstrument(m,0,0,5); + + if (strcmp(N1,strvolume)==0) definirVolume(m,0,0,1); + else + if (strcmp(N2,strvolume)==0) definirVolume(m,0,0,2); + else + if (strcmp(N3,strvolume)==0) definirVolume(m,0,0,3); + else + if (strcmp(N4,strvolume)==0) definirVolume(m,0,0,4); + else + if (strcmp(N5,strvolume)==0) definirVolume(m,0,0,5); + + if (strcmp(N1,streffet)==0) definirEffet(m,0,0,1); + else + if (strcmp(N2,streffet)==0) definirEffet(m,0,0,2); + else + if (strcmp(N3,streffet)==0) definirEffet(m,0,0,3); + else + if (strcmp(N4,streffet)==0) definirEffet(m,0,0,4); + else + if (strcmp(N5,streffet)==0) definirEffet(m,0,0,5); +} +void fenetreNote0_0 ( int argc, char *argv[] ) +{ + GtkWidget *maFenetreNote = GTK_WIDGET( gtk_builder_get_object( monBuilder, "ajoutnote0_0")); + + gtk_widget_show_all (maFenetreNote); +} + +void remplissageNote0_0 (GtkWidget *widget, gpointer *data){ + + GtkEntry *entryNote = (GtkEntry*) gtk_builder_get_object(monBuilder,"combonote0_0"); + GtkEntry *entryOctave = (GtkEntry*) gtk_builder_get_object(monBuilder,"combooctave0_0"); + GtkEntry *entryInstrument = (GtkEntry*) gtk_builder_get_object(monBuilder,"comboinstrument0_0"); + GtkEntry *entryVolume = (GtkEntry*) gtk_builder_get_object(monBuilder,"combovolume0_0"); + GtkEntry *entryEffet = (GtkEntry*) gtk_builder_get_object(monBuilder,"comboeffet0_0"); + + const char *strnote = gtk_entry_get_text(GTK_ENTRY(entryNote)); + const char *stroctave = gtk_entry_get_text(GTK_ENTRY(entryOctave)); + const char *strinstrument = gtk_entry_get_text(GTK_ENTRY(entryInstrument)); + const char *strvolume = gtk_entry_get_text(GTK_ENTRY(entryVolume)); + const char *streffet = gtk_entry_get_text(GTK_ENTRY(entryEffet)); + + if (strcmp(Do,strnote)==0) definirNote(m,0,0,1); + else + if (strcmp(DoD,strnote)==0) definirNote(m,0,0,2); + else + if (strcmp(Re,strnote)==0) definirNote(m,0,0,3); + else + if (strcmp(ReD,strnote)==0) definirNote(m,0,0,4); + else + if (strcmp(Mi,strnote)==0) definirNote(m,0,0,5); + else + if (strcmp(Fa,strnote)==0) definirNote(m,0,0,6); + else + if (strcmp(FaD,strnote)==0) definirNote(m,0,0,7); + else + if (strcmp(Sol,strnote)==0) definirNote(m,0,0,8); + else + if (strcmp(SolD,strnote)==0) definirNote(m,0,0,9); + else + if (strcmp(La,strnote)==0) definirNote(m,0,0,10); + else + if (strcmp(LaD,strnote)==0) definirNote(m,0,0,11); + else + if (strcmp(Si,strnote)==0) definirNote(m,0,0,12); + + if (strcmp(N1,stroctave)==0) definirOctave(m,0,0,1); + else + if (strcmp(N2,stroctave)==0) definirOctave(m,0,0,2); + else + if (strcmp(N3,stroctave)==0) definirOctave(m,0,0,3); + else + if (strcmp(N4,stroctave)==0) definirOctave(m,0,0,4); + else + if (strcmp(N5,stroctave)==0) definirOctave(m,0,0,5); + + if (strcmp(N1,strinstrument)==0) definirInstrument(m,0,0,1); + else + if (strcmp(N2,strinstrument)==0) definirInstrument(m,0,0,2); + else + if (strcmp(N3,strinstrument)==0) definirInstrument(m,0,0,3); + else + if (strcmp(N4,strinstrument)==0) definirInstrument(m,0,0,4); + else + if (strcmp(N5,strinstrument)==0) definirInstrument(m,0,0,5); + + if (strcmp(N1,strvolume)==0) definirVolume(m,0,0,1); + else + if (strcmp(N2,strvolume)==0) definirVolume(m,0,0,2); + else + if (strcmp(N3,strvolume)==0) definirVolume(m,0,0,3); + else + if (strcmp(N4,strvolume)==0) definirVolume(m,0,0,4); + else + if (strcmp(N5,strvolume)==0) definirVolume(m,0,0,5); + + if (strcmp(N1,streffet)==0) definirEffet(m,0,0,1); + else + if (strcmp(N2,streffet)==0) definirEffet(m,0,0,2); + else + if (strcmp(N3,streffet)==0) definirEffet(m,0,0,3); + else + if (strcmp(N4,streffet)==0) definirEffet(m,0,0,4); + else + if (strcmp(N5,streffet)==0) definirEffet(m,0,0,5); +} diff --git a/sources/mainTest/maintest.c b/sources/mainTest/maintest.c index dd31c5a..31940a1 100644 --- a/sources/mainTest/maintest.c +++ b/sources/mainTest/maintest.c @@ -1,23 +1,3 @@ -/** - * \mainpage CSC3502 : PonyTracker - * - * Les fonctionnalités de cette application sont les suivantes : - * - * - * @file main.c - * - * Programme principal du Ponytracker - * - * @version 1.1 - * @author Module CSC3502 : Projet Informatique 1ère année TELECOM SudParis - * @date Mai 2014 -*/ - #include #include #include @@ -26,14 +6,12 @@ #include "motifs/motifs.h" #include "melodie/melodie.h" #include "lecture/lecture.h" -//#include -//#include -//#include #define DEF_NBR_TMP 16 #define MAX_PATTERNS 256 Motif* m; +GtkBuilder *monBuilder; char *Do="Do"; char *DoD="Do#"; char *Re="Re"; @@ -46,25 +24,22 @@ char *SolD="Sol#"; char *La="La"; char *LaD="La#"; char *Si="Si"; -char *SiD="Si#"; char *N1="1"; char *N2="2"; char *N3="3"; char *N4="4"; char *N5="5"; -void remplissageNote (GtkWidget *widget, gpointer *data); - // Fonctions de débug void afficherMotif(Motif* m, int nbrPortees){ - printf("%s :\n",m->nom); - for (int tmp = 0; tmp < m->nbrTmp; tmp++){ - for (int portee = 0; portee < nbrPortees; portee++){ - printf("%d ",getNote(m,portee,tmp)); - } - printf("\n"); - } + printf("%s :\n",m->nom); + for (int tmp = 0; tmp < m->nbrTmp; tmp++){ + for (int portee = 0; portee < nbrPortees; portee++){ + printf("%d ",getNote(m,portee,tmp)); + } + printf("\n"); + } } // Fin des fonctions de débug @@ -152,25 +127,37 @@ void debut(Motif* melodie[], Motif* liste, int nbrPortees){ ajouterMotifVirtuel(melodie,3,p); } +char *str_dup(char const *s) +{ + char *pc = NULL; + + if (s != NULL) + { + pc = malloc((strlen(s) + 1) * sizeof *pc); + if (pc != NULL) + { + strcpy(pc, s); + } + } + + return pc; +} + int main( int argc, char *argv[] ){ - - //lecture(nbrPortee, melodie); - - // insérer code GTK ici - GtkBuilder *monBuilder; - GtkWidget *maFenetre; - char *str=NULL; - - gtk_init( &argc, &argv ); - - monBuilder = gtk_builder_new(); - - gtk_builder_add_from_file( monBuilder, "GUI/ponytrackertest.glade", NULL); - gtk_builder_connect_signals( monBuilder, NULL); - - maFenetre = GTK_WIDGET( gtk_builder_get_object( monBuilder, "fenetreprincipale")); - - GtkLabel *labelNote = (GtkLabel*) gtk_builder_get_object(monBuilder,"button16"); + + GtkWidget *maFenetre; + char *str=NULL; + + gtk_init( &argc, &argv ); + + monBuilder = gtk_builder_new(); + + gtk_builder_add_from_file( monBuilder, "GUI/ponytrackertest.glade", NULL); + gtk_builder_connect_signals( monBuilder, NULL); + + maFenetre = GTK_WIDGET( gtk_builder_get_object( monBuilder, "fenetreprincipale")); + + GtkButton *button = (GtkButton*) gtk_builder_get_object(monBuilder, "button16"); switch (getNote(m,0,0)) { case 0 : str="Do "; @@ -208,9 +195,6 @@ int main( int argc, char *argv[] ){ case 11 : str="Si "; break; - case 12 : - str="Si# "; - break; default : break; } @@ -295,168 +279,121 @@ int main( int argc, char *argv[] ){ break; } - gtk_label_set_text(labelNote, str); + gtk_button_set_label(button, str); gtk_widget_show_all (maFenetre); gtk_main(); return EXIT_SUCCESS; } -void fenetreNote ( int argc, char *argv[] ) -{ - GtkBuilder *monBuilderNote; - GtkWidget *maFenetreNote; - - gtk_init( &argc, &argv ); - - monBuilderNote = gtk_builder_new(); - - gtk_builder_add_from_file( monBuilderNote, "GUI/ponytrackertest.glade", NULL); - gtk_builder_connect_signals( monBuilderNote, NULL); - - maFenetreNote = GTK_WIDGET( gtk_builder_get_object( monBuilderNote, "ajoutnote")); - - GtkButton *button = (GtkButton*) gtk_builder_get_object(monBuilderNote, "buttonok"); - - g_signal_connect(G_OBJECT(button),"clicked",G_CALLBACK(remplissageNote), - GTK_WIDGET( gtk_builder_get_object( monBuilderNote, "ajoutnote"))); - - gtk_widget_show_all (maFenetreNote); -} - -void remplissageNote (GtkWidget *widget, gpointer *data){ - - GtkBuilder *monBuilderNote; - - monBuilderNote = gtk_builder_new(); - - gtk_builder_add_from_file( monBuilderNote, "GUI/ponytrackertest.glade", NULL); - gtk_builder_connect_signals( monBuilderNote, NULL); - - GtkEntry *entryNote = (GtkEntry*) gtk_builder_get_object(monBuilderNote,"choisirnote"); - GtkEntry *entryOctave = (GtkEntry*) gtk_builder_get_object(monBuilderNote,"choisiroctave"); - GtkEntry *entryInstrument = (GtkEntry*) gtk_builder_get_object(monBuilderNote,"choisirinstrument"); - GtkEntry *entryVolume = (GtkEntry*) gtk_builder_get_object(monBuilderNote,"entryvolume"); - GtkEntry *entryEffet = (GtkEntry*) gtk_builder_get_object(monBuilderNote,"entryeffet"); - - if (strcmp(Do,gtk_entry_get_text(entryNote))==0) definirNote(m,0,0,1); - else - if (strcmp(DoD,gtk_entry_get_text(entryNote))==0) definirNote(m,0,0,2); - else - if (strcmp(Re,gtk_entry_get_text(entryNote))==0) definirNote(m,0,0,3); - else - if (strcmp(ReD,gtk_entry_get_text(entryNote))==0) definirNote(m,0,0,4); - else - if (strcmp(Mi,gtk_entry_get_text(entryNote))==0) definirNote(m,0,0,5); - else - if (strcmp(Fa,gtk_entry_get_text(entryNote))==0) definirNote(m,0,0,6); - else - if (strcmp(FaD,gtk_entry_get_text(entryNote))==0) definirNote(m,0,0,7); - else - if (strcmp(Sol,gtk_entry_get_text(entryNote))==0) definirNote(m,0,0,8); - else - if (strcmp(SolD,gtk_entry_get_text(entryNote))==0) definirNote(m,0,0,9); - else - if (strcmp(La,gtk_entry_get_text(entryNote))==0) definirNote(m,0,0,10); - else - if (strcmp(LaD,gtk_entry_get_text(entryNote))==0) definirNote(m,0,0,11); - else - if (strcmp(Si,gtk_entry_get_text(entryNote))==0) definirNote(m,0,0,12); - else - if (strcmp(SiD,gtk_entry_get_text(entryNote))==0) definirNote(m,0,0,13); - - if (strcmp(N1,gtk_entry_get_text(entryOctave))==0) definirOctave(m,0,0,1); - else - if (strcmp(N2,gtk_entry_get_text(entryOctave))==0) definirOctave(m,0,0,2); - else - if (strcmp(N3,gtk_entry_get_text(entryOctave))==0) definirOctave(m,0,0,3); - else - if (strcmp(N4,gtk_entry_get_text(entryOctave))==0) definirOctave(m,0,0,4); - else - if (strcmp(N5,gtk_entry_get_text(entryOctave))==0) definirOctave(m,0,0,5); - - if (strcmp(N1,gtk_entry_get_text(entryInstrument))==0) definirInstrument(m,0,0,1); - else - if (strcmp(N2,gtk_entry_get_text(entryInstrument))==0) definirInstrument(m,0,0,2); - else - if (strcmp(N3,gtk_entry_get_text(entryInstrument))==0) definirInstrument(m,0,0,3); - else - if (strcmp(N4,gtk_entry_get_text(entryInstrument))==0) definirInstrument(m,0,0,4); - else - if (strcmp(N5,gtk_entry_get_text(entryInstrument))==0) definirInstrument(m,0,0,5); - - if (strcmp(N1,gtk_entry_get_text(entryVolume))==0) definirVolume(m,0,0,1); - else - if (strcmp(N2,gtk_entry_get_text(entryVolume))==0) definirVolume(m,0,0,2); - else - if (strcmp(N3,gtk_entry_get_text(entryVolume))==0) definirVolume(m,0,0,3); - else - if (strcmp(N4,gtk_entry_get_text(entryVolume))==0) definirVolume(m,0,0,4); - else - if (strcmp(N5,gtk_entry_get_text(entryVolume))==0) definirVolume(m,0,0,5); - - if (strcmp(N1,gtk_entry_get_text(entryEffet))==0) definirEffet(m,0,0,1); - else - if (strcmp(N2,gtk_entry_get_text(entryEffet))==0) definirEffet(m,0,0,2); - else - if (strcmp(N3,gtk_entry_get_text(entryEffet))==0) definirEffet(m,0,0,3); - else - if (strcmp(N4,gtk_entry_get_text(entryEffet))==0) definirEffet(m,0,0,4); - else - if (strcmp(N5,gtk_entry_get_text(entryEffet))==0) definirEffet(m,0,0,5); -} - void fenetreSample ( int argc, char *argv[] ) { - GtkBuilder *monBuilderSample; - GtkWidget *maFenetreSample; - gtk_init( &argc, &argv ); - - monBuilderSample = gtk_builder_new(); - - gtk_builder_add_from_file( monBuilderSample, "GUI/ponytrackertest.glade", NULL); - gtk_builder_connect_signals( monBuilderSample, NULL); - - maFenetreSample = GTK_WIDGET( gtk_builder_get_object( monBuilderSample, "ajoutsample")); + GtkWidget *maFenetreSample = GTK_WIDGET( gtk_builder_get_object( monBuilder, "ajoutsample")); gtk_widget_show_all (maFenetreSample); } void fenetreInstrument ( int argc, char *argv[] ) { - GtkBuilder *monBuilderInstrument; - GtkWidget *maFenetreInstrument; - - gtk_init( &argc, &argv ); - - monBuilderInstrument = gtk_builder_new(); - - gtk_builder_add_from_file( monBuilderInstrument, "GUI/ponytrackertest.glade", NULL); - gtk_builder_connect_signals( monBuilderInstrument, NULL); - - maFenetreInstrument = GTK_WIDGET( gtk_builder_get_object( monBuilderInstrument, "ajoutinstrument")); + GtkWidget *maFenetreInstrument = GTK_WIDGET( gtk_builder_get_object( monBuilder, "ajoutinstrument")); gtk_widget_show_all (maFenetreInstrument); } void fenetreMotif ( int argc, char *argv[] ) { - GtkBuilder *monBuilderMotif; - GtkWidget *maFenetreMotif; - - gtk_init( &argc, &argv ); - - monBuilderMotif = gtk_builder_new(); - - gtk_builder_add_from_file( monBuilderMotif, "GUI/ponytrackertest.glade", NULL); - gtk_builder_connect_signals( monBuilderMotif, NULL); - - maFenetreMotif = GTK_WIDGET( gtk_builder_get_object( monBuilderMotif, "ajoutmotif")); + GtkWidget *maFenetreMotif = GTK_WIDGET( gtk_builder_get_object( monBuilder, "ajoutmotif")); gtk_widget_show_all (maFenetreMotif); } +void fenetreNote ( int argc, char *argv[] ) +{ + GtkWidget *maFenetreNote = GTK_WIDGET( gtk_builder_get_object( monBuilder, "ajoutnote")); + + gtk_widget_show_all (maFenetreNote); +} + +void remplissageNote (GtkWidget *widget, gpointer *data){ + + GtkEntry *entryNote = (GtkEntry*) gtk_builder_get_object(monBuilder,"combonote"); + GtkEntry *entryOctave = (GtkEntry*) gtk_builder_get_object(monBuilder,"combooctave"); + GtkEntry *entryInstrument = (GtkEntry*) gtk_builder_get_object(monBuilder,"comboinstrument"); + GtkEntry *entryVolume = (GtkEntry*) gtk_builder_get_object(monBuilder,"combovolume"); + GtkEntry *entryEffet = (GtkEntry*) gtk_builder_get_object(monBuilder,"comboeffet"); + + const char *strnote = gtk_entry_get_text(GTK_ENTRY(entryNote)); + const char *stroctave = gtk_entry_get_text(GTK_ENTRY(entryOctave)); + const char *strinstrument = gtk_entry_get_text(GTK_ENTRY(entryInstrument)); + const char *strvolume = gtk_entry_get_text(GTK_ENTRY(entryVolume)); + const char *streffet = gtk_entry_get_text(GTK_ENTRY(entryEffet)); + + if (strcmp(Do,strnote)==0) definirNote(m,0,0,1); + else + if (strcmp(DoD,strnote)==0) definirNote(m,0,0,2); + else + if (strcmp(Re,strnote)==0) definirNote(m,0,0,3); + else + if (strcmp(ReD,strnote)==0) definirNote(m,0,0,4); + else + if (strcmp(Mi,strnote)==0) definirNote(m,0,0,5); + else + if (strcmp(Fa,strnote)==0) definirNote(m,0,0,6); + else + if (strcmp(FaD,strnote)==0) definirNote(m,0,0,7); + else + if (strcmp(Sol,strnote)==0) definirNote(m,0,0,8); + else + if (strcmp(SolD,strnote)==0) definirNote(m,0,0,9); + else + if (strcmp(La,strnote)==0) definirNote(m,0,0,10); + else + if (strcmp(LaD,strnote)==0) definirNote(m,0,0,11); + else + if (strcmp(Si,strnote)==0) definirNote(m,0,0,12); + + if (strcmp(N1,stroctave)==0) definirOctave(m,0,0,1); + else + if (strcmp(N2,stroctave)==0) definirOctave(m,0,0,2); + else + if (strcmp(N3,stroctave)==0) definirOctave(m,0,0,3); + else + if (strcmp(N4,stroctave)==0) definirOctave(m,0,0,4); + else + if (strcmp(N5,stroctave)==0) definirOctave(m,0,0,5); + + if (strcmp(N1,strinstrument)==0) definirInstrument(m,0,0,1); + else + if (strcmp(N2,strinstrument)==0) definirInstrument(m,0,0,2); + else + if (strcmp(N3,strinstrument)==0) definirInstrument(m,0,0,3); + else + if (strcmp(N4,strinstrument)==0) definirInstrument(m,0,0,4); + else + if (strcmp(N5,strinstrument)==0) definirInstrument(m,0,0,5); + + if (strcmp(N1,strvolume)==0) definirVolume(m,0,0,1); + else + if (strcmp(N2,strvolume)==0) definirVolume(m,0,0,2); + else + if (strcmp(N3,strvolume)==0) definirVolume(m,0,0,3); + else + if (strcmp(N4,strvolume)==0) definirVolume(m,0,0,4); + else + if (strcmp(N5,strvolume)==0) definirVolume(m,0,0,5); + + if (strcmp(N1,streffet)==0) definirEffet(m,0,0,1); + else + if (strcmp(N2,streffet)==0) definirEffet(m,0,0,2); + else + if (strcmp(N3,streffet)==0) definirEffet(m,0,0,3); + else + if (strcmp(N4,streffet)==0) definirEffet(m,0,0,4); + else + if (strcmp(N5,streffet)==0) definirEffet(m,0,0,5); +} + void lancerLecture () { Motif* melodie[MAX_PATTERNS] = {NULL}; @@ -472,3 +409,5 @@ void quitter () { gtk_main_quit(); } + +void refresh(){} diff --git a/sources/mainTest/ponytrackertest.glade b/sources/mainTest/ponytrackertest.glade index a1e8472..6dfc899 100644 --- a/sources/mainTest/ponytrackertest.glade +++ b/sources/mainTest/ponytrackertest.glade @@ -954,9 +954,11 @@ True False + True 0 1 + Choisir une note Do Do# Re @@ -969,8 +971,13 @@ La La# Si - Si# + + + False + Choisir une note + + False @@ -982,12 +989,19 @@ True False + True 0 - 1 + Choisir un octave 1 2 + + + False + Choisir un octave + + False @@ -999,15 +1013,23 @@ True False + True 0 1 + Choisir un instrument 1 2 3 4 5 + + + False + Choisir un instrument + + False @@ -1019,15 +1041,23 @@ True False + True 0 1 + Choisir un volume 1 2 3 4 5 + + + False + Choisir un volume + + False @@ -1039,15 +1069,23 @@ True False + True 0 1 + Choisir un effet 1 2 3 4 5 + + + False + Choisir un effet + + False @@ -1065,6 +1103,7 @@ True True True + False @@ -1089,7 +1128,7 @@ False True - 5 + 6 @@ -2035,12 +2074,13 @@ True False - + Notes True True True 0.51999998092651367 + False