initial commit
[goodguy/history.git] / cinelerra-5.0 / cinelerra / patchbay.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5  * 
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.
10  * 
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.
15  * 
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
19  * 
20  */
21
22 #ifndef PATCHBAY_H
23 #define PATCHBAY_H
24
25 #include "guicast.h"
26 #include "filexml.inc"
27 #include "mwindow.inc"
28 #include "mwindowgui.inc"
29 #include "overlayframe.inc"
30 #include "patch.h"
31 #include "patchbay.inc"
32 #include "patchgui.inc"
33 #include "timelinepane.inc"
34
35 class NudgePopupSeconds;
36 class NudgePopupNative;
37 class NudgePopup;
38
39 class PatchBay : public BC_SubWindow
40 {
41 public:
42         PatchBay(MWindow *mwindow, MWindowGUI *gui);
43         PatchBay(MWindow *mwindow, TimelinePane *pane, int x, int y, int w, int h);
44         ~PatchBay();
45
46         int delete_all_patches();
47         void create_objects();
48         void resize_event();
49         void resize_event(int x, int y, int w, int h);
50         int button_press_event();
51         int cursor_motion_event();
52         BC_Pixmap* mode_to_icon(int mode);
53         int icon_to_mode(BC_Pixmap *icon);
54 // Get the patch that matches the track.
55         PatchGUI* get_patch_of(Track *track);
56
57 // Synchronize with Master EDL
58         int update();
59         void update_meters(ArrayList<double> *module_levels);
60         void stop_meters();
61         void synchronize_nudge(int64_t value, Track *skip);
62         void synchronize_faders(float value, int data_type, Track *skip);
63         void set_meter_format(int mode, int min, int max);
64         void reset_meters();
65
66         ArrayList<PatchGUI*> patches;
67
68
69
70
71
72
73 // =========================================== drawing
74
75         int resize_event(int top, int bottom);
76
77
78         MWindow *mwindow;
79         MWindowGUI *gui;
80         TimelinePane *pane;
81
82         int new_status, drag_operation;
83         BC_Pixmap *mode_icons[TRANSFER_TYPES];
84
85         NudgePopup *nudge_popup;
86 };
87
88
89 class NudgePopup : public BC_PopupMenu
90 {
91 public:
92         NudgePopup(MWindow *mwindow, PatchBay *patchbay);
93         ~NudgePopup();
94
95         void create_objects();
96         void activate_menu(PatchGUI *gui);
97
98         MWindow *mwindow;
99         PatchBay *patchbay;
100         NudgePopupSeconds *seconds_item;
101         NudgePopupNative *native_item;
102 };
103
104
105 class NudgePopupSeconds : public BC_MenuItem
106 {
107 public:
108         NudgePopupSeconds(NudgePopup *popup);
109         int handle_event();
110         NudgePopup *popup;
111 };
112
113
114 class NudgePopupNative : public BC_MenuItem
115 {
116 public:
117         NudgePopupNative(NudgePopup *popup);
118         int handle_event();
119         NudgePopup *popup;
120 };
121
122 #endif