annotate src/skins/ui_vis.h @ 3107:2a8eb3450ea4

Link GIO plugin against libgio.
author John Lindgren <john.lindgren@tds.net>
date Thu, 30 Apr 2009 18:14:57 -0400
parents 963796db51ea
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2579
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
1 /*
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
2 * Audacious - a cross-platform multimedia player
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
3 * Copyright (c) 2007 Audacious development team.
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
4 *
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
5 * This program is free software; you can redistribute it and/or modify
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
6 * it under the terms of the GNU General Public License as published by
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
7 * the Free Software Foundation; under version 3 of the License.
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
8 *
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
9 * This program is distributed in the hope that it will be useful,
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
12 * GNU General Public License for more details.
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
13 *
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
14 * You should have received a copy of the GNU General Public License
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
15 * along with this program. If not, see <http://www.gnu.org/licenses>.
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
16 *
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
17 * The Audacious team does not consider modular code linking to
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
18 * Audacious or using our public API to be a derived work.
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
19 */
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
20
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
21 #ifndef UIVIS_H
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
22 #define UIVIS_H
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
23
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
24 #include <gtk/gtk.h>
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
25
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
26 #ifdef __cplusplus
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
27 extern "C" {
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
28 #endif
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
29
3017
963796db51ea Don't use deprecated gtk macros and types
Tomasz Mon <desowin@gmail.com>
parents: 2579
diff changeset
30 #define UI_VIS(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, ui_vis_get_type (), UiVis)
963796db51ea Don't use deprecated gtk macros and types
Tomasz Mon <desowin@gmail.com>
parents: 2579
diff changeset
31 #define UI_VIS_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, ui_vis_get_type (), UiVisClass)
963796db51ea Don't use deprecated gtk macros and types
Tomasz Mon <desowin@gmail.com>
parents: 2579
diff changeset
32 #define UI_IS_VIS(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, ui_vis_get_type ())
2579
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
33
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
34 typedef enum {
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
35 VIS_ANALYZER, VIS_SCOPE, VIS_VOICEPRINT, VIS_OFF
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
36 } VisType;
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
37
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
38 typedef enum {
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
39 ANALYZER_NORMAL, ANALYZER_FIRE, ANALYZER_VLINES
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
40 } AnalyzerMode;
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
41
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
42 typedef enum {
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
43 ANALYZER_LINES, ANALYZER_BARS
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
44 } AnalyzerType;
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
45
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
46 typedef enum {
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
47 SCOPE_DOT, SCOPE_LINE, SCOPE_SOLID
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
48 } ScopeMode;
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
49 typedef enum {
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
50 VOICEPRINT_NORMAL, VOICEPRINT_FIRE, VOICEPRINT_ICE
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
51 } VoiceprintMode;
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
52
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
53
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
54 typedef enum {
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
55 VU_NORMAL, VU_SMOOTH
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
56 } VUMode;
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
57
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
58 typedef enum {
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
59 REFRESH_FULL, REFRESH_HALF, REFRESH_QUARTER, REFRESH_EIGTH
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
60 } RefreshRate;
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
61
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
62 typedef enum {
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
63 FALLOFF_SLOWEST, FALLOFF_SLOW, FALLOFF_MEDIUM, FALLOFF_FAST,
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
64 FALLOFF_FASTEST
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
65 } FalloffSpeed;
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
66
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
67 typedef struct _UiVis UiVis;
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
68 typedef struct _UiVisClass UiVisClass;
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
69
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
70 struct _UiVis {
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
71 GtkWidget widget;
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
72
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
73 gint x, y, width, height;
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
74 gfloat data[75], peak[75], peak_speed[75];
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
75 gint refresh_delay;
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
76 gboolean scaled;
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
77 GtkWidget *fixed;
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
78 gboolean visible_window;
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
79 GdkWindow *event_window;
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
80 };
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
81
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
82 struct _UiVisClass {
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
83 GtkWidgetClass parent_class;
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
84 void (* doubled) (UiVis *vis);
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
85 };
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
86
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
87 GtkWidget* ui_vis_new (GtkWidget *fixed, gint x, gint y, gint width);
3017
963796db51ea Don't use deprecated gtk macros and types
Tomasz Mon <desowin@gmail.com>
parents: 2579
diff changeset
88 GType ui_vis_get_type(void);
2579
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
89 void ui_vis_set_vis(GtkWidget *widget, gint num);
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
90 void ui_vis_clear_data(GtkWidget *widget);
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
91 void ui_vis_timeout_func(GtkWidget *widget, guchar * data);
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
92 void ui_vis_set_visible(GtkWidget *widget, gboolean window_is_visible);
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
93
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
94 #ifdef __cplusplus
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
95 }
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
96 #endif
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
97
8fba3fbf1a0f add vis and svis
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
98 #endif