Browse Source

pre-xmas commit

tth 11 months ago
parent
commit
119a61c0e5
12 changed files with 146 additions and 67 deletions
  1. 1
    52
      .gitignore
  2. 11
    1
      Makefile
  3. 4
    1
      audio/Makefile
  4. 2
    2
      audio/t.c
  5. 37
    0
      build.sh
  6. 5
    1
      files/Makefile
  7. 11
    1
      files/smpllist.c
  8. 23
    0
      interactive.c
  9. 44
    7
      main.c
  10. 6
    0
      nclooper.h
  11. 1
    1
      ui/ncfuncs.c
  12. 1
    1
      ui/ncfuncs.h

+ 1
- 52
.gitignore View File

@@ -7,58 +7,7 @@ nclooper
7 7
 ui/t
8 8
 files/t
9 9
 
10
-
11
-# ---> C
12
-# Prerequisites
13
-*.d
10
+sounds/*
14 11
 
15 12
 # Object files
16 13
 *.o
17
-*.ko
18
-*.obj
19
-*.elf
20
-
21
-# Linker output
22
-*.ilk
23
-*.map
24
-*.exp
25
-
26
-# Precompiled Headers
27
-*.gch
28
-*.pch
29
-
30
-# Libraries
31
-*.lib
32
-*.a
33
-*.la
34
-*.lo
35
-
36
-# Shared objects (inc. Windows DLLs)
37
-*.dll
38
-*.so
39
-*.so.*
40
-*.dylib
41
-
42
-# Executables
43
-*.exe
44
-*.out
45
-*.app
46
-*.i*86
47
-*.x86_64
48
-*.hex
49
-
50
-# Debug files
51
-*.dSYM/
52
-*.su
53
-*.idb
54
-*.pdb
55
-
56
-# Kernel Module Compile Results
57
-*.mod*
58
-*.cmd
59
-.tmp_versions/
60
-modules.order
61
-Module.symvers
62
-Mkfile.old
63
-dkms.conf
64
-

+ 11
- 1
Makefile View File

@@ -1,12 +1,22 @@
1
+#
2
+#	NC-LOOPER --- another kluge from tth
3
+#
4
+
1 5
 CC      = gcc
2
-CCOPT   = -Wall -g -DDEBUG_LEVEL=1
6
+CCOPT   = -Wall -g -DDEBUG_LEVEL=0
3 7
 
4 8
 OBJS	= ui/ncfuncs.o files/smpllist.o files/ffuncs.o
5 9
 LIBS	= -lcurses
6 10
 
11
+all:	nclooper
12
+
7 13
 main.o:	main.c nclooper.h Makefile
8 14
 	$(CC) ${CCOPT} -c $< 
9 15
 
16
+interactive.o:	interactive.c nclooper.h Makefile
17
+	$(CC) ${CCOPT} -c $< 
18
+
19
+OBJS	+= interactive.o
10 20
 
11 21
 nclooper:	main.o ${OBJS} Makefile
12 22
 	$(CC) ${CCOPT} $< ${OBJS} ${LIBS} -o $@

+ 4
- 1
audio/Makefile View File

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

+ 2
- 2
audio/t.c View File

@@ -25,7 +25,7 @@ ao_device		*device;
25 25
 int			foo;
26 26
 
27 27
 device = init_ao_output(44100);
28
-fprintf(stderr, "AO init    -> %p\n", device);
28
+if (verbosity) fprintf(stderr, "AO init    -> %p\n", device);
29 29
 
30 30
 switch (k) {
31 31
 	case 0:
@@ -40,7 +40,7 @@ switch (k) {
40 40
 	}
41 41
 
42 42
 foo = close_ao_output(device);
43
-fprintf(stderr, "AO close   -> %d\n", foo);
43
+if (verbosity) fprintf(stderr, "AO close   -> %d\n", foo);
44 44
 
45 45
 return 0;
46 46
 }

+ 37
- 0
build.sh View File

@@ -0,0 +1,37 @@
1
+#!/bin/bash
2
+
3
+# ------------------------------------------------------------------
4
+
5
+function build
6
+{
7
+echo ============= $1 ==============
8
+curdir=${PWD}
9
+cd $1
10
+make t
11
+error=$?
12
+cd ${curdir}
13
+
14
+if [ ${error} -ne 0 ]
15
+then
16
+	echo === error on $1 = ${error}
17
+	exit
18
+fi
19
+}
20
+
21
+# ------------------------------------------------------------------
22
+
23
+build files
24
+build ui
25
+build audio
26
+
27
+# ------------------------------------------------------------------
28
+
29
+printf "\n...final...\n"
30
+make
31
+
32
+# ------------------------------------------------------------------
33
+
34
+
35
+
36
+
37
+

+ 5
- 1
files/Makefile View File

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

+ 11
- 1
files/smpllist.c View File

@@ -10,7 +10,7 @@
10 10
 #include  "smpllist.h"
11 11
 
12 12
 /* --------------------------------------------------------------------- */
13
-extern int verbosity;
13
+extern int		verbosity;
14 14
 /* --------------------------------------------------------------------- */
15 15
 void affiche_un_sample(SampleRef *sref, int options)
16 16
 {
@@ -18,7 +18,17 @@ printf("%c  %02X  [%-20s]  %s\n", sref->key, sref->flags, sref->text,
18 18
 						sref->path);
19 19
 }
20 20
 /* --------------------------------------------------------------------- */
21
+void liste_des_samples(void)
22
+{
23
+int			foo;
21 24
 
25
+for (foo=0; foo<26; foo++) {
26
+	printf("%2d  %02x  %-30s %s\n", foo, the_samples[foo].key,
27
+					the_samples[foo].text,
28
+					the_samples[foo].path);
29
+	}
30
+}
31
+/* --------------------------------------------------------------------- */
22 32
 int decode_la_ligne(char *line, SampleRef *sref)
23 33
 {
24 34
 char			*ptr, *cp;

+ 23
- 0
interactive.c View File

@@ -0,0 +1,23 @@
1
+/*
2
+ *		NCLOOPER		INTERACTIVE
3
+ */
4
+
5
+#include  <stdio.h>
6
+
7
+#include  "nclooper.h"
8
+
9
+/* --------------------------------------------------------------------- */
10
+
11
+extern int			verbosity;
12
+
13
+/* --------------------------------------------------------------------- */
14
+int enter_interactive(SampleRef *psmpl, int notused)
15
+{
16
+
17
+#if DEBUG_LEVEL
18
+fprintf(stderr, ">>> %s ( %p %d )\n", __func__, psmpl, notused);
19
+#endif
20
+
21
+return -1;
22
+}
23
+/* --------------------------------------------------------------------- */

+ 44
- 7
main.c View File

@@ -9,8 +9,6 @@
9 9
 #include  <ctype.h>
10 10
 
11 11
 #include  "nclooper.h"
12
-// #include  "files/smpllist.h"
13
-// #include  "files/ffuncs.h"
14 12
 
15 13
 /* --------------------------------------------------------------------- */
16 14
 
@@ -25,18 +23,48 @@ puts("NcLooper : version pas finie...");
25 23
 exit(0);
26 24
 }
27 25
 /* --------------------------------------------------------------------- */
26
+/*
27
+ *	all the basic engines are up, we have to fire ncurses
28
+ */
29
+int introduction(int k)
30
+{
31
+int		foo;
32
+
33
+#if DEBUG_LEVEL
34
+fprintf(stderr, ">>> %s ( %d )\n", __func__, k);
35
+#endif
36
+
37
+foo = init_ecran(__func__);
38
+sleep(1);
39
+
40
+return -1;
41
+}
42
+/* --------------------------------------------------------------------- */
43
+int conclusion(int k)
44
+{
45
+int		foo;
46
+
47
+#if DEBUG_LEVEL
48
+fprintf(stderr, ">>> %s ( %d )\n", __func__, k);
49
+#endif
50
+
51
+foo = fin_ecran();
52
+
53
+return -1;
54
+}
55
+/* --------------------------------------------------------------------- */
28 56
 
29 57
 int main(int argc, char *argv[])
30 58
 {
31 59
 int			foo;
32 60
 int			opt;
33
-char			*listname = "samples.list";
61
+char			*listname = "files/samples.list";
34 62
 
35 63
 while ((opt = getopt(argc, argv, "hl:v")) != -1) {
36 64
 	switch(opt) {
37 65
 		case 'h':	help(0);			break;
38
-		case 'v':	verbosity++;			break;
39 66
 		case 'l':	listname = optarg;		break;
67
+		case 'v':	verbosity++;			break;
40 68
 		}
41 69
 	}
42 70
 
@@ -44,15 +72,24 @@ while ((opt = getopt(argc, argv, "hl:v")) != -1) {
44 72
 fprintf(stderr, "argc = %d, optind = %d\n", argc, optind);
45 73
 #endif
46 74
 
47
-
48 75
 foo = lecture_liste_des_samples(listname, the_samples);
49 76
 fprintf(stderr,"retour lecture liste '%s' -> %d\n", listname, foo);
50 77
 
51 78
 for (foo=0; foo<26; foo++) {
52
-	printf("%3d  %02x  %s\n", foo, the_samples[foo].key,
53
-					the_samples[foo].text);
79
+	printf("%2d  %02x  %-30s %s\n", foo, the_samples[foo].key,
80
+					the_samples[foo].text,
81
+					the_samples[foo].path);
54 82
 	}
55 83
 
84
+introduction(0);
85
+
86
+foo = enter_interactive(the_samples, 0);
87
+#if DEBUG_LEVEL
88
+fprintf(stderr, "retour 'enter interactive' -> %d\n", foo);
89
+#endif
90
+
91
+conclusion(0);
92
+
56 93
 return 0;
57 94
 }
58 95
 /* --------------------------------------------------------------------- */

+ 6
- 0
nclooper.h View File

@@ -16,3 +16,9 @@ typedef struct	{
16 16
 
17 17
 #include  "files/smpllist.h"
18 18
 #include  "files/ffuncs.h"
19
+
20
+#include  "ui/ncfuncs.h"
21
+
22
+
23
+
24
+int enter_interactive(SampleRef *, int notused);

+ 1
- 1
ui/ncfuncs.c View File

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

+ 1
- 1
ui/ncfuncs.h View File

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

Loading…
Cancel
Save