license header for review
[cinelerra_cv/ct.git] / cinelerra / recordgui.h
blob17084426aafaef95993988bfd3fab647ad5deeaa
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 EndRecordThread;
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 EndRecordThread *interrupt_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_CancelButton
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 RecordGUIOK : public BC_OKButton
227 public:
228 RecordGUIOK(Record *record, RecordGUI *record_gui);
229 int handle_event();
230 RecordGUI *gui;
231 Record *record;
234 class RecordGUIStartBatches : public BC_GenericButton
236 public:
237 RecordGUIStartBatches(MWindow *mwindow, Record *record, int x, int y);
238 int handle_event();
239 MWindow *mwindow;
240 Record *record;
244 class RecordGUIStopbatches : public BC_GenericButton
246 public:
247 RecordGUIStopbatches(MWindow *mwindow, Record *record, int x, int y);
248 int handle_event();
249 MWindow *mwindow;
250 Record *record;
253 class RecordGUIActivateBatch : public BC_GenericButton
255 public:
256 RecordGUIActivateBatch(MWindow *mwindow, Record *record, int x, int y);
257 int handle_event();
258 MWindow *mwindow;
259 Record *record;
263 class RecordGUIStartOver : public BC_GenericButton
265 public:
266 RecordGUIStartOver(Record *record, RecordGUI *record_gui, int x, int y);
267 ~RecordGUIStartOver();
269 int handle_event();
271 RecordGUI *gui;
272 Record *record;
275 class EndRecordThread : public Thread
277 public:
278 EndRecordThread(Record *record, RecordGUI *record_gui);
279 ~EndRecordThread();
281 void start(int is_ok);
282 void run();
284 RecordGUI *gui;
285 Record *record;
286 QuestionWindow *window;
287 // OK Button was pressed
288 int is_ok;
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;
472 class RecordGUIModeMenu : public BC_PopupMenu
474 public:
475 RecordGUIModeMenu(int x, int y, int w, char *text);
476 ~RecordGUIModeMenu();
478 int handle_event();
479 int add_items();
481 RecordGUIMode *linear;
482 RecordGUIMode *timed;
483 RecordGUIMode *loop;
486 class RecordGUIMode : public BC_MenuItem
488 public:
489 RecordGUIMode(char *text);
490 ~RecordGUIMode();
492 int handle_event();
502 class RecordGUIDCOffset : public BC_Button
504 public:
505 RecordGUIDCOffset(MWindow *mwindow, int y);
506 ~RecordGUIDCOffset();
508 int handle_event();
509 int keypress_event();
512 class RecordGUIDCOffsetText : public BC_TextBox
514 public:
515 RecordGUIDCOffsetText(char *text, int y, int number);
516 ~RecordGUIDCOffsetText();
518 int handle_event();
519 int number;
522 class RecordGUIReset : public BC_Button
524 public:
525 RecordGUIReset(MWindow *mwindow, RecordGUI *gui, int y);
526 ~RecordGUIReset();
528 int handle_event();
529 RecordGUI *gui;
532 class RecordGUIResetTranslation : public BC_Button
534 public:
535 RecordGUIResetTranslation(MWindow *mwindow, RecordGUI *gui, int y);
536 ~RecordGUIResetTranslation();
538 int handle_event();
539 RecordGUI *gui;
548 #endif
550 // Local Variables:
551 // mode: C++
552 // c-file-style: "linux"
553 // End: