00001 #ifndef RECORDGUI_H
00002 #define RECORDGUI_H
00003
00004
00005 class RecordGUIBatches;
00006 class RecordBatch;
00007 class RecordStartType;
00008 class RecordStart;
00009 class RecordPath;
00010 class BrowseButton;
00011 class RecordDuration;
00012 class RecordSource;
00013 class RecordMode;
00014 class RecordNews;
00015 class RecordGUISave;
00016 class RecordGUIStartOver;
00017 class RecordGUICancel;
00018 class RecordGUIMonitorVideo;
00019 class RecordGUIMonitorAudio;
00020 class RecordGUINewBatch;
00021 class RecordGUIDeleteBatch;
00022 class RecordGUIStartBatches;
00023 class RecordGUIStopbatches;
00024 class RecordGUIActivateBatch;
00025 class RecordStatusThread;
00026
00027 class RecordGUIDCOffset;
00028 class RecordGUIFillFrames;
00029 class RecordGUILabel;
00030 class RecordGUILoop;
00031 class RecordGUILoopHr;
00032 class RecordGUILoopMin;
00033 class RecordGUILoopSec;
00034 class RecordGUIModeMenu;
00035 class RecordGUIMode;
00036 class RecordGUIOK;
00037 class RecordGUIReset;
00038 class RecordStartoverThread;
00039 class EndRecordThread;
00040
00041 #include "browsebutton.inc"
00042 #include "condition.inc"
00043 #include "guicast.h"
00044 #include "loadmode.inc"
00045 #include "maxchannels.h"
00046 #include "mutex.inc"
00047 #include "mwindow.inc"
00048 #include "question.inc"
00049 #include "recordgui.inc"
00050 #include "record.inc"
00051 #include "recordmonitor.inc"
00052 #include "recordtransport.inc"
00053 #include "timeentry.h"
00054
00055 #define BATCH_COLUMNS 7
00056
00057 class RecordGUI : public BC_Window
00058 {
00059 public:
00060 RecordGUI(MWindow *mwindow, Record *record);
00061 ~RecordGUI();
00062
00063 void load_defaults();
00064 void save_defaults();
00065 int create_objects();
00066 void flash_batch();
00067 void update_batches();
00068 void update_sources();
00069
00070 void update_batch_sources();
00071
00072 void update_batch_tools();
00073 int resize_event(int w, int h);
00074 int translation_event();
00075
00076 ArrayList<BC_ListBoxItem*> batches[BATCH_COLUMNS];
00077
00078 ArrayList<BC_ListBoxItem*> modes;
00079
00080 ArrayList<BC_ListBoxItem*> batch_numbers;
00081
00082
00083 ArrayList<BC_ListBoxItem*> sources;
00084
00085 BC_Title *current_operation;
00086 BC_Title *position_title;
00087 BC_Title *prev_label_title;
00088 BC_Title *frames_dropped, *samples_clipped;
00089 MWindow *mwindow;
00090 Record *record;
00091 RecordGUIBatches *batch_list;
00092
00093 RecordPath *batch_path;
00094 RecordStatusThread *status_thread;
00095 TimeEntry *batch_start;
00096 TimeEntry *batch_duration;
00097 RecordStartType *start_type;
00098 RecordTransport *record_transport;
00099 BrowseButton *batch_browse;
00100 RecordSource *batch_source;
00101 RecordMode *batch_mode;
00102 RecordGUINewBatch *new_batch;
00103 RecordGUIDeleteBatch *delete_batch;
00104 RecordGUIStartBatches *start_batches;
00105 RecordGUIStopbatches *stop_batches;
00106 RecordGUIActivateBatch *activate_batch;
00107 RecordGUILabel *label_button;
00108 RecordGUIFillFrames *fill_frames;
00109 RecordGUIMonitorVideo *monitor_video;
00110 RecordGUIMonitorAudio *monitor_audio;
00111 RecordStartoverThread *startover_thread;
00112 EndRecordThread *interrupt_thread;
00113 static char *batch_titles[BATCH_COLUMNS];
00114 int column_widths[BATCH_COLUMNS];
00115 LoadMode *load_mode;
00116 int flash_color;
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136 RecordGUIModeMenu *rec_mode_menu;
00137 RecordGUILoopHr *loop_hr;
00138 RecordGUILoopMin *loop_min;
00139 RecordGUILoopSec *loop_sec;
00140 RecordGUIReset *reset;
00141
00142 RecordGUIDCOffset *dc_offset_button;
00143 RecordGUIDCOffsetText *dc_offset_text[MAXCHANNELS];
00144 RecordMonitor *monitor_video_window;
00145 BC_Meter *meter[MAXCHANNELS];
00146 long total_dropped_frames;
00147 long total_clipped_samples;
00148
00149
00150
00151 char* get_path();
00152 int get_record_mode();
00153 int set_record_mode(int value);
00154 int get_output_bits();
00155 int get_dither();
00156 int get_duplex_status();
00157 int set_duplex_status(int value);
00158 int get_loop_status();
00159 int get_sample_rate();
00160 int get_enable_duplex();
00161 long get_playback_buffer();
00162
00163
00164
00165 int set_loop_status(int value);
00166 int update_duration_boxes();
00167
00168 int keypress_event();
00169 int delete_all_labels();
00170 int calibrate_dc_offset();
00171 int calibrate_dc_offset(long new_value, int channel);
00172 int update_dropped_frames(long new_dropped);
00173 int update_clipped_samples(long new_clipped);
00174 int set_translation(int x, int y, float z);
00175
00176 void update_labels(double new_position);
00177 int update_position(double new_position);
00178 int update_prev_label(long new_position);
00179
00180
00181 int update_title(BC_Title *title, double position);
00182
00183 int goto_prev_label();
00184
00185 int toggle_label();
00186 };
00187
00188 class RecordGUIBatches : public BC_ListBox
00189 {
00190 public:
00191 RecordGUIBatches(Record *record, RecordGUI *gui, int x, int y, int w, int h);
00192 int handle_event();
00193 int selection_changed();
00194 int column_resize_event();
00195 int drag_start_event();
00196 int drag_motion_event();
00197 int drag_stop_event();
00198
00199 int dragging_item;
00200 Record *record;
00201 RecordGUI *gui;
00202 };
00203
00204 class RecordGUISave : public BC_Button
00205 {
00206 public:
00207 RecordGUISave(Record *record, RecordGUI *record_gui);
00208 int handle_event();
00209 int keypress_event();
00210 RecordGUI *gui;
00211 Record *record;
00212 };
00213
00214
00215 class RecordGUICancel : public BC_CancelButton
00216 {
00217 public:
00218 RecordGUICancel(Record *record, RecordGUI *record_gui);
00219 int handle_event();
00220 int keypress_event();
00221 RecordGUI *gui;
00222 Record *record;
00223 };
00224
00225 class RecordGUIOK : public BC_OKButton
00226 {
00227 public:
00228 RecordGUIOK(Record *record, RecordGUI *record_gui);
00229 int handle_event();
00230 RecordGUI *gui;
00231 Record *record;
00232 };
00233
00234 class RecordGUIStartBatches : public BC_GenericButton
00235 {
00236 public:
00237 RecordGUIStartBatches(MWindow *mwindow, Record *record, int x, int y);
00238 int handle_event();
00239 MWindow *mwindow;
00240 Record *record;
00241 };
00242
00243
00244 class RecordGUIStopbatches : public BC_GenericButton
00245 {
00246 public:
00247 RecordGUIStopbatches(MWindow *mwindow, Record *record, int x, int y);
00248 int handle_event();
00249 MWindow *mwindow;
00250 Record *record;
00251 };
00252
00253 class RecordGUIActivateBatch : public BC_GenericButton
00254 {
00255 public:
00256 RecordGUIActivateBatch(MWindow *mwindow, Record *record, int x, int y);
00257 int handle_event();
00258 MWindow *mwindow;
00259 Record *record;
00260 };
00261
00262
00263 class RecordGUIStartOver : public BC_GenericButton
00264 {
00265 public:
00266 RecordGUIStartOver(Record *record, RecordGUI *record_gui, int x, int y);
00267 ~RecordGUIStartOver();
00268
00269 int handle_event();
00270
00271 RecordGUI *gui;
00272 Record *record;
00273 };
00274
00275 class EndRecordThread : public Thread
00276 {
00277 public:
00278 EndRecordThread(Record *record, RecordGUI *record_gui);
00279 ~EndRecordThread();
00280
00281 void start(int is_ok);
00282 void run();
00283
00284 RecordGUI *gui;
00285 Record *record;
00286 QuestionWindow *window;
00287
00288 int is_ok;
00289 };
00290
00291 class RecordStartoverThread : public Thread
00292 {
00293 public:
00294 RecordStartoverThread(Record *record, RecordGUI *record_gui);
00295 ~RecordStartoverThread();
00296 void run();
00297
00298 RecordGUI *gui;
00299 Record *record;
00300 QuestionWindow *window;
00301 };
00302
00303 class RecordBatch : public BC_PopupTextBox
00304 {
00305 public:
00306 RecordBatch(MWindow *mwindow, Record *record, RecordGUI *gui, int x, int y);
00307 int handle_event();
00308 MWindow *mwindow;
00309 Record *record;
00310 RecordGUI *gui;
00311 };
00312
00313 class RecordStartType : public BC_CheckBox
00314 {
00315 public:
00316 RecordStartType(MWindow *mwindow, Record *record, int x, int y);
00317 int handle_event();
00318 MWindow *mwindow;
00319 Record *record;
00320 };
00321
00322 class RecordPath : public BC_TextBox
00323 {
00324 public:
00325 RecordPath(MWindow *mwindow, Record *record, int x, int y);
00326 int handle_event();
00327 MWindow *mwindow;
00328 Record *record;
00329 };
00330
00331 class RecordStart : public TimeEntry
00332 {
00333 public:
00334 RecordStart(MWindow *mwindow, Record *record, int x, int y);
00335 int handle_event();
00336 MWindow *mwindow;
00337 Record *record;
00338 };
00339
00340 class RecordDuration : public TimeEntry
00341 {
00342 public:
00343 RecordDuration(MWindow *mwindow, Record *record, int x, int y);
00344 int handle_event();
00345 MWindow *mwindow;
00346 Record *record;
00347 };
00348
00349 class RecordSource : public BC_PopupTextBox
00350 {
00351 public:
00352 RecordSource(MWindow *mwindow, Record *record, RecordGUI *gui, int x, int y);
00353 int handle_event();
00354 MWindow *mwindow;
00355 Record *record;
00356 RecordGUI *gui;
00357 };
00358
00359 class RecordMode : public BC_PopupTextBox
00360 {
00361 public:
00362 RecordMode(MWindow *mwindow, Record *record, RecordGUI *gui, int x, int y);
00363 int handle_event();
00364 MWindow *mwindow;
00365 Record *record;
00366 RecordGUI *gui;
00367 };
00368
00369 class RecordNews : public BC_TextBox
00370 {
00371 public:
00372 RecordNews(MWindow *mwindow, Record *record, int x, int y);
00373 int handle_event();
00374 MWindow *mwindow;
00375 Record *record;
00376 };
00377
00378 class RecordGUIFillFrames : public BC_CheckBox
00379 {
00380 public:
00381 RecordGUIFillFrames(MWindow *mwindow, Record *record, int x, int y);
00382 int handle_event();
00383 MWindow *mwindow;
00384 Record *record;
00385 };
00386
00387 class RecordGUIMonitorVideo : public BC_CheckBox
00388 {
00389 public:
00390 RecordGUIMonitorVideo(MWindow *mwindow, Record *record, int x, int y);
00391 int handle_event();
00392 MWindow *mwindow;
00393 Record *record;
00394 };
00395
00396 class RecordGUIMonitorAudio : public BC_CheckBox
00397 {
00398 public:
00399 RecordGUIMonitorAudio(MWindow *mwindow, Record *record, int x, int y);
00400 int handle_event();
00401 MWindow *mwindow;
00402 Record *record;
00403 };
00404
00405 class RecordGUINewBatch : public BC_GenericButton
00406 {
00407 public:
00408 RecordGUINewBatch(MWindow *mwindow, Record *record, int x, int y);
00409 int handle_event();
00410 MWindow *mwindow;
00411 Record *record;
00412 };
00413
00414
00415 class RecordGUIDeleteBatch : public BC_GenericButton
00416 {
00417 public:
00418 RecordGUIDeleteBatch(MWindow *mwindow, Record *record, int x, int y);
00419 int handle_event();
00420 MWindow *mwindow;
00421 Record *record;
00422 };
00423
00424 class RecordGUILabel : public BC_GenericButton
00425 {
00426 public:
00427 RecordGUILabel(MWindow *mwindow, Record *record, int x, int y);
00428 ~RecordGUILabel();
00429
00430 int handle_event();
00431 int keypress_event();
00432 MWindow *mwindow;
00433 Record *record;
00434 };
00435
00436
00437 class RecordStatusThread : public Thread
00438 {
00439 public:
00440 RecordStatusThread(MWindow *mwindow, RecordGUI *gui);
00441 ~RecordStatusThread();
00442
00443 void update_dropped_frames(long value);
00444 void update_position(double new_position);
00445 void update_clipped_samples(long new_clipped_samples);
00446 void run();
00447
00448 MWindow *mwindow;
00449 RecordGUI *gui;
00450 long new_dropped_frames;
00451 double new_position;
00452 long new_clipped_samples;
00453 int done;
00454 Condition *input_lock;
00455 };
00456
00457
00458
00459
00460
00461
00462
00463
00464
00465
00466
00467
00468
00469
00470
00471
00472 class RecordGUIModeMenu : public BC_PopupMenu
00473 {
00474 public:
00475 RecordGUIModeMenu(int x, int y, int w, char *text);
00476 ~RecordGUIModeMenu();
00477
00478 int handle_event();
00479 int add_items();
00480
00481 RecordGUIMode *linear;
00482 RecordGUIMode *timed;
00483 RecordGUIMode *loop;
00484 };
00485
00486 class RecordGUIMode : public BC_MenuItem
00487 {
00488 public:
00489 RecordGUIMode(char *text);
00490 ~RecordGUIMode();
00491
00492 int handle_event();
00493 };
00494
00495
00496
00497
00498
00499
00500
00501
00502 class RecordGUIDCOffset : public BC_Button
00503 {
00504 public:
00505 RecordGUIDCOffset(MWindow *mwindow, int y);
00506 ~RecordGUIDCOffset();
00507
00508 int handle_event();
00509 int keypress_event();
00510 };
00511
00512 class RecordGUIDCOffsetText : public BC_TextBox
00513 {
00514 public:
00515 RecordGUIDCOffsetText(char *text, int y, int number);
00516 ~RecordGUIDCOffsetText();
00517
00518 int handle_event();
00519 int number;
00520 };
00521
00522 class RecordGUIReset : public BC_Button
00523 {
00524 public:
00525 RecordGUIReset(MWindow *mwindow, RecordGUI *gui, int y);
00526 ~RecordGUIReset();
00527
00528 int handle_event();
00529 RecordGUI *gui;
00530 };
00531
00532 class RecordGUIResetTranslation : public BC_Button
00533 {
00534 public:
00535 RecordGUIResetTranslation(MWindow *mwindow, RecordGUI *gui, int y);
00536 ~RecordGUIResetTranslation();
00537
00538 int handle_event();
00539 RecordGUI *gui;
00540 };
00541
00542
00543
00544
00545
00546
00547
00548 #endif