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

View File

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

View File

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

View File

@ -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;
}

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
CCOPT = -Wall -g -DDEBUG_LEVEL=1
CCOPT = -Wall -g -DDEBUG_LEVEL=0
ffuncs.o: ffuncs.c ffuncs.h Makefile
$(CC) ${CCOPT} -c $<

View File

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

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 "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;
}
/* --------------------------------------------------------------------- */

View File

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

View File

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

View File

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