VS2008 project files.
[xiph/unicode.git] / spectrum / plot.h
blob9560acebd9c8cb19536f36dffe17f9c1daa24a57
1 /*
3 * gtk2 spectrum analyzer
4 *
5 * Copyright (C) 2004 Monty
7 * This analyzer is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2, or (at your option)
10 * any later version.
12 * The analyzer 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
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Postfish; see the file COPYING. If not, write to the
19 * Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
24 #ifndef __PLOT_H__
25 #define __PLOT_H__
27 #include <glib.h>
28 #include <glib-object.h>
29 #include <gtk/gtkcontainer.h>
30 #include <gtk/gtksignal.h>
31 #include <gtk/gtkdrawingarea.h>
33 G_BEGIN_DECLS
35 #define PLOT_TYPE (plot_get_type ())
36 #define PLOT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PLOT_TYPE, Plot))
37 #define PLOT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PLOT_TYPE, PlotClass))
38 #define IS_PLOT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PLOT_TYPE))
39 #define IS_PLOT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PLOT_TYPE))
41 typedef struct _Plot Plot;
42 typedef struct _PlotClass PlotClass;
44 struct _Plot{
46 GtkDrawingArea canvas;
47 GdkPixmap *backing;
48 GdkGC *drawgc;
49 GdkGC *dashes;
51 PangoLayout **lin_layout;
52 PangoLayout **log_layout;
53 PangoLayout **iso_layout;
54 PangoLayout **db_layout;
55 PangoLayout **imp_layout;
56 PangoLayout **phase_layout;
58 int configured;
59 float **ydata;
60 float *floor;
62 int groups;
63 int *ch;
64 int *ch_active;
65 int *ch_process;
66 int total_ch;
67 int datasize;
68 int mode;
69 int link;
70 int scale;
71 int res;
72 int noise;
73 int *rate;
75 int xgrid[11];
76 int xgrids;
77 int xtic[200];
78 int xtics;
80 int ygrid[11];
81 int ygrids;
82 int ytic[200];
83 int ytics;
85 float depth;
86 float ymax;
87 float pmax;
88 float pmin;
90 float disp_depth;
91 float disp_ymax;
92 float disp_pmax;
93 float disp_pmin;
95 float padx;
96 float phax;
97 float pady;
99 int ymaxtimer;
100 int phtimer;
103 struct _PlotClass{
105 GtkDrawingAreaClass parent_class;
106 void (* plot) (Plot *m);
109 GType plot_get_type (void);
110 GtkWidget* plot_new (int n, int inputs, int *channels, int *rate);
111 void plot_refresh (Plot *m, int *process);
112 void plot_setting (Plot *m, int res, int scale, int mode, int link, int depth, int noise);
113 void plot_draw (Plot *m);
114 void plot_clear (Plot *m);
115 int plot_width (Plot *m);
116 float** plot_get (Plot *m);
117 void plot_set_active (Plot *m, int *, int *);
119 GdkColor chcolor(int ch);
121 G_END_DECLS
123 #endif