4 * Copyright (C) 2008-2017 Adam Williams <broadcast at earthling dot net>
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.
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.
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
26 class RecordGUIBatches;
28 class RecordStartType;
36 class RecordGUIStartOver;
37 class RecordGUICancel;
38 class RecordGUIMonitorVideo;
39 class RecordGUIMonitorAudio;
40 class RecordGUIAudioMeters;
41 class RecordGUINewBatch;
42 class RecordGUIDeleteBatch;
43 class RecordGUIStartBatches;
44 class RecordGUIStopBatches;
45 class RecordGUIActivateBatch;
46 class RecordStatusThread;
49 class RecordGUIDCOffset;
50 class RecordGUIDropFrames;
51 class RecordGUIFillFrames;
52 class RecordGUIPowerOff;
53 class RecordGUICommCheck;
54 class RecordGUIDelaceItem;
55 class RecordGUIDeinterlace;
57 class RecordGUIClearLabels;
59 class RecordGUILoopHr;
60 class RecordGUILoopMin;
61 class RecordGUILoopSec;
62 class RecordGUIModeMenu;
66 class RecordStartoverThread;
67 class EndRecordThread;
69 #include "browsebutton.inc"
70 #include "condition.inc"
72 #include "loadmode.inc"
73 #include "maxchannels.h"
75 #include "mwindow.inc"
76 #include "question.inc"
77 #include "recordgui.inc"
79 #include "recordbatches.h"
80 #include "recordmonitor.inc"
81 #include "recordtransport.inc"
82 #include "timeentry.h"
84 class RecordGUIBatches : public RecordBatchesGUI
90 int selection_changed();
92 RecordGUIBatches(RecordGUI *gui, int x, int y, int w, int h);
95 class RecordGUI : public BC_Window
97 static int max(int a,int b) { return a>b ? a : b; }
99 RecordGUI(MWindow *mwindow, Record *record);
102 void create_objects();
103 int resize_event(int w, int h);
104 int translation_event();
106 BC_Title *current_operation;
107 BC_Title *position_title;
108 BC_Title *prev_label_title;
109 BC_Title *frames_behind;
110 BC_Title *frames_dropped;
112 BC_Title *samples_clipped;
113 BC_Title *cron_status;
116 RecordGUIBatches *batch_bay;
117 RecordPath *batch_path;
118 RecordStatusThread *status_thread;
119 TimeEntry *batch_start;
120 TimeEntry *batch_duration;
121 RecordStartType *start_type;
122 RecordTransport *record_transport;
123 BrowseButton *batch_browse;
124 RecordSource *batch_source;
125 RecordGUIModeMenu *batch_mode;
126 RecordGUINewBatch *new_batch;
127 RecordGUIDeleteBatch *delete_batch;
128 RecordGUIStartBatches *start_batches;
129 RecordGUIStopBatches *stop_batches;
130 RecordGUIActivateBatch *activate_batch;
131 RecordGUILabel *label_button;
132 RecordGUIClearLabels *clrlbls_button;
133 RecordGUIDropFrames *drop_frames;
134 RecordGUIFillFrames *fill_frames;
135 RecordGUIPowerOff *power_off;
136 RecordGUICommCheck *commercial_check;
137 RecordGUIDeinterlace *deinterlace;
138 RecordGUIMonitorVideo *monitor_video;
139 RecordGUIMonitorAudio *monitor_audio;
140 RecordGUIAudioMeters *meter_audio;
141 RecordGUIFlash *batch_flash;
142 RecordStartoverThread *startover_thread;
143 EndRecordThread *interrupt_thread;
147 RecordGUILoopHr *loop_hr;
148 RecordGUILoopMin *loop_min;
149 RecordGUILoopSec *loop_sec;
150 RecordGUIReset *reset;
151 RecordGUIDCOffset *dc_offset_button;
152 RecordGUIDCOffsetText *dc_offset_text[MAXCHANNELS];
153 RecordMonitor *monitor_video_window;
154 BC_Meter *meter[MAXCHANNELS];
155 int total_dropped_frames;
156 int total_clipped_samples;
158 int set_loop_status(int value);
159 int keypress_event();
160 int set_translation(int x, int y, float z);
162 void update_batches();
163 Batch *get_current_batch();
164 Batch *get_editing_batch();
165 void start_flash_batch();
166 void stop_flash_batch();
168 // Update the batch channel table when edited
169 void update_batch_sources();
170 // Update the batch editing tools
171 void update_batch_tools();
172 void enable_batch_buttons();
173 void disable_batch_buttons();
177 void update_frames_behind(long value);
178 void update_dropped_frames(long value);
179 void update_position(double value);
180 void update_clipped_samples(long value);
181 void update_framerate(double value);
182 void update_video(int dropped, int behind);
183 void update_audio(int channels, double *max, int *over);
184 void update_cron_status(const char *status);
185 void update_power_off(int value);
186 void update_labels(double new_position);
187 int update_prev_label(long new_position);
188 int update_title(BC_Title *title, double position);
191 class RecordGUISave : public BC_Button
194 RecordGUISave(RecordGUI *gui);
196 int keypress_event();
201 class RecordGUICancel : public BC_CancelButton
204 RecordGUICancel(RecordGUI *record_gui);
206 int keypress_event();
211 class RecordGUIOK : public BC_OKButton
214 RecordGUIOK(RecordGUI *record_gui);
219 class RecordGUIStartBatches : public RecordBatchesGUI::StartBatches
224 RecordGUIStartBatches(RecordGUI *gui, int x, int y);
228 class RecordGUIStopBatches : public RecordBatchesGUI::StopBatches
233 RecordGUIStopBatches(RecordGUI *gui, int x, int y);
236 class RecordGUIActivateBatch : public RecordBatchesGUI::ActivateBatch
239 RecordGUIActivateBatch(RecordGUI *gui, int x, int y);
245 class RecordGUIStartOver : public BC_GenericButton
248 RecordGUIStartOver(RecordGUI *gui, int x, int y);
249 ~RecordGUIStartOver();
256 class EndRecordThread : public Thread
259 EndRecordThread(RecordGUI *record_gui);
262 void start(int is_ok);
266 QuestionWindow *window;
267 // OK Button was pressed
271 class RecordStartoverThread : public Thread
274 RecordStartoverThread(RecordGUI *record_gui);
275 ~RecordStartoverThread();
279 QuestionWindow *window;
282 class RecordBatch : public BC_PopupTextBox
285 RecordBatch(RecordGUI *gui, int x, int y);
290 class RecordPath : public RecordBatchesGUI::Path
295 RecordPath(RecordGUI *gui, int x, int y);
298 class RecordStart : public RecordBatchesGUI::StartTime
303 RecordStart(RecordGUI *gui, int x, int y);
306 class RecordDuration : public RecordBatchesGUI::Duration
311 RecordDuration(RecordGUI *gui, int x, int y);
314 class RecordSource : public RecordBatchesGUI::Source
319 RecordSource(RecordGUI *gui, int x, int y);
322 class RecordNews : public RecordBatchesGUI::News
325 RecordNews(RecordGUI *gui, int x, int y);
330 class RecordGUIDropFrames : public BC_CheckBox
333 RecordGUIDropFrames(RecordGUI *gui, int x, int y);
335 int keypress_event();
339 class RecordGUIFillFrames : public BC_CheckBox
342 RecordGUIFillFrames(RecordGUI *gui, int x, int y);
344 int keypress_event();
348 class RecordGUIPowerOff : public BC_CheckBox
351 RecordGUIPowerOff(RecordGUI *gui, int x, int y);
353 int keypress_event();
357 class RecordGUICommCheck : public BC_CheckBox
360 RecordGUICommCheck(RecordGUI *gui, int x, int y);
362 int keypress_event();
366 class RecordGUIDelaceItem : public BC_MenuItem
369 RecordGUIDelaceItem(RecordGUIDeinterlace *popup, const char *text, int id);
372 RecordGUIDeinterlace *popup;
376 class RecordGUIDeinterlace : public BC_PopupMenu
379 RecordGUIDeinterlace(RecordGUI *gui, int x, int y);
380 void create_objects();
386 class RecordGUIMonitorVideo : public BC_CheckBox
389 RecordGUIMonitorVideo(RecordGUI *gui, int x, int y);
391 int keypress_event();
395 class RecordGUIMonitorAudio : public BC_CheckBox
398 RecordGUIMonitorAudio(RecordGUI *gui, int x, int y);
400 int keypress_event();
404 class RecordGUIAudioMeters : public BC_CheckBox
407 RecordGUIAudioMeters(RecordGUI *gui, int x, int y);
409 int keypress_event();
413 class RecordGUINewBatch : public RecordBatchesGUI::NewBatch
418 RecordGUINewBatch(RecordGUI *gui, int x, int y);
422 class RecordGUIDeleteBatch : public RecordBatchesGUI::DeleteBatch
427 RecordGUIDeleteBatch(RecordGUI *gui, int x, int y);
430 class RecordGUILabel : public BC_GenericButton
433 RecordGUILabel(RecordGUI *gui, int x, int y);
437 int keypress_event();
441 class RecordGUIClearLabels : public BC_GenericButton
444 RecordGUIClearLabels(RecordGUI *gui, int x, int y);
445 ~RecordGUIClearLabels();
451 // Stop GUI blocking the recording when X11 is busy
452 class RecordStatusThread : public Thread
455 RecordStatusThread(MWindow *mwindow, RecordGUI *gui);
456 ~RecordStatusThread();
460 void update_frames_behind(long value);
461 void update_dropped_frames(long value);
462 void update_position(double value);
463 void update_clipped_samples(long value);
464 void update_framerate(double value);
465 void get_window_lock();
467 void update_status_string(const char *fmt,T &new_value,T &displayed_value,BC_Title *widgit);
472 long new_dropped_frames, displayed_dropped_frames;
473 long new_frames_behind, displayed_frames_behind;
474 double new_framerate, displayed_framerate;
475 long new_clipped_samples, displayed_clipped_samples;
479 Condition *input_lock;
482 class RecordGUIFlash : public Thread
485 RecordGUI *record_gui;
486 Condition *flash_lock;
490 RecordGUIFlash(RecordGUI *gui);
494 class RecordGUIModeMenu;
496 class RecordGUIModeTextBox : public BC_TextBox
499 RecordGUIModeTextBox(RecordGUIModeMenu *mode_menu,
500 int x, int y, int w,const char *text);
501 ~RecordGUIModeTextBox();
502 RecordGUI *record_gui;
503 RecordGUIModeMenu *mode_menu;
507 class RecordGUIModeListBox : public BC_ListBox
510 RecordGUIModeListBox(RecordGUIModeMenu *mode_menu);
511 ~RecordGUIModeListBox();
512 RecordGUI *record_gui;
513 RecordGUIModeMenu *mode_menu;
517 class RecordGUIModeMenu
520 RecordGUIModeMenu(RecordGUI *record_gui,int x, int y, int w, const char *text);
521 ~RecordGUIModeMenu();
524 void create_objects();
525 void update(int value);
529 RecordGUI *record_gui;
530 RecordGUIModeTextBox *textbox;
531 RecordGUIModeListBox *listbox;
532 ArrayList<BC_ListBoxItem*> modes;
537 class RecordGUIDCOffset : public BC_Button
540 RecordGUIDCOffset(MWindow *mwindow, int y);
541 ~RecordGUIDCOffset();
544 int keypress_event();
547 class RecordGUIDCOffsetText : public BC_TextBox
550 RecordGUIDCOffsetText(char *text, int y, int number);
551 ~RecordGUIDCOffsetText();
557 class RecordGUIReset : public BC_Button
560 RecordGUIReset(MWindow *mwindow, RecordGUI *gui, int y);
567 class RecordGUIResetTranslation : public BC_Button
570 RecordGUIResetTranslation(MWindow *mwindow, RecordGUI *gui, int y);
571 ~RecordGUIResetTranslation();