This commit is contained in:
Your Name 2024-06-14 11:18:31 +03:00
parent e887e4f4da
commit 55006980f5
4 changed files with 9 additions and 9 deletions

View File

@ -1,4 +1,4 @@
![audio-visual.sh and alsamixer](/img/sshot.jpg)
![audio-visual.sh and alsamixer](/img/sshot.png)
.asoundrc (Должно быть в ~/)
Нужно поменять rockchipes8316c, на вашу карту (aplay -L)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 KiB

BIN
img/sshot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

View File

@ -60,12 +60,12 @@ void sig_handler(int sig) {
exit(0);
}
void print(int y, int x, char *str, int val, int j) {
if (val < 0)
mvprintw(y + j, x, "%s", str);
void print(int middle, int k, int x) {
if (values[x] < 0)
mvprintw(middle + k, x, "@");
else
mvprintw(y - j, x, "%s", str);
mvprintw(middle - k, x, "@");
}
int main(void) {
@ -82,7 +82,7 @@ int main(void) {
int min = 0;
int max = 0;
int middle = ws.ws_row / 2;
int middle = (int)ws.ws_row / 2;
while (1) {
args = 0;
stdin_read();
@ -99,9 +99,9 @@ int main(void) {
else if (val > max)
max = val;
int lvl = (val - min) * (ws.ws_row / 5) / ((max - min) + 1);
for (int j = 0; j < lvl; j++)
print(middle, i, "$", values[i], j);
/* Main */
int lvl = (val - min) * (middle - 5) / ((max - min) + 1);
print(middle, lvl, i);
}
refresh();