00001 #ifndef PATCHGUI_H
00002 #define PATCHGUI_H
00003
00004 #include "guicast.h"
00005 #include "mwindow.inc"
00006 #include "patchbay.inc"
00007 #include "intauto.inc"
00008 #include "track.inc"
00009
00010
00011
00012
00013 class TitlePatch;
00014 class PlayPatch;
00015 class RecordPatch;
00016 class AutoPatch;
00017 class GangPatch;
00018 class DrawPatch;
00019 class MutePatch;
00020 class ExpandPatch;
00021 class NudgePatch;
00022
00023 class PatchGUI
00024 {
00025 public:
00026 PatchGUI(MWindow *mwindow,
00027 PatchBay *patchbay,
00028 Track *track,
00029 int x,
00030 int y);
00031 virtual ~PatchGUI();
00032
00033 virtual int create_objects();
00034 virtual int reposition(int x, int y);
00035 void toggle_behavior(int type,
00036 int value,
00037 BC_Toggle *toggle,
00038 int *output);
00039 virtual int update(int x, int y);
00040 virtual void synchronize_fade(float change) {};
00041 void synchronize_faders(float change, int audio, int video);
00042 char* calculate_nudge_text(int *changed);
00043 int64_t calculate_nudge(char *string);
00044
00045 MWindow *mwindow;
00046 PatchBay *patchbay;
00047 Track *track;
00048
00049
00050 int track_id;
00051 int data_type;
00052 int x, y;
00053
00054 int change_source;
00055
00056 TitlePatch *title;
00057 RecordPatch *record;
00058 PlayPatch *play;
00059
00060 GangPatch *gang;
00061 DrawPatch *draw;
00062 MutePatch *mute;
00063 ExpandPatch *expand;
00064 NudgePatch *nudge;
00065 char string_return[BCTEXTLEN];
00066 };
00067
00068
00069
00070 class PlayPatch : public BC_Toggle
00071 {
00072 public:
00073 PlayPatch(MWindow *mwindow, PatchGUI *patch, int x, int y);
00074 int button_press_event();
00075 int button_release_event();
00076 MWindow *mwindow;
00077 PatchGUI *patch;
00078 };
00079
00080 class RecordPatch : public BC_Toggle
00081 {
00082 public:
00083 RecordPatch(MWindow *mwindow, PatchGUI *patch, int x, int y);
00084 int button_press_event();
00085 int button_release_event();
00086 MWindow *mwindow;
00087 PatchGUI *patch;
00088 };
00089
00090 class TitlePatch : public BC_TextBox
00091 {
00092 public:
00093 TitlePatch(MWindow *mwindow, PatchGUI *patch, int x, int y);
00094 int handle_event();
00095 MWindow *mwindow;
00096 PatchGUI *patch;
00097 };
00098
00099 class AutoPatch : public BC_Toggle
00100 {
00101 public:
00102 AutoPatch(MWindow *mwindow, PatchGUI *patch, int x, int y);
00103 int button_press_event();
00104 int button_release_event();
00105 MWindow *mwindow;
00106 PatchGUI *patch;
00107 };
00108
00109 class GangPatch : public BC_Toggle
00110 {
00111 public:
00112 GangPatch(MWindow *mwindow, PatchGUI *patch, int x, int y);
00113 int button_press_event();
00114 int button_release_event();
00115 MWindow *mwindow;
00116 PatchGUI *patch;
00117 };
00118
00119 class DrawPatch : public BC_Toggle
00120 {
00121 public:
00122 DrawPatch(MWindow *mwindow, PatchGUI *patch, int x, int y);
00123 int button_press_event();
00124 int button_release_event();
00125 MWindow *mwindow;
00126 PatchGUI *patch;
00127 };
00128
00129 class MutePatch : public BC_Toggle
00130 {
00131 public:
00132 MutePatch(MWindow *mwindow, PatchGUI *patch, int x, int y);
00133 int button_press_event();
00134 int button_release_event();
00135 static IntAuto* get_keyframe(MWindow *mwindow, PatchGUI *patch);
00136 MWindow *mwindow;
00137 PatchGUI *patch;
00138 };
00139
00140 class ExpandPatch : public BC_Toggle
00141 {
00142 public:
00143 ExpandPatch(MWindow *mwindow, PatchGUI *patch, int x, int y);
00144 int button_press_event();
00145 int button_release_event();
00146 MWindow *mwindow;
00147 PatchGUI *patch;
00148 };
00149
00150 class NudgePatch : public BC_TextBox
00151 {
00152 public:
00153 NudgePatch(MWindow *mwindow, PatchGUI *patch, int x, int y, int w);
00154 int handle_event();
00155 int button_press_event();
00156 void update();
00157 void set_value(int64_t value);
00158 int64_t calculate_increment();
00159
00160 MWindow *mwindow;
00161 PatchGUI *patch;
00162 };
00163
00164
00165 #endif