r668: Configure.in and autogen.sh cleanup based on ideas by giskard.
[cinelerra_cv.git] / cinelerra / recordgui.h
blob50970815f3e28475934051fc183362142ea4fede
1 #ifndef RECORDGUI_H
2 #define RECORDGUI_H
5 class RecordGUIBatches;
6 class RecordBatch;
7 class RecordStartType;
8 class RecordStart;
9 class RecordPath;
10 class BrowseButton;
11 class RecordDuration;
12 class RecordSource;
13 class RecordMode;
14 class RecordNews;
15 class RecordGUISave;
16 class RecordGUIStartOver;
17 class RecordGUICancel;
18 class RecordGUIMonitorVideo;
19 class RecordGUIMonitorAudio;
20 class RecordGUINewBatch;
21 class RecordGUIDeleteBatch;
22 class RecordGUIStartBatches;
23 class RecordGUIStopbatches;
24 class RecordGUIActivateBatch;
25 class RecordStatusThread;
27 class RecordGUIDCOffset;
28 class RecordGUIFillFrames;
29 class RecordGUILabel;
30 class RecordGUILoop;
31 class RecordGUILoopHr;
32 class RecordGUILoopMin;
33 class RecordGUILoopSec;
34 class RecordGUIModeMenu;
35 class RecordGUIMode;
36 class RecordGUIOK;
37 class RecordGUIReset;
38 class RecordStartoverThread;
39 class RecordCancelThread;
41 #include "browsebutton.inc"
42 #include "condition.inc"
43 #include "guicast.h"
44 #include "loadmode.inc"
45 #include "maxchannels.h"
46 #include "mutex.inc"
47 #include "mwindow.inc"
48 #include "question.inc"
49 #include "recordgui.inc"
50 #include "record.inc"
51 #include "recordmonitor.inc"
52 #include "recordtransport.inc"
53 #include "timeentry.h"
55 #define BATCH_COLUMNS 7
57 class RecordGUI : public BC_Window
59 public:
60 RecordGUI(MWindow *mwindow, Record *record);
61 ~RecordGUI();
63 void load_defaults();
64 void save_defaults();
65 int create_objects();
66 void flash_batch();
67 void update_batches();
68 void update_sources();
69 // Update the batch channel table when edited
70 void update_batch_sources();
71 // Update the batch editing tools
72 void update_batch_tools();
73 int resize_event(int w, int h);
74 int translation_event();
76 ArrayList<BC_ListBoxItem*> batches[BATCH_COLUMNS];
77 // Menu items
78 ArrayList<BC_ListBoxItem*> modes;
79 // Batch numbers
80 ArrayList<BC_ListBoxItem*> batch_numbers;
81 // Temp source pulldowns to create menu.
82 // Real source list is from ChannelPicker
83 ArrayList<BC_ListBoxItem*> sources;
85 BC_Title *current_operation;
86 BC_Title *position_title;
87 BC_Title *prev_label_title;
88 BC_Title *frames_dropped, *samples_clipped;
89 MWindow *mwindow;
90 Record *record;
91 RecordGUIBatches *batch_list;
92 // RecordBatch *batch_number;
93 RecordPath *batch_path;
94 RecordStatusThread *status_thread;
95 TimeEntry *batch_start;
96 TimeEntry *batch_duration;
97 RecordStartType *start_type;
98 RecordTransport *record_transport;
99 BrowseButton *batch_browse;
100 RecordSource *batch_source;
101 RecordMode *batch_mode;
102 RecordGUINewBatch *new_batch;
103 RecordGUIDeleteBatch *delete_batch;
104 RecordGUIStartBatches *start_batches;
105 RecordGUIStopbatches *stop_batches;
106 RecordGUIActivateBatch *activate_batch;
107 RecordGUILabel *label_button;
108 RecordGUIFillFrames *fill_frames;
109 RecordGUIMonitorVideo *monitor_video;
110 RecordGUIMonitorAudio *monitor_audio;
111 RecordStartoverThread *startover_thread;
112 RecordCancelThread *cancel_thread;
113 static char *batch_titles[BATCH_COLUMNS];
114 int column_widths[BATCH_COLUMNS];
115 LoadMode *load_mode;
116 int flash_color;
135 // RecordTransport *record_transport;
136 RecordGUIModeMenu *rec_mode_menu;
137 RecordGUILoopHr *loop_hr;
138 RecordGUILoopMin *loop_min;
139 RecordGUILoopSec *loop_sec;
140 RecordGUIReset *reset;
141 // RecordGUIStartOver *startover_button;
142 RecordGUIDCOffset *dc_offset_button;
143 RecordGUIDCOffsetText *dc_offset_text[MAXCHANNELS];
144 RecordMonitor *monitor_video_window;
145 BC_Meter *meter[MAXCHANNELS];
146 long total_dropped_frames;
147 long total_clipped_samples;
151 char* get_path();
152 int get_record_mode();
153 int set_record_mode(int value);
154 int get_output_bits();
155 int get_dither();
156 int get_duplex_status();
157 int set_duplex_status(int value);
158 int get_loop_status();
159 int get_sample_rate();
160 int get_enable_duplex();
161 long get_playback_buffer();
165 int set_loop_status(int value);
166 int update_duration_boxes(); // Redraw the loop duration textboxes for a script.
168 int keypress_event();
169 int delete_all_labels();
170 int calibrate_dc_offset();
171 int calibrate_dc_offset(long new_value, int channel);
172 int update_dropped_frames(long new_dropped);
173 int update_clipped_samples(long new_clipped);
174 int set_translation(int x, int y, float z);
176 void update_labels(double new_position);
177 int update_position(double new_position);
178 int update_prev_label(long new_position);
179 // int update_next_label(long new_position);
181 int update_title(BC_Title *title, double position);
183 int goto_prev_label();
184 // int goto_next_label();
185 int toggle_label();
188 class RecordGUIBatches : public BC_ListBox
190 public:
191 RecordGUIBatches(Record *record, RecordGUI *gui, int x, int y, int w, int h);
192 int handle_event();
193 int selection_changed();
194 int column_resize_event();
195 int drag_start_event();
196 int drag_motion_event();
197 int drag_stop_event();
199 int dragging_item;
200 Record *record;
201 RecordGUI *gui;
204 class RecordGUISave : public BC_Button
206 public:
207 RecordGUISave(Record *record, RecordGUI *record_gui);
208 int handle_event();
209 int keypress_event();
210 RecordGUI *gui;
211 Record *record;
215 class RecordGUICancel : public BC_Button
217 public:
218 RecordGUICancel(Record *record, RecordGUI *record_gui);
219 int handle_event();
220 int keypress_event();
221 RecordGUI *gui;
222 Record *record;
225 class RecordGUIStartBatches : public BC_GenericButton
227 public:
228 RecordGUIStartBatches(MWindow *mwindow, Record *record, int x, int y);
229 int handle_event();
230 MWindow *mwindow;
231 Record *record;
235 class RecordGUIStopbatches : public BC_GenericButton
237 public:
238 RecordGUIStopbatches(MWindow *mwindow, Record *record, int x, int y);
239 int handle_event();
240 MWindow *mwindow;
241 Record *record;
244 class RecordGUIActivateBatch : public BC_GenericButton
246 public:
247 RecordGUIActivateBatch(MWindow *mwindow, Record *record, int x, int y);
248 int handle_event();
249 MWindow *mwindow;
250 Record *record;
254 class RecordGUIStartOver : public BC_GenericButton
256 public:
257 RecordGUIStartOver(Record *record, RecordGUI *record_gui, int x, int y);
258 ~RecordGUIStartOver();
260 int handle_event();
262 RecordGUI *gui;
263 Record *record;
266 class RecordCancelThread : public Thread
268 public:
269 RecordCancelThread(Record *record, RecordGUI *record_gui);
270 ~RecordCancelThread();
271 void run();
273 RecordGUI *gui;
274 Record *record;
275 QuestionWindow *window;
278 class RecordStartoverThread : public Thread
280 public:
281 RecordStartoverThread(Record *record, RecordGUI *record_gui);
282 ~RecordStartoverThread();
283 void run();
285 RecordGUI *gui;
286 Record *record;
287 QuestionWindow *window;
290 class RecordBatch : public BC_PopupTextBox
292 public:
293 RecordBatch(MWindow *mwindow, Record *record, RecordGUI *gui, int x, int y);
294 int handle_event();
295 MWindow *mwindow;
296 Record *record;
297 RecordGUI *gui;
300 class RecordStartType : public BC_CheckBox
302 public:
303 RecordStartType(MWindow *mwindow, Record *record, int x, int y);
304 int handle_event();
305 MWindow *mwindow;
306 Record *record;
309 class RecordPath : public BC_TextBox
311 public:
312 RecordPath(MWindow *mwindow, Record *record, int x, int y);
313 int handle_event();
314 MWindow *mwindow;
315 Record *record;
318 class RecordStart : public TimeEntry
320 public:
321 RecordStart(MWindow *mwindow, Record *record, int x, int y);
322 int handle_event();
323 MWindow *mwindow;
324 Record *record;
327 class RecordDuration : public TimeEntry
329 public:
330 RecordDuration(MWindow *mwindow, Record *record, int x, int y);
331 int handle_event();
332 MWindow *mwindow;
333 Record *record;
336 class RecordSource : public BC_PopupTextBox
338 public:
339 RecordSource(MWindow *mwindow, Record *record, RecordGUI *gui, int x, int y);
340 int handle_event();
341 MWindow *mwindow;
342 Record *record;
343 RecordGUI *gui;
346 class RecordMode : public BC_PopupTextBox
348 public:
349 RecordMode(MWindow *mwindow, Record *record, RecordGUI *gui, int x, int y);
350 int handle_event();
351 MWindow *mwindow;
352 Record *record;
353 RecordGUI *gui;
356 class RecordNews : public BC_TextBox
358 public:
359 RecordNews(MWindow *mwindow, Record *record, int x, int y);
360 int handle_event();
361 MWindow *mwindow;
362 Record *record;
365 class RecordGUIFillFrames : public BC_CheckBox
367 public:
368 RecordGUIFillFrames(MWindow *mwindow, Record *record, int x, int y);
369 int handle_event();
370 MWindow *mwindow;
371 Record *record;
374 class RecordGUIMonitorVideo : public BC_CheckBox
376 public:
377 RecordGUIMonitorVideo(MWindow *mwindow, Record *record, int x, int y);
378 int handle_event();
379 MWindow *mwindow;
380 Record *record;
383 class RecordGUIMonitorAudio : public BC_CheckBox
385 public:
386 RecordGUIMonitorAudio(MWindow *mwindow, Record *record, int x, int y);
387 int handle_event();
388 MWindow *mwindow;
389 Record *record;
392 class RecordGUINewBatch : public BC_GenericButton
394 public:
395 RecordGUINewBatch(MWindow *mwindow, Record *record, int x, int y);
396 int handle_event();
397 MWindow *mwindow;
398 Record *record;
402 class RecordGUIDeleteBatch : public BC_GenericButton
404 public:
405 RecordGUIDeleteBatch(MWindow *mwindow, Record *record, int x, int y);
406 int handle_event();
407 MWindow *mwindow;
408 Record *record;
411 class RecordGUILabel : public BC_GenericButton
413 public:
414 RecordGUILabel(MWindow *mwindow, Record *record, int x, int y);
415 ~RecordGUILabel();
417 int handle_event();
418 int keypress_event();
419 MWindow *mwindow;
420 Record *record;
423 // Stop GUI blocking the recording when X11 is busy
424 class RecordStatusThread : public Thread
426 public:
427 RecordStatusThread(MWindow *mwindow, RecordGUI *gui);
428 ~RecordStatusThread();
430 void update_dropped_frames(long value);
431 void update_position(double new_position);
432 void update_clipped_samples(long new_clipped_samples);
433 void run();
435 MWindow *mwindow;
436 RecordGUI *gui;
437 long new_dropped_frames;
438 double new_position;
439 long new_clipped_samples;
440 int done;
441 Condition *input_lock;
458 class RecordGUIOK : public BC_OKButton
460 public:
461 RecordGUIOK(MWindow *mwindow, int y);
462 ~RecordGUIOK();
464 int handle_event();
468 class RecordGUIModeMenu : public BC_PopupMenu
470 public:
471 RecordGUIModeMenu(int x, int y, int w, char *text);
472 ~RecordGUIModeMenu();
474 int handle_event();
475 int add_items();
477 RecordGUIMode *linear;
478 RecordGUIMode *timed;
479 RecordGUIMode *loop;
482 class RecordGUIMode : public BC_MenuItem
484 public:
485 RecordGUIMode(char *text);
486 ~RecordGUIMode();
488 int handle_event();
498 class RecordGUIDCOffset : public BC_Button
500 public:
501 RecordGUIDCOffset(MWindow *mwindow, int y);
502 ~RecordGUIDCOffset();
504 int handle_event();
505 int keypress_event();
508 class RecordGUIDCOffsetText : public BC_TextBox
510 public:
511 RecordGUIDCOffsetText(char *text, int y, int number);
512 ~RecordGUIDCOffsetText();
514 int handle_event();
515 int number;
518 class RecordGUIReset : public BC_Button
520 public:
521 RecordGUIReset(MWindow *mwindow, RecordGUI *gui, int y);
522 ~RecordGUIReset();
524 int handle_event();
525 RecordGUI *gui;
528 class RecordGUIResetTranslation : public BC_Button
530 public:
531 RecordGUIResetTranslation(MWindow *mwindow, RecordGUI *gui, int y);
532 ~RecordGUIResetTranslation();
534 int handle_event();
535 RecordGUI *gui;
544 #endif