1 /* 2 3 (c) Fraser Stuart 2009 4 5 This program is free software; you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation; either version 2 of the License, or 8 (at your option) any later version. 9 10 This program is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public License 16 along with this program; if not, write to the Free Software 17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 19 */ 20 21 #ifndef __VU_METER_H 22 #define __VU_METER_H 23 24 #include <gtk/gtk.h> 25 #include <cairo.h> 26 #include "widgets.h" 27 28 G_BEGIN_DECLS 29 30 #define INV_VU_METER_DRAW_ALL 0 31 #define INV_VU_METER_DRAW_DATA 1 32 33 #define INV_VU_METER(obj) GTK_CHECK_CAST(obj, inv_vu_meter_get_type (), InvVuMeter) 34 #define INV_VU_METER_CLASS(klass) GTK_CHECK_CLASS_CAST(klass, inv_vu_meter_get_type(), InvVuMeterClass) 35 #define INV_IS_VU_METER(obj) GTK_CHECK_TYPE(obj, inv_vu_meter_get_type()) 36 37 38 typedef struct _InvVuMeter InvVuMeter; 39 typedef struct _InvVuMeterClass InvVuMeterClass; 40 41 42 struct _InvVuMeter { 43 GtkWidget widget; 44 45 gint bypass; 46 float value; 47 float lastvalue; 48 49 gint headroom; 50 float scale; 51 52 float cx,cy; 53 float r[4],a[5]; 54 55 struct point2D dbm20[3]; 56 struct point2D dbm10[3]; 57 struct point2D dbm07[3]; 58 struct point2D dbm05[3]; 59 struct point2D dbm03[3]; 60 struct point2D dbm02[3]; 61 struct point2D dbm01[3]; 62 struct point2D db00[3]; 63 struct point2D dbp01[3]; 64 struct point2D dbp02[3]; 65 struct point2D dbp03[3]; 66 67 struct point2D cp[2]; 68 69 gint label_font_size,scale_font_size; 70 }; 71 72 struct _InvVuMeterClass { 73 GtkWidgetClass parent_class; 74 }; 75 76 77 GtkType inv_vu_meter_get_type(void); 78 GtkWidget * inv_vu_meter_new(); 79 80 void inv_vu_meter_set_bypass(InvVuMeter *meter, gint num); 81 void inv_vu_meter_set_value(InvVuMeter *meter, float num); 82 void inv_vu_meter_set_headroom(InvVuMeter *meter, gint num); 83 84 85 G_END_DECLS 86 87 #endif /* __VU_METER_VU_H */ 88 89