2 #ifndef __BST_QSAMPLER_H__
3 #define __BST_QSAMPLER_H__
10 #define BST_TYPE_QSAMPLER (bst_qsampler_get_type ())
11 #define BST_QSAMPLER(object) (GTK_CHECK_CAST ((object), BST_TYPE_QSAMPLER, BstQSampler))
12 #define BST_QSAMPLER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), BST_TYPE_QSAMPLER, BstQSamplerClass))
13 #define BST_IS_QSAMPLER(object) (GTK_CHECK_TYPE ((object), BST_TYPE_QSAMPLER))
14 #define BST_IS_QSAMPLER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), BST_TYPE_QSAMPLER))
15 #define BST_QSAMPLER_GET_CLASS(obj) ((BstQSamplerClass*) ((GtkObject*) (obj))->klass)
24 typedef struct _BstQSamplerSource BstQSamplerSource;
25 typedef struct _BstQSamplerBlock BstQSamplerBlock;
28 typedef guint (*BstQSamplerFill) (gpointer data,
33 BstQSamplerPeak *values,
34 BstQSampler *qsampler);
38 BST_QSAMPLER_ACTIVE = 1 << 1,
39 BST_QSAMPLER_SELECTED = 1 << 2,
41 BST_QSAMPLER_PRELIGHT = 1 << 3,
44 BST_QSAMPLER_MARK_MASK = (BST_QSAMPLER_SELECTED | BST_QSAMPLER_ACTIVE | BST_QSAMPLER_PRELIGHT),
45 BST_QSAMPLER_REGION_MASK = (BST_QSAMPLER_SELECTED | BST_QSAMPLER_ACTIVE),
46 BST_QSAMPLER_MARK = 1 << 4,
47 BST_QSAMPLER_MASK = 0x1f,
48 BST_QSAMPLER_SKIP = 1 << 5,
49 BST_QSAMPLER_NEEDS_DRAW = 1 << 6,
50 BST_QSAMPLER_DIRTY = 1 << 7
53 constexpr BstQSamplerType operator& (BstQSamplerType s1, BstQSamplerType s2) {
return BstQSamplerType (s1 & (
long long unsigned) s2); }
54 inline BstQSamplerType& operator&= (BstQSamplerType &s1, BstQSamplerType s2) { s1 = s1 & s2;
return s1; }
55 constexpr BstQSamplerType operator| (BstQSamplerType s1, BstQSamplerType s2) {
return BstQSamplerType (s1 | (
long long unsigned) s2); }
56 inline BstQSamplerType& operator|= (BstQSamplerType &s1, BstQSamplerType s2) { s1 = s1 | s2;
return s1; }
57 constexpr BstQSamplerType operator~ (BstQSamplerType s1) {
return BstQSamplerType (~(
long long unsigned) s1); }
62 BST_QSAMPLER_DRAW_CRANGE,
63 BST_QSAMPLER_DRAW_CSHAPE,
64 BST_QSAMPLER_DRAW_ZERO_SHAPE,
65 BST_QSAMPLER_DRAW_MINIMUM_LINE,
66 BST_QSAMPLER_DRAW_MIDDLE_LINE,
67 BST_QSAMPLER_DRAW_MAXIMUM_LINE,
68 BST_QSAMPLER_DRAW_MINIMUM_SHAPE,
69 BST_QSAMPLER_DRAW_MAXIMUM_SHAPE,
70 BST_QSAMPLER_DRAW_MODE_LAST
71 } BstQSamplerDrawMode;
72 #define BST_QSAMPLER_RELOAD_PRIORITY (GTK_PRIORITY_REDRAW + 5)
78 GtkWidget parent_instance;
82 BstQSamplerTPeak *peaks;
89 BstQSamplerMark *marks;
91 BstQSamplerRegion *regions;
93 BstQSamplerFill src_filler;
95 GDestroyNotify src_destroy;
98 GtkAdjustment *adjustment;
99 gdouble vscale_factor;
102 GdkGC *red_gc, *green_gc;
104 guint draw_mode : 16;
105 guint expose_frame : 1;
106 guint ignore_adjustment : 1;
107 guint refresh_queued : 1;
108 guint invalid_remains : 1;
125 GtkWidgetClass parent_class;
130 BstQSamplerType type;
136 BstQSamplerType type;
143 GType bst_qsampler_get_type (
void);
144 void bst_qsampler_set_source (BstQSampler *qsampler,
145 guint n_total_samples,
146 BstQSamplerFill fill_func,
148 GDestroyNotify destroy);
149 void bst_qsampler_get_bounds (BstQSampler *qsampler,
152 gboolean bst_qsampler_get_offset_at (BstQSampler *qsampler,
154 void bst_qsampler_scroll_show (BstQSampler *qsampler,
156 void bst_qsampler_scroll_rbounded (BstQSampler *qsampler,
158 gfloat boundary_padding,
160 void bst_qsampler_scroll_lbounded (BstQSampler *qsampler,
162 gfloat boundary_padding,
164 void bst_qsampler_scroll_bounded (BstQSampler *qsampler,
166 gfloat boundary_padding,
168 void bst_qsampler_scroll_to (BstQSampler *qsampler,
170 void bst_qsampler_force_refresh (BstQSampler *qsampler);
171 void bst_qsampler_set_mark (BstQSampler *qsampler,
174 BstQSamplerType type);
175 gint bst_qsampler_get_mark_offset (BstQSampler *qsampler,
177 void bst_qsampler_set_region (BstQSampler *qsampler,
181 BstQSamplerType type);
182 void bst_qsampler_set_zoom (BstQSampler *qsampler,
184 void bst_qsampler_set_vscale (BstQSampler *qsampler,
186 void bst_qsampler_set_draw_mode (BstQSampler *qsampler,
187 BstQSamplerDrawMode dmode);
188 void bst_qsampler_set_adjustment (BstQSampler *qsampler,
189 GtkAdjustment *adjustment);
191 void bst_qsampler_set_source_from_esample (BstQSampler *qsampler,
Definition: bstqsampler.hh:119
Definition: bstqsampler.hh:133
Definition: bstqsampler.hh:123
Definition: bstqsampler.hh:127
Definition: bstqsampler.hh:76
Definition: bstqsampler.hh:114