Confronta commit

...

2 Commit

Autore SHA1 Messaggio Data
tTh
d61fff9b4d small tuning 2023-11-30 02:49:33 +01:00
tTh
5ebc44a9be add a chdir from cli opt 2023-11-30 02:47:56 +01:00
6 ha cambiato i file con 33 aggiunte e 7 eliminazioni

Vedi File

@ -8,7 +8,7 @@
# #
#---------------------------------------------------------------- #----------------------------------------------------------------
VERSION=0.0036 VERSION=0.0037
TEKFLAG= -DDEBUG_LEVEL=0 -g TEKFLAG= -DDEBUG_LEVEL=0 -g
CFLAGS=-Wall -Wextra -ansi $(TEKFLAG) -DVERSION=\"$(VERSION)\" CFLAGS=-Wall -Wextra -ansi $(TEKFLAG) -DVERSION=\"$(VERSION)\"

Vedi File

@ -9,7 +9,9 @@ de disque ne sont pas là.
En fait, j'ai commencé à écrire ce logiciel il y a très En fait, j'ai commencé à écrire ce logiciel il y a très
longtemps pour découvrir longtemps pour découvrir
[libsndfile](https://en.wikipedia.org/wiki/Libsndfile). [libsndfile](https://en.wikipedia.org/wiki/Libsndfile).
Ensuite, je l'ai un peu oublié dans son coin. Mais je Ensuite, je l'ai un peu oublié dans son coin.
Il manque même pas mal de formats de base (ex, le .ogg) dans
ce qu'il connait. Mais je
viens de lui trouver une nouvelle utilité, il va m'aider viens de lui trouver une nouvelle utilité, il va m'aider
à trier les fichiers de mon [Tascam](https://www.thomann.de/intl/tascam_dr_05x.htm). Il faut juste rajouter les fonctions à trier les fichiers de mon [Tascam](https://www.thomann.de/intl/tascam_dr_05x.htm). Il faut juste rajouter les fonctions
qui manquent. qui manquent.
@ -46,10 +48,15 @@ Il y a de quoi faire.
## Pour la suite ? ## Pour la suite ?
Première étape : Prévoir la possibilité de faire un *abort* Première étape : Prévoir la possibilité de faire un *abort*
pendant la lecture d'un fichier son. pendant la lecture d'un fichier son. Ça ne va pas être simple, il
faut d'abord factoriser la fonction de scrutation du clavier
pendant la lecture du son, et ensuite la brancher dans les
différents modules.
Deuxième étape : Implémenter une fonction bien *molly-guarded* pour pouvoir effacer un fichier. Deuxième étape : Implémenter une fonction bien *molly-guarded* pour pouvoir effacer un fichier.
tTh.

Vedi File

@ -7,7 +7,7 @@ ecoute \- ncurses based note,wav,ogg,au player.
\fBecoute\fP \fBecoute\fP
.SH OPTIONS .SH OPTIONS
No command-line available. -s <newdir> : change working directory to <newdir>.
.SH INTERACTIVE .SH INTERACTIVE
This player is a real ncurses based interactive software. This player is a real ncurses based interactive software.

Vedi File

@ -113,6 +113,11 @@ WINDOW *popup;
fprintf(stderr, ">>> %s ( '%s' %d 0x%x )\n", __func__, nom, type, flags); fprintf(stderr, ">>> %s ( '%s' %d 0x%x )\n", __func__, nom, type, flags);
#endif #endif
if (NULL==nom) {
/* molly-guard */
fprintf(stderr, "%s:%s called with a NULL name\n", __FILE__, __func__);
return -1;
}
/* /*
* ncurses initial stuff * ncurses initial stuff
*/ */
@ -149,7 +154,7 @@ switch (type)
break; break;
} }
foo = stop_sound_output(0); (void)stop_sound_output(0);
/* /*
* screen washing. * screen washing.

Vedi File

@ -261,7 +261,8 @@ do
/* the show must go on */ /* the show must go on */
case '\r': case 'p': case '\r': case 'p':
idx = curseur+first; /* ??? */ idx = curseur+first; /* ??? */
play_this_file(liste[idx].nom, liste[idx].son.type, 0); foo = play_this_file(liste[idx].nom, liste[idx].son.type, 0);
fprintf(stderr, "play '%s' => %d\n",liste[idx].nom, foo);
break; break;
case 'D': case 'd': case 'D': case 'd':

Vedi File

@ -116,14 +116,18 @@ int main(int argc, char * argv[])
int opt = 0; int opt = 0;
int foo; int foo;
char *audiodevice = "none"; char *audiodevice = "none";
char *newdir = NULL;
while ((opt = getopt(argc, argv, "d:hx")) != -1) { while ((opt = getopt(argc, argv, "d:hs:x")) != -1) {
switch (opt) { switch (opt) {
case 'd': case 'd':
audiodevice = optarg; audiodevice = optarg;
break; break;
case 'h': case 'h':
help_cli(argv[0]); break; help_cli(argv[0]); break;
case 's':
newdir = optarg;
break;
case 'x': case 'x':
fprintf(stderr, "no crash available\n"); fprintf(stderr, "no crash available\n");
exit(0); exit(0);
@ -133,7 +137,16 @@ while ((opt = getopt(argc, argv, "d:hx")) != -1) {
} }
} }
#if DEBUG_LEVEL
fprintf(stderr, "audio device = %s\n", audiodevice); fprintf(stderr, "audio device = %s\n", audiodevice);
#endif
if (NULL != newdir) {
#if DEBUG_LEVEL
fprintf(stderr, "newdir = '%s'\n", newdir);
#endif
foo = chdir(newdir);
}
foo = init_sound_output(audiodevice, 0); foo = init_sound_output(audiodevice, 0);
if (foo) { if (foo) {