Mercurial > audlegacy-plugins
annotate src/rootvis/rootvis.h @ 3193:93cf4d0a0dde
alsa-ng: Prefer "PCM" volume control over "Wave" on systems that have both, for consistency with OSS plugin and maybe other apps (closes AUD-34 and AUD-36).
author | John Lindgren <john.lindgren@tds.net> |
---|---|
date | Mon, 29 Jun 2009 23:05:56 -0400 |
parents | 3134a0987162 |
children |
rev | line source |
---|---|
900
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
1 #include <stdio.h> |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
2 #include <stdlib.h> |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
3 #include <X11/Xlib.h> |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
4 #include <X11/Xatom.h> |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
5 #include <X11/Xproto.h> |
2971
3134a0987162
- changed include path from audacious to audlegacy.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
2576
diff
changeset
|
6 #include <audlegacy/plugin.h> |
900
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
7 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
8 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
9 /* following values are used if there is no user configuration */ |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
10 #define DEFAULT_stereo 0 // therefore we don't initialize the second channel with different settings |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
11 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
12 #define DEFAULT_geometry_posx 520 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
13 #define DEFAULT_geometry_posy 1 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
14 #define DEFAULT_geometry_orientation 0 // 0 = bottom->up, 1 = top->down, 2 = left->right, 3 = right->left |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
15 #define DEFAULT_geometry_height 50 // maximum height/amplitude of a bar |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
16 #define DEFAULT_geometry_space 1 // space between bars |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
17 #define DEFAULT_bar_width 8 // width of a bar |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
18 // set the following to 0 to disable shadows |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
19 #define DEFAULT_bar_shadow 1 // offset of shadow in pixels |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
20 // set the following to HEIGHT to disable falloff |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
21 #define DEFAULT_bar_falloff 5 // how many pixels the bars should falloff every frame |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
22 #define DEFAULT_bar_color_1 "#a3c422FF" |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
23 #define DEFAULT_bar_color_2 "#b8dd27FF" |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
24 #define DEFAULT_bar_color_3 "#cdf62bFF" |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
25 #define DEFAULT_bar_color_4 "#e6ff64FF" |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
26 #define DEFAULT_bar_shadow_color "#00285088" |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
27 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
28 // set the following to 0 to disable peaks |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
29 #define DEFAULT_peak_enabled 1 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
30 #define DEFAULT_peak_falloff 4 // how many pixels the peaks should falloff every frame |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
31 #define DEFAULT_peak_step 5 // how many frames should the peak resist the falloff |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
32 #define DEFAULT_peak_color "#ffffffdd" |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
33 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
34 // we're cutting off high frequencies by only showing 0 to CUTOFF |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
35 #define DEFAULT_cutoff 180 // frequencies are represented by 256 values |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
36 #define DEFAULT_div 4 // we have CUTOFF sources, every bar represents DIV sources |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
37 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
38 /* Linearity of the amplitude scale (0.5 for linear, keep in [0.1, 0.9]) */ |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
39 #define DEFAULT_linearity 0.33 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
40 #define DEFAULT_fps 30 // how many frames per second should be drawn |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
41 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
42 // print out debug messages |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
43 #define DEFAULT_debug 0 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
44 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
45 // this is for color[] indexing |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
46 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
47 #define RED 0 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
48 #define GREEN 1 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
49 #define BLUE 2 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
50 #define ALPHA 3 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
51 #define COLORSIZE 4 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
52 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
53 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
54 void print_status(char msg[]); |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
55 void error_exit(char msg[]); |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
56 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
57 void threads_lock(void); |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
58 void threads_unlock(char); |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
59 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
60 struct rootvis_geometry { |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
61 char* display; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
62 int posx; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
63 int posy; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
64 int orientation; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
65 int height; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
66 int space; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
67 }; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
68 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
69 struct rootvis_bar { |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
70 int width; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
71 int shadow; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
72 int falloff; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
73 int bevel; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
74 int gradient; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
75 unsigned char color[4][4]; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
76 unsigned char bevel_color[4]; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
77 unsigned char shadow_color[4]; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
78 }; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
79 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
80 struct rootvis_peak { |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
81 int enabled; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
82 int falloff; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
83 int step; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
84 int shadow; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
85 unsigned char color[4]; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
86 }; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
87 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
88 struct rootvis_data { |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
89 int cutoff; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
90 int div; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
91 int fps; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
92 float linearity; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
93 }; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
94 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
95 struct rootvis_config { |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
96 int stereo; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
97 struct rootvis_geometry geo[2]; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
98 struct rootvis_bar bar[2]; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
99 struct rootvis_peak peak[2]; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
100 struct rootvis_data data[2]; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
101 int debug; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
102 } conf; |