6395b809cc3b00e0feb0b579b9bdad386265d260
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / mainsession.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 MAINSESSION_H
23 #define MAINSESSION_H
24
25 #include "asset.inc"
26 #include "assets.inc"
27 #include "auto.inc"
28 #include "bchash.inc"
29 #include "edit.inc"
30 #include "edits.inc"
31 #include "edl.inc"
32 #include "guicast.h"
33 #include "indexable.inc"
34 #include "mainsession.inc"
35 #include "maxchannels.h"
36 #include "mwindow.inc"
37 #include "plugin.inc"
38 #include "pluginset.inc"
39 #include "pluginserver.inc"
40 #include "track.inc"
41 #include "vwindowgui.inc"
42
43 // Options not in EDL but not changed in preferences
44 class MainSession
45 {
46 public:
47         MainSession(MWindow *mwindow);
48         ~MainSession();
49
50         int load_defaults(BC_Hash *defaults);
51         int save_defaults(BC_Hash *defaults);
52         void save_x11_host(int play_config, const char *x11_host);
53         int set_default_x11_host(int win_config=-1);
54         void default_window_positions(int window_config=0);
55         void boundaries();
56         Track *drag_handle_track();
57         void update_clip_number();
58         int load_file(const char *path);
59         int save_file(const char *path);
60
61 // For drag and drop events
62 // The entire track where the dropped asset is going to go
63         Track *track_highlighted;
64 // The edit after the point where the media is going to be dropped.
65         Edit *edit_highlighted;
66 // The plugin set where the plugin is going to be dropped.
67         PluginSet *pluginset_highlighted;
68 // The plugin after the point where the plugin is going to be dropped.
69         Plugin *plugin_highlighted;
70 // Current drag operation
71         int current_operation;
72
73 // Item being dragged
74         ArrayList <PluginServer*> *drag_pluginservers;
75         Plugin *drag_plugin;
76 // When trim should only affect the selected edits or plugins
77         Edits *trim_edits;
78         ArrayList<Indexable*> *drag_assets;
79         ArrayList<EDL*> *drag_clips;
80         Auto *drag_auto;
81         ArrayList<Auto*> *drag_auto_gang;
82
83 // Edit whose handle is being dragged
84         Edit *drag_edit;
85 // Selected edits clip of grouped drag
86         EDL *drag_group;
87 // drag edit of selected edits
88         Edit *drag_group_edit;
89 // cursor position in selected edits at start of drag
90         double drag_group_position;
91 // top track of selected edits
92         Track *drag_group_first_track;
93 // Edits who are being dragged
94         ArrayList<Edit*> *drag_edits;
95 // Button pressed during drag
96         int drag_button;
97 // Handle being dragged
98         int drag_handle;
99 // Current position of drag cursor
100         double drag_position;
101 // Starting position of drag cursor
102         double drag_start;
103 // Cursor position when button was pressed
104         int drag_origin_x, drag_origin_y;
105 // Value of keyframe when button was pressed
106         float drag_start_percentage;
107         long drag_start_position;
108 // Amount of data rendered, for drawing status in timebar
109         double brender_end;
110 // Position of cursor in CWindow output.  Used by ruler.
111         int cwindow_output_x, cwindow_output_y;
112
113 // Show controls in CWindow
114         int cwindow_controls;
115
116 // Clip number for automatic title generation
117         int clip_number;
118 // Next group id index
119         int group_number;
120
121 // Audio session
122         int changes_made;
123
124 // filename of the current project for window titling and saving
125         char filename[BCTEXTLEN];
126
127 // title bar background blend
128         float title_bar_alpha;
129
130         int batchrender_x, batchrender_y, batchrender_w, batchrender_h;
131
132 // Window positions
133         int window_config;
134         char a_x11_host[BCSTRLEN], b_x11_host[BCSTRLEN];
135 // level window
136         int lwindow_x, lwindow_y, lwindow_w, lwindow_h;
137 // main window
138         int mwindow_x, mwindow_y, mwindow_w, mwindow_h;
139 // viewer
140         int vwindow_x, vwindow_y, vwindow_w, vwindow_h;
141 // compositor
142         int cwindow_x, cwindow_y, cwindow_w, cwindow_h;
143         int ctool_x, ctool_y;
144 // asset window
145         int awindow_x, awindow_y, awindow_w, awindow_h;
146         int gwindow_x, gwindow_y;
147 // record monitor
148         int rmonitor_x, rmonitor_y, rmonitor_w, rmonitor_h;
149 // record status
150         int rwindow_x, rwindow_y, rwindow_w, rwindow_h;
151 // channelinfo
152         int cswindow_x, cswindow_y, cswindow_w, cswindow_h;
153 // subtitle
154         int swindow_x, swindow_y, swindow_w, swindow_h;
155 // binfolder filter window
156         int bwindow_w, bwindow_h;
157 // error window
158         int ewindow_w, ewindow_h;
159 // Channel edit window
160         int channels_x, channels_y;
161 // Picture edit window
162         int picture_x, picture_y;
163 // Recording scope window
164         int scope_x, scope_y, scope_w, scope_h;
165 // Recording histogram window
166         int histogram_x, histogram_y, histogram_w, histogram_h;
167 // Recording scopes enabled
168         int record_scope;
169 // Recording scope parameters
170         int use_hist;
171         int use_wave;
172         int use_vector;
173         int use_hist_parade;
174         int use_wave_parade;
175
176         int afolders_w;
177         int show_vwindow, show_awindow, show_cwindow, show_gwindow, show_lwindow;
178         int plugindialog_w, plugindialog_h;
179 //      int presetdialog_w, presetdialog_h;
180         int keyframedialog_w, keyframedialog_h;
181         int keyframedialog_column1;
182         int keyframedialog_column2;
183         int keyframedialog_all;
184         int menueffect_w, menueffect_h;
185         int transitiondialog_w, transitiondialog_h;
186
187         int selected_zwindow;
188
189         double actual_frame_rate;
190
191 // Tip of the day
192         int current_tip;
193
194         MWindow *mwindow;
195 };
196
197 #endif