4 * Copyright (C) 2008 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;
55 class RecordGUIClearLabels;
57 class RecordGUILoopHr;
58 class RecordGUILoopMin;
59 class RecordGUILoopSec;
60 class RecordGUIModeMenu;
64 class RecordStartoverThread;
65 class EndRecordThread;
67 #include "browsebutton.inc"
68 #include "condition.inc"
70 #include "loadmode.inc"
71 #include "maxchannels.h"
73 #include "mwindow.inc"
74 #include "question.inc"
75 #include "recordgui.inc"
77 #include "recordbatches.h"
78 #include "recordmonitor.inc"
79 #include "recordtransport.inc"
80 #include "timeentry.h"
82 class RecordGUIBatches : public RecordBatchesGUI
88 int selection_changed();
90 RecordGUIBatches(RecordGUI *gui, int x, int y, int w, int h);
93 class RecordGUI : public BC_Window
95 static int max(int a,int b) { return a>b ? a : b; }
97 RecordGUI(MWindow *mwindow, Record *record);
100 void create_objects();
101 int resize_event(int w, int h);
102 int translation_event();
104 BC_Title *current_operation;
105 BC_Title *position_title;
106 BC_Title *prev_label_title;
107 BC_Title *frames_behind;
108 BC_Title *frames_dropped;
110 BC_Title *samples_clipped;
111 BC_Title *cron_status;
114 RecordGUIBatches *batch_bay;
115 RecordPath *batch_path;
116 RecordStatusThread *status_thread;
117 TimeEntry *batch_start;
118 TimeEntry *batch_duration;
119 RecordStartType *start_type;
120 RecordTransport *record_transport;
121 BrowseButton *batch_browse;
122 RecordSource *batch_source;
123 RecordGUIModeMenu *batch_mode;
124 RecordGUINewBatch *new_batch;
125 RecordGUIDeleteBatch *delete_batch;
126 RecordGUIStartBatches *start_batches;
127 RecordGUIStopBatches *stop_batches;
128 RecordGUIActivateBatch *activate_batch;
129 RecordGUILabel *label_button;
130 RecordGUIClearLabels *clrlbls_button;
131 RecordGUIDropFrames *drop_frames;
132 RecordGUIFillFrames *fill_frames;
133 RecordGUIPowerOff *power_off;
134 RecordGUICommCheck *commercial_check;
135 RecordGUIMonitorVideo *monitor_video;
136 RecordGUIMonitorAudio *monitor_audio;
137 RecordGUIAudioMeters *meter_audio;
138 RecordGUIFlash *batch_flash;
139 RecordStartoverThread *startover_thread;
140 EndRecordThread *interrupt_thread;
144 RecordGUILoopHr *loop_hr;
145 RecordGUILoopMin *loop_min;
146 RecordGUILoopSec *loop_sec;
147 RecordGUIReset *reset;
148 RecordGUIDCOffset *dc_offset_button;
149 RecordGUIDCOffsetText *dc_offset_text[MAXCHANNELS];
150 RecordMonitor *monitor_video_window;
151 BC_Meter *meter[MAXCHANNELS];
152 int total_dropped_frames;
153 int total_clipped_samples;
155 int set_loop_status(int value);
156 int keypress_event();
157 int set_translation(int x, int y, float z);
159 void update_batches();
160 Batch *get_current_batch();
161 Batch *get_editing_batch();
162 void start_flash_batch();
163 void stop_flash_batch();
165 // Update the batch channel table when edited
166 void update_batch_sources();
167 // Update the batch editing tools
168 void update_batch_tools();
169 void enable_batch_buttons();
170 void disable_batch_buttons();
174 void update_frames_behind(long value);
175 void update_dropped_frames(long value);
176 void update_position(double value);
177 void update_clipped_samples(long value);
178 void update_framerate(double value);
179 void update_video(int dropped, int behind);
180 void update_audio(int channels, double *max, int *over);
181 void update_cron_status(const char *status);
182 void update_power_off(int value);
183 void update_labels(double new_position);
184 int update_prev_label(long new_position);
185 int update_title(BC_Title *title, double position);
188 class RecordGUISave : public BC_Button
191 RecordGUISave(RecordGUI *gui);
193 int keypress_event();
198 class RecordGUICancel : public BC_CancelButton
201 RecordGUICancel(RecordGUI *record_gui);
203 int keypress_event();
208 class RecordGUIOK : public BC_OKButton
211 RecordGUIOK(RecordGUI *record_gui);
216 class RecordGUIStartBatches : public RecordBatchesGUI::StartBatches
221 RecordGUIStartBatches(RecordGUI *gui, int x, int y);
225 class RecordGUIStopBatches : public RecordBatchesGUI::StopBatches
230 RecordGUIStopBatches(RecordGUI *gui, int x, int y);
233 class RecordGUIActivateBatch : public RecordBatchesGUI::ActivateBatch
236 RecordGUIActivateBatch(RecordGUI *gui, int x, int y);
242 class RecordGUIStartOver : public BC_GenericButton
245 RecordGUIStartOver(RecordGUI *gui, int x, int y);
246 ~RecordGUIStartOver();
253 class EndRecordThread : public Thread
256 EndRecordThread(RecordGUI *record_gui);
259 void start(int is_ok);
263 QuestionWindow *window;
264 // OK Button was pressed
268 class RecordStartoverThread : public Thread
271 RecordStartoverThread(RecordGUI *record_gui);
272 ~RecordStartoverThread();
276 QuestionWindow *window;
279 class RecordBatch : public BC_PopupTextBox
282 RecordBatch(RecordGUI *gui, int x, int y);
287 class RecordPath : public RecordBatchesGUI::Path
292 RecordPath(RecordGUI *gui, int x, int y);
295 class RecordStart : public RecordBatchesGUI::StartTime
300 RecordStart(RecordGUI *gui, int x, int y);
303 class RecordDuration : public RecordBatchesGUI::Duration
308 RecordDuration(RecordGUI *gui, int x, int y);
311 class RecordSource : public RecordBatchesGUI::Source
316 RecordSource(RecordGUI *gui, int x, int y);
319 class RecordNews : public RecordBatchesGUI::News
322 RecordNews(RecordGUI *gui, int x, int y);
327 class RecordGUIDropFrames : public BC_CheckBox
330 RecordGUIDropFrames(RecordGUI *gui, int x, int y);
332 int keypress_event();
336 class RecordGUIFillFrames : public BC_CheckBox
339 RecordGUIFillFrames(RecordGUI *gui, int x, int y);
341 int keypress_event();
345 class RecordGUIPowerOff : public BC_CheckBox
348 RecordGUIPowerOff(RecordGUI *gui, int x, int y);
350 int keypress_event();
354 class RecordGUICommCheck : public BC_CheckBox
357 RecordGUICommCheck(RecordGUI *gui, int x, int y);
359 int keypress_event();
363 class RecordGUIMonitorVideo : public BC_CheckBox
366 RecordGUIMonitorVideo(RecordGUI *gui, int x, int y);
368 int keypress_event();
372 class RecordGUIMonitorAudio : public BC_CheckBox
375 RecordGUIMonitorAudio(RecordGUI *gui, int x, int y);
377 int keypress_event();
381 class RecordGUIAudioMeters : public BC_CheckBox
384 RecordGUIAudioMeters(RecordGUI *gui, int x, int y);
386 int keypress_event();
390 class RecordGUINewBatch : public RecordBatchesGUI::NewBatch
395 RecordGUINewBatch(RecordGUI *gui, int x, int y);
399 class RecordGUIDeleteBatch : public RecordBatchesGUI::DeleteBatch
404 RecordGUIDeleteBatch(RecordGUI *gui, int x, int y);
407 class RecordGUILabel : public BC_GenericButton
410 RecordGUILabel(RecordGUI *gui, int x, int y);
414 int keypress_event();
418 class RecordGUIClearLabels : public BC_GenericButton
421 RecordGUIClearLabels(RecordGUI *gui, int x, int y);
422 ~RecordGUIClearLabels();
428 // Stop GUI blocking the recording when X11 is busy
429 class RecordStatusThread : public Thread
432 RecordStatusThread(MWindow *mwindow, RecordGUI *gui);
433 ~RecordStatusThread();
437 void update_frames_behind(long value);
438 void update_dropped_frames(long value);
439 void update_position(double value);
440 void update_clipped_samples(long value);
441 void update_framerate(double value);
442 void get_window_lock();
444 void update_status_string(const char *fmt,T &new_value,T &displayed_value,BC_Title *widgit);
449 long new_dropped_frames, displayed_dropped_frames;
450 long new_frames_behind, displayed_frames_behind;
451 double new_framerate, displayed_framerate;
452 long new_clipped_samples, displayed_clipped_samples;
456 Condition *input_lock;
459 class RecordGUIFlash : public Thread
462 RecordGUI *record_gui;
463 Condition *flash_lock;
467 RecordGUIFlash(RecordGUI *gui);
471 class RecordGUIModeMenu;
473 class RecordGUIModeTextBox : public BC_TextBox
476 RecordGUIModeTextBox(RecordGUIModeMenu *mode_menu,
477 int x, int y, int w,const char *text);
478 ~RecordGUIModeTextBox();
479 RecordGUI *record_gui;
480 RecordGUIModeMenu *mode_menu;
484 class RecordGUIModeListBox : public BC_ListBox
487 RecordGUIModeListBox(RecordGUIModeMenu *mode_menu);
488 ~RecordGUIModeListBox();
489 RecordGUI *record_gui;
490 RecordGUIModeMenu *mode_menu;
494 class RecordGUIModeMenu
497 RecordGUIModeMenu(RecordGUI *record_gui,int x, int y, int w, const char *text);
498 ~RecordGUIModeMenu();
501 void create_objects();
502 void update(int value);
506 RecordGUI *record_gui;
507 RecordGUIModeTextBox *textbox;
508 RecordGUIModeListBox *listbox;
509 ArrayList<BC_ListBoxItem*> modes;
514 class RecordGUIDCOffset : public BC_Button
517 RecordGUIDCOffset(MWindow *mwindow, int y);
518 ~RecordGUIDCOffset();
521 int keypress_event();
524 class RecordGUIDCOffsetText : public BC_TextBox
527 RecordGUIDCOffsetText(char *text, int y, int number);
528 ~RecordGUIDCOffsetText();
534 class RecordGUIReset : public BC_Button
537 RecordGUIReset(MWindow *mwindow, RecordGUI *gui, int y);
544 class RecordGUIResetTranslation : public BC_Button
547 RecordGUIResetTranslation(MWindow *mwindow, RecordGUI *gui, int y);
548 ~RecordGUIResetTranslation();