NcLooper/main.c

116 lines
2.2 KiB
C
Raw Permalink Normal View History

2019-11-03 18:58:21 +01:00
/*
* NcLooper test des fonctions fichier (???)
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <ctype.h>
2020-05-13 12:42:05 +02:00
#include <ao/ao.h>
2019-11-03 18:58:21 +01:00
#include "nclooper.h"
/* --------------------------------------------------------------------- */
int verbosity;
2020-05-13 12:38:06 +02:00
SampleRef the_samples[26];
2019-11-03 18:58:21 +01:00
/* --------------------------------------------------------------------- */
void help(int k)
{
puts("NcLooper : version pas finie...");
exit(0);
}
/* --------------------------------------------------------------------- */
2019-12-23 17:55:31 +01:00
/*
* all the basic engines are up, we have to fire ncurses
*/
int introduction(int k)
{
2020-05-13 12:38:06 +02:00
int foo;
ao_device *device;
2019-12-23 17:55:31 +01:00
#if DEBUG_LEVEL
fprintf(stderr, ">>> %s ( %d )\n", __func__, k);
#endif
foo = init_ecran(__func__);
sleep(1);
2020-05-13 12:38:06 +02:00
/* check the sound subsystem */
2021-02-22 12:39:11 +01:00
return -1;
}
/* --------------------------------------------------------------------- */
int start_the_engine(int k)
{
#if DEBUG_LEVEL
fprintf(stderr, ">>> %s ( %d )\n", __func__, k);
#endif
if (k) {
fprintf(stderr, "%s: k %d is not null ?\n", __func__, k);
exit(1);
}
2019-12-23 17:55:31 +01:00
return -1;
}
/* --------------------------------------------------------------------- */
int conclusion(int k)
{
2020-05-13 12:38:06 +02:00
int foo;
2019-12-23 17:55:31 +01:00
#if DEBUG_LEVEL
fprintf(stderr, ">>> %s ( %d )\n", __func__, k);
#endif
foo = fin_ecran();
return -1;
}
/* --------------------------------------------------------------------- */
2019-11-03 18:58:21 +01:00
int main(int argc, char *argv[])
{
int foo;
int opt;
2021-02-22 12:39:11 +01:00
int mode = 0;
2019-12-23 17:55:31 +01:00
char *listname = "files/samples.list";
2019-11-03 18:58:21 +01:00
2021-02-22 12:39:11 +01:00
while ((opt = getopt(argc, argv, "hl:m:v")) != -1) {
2019-11-03 18:58:21 +01:00
switch(opt) {
case 'h': help(0); break;
case 'l': listname = optarg; break;
2021-02-22 12:39:11 +01:00
case 'm': mode = atoi(optarg); break;
2019-12-23 17:55:31 +01:00
case 'v': verbosity++; break;
2019-11-03 18:58:21 +01:00
}
}
#if DEBUG_LEVEL
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);
2021-02-22 12:39:11 +01:00
foo = start_the_engine(mode);
2020-05-13 12:38:06 +02:00
fprintf(stderr,"retour start engine -> %d\n", foo);
2019-11-03 18:58:21 +01:00
2019-12-23 17:55:31 +01:00
introduction(0);
foo = enter_interactive(the_samples, 0);
#if DEBUG_LEVEL
fprintf(stderr, "retour 'enter interactive' -> %d\n", foo);
#endif
conclusion(0);
2019-11-03 18:58:21 +01:00
return 0;
}
/* --------------------------------------------------------------------- */