r499: This commit was manufactured by cvs2svn to create tag 'r1_2_1-last'.
[cinelerra_cv/mob.git] / hvirtual / guicast / bcpan.h
blob87da3c890242bfd60fe8d2c57506007f1a168ed1
1 #ifndef BCPAN_H
2 #define BCPAN_H
4 // pan angles
5 //
6 // 360/0
7 //
8 // 270 90
9 //
10 // 180
12 #include "bcsubwindow.h"
13 #include "rotateframe.inc"
14 #include "vframe.inc"
16 #define PAN_UP 0
17 #define PAN_HI 1
18 #define PAN_POPUP 2
19 #define PAN_CHANNEL 3
20 #define PAN_STICK 4
21 #define PAN_CHANNEL_SMALL 5
22 #define PAN_STICK_SMALL 6
23 #define PAN_IMAGES 7
27 class BC_Pan : public BC_SubWindow
29 public:
30 BC_Pan(int x,
31 int y,
32 int virtual_r,
33 float maxvalue,
34 int total_values,
35 int *value_positions,
36 int stick_x,
37 int stick_y,
38 float *values);
39 virtual ~BC_Pan();
41 int initialize();
42 int update(int x, int y);
43 int button_press_event();
44 int cursor_motion_event();
45 int button_release_event();
46 int cursor_enter_event();
47 int cursor_leave_event();
48 int repeat_event(int64_t duration);
49 virtual int handle_event() { return 0; };
50 // change radial positions of channels
51 int change_channels(int new_channels, int *value_positions);
52 // update values from stick position
53 int stick_to_values();
54 // Generic conversion from stick to values for channel changes with no GUI
55 static int stick_to_values(float *values,
56 int total_values,
57 int *value_positions,
58 int stick_x,
59 int stick_y,
60 int virtual_r,
61 float maxvalue);
62 int get_total_values();
63 float get_value(int channel);
64 int get_stick_x();
65 int get_stick_y();
66 void set_images(VFrame **data);
67 static void calculate_stick_position(int total_values,
68 int *value_positions,
69 float *values,
70 float maxvalue,
71 int virtual_r,
72 int &stick_x,
73 int &stick_y);
74 static int rdtoxy(int &x, int &y, int a, int virtual_r);
75 int activate(int popup_x = -1, int popup_y = -1);
76 int deactivate();
77 float* get_values();
79 private:
80 void draw();
81 void draw_popup();
82 // update values from stick position
83 static float distance(int x1, int x2, int y1, int y2);
84 // get x and y positions of channels
85 static int get_channel_positions(int *value_x,
86 int *value_y,
87 int *value_positions,
88 int virtual_r,
89 int total_values);
91 int virtual_r;
92 float maxvalue;
93 int total_values;
94 int *value_positions;
95 int stick_x;
96 int stick_y;
97 // Cursor origin on button press
98 int x_origin, y_origin;
99 // Stick origin on button press
100 int stick_x_origin, stick_y_origin;
101 float *values;
102 int highlighted;
103 // virtual x and y positions
104 int *value_x, *value_y;
105 int active;
107 // Used in popup
108 BC_Pixmap *images[PAN_IMAGES];
109 VFrame *temp_channel;
110 RotateFrame *rotater;
111 BC_Popup *popup;
114 #endif