Merge branch 'master' of https://github.com/calf-studio-gear/calf
[calf.git] / src / calf / ctl_tube.h
blobefa9d1d0d3f59268424c8e805402ac36fcce049f
1 /* Calf DSP Library
2 * A tube widget for overdrive-type plugins (saturator etc).
4 * Copyright (C) 2010-2012 Markus Schmidt and others
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General
17 * Public License along with this program; if not, write to the
18 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02111-1307, USA.
22 #ifndef CALF_CTL_TUBE_H
23 #define CALF_CTL_TUBE_H
25 #include <gtk/gtk.h>
27 G_BEGIN_DECLS
29 #define CALF_TYPE_TUBE (calf_tube_get_type())
30 #define CALF_TUBE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CALF_TYPE_TUBE, CalfTube))
31 #define CALF_IS_TUBE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CALF_TYPE_TUBE))
32 #define CALF_TUBE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CALF_TYPE_TUBE, CalfTubeClass))
33 #define CALF_IS_TUBE_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((klass), CALF_TYPE_TUBE))
34 #define CALF_TUBE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CALF_TYPE_TUBE, CalfTubeClass))
36 struct CalfTube
38 GtkDrawingArea parent;
39 int size;
40 int direction;
41 float value;
42 float last_value;
43 float tube_falloff;
44 bool falling;
45 float last_falloff;
46 long last_falltime;
47 cairo_surface_t *cache_surface;
50 struct CalfTubeClass
52 GtkDrawingAreaClass parent_class;
55 extern GtkWidget *calf_tube_new();
56 extern GType calf_tube_get_type();
57 extern void calf_tube_set_value(CalfTube *tube, float value);
59 G_END_DECLS
61 #endif