added tuning knob
[nekobee.git] / src / gtk / knob.h
blob3f827fd870951c7dc0f7507eb89926e0ce75d8e4
1 /* nekobee DSSI software synthesizer GUI
3 * Most of this code comes from gAlan 0.2.0, copyright (C) 1999
4 * Tony Garnock-Jones, with modifications by Sean Bolton,
5 * copyright (c) 2004.
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of
10 * the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be
13 * useful, but WITHOUT ANY WARRANTY; without even the implied
14 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public
18 * License along with this program; if not, write to the Free
19 * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20 * MA 02111-1307, USA.
23 #ifndef __GTK_KNOB_H__
24 #define __GTK_KNOB_H__
26 #include <gdk/gdk.h>
27 #include <gtk/gtkadjustment.h>
28 #include <gtk/gtkwidget.h>
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
34 #define GTK_KNOB(obj) GTK_CHECK_CAST(obj, gtk_knob_get_type(), GtkKnob)
35 #define GTK_KNOB_CLASS(klass) GTK_CHECK_CLASS_CAST(klass, gtk_knob_get_type(), GtkKnobClass)
36 #define GTK_IS_KNOB(obj) GTK_CHECK_TYPE(obj, gtk_knob_get_type())
38 typedef struct _GtkKnob GtkKnob;
39 typedef struct _GtkKnobClass GtkKnobClass;
41 struct _GtkKnob {
42 GtkWidget widget;
44 /* update policy (GTK_UPDATE_[CONTINUOUS/DELAYED/DISCONTINUOUS]) */
45 guint policy : 2;
47 /* State of widget (to do with user interaction) */
48 guint8 state;
49 gint saved_x, saved_y;
51 /* ID of update timer, or 0 if none */
52 guint32 timer;
54 /* Pixmap for knob */
55 GdkPixbuf *pixbuf;
57 gint knobtype;
59 /* Old values from adjustment stored so we know when something changes */
60 gfloat old_value;
61 gfloat old_lower;
62 gfloat old_upper;
64 /* The adjustment object that stores the data for this knob */
65 GtkAdjustment *adjustment;
68 struct _GtkKnobClass
70 GtkWidgetClass parent_class;
73 extern GtkWidget *gtk_knob_new(GtkAdjustment *adjustment);
74 extern guint gtk_knob_get_type(void);
76 extern GtkAdjustment *gtk_knob_get_adjustment(GtkKnob *knob);
77 extern void gtk_knob_set_update_policy(GtkKnob *knob, GtkUpdateType policy);
79 extern void gtk_knob_set_adjustment(GtkKnob *knob, GtkAdjustment *adjustment);
81 #ifdef __cplusplus
83 #endif
85 #endif