![]() |
![]() |
![]() |
PHAT Reference Manual | ![]() |
---|---|---|---|---|
PhatKnob; GtkWidget* phat_knob_new (GtkAdjustment *adjustment); GtkWidget* phat_knob_new_with_range (double value, double lower, double upper, double step); GtkAdjustment* phat_knob_get_adjustment (PhatKnob *knob); double phat_knob_get_value (PhatKnob *knob); void phat_knob_set_value (PhatKnob *knob, double value); void phat_knob_set_range (PhatKnob *knob, double lower, double upper); void phat_knob_set_update_policy (PhatKnob *knob, GtkUpdateType policy); void phat_knob_set_adjustment (PhatKnob *knob, GtkAdjustment *adjustment); void phat_knob_set_log (PhatKnob *knob, gboolean is_log); gboolean phat_knob_is_log (PhatKnob *knob);
typedef struct { GtkWidget widget; /* The adjustment object that stores the data for this knob */ GtkAdjustment *adjustment; GtkAdjustment* adjustment_prv; /* update policy (GTK_UPDATE_[CONTINUOUS/DELAYED/DISCONTINUOUS]) */ guint policy : 2; gboolean is_log; /* State of widget (to do with user interaction) */ guint8 state; gint saved_x, saved_y; /* ID of update timer, or 0 if none */ guint32 timer; /* Pixmap for knob */ GdkPixbuf *pixbuf; GdkBitmap *mask; GdkGC *mask_gc; GdkGC *red_gc; /* Old values from adjustment stored so we know when something changes */ gfloat old_value; gfloat old_lower; gfloat old_upper; } PhatKnob;
GtkWidget* phat_knob_new_with_range (double value, double lower, double upper, double step);
Creates a new PhatKnob. The knob will create a new
GtkAdjustment from value
, lower
, upper
, and step
. If these
parameters represent a bogus configuration, the program will
terminate.
value : |
the initial value the new knob should have |
lower : |
the lowest value the new knob will allow |
upper : |
the highest value the new knob will allow |
step : |
increment added or subtracted when turning |
Returns : | a newly created PhatKnob |
GtkAdjustment* phat_knob_get_adjustment (PhatKnob *knob);
knob : |
|
Returns : |
double phat_knob_get_value (PhatKnob *knob);
Retrieves the current value of the knob.
knob : |
a PhatKnob |
Returns : | current value of the knob |
void phat_knob_set_value (PhatKnob *knob, double value);
Sets the current value of the knob. If the value is outside the
range of values allowed by knob
, it will be clamped. The knob
emits the "value-changed" signal if the value changes.
knob : |
a PhatKnob |
value : |
a new value for the knob |
void phat_knob_set_range (PhatKnob *knob, double lower, double upper);
Sets the range of allowable values for the knob, and clamps the
knob's current value to be between lower
and upper
.
knob : |
a PhatKnob |
lower : |
lowest allowable value |
upper : |
highest allowable value |
void phat_knob_set_update_policy (PhatKnob *knob, GtkUpdateType policy);
knob : |
|
policy : |
void phat_knob_set_adjustment (PhatKnob *knob, GtkAdjustment *adjustment);
knob : |
|
adjustment : |