commit 136b70feb49bcf9adc0a9eaf5452cc7c04764243
parent bc0adc7e4e6ef2b336d8a66f72583234d3a72950
Author: lostd <lostd@2f30.org>
Date: Mon, 15 Sep 2014 03:15:43 +0100
Command line flag to select visualization and manpage updates
Diffstat:
3 files changed, 28 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
@@ -2,6 +2,7 @@ PREFIX = /usr/local
MANPREFIX = $(PREFIX)/man
CPPFLAGS = -I/usr/local/include
+CFLAGS = -g
LDFLAGS = -L/usr/local/lib
LDLIBS = -lm -lcurses -lfftw3
diff --git a/nausea.1 b/nausea.1
@@ -1,4 +1,4 @@
-.Dd Nov 22, 2013
+.Dd Sep 15, 2014
.Dt NAUSEA 1
.Os
.Sh NAME
@@ -6,7 +6,8 @@
.Nd curses audio visualizer
.Sh SYNOPSIS
.Nm nausea
-.Op Fl hcp
+.Op Fl hcpk
+.Op Fl d Ar num
.Op Ar fifo
.Sh DESCRIPTION
The
@@ -23,6 +24,8 @@ The options are as follows:
.Bl -tag -width Ds
.It Fl h
Show usage line.
+.It Fl d Ar num
+Choose a visualization using its number from below.
.It Fl c
Enable color.
.It Fl p
@@ -43,4 +46,6 @@ Select the fountain visualization.
Toggle color.
.It p
Toggle falling peaks.
+.It k
+Toggle keep state.
.El
diff --git a/nausea.c b/nausea.c
@@ -422,7 +422,7 @@ initcolors(void)
static void
usage(void)
{
- fprintf(stderr, "usage: %s [-hcpk] [fifo]\n", argv0);
+ fprintf(stderr, "usage: %s [-hcpk] [-d num] [fifo]\n", argv0);
fprintf(stderr, "default fifo path is `/tmp/audio.fifo'\n");
exit(1);
}
@@ -432,12 +432,28 @@ main(int argc, char *argv[])
{
int c;
struct frame fr;
- void *draw_prev = draw;
+ void *draw_prev;
argv0 = argv[0];
while (--argc > 0 && (*++argv)[0] == '-')
while ((c = *++argv[0]))
switch (c) {
+ case 'd':
+ if (*++argv == NULL)
+ usage();
+ argc--;
+ switch (atoi(argv[0])) {
+ case 1:
+ draw = draw_spectrum;
+ break;
+ case 2:
+ draw = draw_wave;
+ break;
+ case 3:
+ draw = draw_fountain;
+ break;
+ }
+ break;
case 'c':
colors = 1;
break;
@@ -477,6 +493,8 @@ main(int argc, char *argv[])
errx(1, "your terminal does not support colors");
}
+ draw_prev = draw;
+
while (!die) {
switch (getch()) {
case 'q':