r602: Fix baver's code... don't insert timecode when show_tc is not set
[cinelerra_cv/mob.git] / cinelerra / recordgui.h
blob7e37291f0b6d2a889fcddf6fb836d4f4a0edfa44
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 BC_Title *transport_title;
99 RecordTransport *record_transport;
100 BrowseButton *batch_browse;
101 RecordSource *batch_source;
102 RecordMode *batch_mode;
103 // RecordNews *batch_news;
104 BC_Title *batch_number_title;
105 BC_Title *batch_start_title;
106 BC_Title *batch_path_title;
107 BC_Title *batch_browse_title;
108 BC_Title *batch_duration_title;
109 BC_Title *batch_source_title;
110 BC_Title *batch_mode_title;
111 BC_Title *batch_news_title;
112 RecordGUINewBatch *new_batch;
113 RecordGUIDeleteBatch *delete_batch;
114 RecordGUIStartBatches *start_batches;
115 RecordGUIStopbatches *stop_batches;
116 RecordGUIActivateBatch *activate_batch;
117 RecordGUILabel *label_button;
118 RecordGUISave *save;
119 // RecordGUIStartOver *start_over;
120 RecordGUICancel *cancel;
121 RecordGUIFillFrames *fill_frames;
122 RecordGUIMonitorVideo *monitor_video;
123 RecordGUIMonitorAudio *monitor_audio;
124 RecordStartoverThread *startover_thread;
125 RecordCancelThread *cancel_thread;
126 static char *batch_titles[BATCH_COLUMNS];
127 int column_widths[BATCH_COLUMNS];
128 LoadMode *load_mode;
129 int flash_color;
148 // RecordTransport *record_transport;
149 RecordGUIModeMenu *rec_mode_menu;
150 RecordGUILoopHr *loop_hr;
151 RecordGUILoopMin *loop_min;
152 RecordGUILoopSec *loop_sec;
153 RecordGUIReset *reset;
154 // RecordGUIStartOver *startover_button;
155 RecordGUIDCOffset *dc_offset_button;
156 RecordGUIDCOffsetText *dc_offset_text[MAXCHANNELS];
157 RecordMonitor *monitor_video_window;
158 BC_Meter *meter[MAXCHANNELS];
159 long total_dropped_frames;
160 long total_clipped_samples;
164 char* get_path();
165 int get_record_mode();
166 int set_record_mode(int value);
167 int get_output_bits();
168 int get_dither();
169 int get_duplex_status();
170 int set_duplex_status(int value);
171 int get_loop_status();
172 int get_sample_rate();
173 int get_enable_duplex();
174 long get_playback_buffer();
178 int set_loop_status(int value);
179 int update_duration_boxes(); // Redraw the loop duration textboxes for a script.
181 int keypress_event();
182 int delete_all_labels();
183 int calibrate_dc_offset();
184 int calibrate_dc_offset(long new_value, int channel);
185 int update_dropped_frames(long new_dropped);
186 int update_clipped_samples(long new_clipped);
187 int set_translation(int x, int y, float z);
189 void update_labels(double new_position);
190 int update_position(double new_position);
191 int update_prev_label(long new_position);
192 // int update_next_label(long new_position);
194 int update_title(BC_Title *title, double position);
196 int goto_prev_label();
197 // int goto_next_label();
198 int toggle_label();
201 class RecordGUIBatches : public BC_ListBox
203 public:
204 RecordGUIBatches(Record *record, RecordGUI *gui, int x, int y, int w, int h);
205 int handle_event();
206 int selection_changed();
207 int column_resize_event();
208 int drag_start_event();
209 int drag_motion_event();
210 int drag_stop_event();
212 int dragging_item;
213 Record *record;
214 RecordGUI *gui;
217 class RecordGUISave : public BC_GenericButton
219 public:
220 RecordGUISave(Record *record, RecordGUI *record_gui, int x, int y);
221 int handle_event();
222 int keypress_event();
223 RecordGUI *gui;
224 Record *record;
228 class RecordGUICancel : public BC_GenericButton
230 public:
231 RecordGUICancel(Record *record, RecordGUI *record_gui, int x, int y);
232 int handle_event();
233 int keypress_event();
234 RecordGUI *gui;
235 Record *record;
238 class RecordGUIStartBatches : public BC_GenericButton
240 public:
241 RecordGUIStartBatches(MWindow *mwindow, Record *record, int x, int y);
242 int handle_event();
243 MWindow *mwindow;
244 Record *record;
248 class RecordGUIStopbatches : public BC_GenericButton
250 public:
251 RecordGUIStopbatches(MWindow *mwindow, Record *record, int x, int y);
252 int handle_event();
253 MWindow *mwindow;
254 Record *record;
257 class RecordGUIActivateBatch : public BC_GenericButton
259 public:
260 RecordGUIActivateBatch(MWindow *mwindow, Record *record, int x, int y);
261 int handle_event();
262 MWindow *mwindow;
263 Record *record;
267 class RecordGUIStartOver : public BC_GenericButton
269 public:
270 RecordGUIStartOver(Record *record, RecordGUI *record_gui, int x, int y);
271 ~RecordGUIStartOver();
273 int handle_event();
275 RecordGUI *gui;
276 Record *record;
279 class RecordCancelThread : public Thread
281 public:
282 RecordCancelThread(Record *record, RecordGUI *record_gui);
283 ~RecordCancelThread();
284 void run();
286 RecordGUI *gui;
287 Record *record;
288 QuestionWindow *window;
291 class RecordStartoverThread : public Thread
293 public:
294 RecordStartoverThread(Record *record, RecordGUI *record_gui);
295 ~RecordStartoverThread();
296 void run();
298 RecordGUI *gui;
299 Record *record;
300 QuestionWindow *window;
303 class RecordBatch : public BC_PopupTextBox
305 public:
306 RecordBatch(MWindow *mwindow, Record *record, RecordGUI *gui, int x, int y);
307 int handle_event();
308 MWindow *mwindow;
309 Record *record;
310 RecordGUI *gui;
313 class RecordStartType : public BC_CheckBox
315 public:
316 RecordStartType(MWindow *mwindow, Record *record, int x, int y);
317 int handle_event();
318 MWindow *mwindow;
319 Record *record;
322 class RecordPath : public BC_TextBox
324 public:
325 RecordPath(MWindow *mwindow, Record *record, int x, int y);
326 int handle_event();
327 MWindow *mwindow;
328 Record *record;
331 class RecordStart : public TimeEntry
333 public:
334 RecordStart(MWindow *mwindow, Record *record, int x, int y);
335 int handle_event();
336 MWindow *mwindow;
337 Record *record;
340 class RecordDuration : public TimeEntry
342 public:
343 RecordDuration(MWindow *mwindow, Record *record, int x, int y);
344 int handle_event();
345 MWindow *mwindow;
346 Record *record;
349 class RecordSource : public BC_PopupTextBox
351 public:
352 RecordSource(MWindow *mwindow, Record *record, RecordGUI *gui, int x, int y);
353 int handle_event();
354 MWindow *mwindow;
355 Record *record;
356 RecordGUI *gui;
359 class RecordMode : public BC_PopupTextBox
361 public:
362 RecordMode(MWindow *mwindow, Record *record, RecordGUI *gui, int x, int y);
363 int handle_event();
364 MWindow *mwindow;
365 Record *record;
366 RecordGUI *gui;
369 class RecordNews : public BC_TextBox
371 public:
372 RecordNews(MWindow *mwindow, Record *record, int x, int y);
373 int handle_event();
374 MWindow *mwindow;
375 Record *record;
378 class RecordGUIFillFrames : public BC_CheckBox
380 public:
381 RecordGUIFillFrames(MWindow *mwindow, Record *record, int x, int y);
382 int handle_event();
383 MWindow *mwindow;
384 Record *record;
387 class RecordGUIMonitorVideo : public BC_CheckBox
389 public:
390 RecordGUIMonitorVideo(MWindow *mwindow, Record *record, int x, int y);
391 int handle_event();
392 MWindow *mwindow;
393 Record *record;
396 class RecordGUIMonitorAudio : public BC_CheckBox
398 public:
399 RecordGUIMonitorAudio(MWindow *mwindow, Record *record, int x, int y);
400 int handle_event();
401 MWindow *mwindow;
402 Record *record;
405 class RecordGUINewBatch : public BC_GenericButton
407 public:
408 RecordGUINewBatch(MWindow *mwindow, Record *record, int x, int y);
409 int handle_event();
410 MWindow *mwindow;
411 Record *record;
415 class RecordGUIDeleteBatch : public BC_GenericButton
417 public:
418 RecordGUIDeleteBatch(MWindow *mwindow, Record *record, int x, int y);
419 int handle_event();
420 MWindow *mwindow;
421 Record *record;
424 class RecordGUILabel : public BC_GenericButton
426 public:
427 RecordGUILabel(MWindow *mwindow, Record *record, int x, int y);
428 ~RecordGUILabel();
430 int handle_event();
431 int keypress_event();
432 MWindow *mwindow;
433 Record *record;
436 // Stop GUI blocking the recording when X11 is busy
437 class RecordStatusThread : public Thread
439 public:
440 RecordStatusThread(MWindow *mwindow, RecordGUI *gui);
441 ~RecordStatusThread();
443 void update_dropped_frames(long value);
444 void update_position(double new_position);
445 void update_clipped_samples(long new_clipped_samples);
446 void run();
448 MWindow *mwindow;
449 RecordGUI *gui;
450 long new_dropped_frames;
451 double new_position;
452 long new_clipped_samples;
453 int done;
454 Condition *input_lock;
471 class RecordGUIOK : public BC_OKButton
473 public:
474 RecordGUIOK(MWindow *mwindow, int y);
475 ~RecordGUIOK();
477 int handle_event();
481 class RecordGUIModeMenu : public BC_PopupMenu
483 public:
484 RecordGUIModeMenu(int x, int y, int w, char *text);
485 ~RecordGUIModeMenu();
487 int handle_event();
488 int add_items();
490 RecordGUIMode *linear;
491 RecordGUIMode *timed;
492 RecordGUIMode *loop;
495 class RecordGUIMode : public BC_MenuItem
497 public:
498 RecordGUIMode(char *text);
499 ~RecordGUIMode();
501 int handle_event();
511 class RecordGUIDCOffset : public BC_Button
513 public:
514 RecordGUIDCOffset(MWindow *mwindow, int y);
515 ~RecordGUIDCOffset();
517 int handle_event();
518 int keypress_event();
521 class RecordGUIDCOffsetText : public BC_TextBox
523 public:
524 RecordGUIDCOffsetText(char *text, int y, int number);
525 ~RecordGUIDCOffsetText();
527 int handle_event();
528 int number;
531 class RecordGUIReset : public BC_Button
533 public:
534 RecordGUIReset(MWindow *mwindow, RecordGUI *gui, int y);
535 ~RecordGUIReset();
537 int handle_event();
538 RecordGUI *gui;
541 class RecordGUIResetTranslation : public BC_Button
543 public:
544 RecordGUIResetTranslation(MWindow *mwindow, RecordGUI *gui, int y);
545 ~RecordGUIResetTranslation();
547 int handle_event();
548 RecordGUI *gui;
557 #endif