Compare commits
7 Commits
86f3f2e3e7
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ffbc4a13d4 | ||
|
|
b372e0428d | ||
|
|
4a3408633d | ||
|
|
4ed0ab33b9 | ||
|
|
c9154c923b | ||
|
|
9defba34c6 | ||
|
|
298c6e1d1e |
@@ -10,9 +10,10 @@
|
||||
|
||||
VERSION=0.0040
|
||||
|
||||
TEKFLAG= -DDEBUG_LEVEL=1 -g
|
||||
CFLAGS=-Wall -Wextra -ansi $(TEKFLAG) -DVERSION=\"$(VERSION)\"
|
||||
BIBS=-lncurses -lao -lsndfile -logg
|
||||
TEKFLAG = -DDEBUG_LEVEL=1 -g
|
||||
CFLAGS = -std=c11 -Wall -Wextra -ansi -Wlogical-op \
|
||||
$(TEKFLAG) -DVERSION=\"$(VERSION)\"
|
||||
BIBS = -lncurses -lao -lsndfile -logg
|
||||
|
||||
#---------------------------------------------------------
|
||||
|
||||
@@ -33,9 +34,10 @@ playau.o: playau.c ecoute.h Makefile
|
||||
playogg.o: playogg.c ecoute.h Makefile
|
||||
playspeex.o: playspeex.c ecoute.h Makefile
|
||||
playflac.o: playflac.c ecoute.h Makefile
|
||||
rmfile.o: rmfile.c ecoute.h Makefile
|
||||
|
||||
OBJ=main.o ecran.o playnote.o playwav.o playogg.o fonctions.o interactive.o \
|
||||
dump.o playau.o playspeex.o playflac.o magic.o ifao.o
|
||||
dump.o playau.o playspeex.o playflac.o magic.o ifao.o rmfile.o
|
||||
|
||||
ecoute: $(OBJ)
|
||||
gcc $(CFLAGS) $(OBJ) $(BIBS) -o ecoute
|
||||
|
||||
@@ -6,9 +6,14 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#define _POSIX_C_SOURCE 600L /* for fileno(3) */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <sys/select.h>
|
||||
|
||||
#include "ecoute.h"
|
||||
|
||||
/*==------------------------------------------------------------------==*/
|
||||
@@ -79,6 +84,42 @@ foo = 42;
|
||||
return foo;
|
||||
}
|
||||
/*==------------------------------------------------------------------==*/
|
||||
/*
|
||||
* detection de la frappe d'une touche clavier -- remember kbhit() ?
|
||||
*/
|
||||
int is_a_key_hitted(void)
|
||||
{
|
||||
int fd,retv;
|
||||
fd_set in_fds;
|
||||
struct timeval tv;
|
||||
|
||||
fd = fileno(stdin);
|
||||
#if DEBUG_LEVEL
|
||||
fprintf(stderr, "%s: fileno -> %d\n", __func__, fd);
|
||||
#endif
|
||||
|
||||
FD_ZERO(&in_fds); FD_SET(fd, &in_fds);
|
||||
tv.tv_sec = tv.tv_usec = 0;
|
||||
|
||||
retv = select(1, &in_fds, NULL, NULL, &tv);
|
||||
#if DEBUG_LEVEL
|
||||
fprintf(stderr, "%s: select -> %d\n", __func__, retv);
|
||||
#endif
|
||||
|
||||
if (-1 == retv) {
|
||||
perror("select()");
|
||||
}
|
||||
else if (0 == retv) {
|
||||
/* no key hit */
|
||||
}
|
||||
else {
|
||||
/* got a keypress */
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
/*==------------------------------------------------------------------==*/
|
||||
void termine_ecran(void)
|
||||
{
|
||||
endwin(); exit(0);
|
||||
|
||||
@@ -57,7 +57,7 @@ int foo, len_nom, len_ext;
|
||||
fprintf(stderr, "type_du_fichier(%s)\n", nom);
|
||||
#endif
|
||||
len_nom = strlen(nom);
|
||||
for (foo=0; foo<NBR_TYPES; foo++) {
|
||||
for (foo=0; foo<(int)NBR_TYPES; foo++) {
|
||||
len_ext = strlen(types_de_fichiers[foo].extension);
|
||||
if ( (len_nom > len_ext) &&
|
||||
!strcmp(nom+(len_nom-len_ext), types_de_fichiers[foo].extension) ) {
|
||||
@@ -80,7 +80,7 @@ int foo;
|
||||
|
||||
if (type == SON_UNKNOW) return "unknow";
|
||||
|
||||
for (foo=0; foo<NBR_TYPES; foo++) {
|
||||
for (foo=0; foo<(int)NBR_TYPES; foo++) {
|
||||
if (type==types_de_fichiers[foo].numtype)
|
||||
return (types_de_fichiers[foo].extension)+1;
|
||||
}
|
||||
@@ -93,7 +93,7 @@ int foo;
|
||||
|
||||
if (type == SON_UNKNOW) return "unknow";
|
||||
|
||||
for (foo=0; foo<NBR_TYPES; foo++) {
|
||||
for (foo=0; foo<(int)NBR_TYPES; foo++) {
|
||||
if (type==types_de_fichiers[foo].numtype)
|
||||
return (types_de_fichiers[foo].descr);
|
||||
}
|
||||
@@ -175,7 +175,6 @@ int foo;
|
||||
WINDOW *popup;
|
||||
char chaine[100];
|
||||
struct stat st;
|
||||
long magicbits;
|
||||
|
||||
/*
|
||||
* ncurses initial stuff
|
||||
|
||||
@@ -90,7 +90,7 @@ format.byte_format = AO_FMT_LITTLE; /* XXX ??? */
|
||||
fprintf(stderr, "%s: going to open ao\n", __func__);
|
||||
|
||||
device = ao_open_live(driver, &format, NULL);
|
||||
fprintf(stderr, "%s: open live -> %p\n", device);
|
||||
fprintf(stderr, "%s: open live -> %p\n", __func__, device);
|
||||
if (NULL == device) {
|
||||
fprintf(stderr, "\nEcoute: Error open device\n");
|
||||
/*
|
||||
|
||||
@@ -20,7 +20,7 @@ ao_sample_format format;
|
||||
ao_device * device;
|
||||
char chaine[120];
|
||||
short * samples;
|
||||
int lu;
|
||||
int lu, key;
|
||||
long total_lu;
|
||||
|
||||
#if DEBUG_LEVEL
|
||||
@@ -103,7 +103,13 @@ while ( (lu=sf_read_short(sndf, samples, T_BUFFER)) > 0 )
|
||||
wrefresh(popup);
|
||||
|
||||
/* HERE WE HAVE TO DETECT A 'STOP LISTEN' FUNCTION. */
|
||||
|
||||
if (is_a_key_hitted()) {
|
||||
key = getch();
|
||||
fprintf(stderr, "%s key pressed 0x%X\n", __func__, key);
|
||||
if ('X' == key) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -125,7 +125,7 @@ char buffer[200];
|
||||
|
||||
barre_inverse(' ', 0);
|
||||
standout();
|
||||
mvaddstr(0, 2, " Visuel HexDiff v " VERSION " by tTh 2023 ");
|
||||
mvaddstr(0, 2, " Visuel HexDiff v " VERSION " by tTh 2024 ");
|
||||
#if TRACE
|
||||
sprintf(buffer, " screen size %dx%d ", COLS, LINES);
|
||||
foo = strlen(buffer);
|
||||
@@ -211,7 +211,7 @@ delwin(popup);
|
||||
static char *about_texte[] =
|
||||
{
|
||||
"Visuel Hexdiff - version " VERSION,
|
||||
"(c) 2023 by Thierry [tTh] Boudet",
|
||||
"(c) 2024 by Thierry [tTh] Boudet",
|
||||
"http://tboudet.free.fr/hexdiff/",
|
||||
"https://git.tetalab.org/tTh/KlugyTools/",
|
||||
"send bugs reports: tontonth@free.fr",
|
||||
@@ -319,7 +319,7 @@ return -1;
|
||||
/*----------------------------------------------------------------*/
|
||||
void version(void)
|
||||
{
|
||||
fprintf(stderr, "\nThis is 'hexdiff' v "VERSION", made by tTh in 2023\n");
|
||||
fprintf(stderr, "\nThis is 'hexdiff' v "VERSION", made by tTh in 2024\n");
|
||||
/* fprintf(stderr, "homepage: http://tboudet.free.fr/hexdiff/\n"); */
|
||||
fprintf(stderr, "homepage: https://git.tetalab.org/tTh/KlugyTools/\n");
|
||||
#if TRACE
|
||||
|
||||
@@ -8,8 +8,8 @@ nécessite donc un peu de nettoyage.
|
||||
|
||||
## DumpGDBM
|
||||
|
||||
Pour le [debug](DumpGDBM) des fichiers `key/data` géres par GDBM. Ligne de commande
|
||||
aver une interface _readline_.
|
||||
Pour le [debug](DumpGDBM) des fichiers `key/data` géres par GDBM.
|
||||
Ligne de commande avec une interface _readline_.
|
||||
|
||||
```
|
||||
tth@redlady:~/Devel/KlugyTools/DumpGDBM$ ./dumpgdbm -i exemple.gdbm
|
||||
|
||||
Reference in New Issue
Block a user