i like eyecandy
This commit is contained in:
parent
1dcbc6746c
commit
80b00561af
@ -14,20 +14,26 @@ int verbosity;
|
||||
void demo_7segments(int nbl, int notused)
|
||||
{
|
||||
int loop, idx, c, p;
|
||||
char ligne[100];
|
||||
|
||||
char ligne[120];
|
||||
time_t temps;
|
||||
|
||||
for (loop=0; loop<nbl; loop++) {
|
||||
sprintf(ligne, "%04x", loop);
|
||||
sprintf(ligne, "$%04x", loop);
|
||||
mvaddstr(2, 1, ligne);
|
||||
for (idx=0; idx<strlen(ligne); idx++) {
|
||||
aff7segs_digit(stdscr, 3, 10+(idx*9), ligne[idx]);
|
||||
}
|
||||
|
||||
sprintf(ligne, "%.3f", drand48());
|
||||
mvaddstr(12, 1, ligne);
|
||||
mvaddstr(13, 1, ligne);
|
||||
for (idx=0; idx<strlen(ligne); idx++) {
|
||||
aff7segs_digit(stdscr, 13, 10+(idx*9), ligne[idx]);
|
||||
aff7segs_digit(stdscr, 14, 10+(idx*9), ligne[idx]);
|
||||
}
|
||||
|
||||
if (verbosity && (loop%2)) {
|
||||
temps = time(NULL);
|
||||
sprintf(ligne, "%12ld | %s", temps, ctime(&temps));
|
||||
message(ligne);
|
||||
}
|
||||
|
||||
refresh();
|
||||
@ -40,8 +46,9 @@ void demo_vumetres(int nbl, int notused)
|
||||
{
|
||||
int loop, idx;
|
||||
int hpos;
|
||||
// char ligne[100];
|
||||
char ligne[100];
|
||||
float value;
|
||||
time_t temps;
|
||||
|
||||
for (loop=0; loop<nbl; loop++) {
|
||||
|
||||
@ -56,6 +63,12 @@ for (loop=0; loop<nbl; loop++) {
|
||||
else vumetre_1(stdscr, hpos, 12, value, 60);
|
||||
|
||||
}
|
||||
|
||||
if (verbosity && (loop%2)) {
|
||||
temps = time(NULL);
|
||||
sprintf(ligne, "%12ld | %s", temps, ctime(&temps));
|
||||
message(ligne);
|
||||
}
|
||||
|
||||
refresh();
|
||||
usleep(200*1000);
|
||||
@ -147,6 +160,9 @@ switch (demonum) {
|
||||
case 0: demo_vumetres(nb_loops, 0); break;
|
||||
case 1: demo_waterfall(nb_loops, 0); break;
|
||||
case 2: demo_7segments(nb_loops, 0); break;
|
||||
default:
|
||||
fprintf(stderr, "eyecandy #%d don't exist\n", demonum);
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user