ardour
canvas-waveview.h
Go to the documentation of this file.
1 /* libgnomecanvas/gnome-canvas-waveview.h: GnomeCanvas item for displaying wave data
2  *
3  * Copyright (C) 2001 Paul Davis <pbd@op.net>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library 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 GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18  * Boston, MA 02111-1307, USA.
19  *
20  */
21 
22 #ifndef __GNOME_CANVAS_WAVEVIEW_H__
23 #define __GNOME_CANVAS_WAVEVIEW_H__
24 
25 #include <stdint.h>
26 
27 #include <libgnomecanvas/libgnomecanvas.h>
28 
29 G_BEGIN_DECLS
30 
31 /* Wave viewer item for canvas.
32  */
33 
34 #define GNOME_TYPE_CANVAS_WAVEVIEW (gnome_canvas_waveview_get_type ())
35 #define GNOME_CANVAS_WAVEVIEW(obj) (GTK_CHECK_CAST ((obj), GNOME_TYPE_CANVAS_WAVEVIEW, GnomeCanvasWaveView))
36 #define GNOME_CANVAS_WAVEVIEW_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GNOME_TYPE_CANVAS_WAVEVIEW, GnomeCanvasWaveViewClass))
37 #define GNOME_IS_CANVAS_WAVEVIEW(obj) (GTK_CHECK_TYPE ((obj), GNOME_TYPE_CANVAS_WAVEVIEW))
38 #define GNOME_IS_CANVAS_WAVEVIEW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GNOME_TYPE_CANVAS_WAVEVIEW))
39 #define GNOME_CANVAS_WAVEVIEW_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GNOME_TYPE_CANVAS_WAVEVIEW, GnomeCanvasWaveViewClass))
40 
43 typedef struct _GnomeCanvasWaveViewChannelInfo GnomeCanvasWaveViewChannelInfo;
46 
47 /* XXX this needs to be synced with ardour/source.h PeakData */
48 
50 {
51  float min;
52  float max;
53 };
54 
56 {
58  guint32 allocated;
59  guint64 data_size;
60  gulong start;
61  gulong end;
62 };
63 
66 
68 
69 typedef gulong (*waveview_length_function_t)(void*);
70 typedef gulong (*waveview_sourcefile_length_function_t)(void*, double);
71 typedef void (*waveview_gain_curve_function_t)(void *arg, double start, double end, float* vector, gint64 veclen);
72 typedef void (*waveview_peak_function_t)(void*,gulong,gulong,gulong,gpointer,guint32,double);
73 
75 {
76  GnomeCanvasItem item;
77 
79  gboolean cache_updater;
81 
82  void *data_src;
83  guint32 channel;
88  void *gain_src;
89 
92 
103 
104  double x;
105  double y;
106  double height;
107  double half_height;
108  uint32_t wave_color;
109  uint32_t clip_color;
110  uint32_t zero_color;
111  uint32_t fill_color;
112 
113  char filled;
114  char rectified;
115  char zero_line;
116  char logscaled;
117 
118  /* These are updated by the update() routine
119  to optimize the render() routine, which may
120  be called several times after a single update().
121  */
122 
123  int32_t bbox_ulx;
124  int32_t bbox_uly;
125  int32_t bbox_lrx;
126  int32_t bbox_lry;
127  unsigned char wave_r, wave_g, wave_b, wave_a;
128  unsigned char clip_r, clip_g, clip_b, clip_a;
129  unsigned char fill_r, fill_g, fill_b, fill_a;
130  uint32_t samples;
131  uint32_t region_start;
133 };
134 
136  GnomeCanvasItemClass parent_class;
137 };
138 
139 GType gnome_canvas_waveview_get_type (void) G_GNUC_CONST;
140 
141 G_END_DECLS
142 
143 #endif /* __GNOME_CANVAS_WAVEVIEW_H__ */
GType gnome_canvas_waveview_get_type(void) G_GNUC_CONST
GnomeCanvasItemClass parent_class
void(* waveview_gain_curve_function_t)(void *arg, double start, double end, float *vector, gint64 veclen)
GnomeCanvasWaveViewCache * gnome_canvas_waveview_cache_new(void)
waveview_peak_function_t peak_function
LIBARDOUR_API PBD::PropertyDescriptor< framepos_t > start
Definition: region.cc:63
GnomeCanvasWaveViewCacheEntry * data
gulong(* waveview_length_function_t)(void *)
waveview_length_function_t length_function
GnomeCanvasItem item
struct _GnomeCanvasWaveViewChannelInfo GnomeCanvasWaveViewChannelInfo
void gnome_canvas_waveview_cache_destroy(GnomeCanvasWaveViewCache *)
gulong(* waveview_sourcefile_length_function_t)(void *, double)
waveview_sourcefile_length_function_t sourcefile_length_function
void(* waveview_peak_function_t)(void *, gulong, gulong, gulong, gpointer, guint32, double)
void gnome_canvas_waveview_set_gradient_waveforms(int)
GnomeCanvasWaveViewCache * cache
waveview_gain_curve_function_t gain_curve_function