4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
33 #include "bcsubwindow.h"
34 #include "rotateframe.inc"
42 #define PAN_CHANNEL_SMALL 5
43 #define PAN_STICK_SMALL 6
48 class BC_Pan : public BC_SubWindow
63 int update(int x, int y);
64 int button_press_event();
65 int cursor_motion_event();
66 int button_release_event();
67 int cursor_enter_event();
68 int cursor_leave_event();
69 int repeat_event(int64_t duration);
70 virtual int handle_event() { return 0; };
71 // change radial positions of channels
72 int change_channels(int new_channels, int *value_positions);
73 // update values from stick position
74 int stick_to_values();
75 // Generic conversion from stick to values for channel changes with no GUI
76 static int stick_to_values(float *values,
83 int get_total_values();
84 float get_value(int channel);
87 void set_images(VFrame **data);
88 static void calculate_stick_position(int total_values,
95 static int rdtoxy(int &x, int &y, int a, int virtual_r);
96 int activate(int popup_x = -1, int popup_y = -1);
101 void draw(int flash, int flush);
103 // update values from stick position
104 static float distance(int x1, int x2, int y1, int y2);
105 // get x and y positions of channels
106 static int get_channel_positions(int *value_x,
108 int *value_positions,
115 int *value_positions;
118 // Cursor origin on button press
119 int x_origin, y_origin;
120 // Stick origin on button press
121 int stick_x_origin, stick_y_origin;
124 // virtual x and y positions
125 int *value_x, *value_y;
129 BC_Pixmap *images[PAN_IMAGES];
130 VFrame *temp_channel;
131 RotateFrame *rotater;