00001 #ifndef ZOOMBAR_H
00002 #define ZOOMBAR_H
00003
00004 class FromTextBox;
00005 class LengthTextBox;
00006 class ToTextBox;
00007
00008
00009 class SampleZoomPanel;
00010 class AmpZoomPanel;
00011 class TrackZoomPanel;
00012 class AutoZoom;
00013 class AutoTypeMenu;
00014 class ZoomTextBox;
00015
00016 #include "guicast.h"
00017 #include "mwindow.inc"
00018 #include "mwindowgui.inc"
00019 #include "zoompanel.h"
00020
00021 class ZoomBar : public BC_SubWindow
00022 {
00023 public:
00024 ZoomBar(MWindow *mwindow, MWindowGUI *gui);
00025 ~ZoomBar();
00026
00027 int create_objects();
00028 void resize_event();
00029 int draw();
00030 int resize_event(int w, int h);
00031 void redraw_time_dependancies();
00032 int update();
00033 void update_autozoom();
00034 int update_clocks();
00035 int update_playback(int64_t new_position);
00036 int set_selection(int which_one);
00037 void update_formatting(BC_TextBox *dst);
00038
00039 MWindow *mwindow;
00040 MWindowGUI *gui;
00041 SampleZoomPanel *sample_zoom;
00042 AmpZoomPanel *amp_zoom;
00043 TrackZoomPanel *track_zoom;
00044 AutoZoom *auto_zoom;
00045 AutoTypeMenu *auto_type;
00046 ZoomTextBox *auto_zoom_text;
00047
00048 BC_Title *zoom_value, *playback_value;
00049 LengthTextBox *length_value;
00050 FromTextBox *from_value;
00051 ToTextBox *to_value;
00052 char string[256], string2[256];
00053 int64_t old_position;
00054 };
00055
00056 class SampleZoomPanel : public ZoomPanel
00057 {
00058 public:
00059 SampleZoomPanel(MWindow *mwindow, ZoomBar *zoombar, int x, int y);
00060 int handle_event();
00061 MWindow *mwindow;
00062 ZoomBar *zoombar;
00063 };
00064
00065 class AmpZoomPanel : public ZoomPanel
00066 {
00067 public:
00068 AmpZoomPanel(MWindow *mwindow, ZoomBar *zoombar, int x, int y);
00069 int handle_event();
00070 MWindow *mwindow;
00071 ZoomBar *zoombar;
00072 };
00073
00074 class TrackZoomPanel : public ZoomPanel
00075 {
00076 public:
00077 TrackZoomPanel(MWindow *mwindow, ZoomBar *zoombar, int x, int y);
00078 int handle_event();
00079 MWindow *mwindow;
00080 ZoomBar *zoombar;
00081 };
00082
00083 class AutoZoom : public BC_Tumbler
00084 {
00085 public:
00086 AutoZoom(MWindow *mwindow, ZoomBar *zoombar, int x, int y, int changemax);
00087 int handle_up_event();
00088 int handle_down_event();
00089 MWindow *mwindow;
00090 ZoomBar *zoombar;
00091 int changemax;
00092 };
00093
00094
00095 class AutoTypeMenu : public BC_PopupMenu
00096 {
00097 public:
00098 AutoTypeMenu(MWindow *mwindow,
00099 ZoomBar *zoombar,
00100 int x,
00101 int y);
00102 void create_objects();
00103 static char* to_text(int shape);
00104 static int from_text(char *text);
00105 int handle_event();
00106 MWindow *mwindow;
00107 ZoomBar *zoombar;
00108 };
00109
00110
00111 class ZoomTextBox : public BC_TextBox
00112 {
00113 public:
00114 ZoomTextBox(MWindow *mwindow, ZoomBar *zoombar, int x, int y, char *text);
00115 int button_press_event();
00116 int handle_event();
00117 MWindow *mwindow;
00118 ZoomBar *zoombar;
00119 };
00120
00121
00122
00123
00124
00125
00126
00127
00128 class FromTextBox : public BC_TextBox
00129 {
00130 public:
00131 FromTextBox(MWindow *mwindow, ZoomBar *zoombar, int x, int y);
00132 int handle_event();
00133 int update_position(double new_position);
00134 char string[256], string2[256];
00135 MWindow *mwindow;
00136 ZoomBar *zoombar;
00137 };
00138
00139
00140 class LengthTextBox : public BC_TextBox
00141 {
00142 public:
00143 LengthTextBox(MWindow *mwindow, ZoomBar *zoombar, int x, int y);
00144 int handle_event();
00145 int update_position(double new_position);
00146 char string[256], string2[256];
00147 MWindow *mwindow;
00148 ZoomBar *zoombar;
00149 };
00150
00151 class ToTextBox : public BC_TextBox
00152 {
00153 public:
00154 ToTextBox(MWindow *mwindow, ZoomBar *zoombar, int x, int y);
00155 int handle_event();
00156 int update_position(double new_position);
00157 char string[256], string2[256];
00158 MWindow *mwindow;
00159 ZoomBar *zoombar;
00160 };
00161
00162
00163
00164
00165 #endif