diff --git a/.gitignore b/.gitignore index 030295b..349b859 100644 --- a/.gitignore +++ b/.gitignore @@ -7,58 +7,7 @@ nclooper ui/t files/t - -# ---> C -# Prerequisites -*.d +sounds/* # Object files *.o -*.ko -*.obj -*.elf - -# Linker output -*.ilk -*.map -*.exp - -# Precompiled Headers -*.gch -*.pch - -# Libraries -*.lib -*.a -*.la -*.lo - -# Shared objects (inc. Windows DLLs) -*.dll -*.so -*.so.* -*.dylib - -# Executables -*.exe -*.out -*.app -*.i*86 -*.x86_64 -*.hex - -# Debug files -*.dSYM/ -*.su -*.idb -*.pdb - -# Kernel Module Compile Results -*.mod* -*.cmd -.tmp_versions/ -modules.order -Module.symvers -Mkfile.old -dkms.conf - diff --git a/Makefile b/Makefile index ae44a08..5f4cf15 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,22 @@ +# +# NC-LOOPER --- another kluge from tth +# + CC = gcc -CCOPT = -Wall -g -DDEBUG_LEVEL=1 +CCOPT = -Wall -g -DDEBUG_LEVEL=0 OBJS = ui/ncfuncs.o files/smpllist.o files/ffuncs.o LIBS = -lcurses +all: nclooper + main.o: main.c nclooper.h Makefile $(CC) ${CCOPT} -c $< +interactive.o: interactive.c nclooper.h Makefile + $(CC) ${CCOPT} -c $< + +OBJS += interactive.o nclooper: main.o ${OBJS} Makefile $(CC) ${CCOPT} $< ${OBJS} ${LIBS} -o $@ diff --git a/audio/Makefile b/audio/Makefile index e30f271..711b016 100644 --- a/audio/Makefile +++ b/audio/Makefile @@ -1,6 +1,9 @@ +# +# NC-LOOPER --- another kluge from tth +# CC = gcc -CCOPT = -Wall -g -DDEBUG_LEVEL=1 +CCOPT = -Wall -g -DDEBUG_LEVEL=0 LIBS = -lao -lsndfile -lm ao_output.o: ao_output.c Makefile diff --git a/audio/t.c b/audio/t.c index da7c333..d769389 100644 --- a/audio/t.c +++ b/audio/t.c @@ -25,7 +25,7 @@ ao_device *device; int foo; device = init_ao_output(44100); -fprintf(stderr, "AO init -> %p\n", device); +if (verbosity) fprintf(stderr, "AO init -> %p\n", device); switch (k) { case 0: @@ -40,7 +40,7 @@ switch (k) { } foo = close_ao_output(device); -fprintf(stderr, "AO close -> %d\n", foo); +if (verbosity) fprintf(stderr, "AO close -> %d\n", foo); return 0; } diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..fe05138 --- /dev/null +++ b/build.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +# ------------------------------------------------------------------ + +function build +{ +echo ============= $1 ============== +curdir=${PWD} +cd $1 +make t +error=$? +cd ${curdir} + +if [ ${error} -ne 0 ] +then + echo === error on $1 = ${error} + exit +fi +} + +# ------------------------------------------------------------------ + +build files +build ui +build audio + +# ------------------------------------------------------------------ + +printf "\n...final...\n" +make + +# ------------------------------------------------------------------ + + + + + diff --git a/files/Makefile b/files/Makefile index 86ba461..31bd322 100644 --- a/files/Makefile +++ b/files/Makefile @@ -1,5 +1,9 @@ +# +# NC-LOOPER --- another kluge from tth +# + CC = gcc -CCOPT = -Wall -g -DDEBUG_LEVEL=1 +CCOPT = -Wall -g -DDEBUG_LEVEL=0 ffuncs.o: ffuncs.c ffuncs.h Makefile $(CC) ${CCOPT} -c $< diff --git a/files/smpllist.c b/files/smpllist.c index 65514cc..b37f408 100644 --- a/files/smpllist.c +++ b/files/smpllist.c @@ -10,7 +10,7 @@ #include "smpllist.h" /* --------------------------------------------------------------------- */ -extern int verbosity; +extern int verbosity; /* --------------------------------------------------------------------- */ void affiche_un_sample(SampleRef *sref, int options) { @@ -18,7 +18,17 @@ printf("%c %02X [%-20s] %s\n", sref->key, sref->flags, sref->text, sref->path); } /* --------------------------------------------------------------------- */ +void liste_des_samples(void) +{ +int foo; +for (foo=0; foo<26; foo++) { + printf("%2d %02x %-30s %s\n", foo, the_samples[foo].key, + the_samples[foo].text, + the_samples[foo].path); + } +} +/* --------------------------------------------------------------------- */ int decode_la_ligne(char *line, SampleRef *sref) { char *ptr, *cp; diff --git a/interactive.c b/interactive.c new file mode 100644 index 0000000..ab2e08a --- /dev/null +++ b/interactive.c @@ -0,0 +1,23 @@ +/* + * NCLOOPER INTERACTIVE + */ + +#include + +#include "nclooper.h" + +/* --------------------------------------------------------------------- */ + +extern int verbosity; + +/* --------------------------------------------------------------------- */ +int enter_interactive(SampleRef *psmpl, int notused) +{ + +#if DEBUG_LEVEL +fprintf(stderr, ">>> %s ( %p %d )\n", __func__, psmpl, notused); +#endif + +return -1; +} +/* --------------------------------------------------------------------- */ diff --git a/main.c b/main.c index 2314f51..ed979a4 100644 --- a/main.c +++ b/main.c @@ -9,8 +9,6 @@ #include #include "nclooper.h" -// #include "files/smpllist.h" -// #include "files/ffuncs.h" /* --------------------------------------------------------------------- */ @@ -25,18 +23,48 @@ puts("NcLooper : version pas finie..."); exit(0); } /* --------------------------------------------------------------------- */ +/* + * all the basic engines are up, we have to fire ncurses + */ +int introduction(int k) +{ +int foo; + +#if DEBUG_LEVEL +fprintf(stderr, ">>> %s ( %d )\n", __func__, k); +#endif + +foo = init_ecran(__func__); +sleep(1); + +return -1; +} +/* --------------------------------------------------------------------- */ +int conclusion(int k) +{ +int foo; + +#if DEBUG_LEVEL +fprintf(stderr, ">>> %s ( %d )\n", __func__, k); +#endif + +foo = fin_ecran(); + +return -1; +} +/* --------------------------------------------------------------------- */ int main(int argc, char *argv[]) { int foo; int opt; -char *listname = "samples.list"; +char *listname = "files/samples.list"; while ((opt = getopt(argc, argv, "hl:v")) != -1) { switch(opt) { case 'h': help(0); break; - case 'v': verbosity++; break; case 'l': listname = optarg; break; + case 'v': verbosity++; break; } } @@ -44,15 +72,24 @@ while ((opt = getopt(argc, argv, "hl:v")) != -1) { fprintf(stderr, "argc = %d, optind = %d\n", argc, optind); #endif - foo = lecture_liste_des_samples(listname, the_samples); fprintf(stderr,"retour lecture liste '%s' -> %d\n", listname, foo); for (foo=0; foo<26; foo++) { - printf("%3d %02x %s\n", foo, the_samples[foo].key, - the_samples[foo].text); + printf("%2d %02x %-30s %s\n", foo, the_samples[foo].key, + the_samples[foo].text, + the_samples[foo].path); } +introduction(0); + +foo = enter_interactive(the_samples, 0); +#if DEBUG_LEVEL +fprintf(stderr, "retour 'enter interactive' -> %d\n", foo); +#endif + +conclusion(0); + return 0; } /* --------------------------------------------------------------------- */ diff --git a/nclooper.h b/nclooper.h index bb76ab4..512391e 100644 --- a/nclooper.h +++ b/nclooper.h @@ -16,3 +16,9 @@ typedef struct { #include "files/smpllist.h" #include "files/ffuncs.h" + +#include "ui/ncfuncs.h" + + + +int enter_interactive(SampleRef *, int notused); diff --git a/ui/ncfuncs.c b/ui/ncfuncs.c index 927f605..0bdee97 100644 --- a/ui/ncfuncs.c +++ b/ui/ncfuncs.c @@ -6,7 +6,7 @@ #include "ncfuncs.h" /* --------------------------------------------------------------------- */ -int init_ecran(char *txt) +int init_ecran(const char *txt) { initscr(); diff --git a/ui/ncfuncs.h b/ui/ncfuncs.h index 45f0d6d..3e50951 100644 --- a/ui/ncfuncs.h +++ b/ui/ncfuncs.h @@ -4,7 +4,7 @@ #include -int init_ecran(char *txt); +int init_ecran(const char *txt); int fin_ecran(void); int idx2position(int idx, int *prow, int *pcol);