* New: selectable styles
[calf.git] / src / calf / ctl_knob.h
blobc9904765724627d1e2b49f1396bfb82521b3ffc0
1 /* Calf DSP Library
2 * A knob (dial) widget.
4 * Copyright (C) 2008-2010 Krzysztof Foltman, Torben Hohn, Markus
5 * Schmidt and others
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This program 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 GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General
18 * Public License along with this program; if not, write to the
19 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02111-1307, USA.
23 #ifndef CALF_CTL_KNOB_H
24 #define CALF_CTL_KNOB_H
26 #include <gtk/gtk.h>
27 #include <vector>
28 #include <calf/gui.h>
30 G_BEGIN_DECLS
32 #define CALF_TYPE_KNOB (calf_knob_get_type())
33 #define CALF_KNOB(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CALF_TYPE_KNOB, CalfKnob))
34 #define CALF_IS_KNOB(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CALF_TYPE_KNOB))
35 #define CALF_KNOB_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CALF_TYPE_KNOB, CalfKnobClass))
36 #define CALF_IS_KNOB_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((klass), CALF_TYPE_KNOB))
38 struct CalfKnob
40 GtkRange parent;
41 int type;
42 int size;
43 double start_x, start_y, last_y, start_value, default_value;
44 std::vector<double> ticks;
45 GdkPixbuf *knob_image;
48 struct CalfKnobClass
50 GtkRangeClass parent_class;
53 extern GtkWidget *calf_knob_new();
54 extern GtkWidget *calf_knob_new_with_adjustment(GtkAdjustment *_adjustment);
55 extern void calf_knob_set_size (CalfKnob*self, int size);
56 extern void calf_knob_set_pixbuf (CalfKnob*self, GdkPixbuf *pixbuf);
58 extern GType calf_knob_get_type();
60 G_END_DECLS
62 #endif