pre-xmas commit

This commit is contained in:
tth 2019-12-23 17:55:31 +01:00
parent db3d7283df
commit 119a61c0e5
12 changed files with 146 additions and 67 deletions

53
.gitignore vendored
View File

@ -7,58 +7,7 @@ nclooper
ui/t ui/t
files/t files/t
sounds/*
# ---> C
# Prerequisites
*.d
# Object files # Object files
*.o *.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

View File

@ -1,12 +1,22 @@
#
# NC-LOOPER --- another kluge from tth
#
CC = gcc CC = gcc
CCOPT = -Wall -g -DDEBUG_LEVEL=1 CCOPT = -Wall -g -DDEBUG_LEVEL=0
OBJS = ui/ncfuncs.o files/smpllist.o files/ffuncs.o OBJS = ui/ncfuncs.o files/smpllist.o files/ffuncs.o
LIBS = -lcurses LIBS = -lcurses
all: nclooper
main.o: main.c nclooper.h Makefile main.o: main.c nclooper.h Makefile
$(CC) ${CCOPT} -c $< $(CC) ${CCOPT} -c $<
interactive.o: interactive.c nclooper.h Makefile
$(CC) ${CCOPT} -c $<
OBJS += interactive.o
nclooper: main.o ${OBJS} Makefile nclooper: main.o ${OBJS} Makefile
$(CC) ${CCOPT} $< ${OBJS} ${LIBS} -o $@ $(CC) ${CCOPT} $< ${OBJS} ${LIBS} -o $@

View File

@ -1,6 +1,9 @@
#
# NC-LOOPER --- another kluge from tth
#
CC = gcc CC = gcc
CCOPT = -Wall -g -DDEBUG_LEVEL=1 CCOPT = -Wall -g -DDEBUG_LEVEL=0
LIBS = -lao -lsndfile -lm LIBS = -lao -lsndfile -lm
ao_output.o: ao_output.c Makefile ao_output.o: ao_output.c Makefile

View File

@ -25,7 +25,7 @@ ao_device *device;
int foo; int foo;
device = init_ao_output(44100); device = init_ao_output(44100);
fprintf(stderr, "AO init -> %p\n", device); if (verbosity) fprintf(stderr, "AO init -> %p\n", device);
switch (k) { switch (k) {
case 0: case 0:
@ -40,7 +40,7 @@ switch (k) {
} }
foo = close_ao_output(device); foo = close_ao_output(device);
fprintf(stderr, "AO close -> %d\n", foo); if (verbosity) fprintf(stderr, "AO close -> %d\n", foo);
return 0; return 0;
} }

37
build.sh Executable file
View File

@ -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
# ------------------------------------------------------------------

View File

@ -1,5 +1,9 @@
#
# NC-LOOPER --- another kluge from tth
#
CC = gcc CC = gcc
CCOPT = -Wall -g -DDEBUG_LEVEL=1 CCOPT = -Wall -g -DDEBUG_LEVEL=0
ffuncs.o: ffuncs.c ffuncs.h Makefile ffuncs.o: ffuncs.c ffuncs.h Makefile
$(CC) ${CCOPT} -c $< $(CC) ${CCOPT} -c $<

View File

@ -18,7 +18,17 @@ printf("%c %02X [%-20s] %s\n", sref->key, sref->flags, sref->text,
sref->path); 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) int decode_la_ligne(char *line, SampleRef *sref)
{ {
char *ptr, *cp; char *ptr, *cp;

23
interactive.c Normal file
View File

@ -0,0 +1,23 @@
/*
* NCLOOPER INTERACTIVE
*/
#include <stdio.h>
#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;
}
/* --------------------------------------------------------------------- */

51
main.c
View File

@ -9,8 +9,6 @@
#include <ctype.h> #include <ctype.h>
#include "nclooper.h" #include "nclooper.h"
// #include "files/smpllist.h"
// #include "files/ffuncs.h"
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
@ -25,18 +23,48 @@ puts("NcLooper : version pas finie...");
exit(0); 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 main(int argc, char *argv[])
{ {
int foo; int foo;
int opt; int opt;
char *listname = "samples.list"; char *listname = "files/samples.list";
while ((opt = getopt(argc, argv, "hl:v")) != -1) { while ((opt = getopt(argc, argv, "hl:v")) != -1) {
switch(opt) { switch(opt) {
case 'h': help(0); break; case 'h': help(0); break;
case 'v': verbosity++; break;
case 'l': listname = optarg; 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); fprintf(stderr, "argc = %d, optind = %d\n", argc, optind);
#endif #endif
foo = lecture_liste_des_samples(listname, the_samples); foo = lecture_liste_des_samples(listname, the_samples);
fprintf(stderr,"retour lecture liste '%s' -> %d\n", listname, foo); fprintf(stderr,"retour lecture liste '%s' -> %d\n", listname, foo);
for (foo=0; foo<26; foo++) { for (foo=0; foo<26; foo++) {
printf("%3d %02x %s\n", foo, the_samples[foo].key, printf("%2d %02x %-30s %s\n", foo, the_samples[foo].key,
the_samples[foo].text); 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; return 0;
} }
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */

View File

@ -16,3 +16,9 @@ typedef struct {
#include "files/smpllist.h" #include "files/smpllist.h"
#include "files/ffuncs.h" #include "files/ffuncs.h"
#include "ui/ncfuncs.h"
int enter_interactive(SampleRef *, int notused);

View File

@ -6,7 +6,7 @@
#include "ncfuncs.h" #include "ncfuncs.h"
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
int init_ecran(char *txt) int init_ecran(const char *txt)
{ {
initscr(); initscr();

View File

@ -4,7 +4,7 @@
#include <curses.h> #include <curses.h>
int init_ecran(char *txt); int init_ecran(const char *txt);
int fin_ecran(void); int fin_ecran(void);
int idx2position(int idx, int *prow, int *pcol); int idx2position(int idx, int *prow, int *pcol);