HAAS Stereo Enhancer
[calf.git] / src / calf / ctl_vumeter.h
blob9d851c12d0b90175ba2801e0573f4eb438f0c231
1 /* Calf DSP Library
2 * Volume meter widget
4 * Copyright (C) 2008-2010 Krzysztof Foltman, Torben Hohn, Markus
5 * Schmidt and others
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General
18 * Public License along with this program; if not, write to the
19 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02111-1307, USA.
22 #ifndef CALF_VUMETER_H
23 #define CALF_VUMETER_H
25 #include <gtk/gtk.h>
26 #include <calf/giface.h>
28 G_BEGIN_DECLS
30 #define CALF_TYPE_VUMETER (calf_vumeter_get_type())
31 #define CALF_VUMETER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CALF_TYPE_VUMETER, CalfVUMeter))
32 #define CALF_IS_VUMETER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CALF_TYPE_VUMETER))
33 #define CALF_VUMETER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CALF_TYPE_VUMETER, CalfVUMeterClass))
34 #define CALF_IS_VUMETER_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((klass), CALF_TYPE_VUMETER))
35 #define CALF_VUMETER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CALF_TYPE_VUMETER, CalfVUMeterClass))
37 enum CalfVUMeterMode
39 VU_STANDARD,
40 VU_MONOCHROME,
41 VU_MONOCHROME_REVERSE,
42 VU_STANDARD_CENTER,
43 VU_MONOCHROME_CENTER
46 struct CalfVUMeter
48 GtkDrawingArea parent;
49 CalfVUMeterMode mode;
50 float value;
51 float vumeter_hold;
52 bool holding;
53 long last_hold;
54 float last_value;
55 float vumeter_falloff;
56 bool falling;
57 float last_falloff;
58 long last_falltime;
59 int meter_width;
60 int vumeter_width;
61 int vumeter_height;
62 float disp_value;
63 int vumeter_position;
64 cairo_surface_t *cache_surface;
65 cairo_pattern_t *pat;
68 struct CalfVUMeterClass
70 GtkDrawingAreaClass parent_class;
73 extern GtkWidget *calf_vumeter_new();
74 extern GType calf_vumeter_get_type();
75 extern void calf_vumeter_set_value(CalfVUMeter *meter, float value);
76 extern float calf_vumeter_get_value(CalfVUMeter *meter);
77 extern void calf_vumeter_set_mode(CalfVUMeter *meter, CalfVUMeterMode mode);
78 extern CalfVUMeterMode calf_vumeter_get_mode(CalfVUMeter *meter);
79 extern void calf_vumeter_set_hold(CalfVUMeter *meter, float value);
80 extern float calf_vumeter_get_hold(CalfVUMeter *meter);
81 extern void calf_vumeter_set_falloff(CalfVUMeter *meter, float value);
82 extern float calf_vumeter_get_falloff(CalfVUMeter *meter);
83 extern void calf_vumeter_set_width(CalfVUMeter *meter, int value);
84 extern int calf_vumeter_get_width(CalfVUMeter *meter);
85 extern void calf_vumeter_set_height(CalfVUMeter *meter, int value);
86 extern int calf_vumeter_get_height(CalfVUMeter *meter);
87 extern void calf_vumeter_set_position(CalfVUMeter *meter, int value);
88 extern int calf_vumeter_get_position(CalfVUMeter *meter);
90 G_END_DECLS
92 #endif