RecordGUI::RecordGUI(MWindow *mwindow, Record *record)
: BC_Window(_(PROGRAM_NAME ": Recording"),
- mwindow->session->rwindow_x, mwindow->session->rwindow_y,
+ mwindow->session->rwindow_x, mwindow->session->rwindow_y,
mwindow->session->rwindow_w, mwindow->session->rwindow_h,
- 10, 10, 1, 0, 1)
+ xS(10), yS(10), 1, 0, 1)
{
this->mwindow = mwindow;
this->record = record;
prev_label_title = 0;
frames_behind = 0;
frames_dropped = 0;
- framerate = 0;
+ framerate = 0;
samples_clipped = 0;
cron_status = 0;
batch_bay = 0;
void RecordGUI::create_objects()
{
+ int xs5 = xS(5), xs10 = xS(10), xs20 = xS(20), xs30 = xS(30);
+ int ys5 = yS(5), ys10 = yS(10);
char string[BCTEXTLEN];
flash_color = RED;
Asset *asset = record->default_asset;
//printf("RecordGUI::create_objects 1\n");
mwindow->theme->draw_rwindow_bg(this);
- int x = 10;
- int y = 10;
+ int x = xs10;
+ int y = ys10;
int x1 = 0;
BC_Title *title;
int pad = max(BC_TextBox::calculate_h(this, MEDIUMFONT, 1, 1),
- BC_Title::calculate_h(this, "X")) + 5;
+ BC_Title::calculate_h(this, "X")) + ys5;
int button_y = 0;
// Current batch
int x2 = 0;
- y = 10;
- x = x1 + 20;
+ y = ys10;
+ x = x1 + xs20;
add_subwindow(batch_path = new RecordPath(this, x, y));
add_subwindow(batch_browse = new BrowseButton(mwindow->theme,
this,
batch_source->create_objects();
x2 = max(x2, batch_source->get_w());
y += pad;
- batch_mode = new RecordGUIModeMenu(this, x, y, 200, "");
+ batch_mode = new RecordGUIModeMenu(this, x, y, xS(200), "");
batch_mode->create_objects();
x2 = max(x2, batch_mode->get_w());
y += pad;
// Compression settings
- x = x2 + x1 + 30;
- y = 10;
+ x = x2 + x1 + xs30;
+ y = ys10;
int x3 = 0;
- pad = BC_Title::calculate_h(this, "X") + 5;
+ pad = BC_Title::calculate_h(this, "X") + ys5;
add_subwindow(title = new BC_Title(x, y, _("Format:")));
x3 = max(title->get_w(), x3);
y += pad;
y += pad;
button_y = max(y, button_y);
- y = 10;
- x = x3 + x2 + x1 + 40;
+ y = ys10;
+ x = x3 + x2 + x1 + xS(40);
add_subwindow(new BC_Title(x, y,
File::formattostr(asset->format),
_("None"), MEDIUMFONT,
mwindow->theme->recordgui_variable_color));
- y += pad + 10;
+ y += pad + ys10;
button_y = max(y, button_y);
// Buttons
- x = 10;
+ x = xs10;
y = button_y;
add_subwindow(title = new BC_Title(x,y, _("Batches:")));
int y_max = y + title->get_h(); x1 = x;
- x += title->get_w() + 5;
+ x += title->get_w() + xs5;
add_subwindow(activate_batch = new RecordGUIActivateBatch(this, x, y));
x += activate_batch->get_w();
y_max = max(y_max, y + activate_batch->get_h());
add_subwindow(label_button = new RecordGUILabel(this, x, y));
y_max = max(y_max, y + label_button->get_h());
- int y1 = y_max, y2 = y1 + 5;
+ int y1 = y_max, y2 = y1 + ys5;
add_subwindow(title = new BC_Title(x1,y2, _("Cron:")));
y_max = max(y_max, y2 + title->get_h());
- x1 += title->get_w() + 5;
+ x1 += title->get_w() + xs5;
add_subwindow(cron_status = new BC_Title(x1,y2, _("Idle"), MEDIUMFONT,
mwindow->theme->recordgui_variable_color));
y_max = max(y_max, y2 + cron_status->get_h());
add_subwindow(clrlbls_button = new RecordGUIClearLabels(this, x4, y1));
y_max = max(y_max, y1 + clrlbls_button->get_h());
- x = x1 = 10;
+ x = x1 = xs10;
y = y_max + pad;
- y1 = y + pad + 5;
+ y1 = y + pad + ys5;
fill_frames = 0;
monitor_video = 0;
if(asset->video_data) {
add_subwindow(drop_frames = new RecordGUIDropFrames(this, x, y));
add_subwindow(fill_frames = new RecordGUIFillFrames(this, x, y1));
- x += drop_frames->get_w() + 5; x1 = x;
+ x += drop_frames->get_w() + xs5; x1 = x;
add_subwindow(monitor_video = new RecordGUIMonitorVideo(this, x, y));
- x += monitor_video->get_w() + 5;
+ x += monitor_video->get_w() + xs5;
}
if(asset->audio_data) {
add_subwindow(monitor_audio = new RecordGUIMonitorAudio(this, x, y));
- x += monitor_audio->get_w() + 5;
+ x += monitor_audio->get_w() + xs5;
add_subwindow(meter_audio = new RecordGUIAudioMeters(this, x, y));
- x += meter_audio->get_w() + 5;
+ x += meter_audio->get_w() + xs5;
}
add_subwindow(power_off = new RecordGUIPowerOff(this, x1, y1));
- x1 += power_off->get_w() + 10;
+ x1 += power_off->get_w() + xs10;
add_subwindow(commercial_check = new RecordGUICommCheck(this, x1, y1));
+ x1 += commercial_check->get_w() + xs30;
+ add_subwindow(deinterlace = new RecordGUIDeinterlace(this, x1, y1));
+ deinterlace->create_objects();
+ x1 += deinterlace->get_w() + xs5;
+ add_subwindow(new BC_Title(x1, y1, _("deinterlace")));
// Batches
- x = 10;
- y += 5;
+ x = xs10;
+ y += ys5;
if( fill_frames )
y = y1 + fill_frames->get_h();
else if( monitor_audio )
y += monitor_audio->get_h();
int bottom_margin = max(BC_OKButton::calculate_h(),
- LoadMode::calculate_h(this, mwindow->theme)) + 5;
+ LoadMode::calculate_h(this, mwindow->theme)) + ys5;
add_subwindow(batch_bay = new RecordGUIBatches(this, x, y,
- get_w() - 20, get_h() - y - bottom_margin - 10));
- y += batch_bay->get_h() + 5;
+ get_w() - xs20, get_h() - y - bottom_margin - ys10));
+ y += batch_bay->get_h() + ys5;
record->record_batches.gui = batch_bay;
batch_bay->update_batches(-1);
// Controls
int loadmode_w = LoadMode::calculate_w(this, mwindow->theme);
- load_mode = new LoadMode(mwindow, this, get_w() / 2 - loadmode_w / 2, y,
- &record->load_mode, 1);
+ load_mode = new LoadMode(mwindow, this,
+ get_w() / 2 - loadmode_w / 2, y, &record->load_mode);
load_mode->create_objects();
- y += load_mode->get_h() + 5;
+ y += load_mode->get_h() + ys5;
add_subwindow(new RecordGUIOK(this));
batch_duration->enable();
else
batch_duration->disable();
+ show_window(1);
unlock_window();
}
int RecordGUI::resize_event(int w, int h)
{
+ int xs20 = xS(20), ys10 = yS(10);
// Recompute batch list based on previous extents
int bottom_margin = mwindow->session->rwindow_h -
batch_bay->get_y() -
mwindow->theme->draw_rwindow_bg(this);
int new_h = mwindow->session->rwindow_h - bottom_margin - batch_bay->get_y();
- if(new_h < 10) new_h = 10;
+ if(new_h < ys10) new_h = ys10;
batch_bay->reposition_window(batch_bay->get_x(),
batch_bay->get_y(),
- mwindow->session->rwindow_w - 20,
+ mwindow->session->rwindow_w - xs20,
mwindow->session->rwindow_h - bottom_margin - batch_bay->get_y());
load_mode->reposition_window(mwindow->session->rwindow_w / 2 -
RecordGUISave::RecordGUISave(RecordGUI *gui)
- : BC_Button(10,
- gui->get_h() - BC_WindowBase::get_resources()->ok_images[0]->get_h() - 10,
+ : BC_Button(xS(10),
+ gui->get_h() - BC_WindowBase::get_resources()->ok_images[0]->get_h() - yS(10),
BC_WindowBase::get_resources()->ok_images)
{
set_tooltip(_("Save the recording and quit."));
return 1;
}
-
int RecordGUICommCheck::keypress_event()
{
if( get_keypress() == caption[0] ) {
}
+RecordGUIDelaceItem::RecordGUIDelaceItem(RecordGUIDeinterlace *popup,
+ const char *text, int id)
+ : BC_MenuItem(text)
+{
+ this->popup = popup;
+ this->id = id;
+}
+int RecordGUIDelaceItem::handle_event()
+{
+ popup->gui->record->deinterlace = id;
+ popup->update();
+ return 1;
+}
+
+RecordGUIDeinterlace::RecordGUIDeinterlace(RecordGUI *gui, int x, int y)
+ : BC_PopupMenu(x, y, xS(24), "", 1, 0, xS(3))
+{
+ this->gui = gui;
+}
+
+void RecordGUIDeinterlace::create_objects()
+{
+ add_item(new RecordGUIDelaceItem(this, _("None"), RECORD_LACE_NONE));
+ add_item(new RecordGUIDelaceItem(this, _("Even"), RECORD_LACE_EVEN));
+ add_item(new RecordGUIDelaceItem(this, _("Odd"), RECORD_LACE_ODD));
+ update();
+}
+
+void RecordGUIDeinterlace::update()
+{
+ int v = gui->record->deinterlace;
+ for( int i=0,n=total_items(); i<n; ++i ) {
+ RecordGUIDelaceItem *item = (RecordGUIDelaceItem *)get_item(i);
+ item->set_checked(item->id == v);
+ }
+}
+
+
RecordGUIMonitorVideo::RecordGUIMonitorVideo(RecordGUI *gui, int x, int y)
: BC_CheckBox(x, y, gui->record->monitor_video, _("Monitor video"))
{
lock_window("RecordGUIMonitorVideo::handle_event");
record->video_window_open = 1;
}
+ else {
+ unlock_window();
+ BC_Window *window = record->record_monitor->window;
+ window->lock_window("RecordGUIMonitorVideo::handle_event");
+ window->hide_window();
+ window->flush();
+ window->unlock_window();
+ lock_window("RecordGUIMonitorVideo::handle_event");
+ record->video_window_open = 0;
+ }
return 1;
}
RecordGUIModeListBox::RecordGUIModeListBox(RecordGUIModeMenu *mode_menu)
: BC_ListBox(mode_menu->textbox->get_x() + mode_menu->textbox->get_w(),
- mode_menu->textbox->get_y(), 100, 50, LISTBOX_TEXT,
+ mode_menu->textbox->get_y(), xS(100), yS(50), LISTBOX_TEXT,
&mode_menu->modes, 0, 0, 1, 0, 1)
{
this->mode_menu = mode_menu;
RecordGUIDCOffset::RecordGUIDCOffset(MWindow *mwindow, int y)
- : BC_Button(230, y, mwindow->theme->calibrate_data)
+ : BC_Button(xS(230), y, mwindow->theme->calibrate_data)
{
}
int RecordGUIDCOffset::keypress_event() { return 0; }
RecordGUIDCOffsetText::RecordGUIDCOffsetText(char *text, int y, int number)
- : BC_TextBox(30, y+1, 67, 1, text, 0)
+ : BC_TextBox(xS(30), y+yS(1), xS(67), 1, text, 0)
{
this->number = number;
}
}
RecordGUIReset::RecordGUIReset(MWindow *mwindow, RecordGUI *gui, int y)
- : BC_Button(400, y, mwindow->theme->over_button)
+ : BC_Button(xS(400), y, mwindow->theme->over_button)
{ this->gui = gui; }
RecordGUIReset::~RecordGUIReset()
}
RecordGUIResetTranslation::RecordGUIResetTranslation(MWindow *mwindow, RecordGUI *gui, int y)
- : BC_Button(250, y, mwindow->theme->reset_data)
+ : BC_Button(xS(250), y, mwindow->theme->reset_data)
{
this->gui = gui;
}