Updated
This commit is contained in:
parent
e887e4f4da
commit
55006980f5
@ -1,4 +1,4 @@
|
|||||||
![audio-visual.sh and alsamixer](/img/sshot.jpg)
|
![audio-visual.sh and alsamixer](/img/sshot.png)
|
||||||
|
|
||||||
.asoundrc (Должно быть в ~/)
|
.asoundrc (Должно быть в ~/)
|
||||||
Нужно поменять rockchipes8316c, на вашу карту (aplay -L)
|
Нужно поменять rockchipes8316c, на вашу карту (aplay -L)
|
||||||
|
BIN
img/sshot.jpg
BIN
img/sshot.jpg
Binary file not shown.
Before Width: | Height: | Size: 118 KiB |
BIN
img/sshot.png
Normal file
BIN
img/sshot.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 63 KiB |
@ -60,12 +60,12 @@ void sig_handler(int sig) {
|
|||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void print(int y, int x, char *str, int val, int j) {
|
void print(int middle, int k, int x) {
|
||||||
if (val < 0)
|
if (values[x] < 0)
|
||||||
mvprintw(y + j, x, "%s", str);
|
mvprintw(middle + k, x, "@");
|
||||||
|
|
||||||
else
|
else
|
||||||
mvprintw(y - j, x, "%s", str);
|
mvprintw(middle - k, x, "@");
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(void) {
|
int main(void) {
|
||||||
@ -82,7 +82,7 @@ int main(void) {
|
|||||||
int min = 0;
|
int min = 0;
|
||||||
int max = 0;
|
int max = 0;
|
||||||
|
|
||||||
int middle = ws.ws_row / 2;
|
int middle = (int)ws.ws_row / 2;
|
||||||
while (1) {
|
while (1) {
|
||||||
args = 0;
|
args = 0;
|
||||||
stdin_read();
|
stdin_read();
|
||||||
@ -99,9 +99,9 @@ int main(void) {
|
|||||||
else if (val > max)
|
else if (val > max)
|
||||||
max = val;
|
max = val;
|
||||||
|
|
||||||
int lvl = (val - min) * (ws.ws_row / 5) / ((max - min) + 1);
|
/* Main */
|
||||||
for (int j = 0; j < lvl; j++)
|
int lvl = (val - min) * (middle - 5) / ((max - min) + 1);
|
||||||
print(middle, i, "$", values[i], j);
|
print(middle, lvl, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
refresh();
|
refresh();
|
||||||
|
Loading…
Reference in New Issue
Block a user