6 #include "bcsubwindow.h"
16 class BC_PercentagePot
;
18 class BC_Pot
: public BC_SubWindow
21 BC_Pot(int x
, int y
, VFrame
**data
);
27 friend class BC_PercentagePot
;
30 virtual float get_percentage() { return 0; };
31 virtual int percentage_to_value(float percentage
) { return 0; };
32 virtual int handle_event() { return 0; };
33 virtual char* get_caption() { return ""; };
34 virtual int increase_value() { return 0; };
35 virtual int decrease_value() { return 0; };
37 int reposition_window(int x
, int y
);
38 int repeat_event(int64_t repeat_id
);
39 int cursor_enter_event();
40 int cursor_leave_event();
41 int button_press_event();
42 int button_release_event();
43 int cursor_motion_event();
47 int set_data(VFrame
**data
);
49 float percentage_to_angle(float percentage
);
50 float angle_to_percentage(float angle
);
51 int angle_to_coords(int &x1
, int &y1
, int &x2
, int &y2
, float angle
);
52 float coords_to_angle(int x2
, int y2
);
53 void show_value_tooltip();
56 BC_Pixmap
*images
[POT_STATES
];
57 char caption
[BCTEXTLEN
], temp_tooltip_text
[BCTEXTLEN
];
59 int64_t keypress_tooltip_timer
;
61 float start_cursor_angle
;
62 float start_needle_angle
;
63 float prev_angle
, angle_correction
;
66 class BC_FPot
: public BC_Pot
80 float get_percentage();
82 int percentage_to_value(float percentage
);
83 void update(float value
);
84 void set_precision(float value
);
87 float value
, minvalue
, maxvalue
;
91 class BC_IPot
: public BC_Pot
103 int increase_value();
104 int decrease_value();
105 float get_percentage();
106 int percentage_to_value(float percentage
);
108 void update(int64_t value
);
111 int64_t value
, minvalue
, maxvalue
;
114 class BC_QPot
: public BC_Pot
119 int64_t value
, // Units of frequencies
124 int increase_value();
125 int decrease_value();
126 float get_percentage();
127 int percentage_to_value(float percentage
);
128 // Units of frequencies
130 // Units of frequencies
131 void update(int64_t value
);
134 // Units of frequency index
135 int64_t value
, minvalue
, maxvalue
;
138 class BC_PercentagePot
: public BC_Pot
141 BC_PercentagePot(int x
,
150 int increase_value();
151 int decrease_value();
152 float get_percentage();
154 int percentage_to_value(float percentage
);
155 void update(float value
);
158 float value
, minvalue
, maxvalue
;