File: spectool_gtk_planar.h

package info (click to toggle)
spectools 201601r1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 1,272 kB
  • ctags: 1,837
  • sloc: ansic: 18,708; sh: 2,476; makefile: 85
file content (101 lines) | stat: -rw-r--r-- 2,507 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/* Spectool signal graph
 *
 * GTK widget implementation
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */

#include "config.h"

#ifndef __SPECTOOL_PLANAR_WIDGET_H__
#define __SPECTOOL_PLANAR_WIDGET_H__

#ifdef HAVE_GTK

#include <glib.h>
#include <glib-object.h>

#include "spectool_container.h"
#include "spectool_gtk_hw_registry.h"
#include "spectool_gtk_widget.h"

G_BEGIN_DECLS

#define SPECTOOL_TYPE_PLANAR \
	(spectool_planar_get_type())
#define SPECTOOL_PLANAR(obj) \
	(G_TYPE_CHECK_INSTANCE_CAST((obj), \
	SPECTOOL_TYPE_PLANAR, SpectoolPlanar))
#define SPECTOOL_PLANAR_CLASS(klass) \
	(G_TYPE_CHECK_CLASS_CAST((klass), \
	SPECTOOL_TYPE_PLANAR, SpectoolPlanarClass))
#define IS_SPECTOOL_PLANAR(obj) \
	(G_TYPE_CHECK_INSTANCE_TYPE((obj), \
	SPECTOOL_TYPE_PLANAR))
#define IS_SPECTOOL_PLANAR_CLASS(klass) \
	(G_TYPE_CHECK_CLASS_TYPE((class), \
	SPECTOOL_TYPE_PLANAR))

typedef struct _SpectoolPlanar SpectoolPlanar;
typedef struct _SpectoolPlanarClass SpectoolPlanarClass;

#define SPECTOOL_PLANAR_NUM_SAMPLES		250

typedef struct _spectool_planar_marker {
	double r, g, b;
	GdkPixbuf *pixbuf;
	int samp_num;
	int cur, avg, peak;
} spectool_planar_marker;

struct _SpectoolPlanar {
	SpectoolWidget parent;

	/* What components do we draw */
	int draw_markers;
	int draw_peak;
	int draw_avg;
	int draw_cur;
	int draw_history;

	/* is the mouse down during an event? */
	int mouse_down;

	GtkWidget *sweepinfo;

	GtkWidget *mkr_treeview;
	GtkListStore *mkr_treelist;
	GList *mkr_list;
	spectool_planar_marker *cur_mkr;
	GtkWidget *mkr_newbutton, *mkr_delbutton;

	spectool_sweep_cache *agecache;
};

struct _SpectoolPlanarClass {
	SpectoolWidgetClass parent_class;
};

GType spectool_planar_get_type(void);
GtkWidget *spectool_planar_new();
void spectool_planar_clear(void);

G_END_DECLS

#endif
#endif