Mercurial > audlegacy-plugins
annotate src/rootvis/config_frontend.c @ 1770:af8c3e5a9f61
warning cleanups
author | William Pitcock <nenolod@atheme.org> |
---|---|
date | Mon, 24 Sep 2007 11:17:39 -0500 |
parents | 30e515b6e651 |
children | 7b284f323ad8 |
rev | line source |
---|---|
900
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
1 #include <stdarg.h> |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
2 #include <string.h> |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
3 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
4 #include <rootvis.h> |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
5 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
6 #include <config_frontend.h> |
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 extern GtkWidget *frontend_create_channel(int channel); |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
9 extern GtkWidget *frontend_create_main(void); |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
10 extern void frontend_create_colorpicker(struct config_value*); |
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 void signal_revert(GtkWidget *togglebutton, gpointer data) |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
13 { |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
14 config_revert(GPOINTER_TO_INT(data)); |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
15 } |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
16 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
17 void signal_save(GtkWidget *togglebutton, gpointer data) |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
18 { |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
19 config_save(GPOINTER_TO_INT(data)); |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
20 } |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
21 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
22 void signal_show(GtkWidget *togglebutton, gpointer data) |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
23 { |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
24 config_show(GPOINTER_TO_INT(data)); |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
25 } |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
26 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
27 void signal_hide(GtkWidget *togglebutton, gpointer data) |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
28 { |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
29 config_hide(GPOINTER_TO_INT(data)); |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
30 } |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
31 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
32 void signal_toggle_colorselector(GtkWidget *w, struct config_value *cvar) |
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 struct rootvis_colorsel* colorsel = cvar->valc.frontend; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
35 if (colorsel->window == NULL) |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
36 frontend_create_colorpicker(cvar); |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
37 gtk_widget_show(colorsel->window); |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
38 } |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
39 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
40 void signal_colorselector_ok(GtkWidget *w, struct config_value *cvar) |
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 struct rootvis_colorsel* colorsel = cvar->valc.frontend; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
43 gtk_color_selection_get_color(GTK_COLOR_SELECTION(colorsel->color_picker), colorsel->color); |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
44 memcpy(colorsel->saved_color, colorsel->color, COLORSIZE*sizeof(gdouble)); |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
45 frontend_update_color(cvar, 1); |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
46 gtk_widget_hide(colorsel->window); |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
47 } |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
48 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
49 void signal_colorselector_cancel(GtkWidget *w, struct config_value *cvar) |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
50 { |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
51 struct rootvis_colorsel* colorsel = cvar->valc.frontend; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
52 memcpy(colorsel->color, colorsel->saved_color, COLORSIZE*sizeof(gdouble)); |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
53 frontend_update_color(cvar, 1); |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
54 gtk_widget_destroy(colorsel->window); |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
55 colorsel->window = NULL; |
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 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
58 void signal_colorselector_update(GtkWidget *w, struct config_value *cvar) |
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_colorsel* colorsel = cvar->valc.frontend; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
61 gtk_color_selection_get_color(GTK_COLOR_SELECTION(colorsel->color_picker), colorsel->color); |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
62 frontend_update_color(cvar, 1); |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
63 } |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
64 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
65 void color_char2double(unsigned char source[4], gdouble dest[4]) |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
66 { |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
67 int i; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
68 for (i = 0; i < COLORSIZE; ++i) |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
69 { |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
70 dest[i] = (double)source[i] / 255.0; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
71 } |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
72 } |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
73 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
74 void color_double2char(double source[4], unsigned char dest[4]) |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
75 { |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
76 int i; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
77 for (i = 0; i < COLORSIZE; ++i) |
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 dest[i] = (int)(source[i] * 255.0); |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
80 } |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
81 } |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
82 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
83 // This was ripped from xmms-iris's config.c. |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
84 void frontend_update_color(struct config_value *cvar, int system) |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
85 { |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
86 struct rootvis_colorsel* colorsel = cvar->valc.frontend; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
87 if (system > 0) |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
88 { |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
89 threads_lock(); |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
90 color_double2char(colorsel->color, cvar->valc.var); |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
91 threads_unlock(2); |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
92 } |
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 // following is among the dumbest shit I've ever seen. GtkPreview seems to suck a lot! |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
95 unsigned int i; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
96 guchar color_buf[3*30]; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
97 char red, green, blue; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
98 red = colorsel->color[RED]*0xff; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
99 green = colorsel->color[GREEN]*0xff; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
100 blue = colorsel->color[BLUE]*0xff; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
101 for (i = 0; i < 30*3; i += 3) { |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
102 color_buf[i+RED] = (char) red; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
103 color_buf[i+GREEN] = (char) green; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
104 color_buf[i+BLUE] = (char) blue; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
105 } |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
106 for (i = 0; i < 30; i++) |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
107 gtk_preview_draw_row(GTK_PREVIEW(colorsel->preview), color_buf, 0, i, 30); |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
108 gtk_widget_draw(colorsel->preview, NULL); |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
109 } |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
110 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
111 void frontend_set_color(struct config_value *cvar) |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
112 { |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
113 struct rootvis_colorsel* colorsel = cvar->valc.frontend; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
114 color_char2double(cvar->valc.var, colorsel->color); |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
115 memcpy(colorsel->saved_color, colorsel->color, COLORSIZE*sizeof(gdouble)); |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
116 } |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
117 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
118 /* following functions catch signals from the gui widgets */ |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
119 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
120 int signal_window_close(GtkWidget *window, gpointer data) |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
121 { |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
122 int number = 2; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
123 if (window == widgets.window_channel[0]) number = 0; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
124 if (window == widgets.window_channel[1]) number = 1; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
125 config_hide(number); |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
126 return TRUE; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
127 } |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
128 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
129 void signal_check_toggled(GtkWidget *togglebutton, gpointer data) |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
130 { |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
131 printf("%s \n", (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(togglebutton))) ? "TRUE" : "FALSE"); |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
132 } |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
133 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
134 void signal_stereo_toggled(GtkWidget *togglebutton, gpointer data) |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
135 { |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
136 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(togglebutton))) { |
958
30e515b6e651
[svn] A cast a day keeps the compiler warning at bay.
chainsaw
parents:
900
diff
changeset
|
137 gtk_label_set_text(GTK_LABEL(widgets.stereo_status[0]), "renders left channel"); |
30e515b6e651
[svn] A cast a day keeps the compiler warning at bay.
chainsaw
parents:
900
diff
changeset
|
138 gtk_label_set_text(GTK_LABEL(widgets.stereo_status[1]), "renders right channel"); |
900
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
139 } else { |
958
30e515b6e651
[svn] A cast a day keeps the compiler warning at bay.
chainsaw
parents:
900
diff
changeset
|
140 gtk_label_set_text(GTK_LABEL(widgets.stereo_status[0]), "renders both channels"); |
30e515b6e651
[svn] A cast a day keeps the compiler warning at bay.
chainsaw
parents:
900
diff
changeset
|
141 gtk_label_set_text(GTK_LABEL(widgets.stereo_status[1]), "unused / inactive"); |
900
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
142 } |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
143 } |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
144 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
145 void signal_textentry_changed(GtkWidget *entry, gpointer data) |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
146 { |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
147 } |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
148 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
149 void config_show_channel(int channel) { |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
150 if (widgets.window_channel[channel] == NULL) { |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
151 widgets.window_channel[channel] = frontend_create_channel(channel); |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
152 } else { |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
153 print_status("raising channel window"); |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
154 gtk_widget_show(widgets.window_channel[channel]); |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
155 } |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
156 } |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
157 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
158 void config_show(int channel) { |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
159 if (channel == 2) |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
160 { |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
161 if (widgets.window_main == NULL) { |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
162 widgets.window_main = frontend_create_main(); |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
163 } else { |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
164 print_status("raising windows"); |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
165 gtk_widget_show(widgets.window_main); |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
166 if (widgets.window_channel[0] != NULL) { |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
167 gtk_widget_show(widgets.window_channel[0]); |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
168 } |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
169 if (widgets.window_channel[1] != NULL) { |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
170 gtk_widget_show(widgets.window_channel[1]); |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
171 } |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
172 } |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
173 } else config_show_channel(channel); |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
174 } |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
175 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
176 void config_hide(int number) { |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
177 /* hide or destroy? if destroy, pointers must be set to NULL */ |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
178 if (number < 2) { |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
179 if (widgets.window_channel[number] != NULL) |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
180 gtk_widget_hide(widgets.window_channel[number]); |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
181 /* widgets.window_channel[number] = NULL; */ |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
182 } else { |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
183 if (widgets.window_main != NULL) |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
184 gtk_widget_hide(widgets.window_main); |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
185 if (widgets.window_channel[0] != NULL) |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
186 gtk_widget_hide(widgets.window_channel[0]); |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
187 if (widgets.window_channel[1] != NULL) |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
188 gtk_widget_hide(widgets.window_channel[1]); |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
189 widgets.window_main = NULL; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
190 widgets.window_channel[0] = NULL; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
191 widgets.window_channel[1] = NULL; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
192 // THIS SUCKS BEYOND REPAIR! |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
193 } |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
194 } |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
195 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
196 void config_set_widgets(int number) |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
197 { |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
198 if (number < 2) { |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
199 // set per channel stuff |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
200 } else { |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
201 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets.stereo_check), ((conf.stereo>0) ? TRUE : FALSE)); |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
202 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets.debug_check), ((conf.debug>0) ? TRUE : FALSE)); |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
203 } |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
204 } |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
205 |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
206 void config_frontend_init(void) { |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
207 widgets.window_main = NULL; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
208 widgets.window_channel[0] = NULL; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
209 widgets.window_channel[1] = NULL; |
d985f0dcdeb0
[svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff
changeset
|
210 } |