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