void LiveVideoWindow::create_objects() { int x = 10, y = 10; for(int i = 0; i < plugin->channeldb->size(); i++) { BC_ListBoxItem *current; channel_list.append(current = new BC_ListBoxItem(plugin->channeldb->get(i)->title)); if(i == plugin->config.channel) current->set_selected(1); } add_subwindow(title = new BC_Title(x, y, _("Channels:"))); y += title->get_h() + 5; add_subwindow(list = new LiveChannelList(plugin, this, x, y, get_w() - x - 10, get_h() - y - BC_OKButton::calculate_h() - 10 - 10)); y += list->get_h() + 10; add_subwindow(select = new LiveChannelSelect(plugin, this, x, y)); show_window(); flush(); }
void RecordGUI::flash_batch() { if(record->current_batch < batches[0].total) { if(flash_color == GREEN) flash_color = RED; else flash_color = GREEN; //printf("RecordGUI::flash_batch %x\n", flash_color); for(int i = 0; i < BATCH_COLUMNS; i++) { BC_ListBoxItem *batch = batches[i].values[record->current_batch]; batch->set_color(flash_color); } batch_list->update(batches, batch_titles, column_widths, BATCH_COLUMNS, batch_list->get_yposition(), batch_list->get_xposition(), batch_list->get_highlighted_item()); batch_list->flush(); } }
void PerformancePrefs::generate_node_list() { int selected_row = node_list ? node_list->get_selection_number(0, 0) : -1; for(int i = 0; i < TOTAL_COLUMNS; i++) nodes[i].remove_all_objects(); for(int i = 0; i < pwindow->thread->preferences->renderfarm_nodes.size(); i++) { BC_ListBoxItem *item; nodes[ENABLED_COLUMN].append(item = new BC_ListBoxItem( (char*)(pwindow->thread->preferences->renderfarm_enabled.get(i) ? "X" : " "))); if(i == selected_row) item->set_selected(1); nodes[HOSTNAME_COLUMN].append(item = new BC_ListBoxItem( pwindow->thread->preferences->renderfarm_nodes.get(i))); if(i == selected_row) item->set_selected(1); char string[BCTEXTLEN]; sprintf(string, "%d", pwindow->thread->preferences->renderfarm_ports.get(i)); nodes[PORT_COLUMN].append(item = new BC_ListBoxItem(string)); if(i == selected_row) item->set_selected(1); sprintf(string, "%0.3f", pwindow->thread->preferences->renderfarm_rate.get(i)); nodes[RATE_COLUMN].append(item = new BC_ListBoxItem(string)); if(i == selected_row) item->set_selected(1); } }
void BatchRenderGUI::create_list(int update_widget) { for(int i = 0; i < BATCHRENDER_COLUMNS; i++) { list_columns[i].remove_all_objects(); } for(int i = 0; i < thread->jobs.total; i++) { BatchRenderJob *job = thread->jobs.values[i]; char string[BCTEXTLEN]; BC_ListBoxItem *enabled = new BC_ListBoxItem(job->enabled ? (char*)"X" : (char*)" "); BC_ListBoxItem *item1 = new BC_ListBoxItem(job->asset->path); BC_ListBoxItem *item2 = new BC_ListBoxItem(job->edl_path); BC_ListBoxItem *item3; if(job->elapsed) item3 = new BC_ListBoxItem( Units::totext(string, job->elapsed, TIME_HMS2)); else item3 = new BC_ListBoxItem(_("Unknown")); list_columns[0].append(enabled); list_columns[1].append(item1); list_columns[2].append(item2); list_columns[3].append(item3); if(i == thread->current_job) { enabled->set_selected(1); item1->set_selected(1); item2->set_selected(1); item3->set_selected(1); } if(i == thread->rendering_job) { enabled->set_color(RED); item1->set_color(RED); item2->set_color(RED); item3->set_color(RED); } } if(update_widget) { batch_list->update(list_columns, list_titles, thread->column_width, BATCHRENDER_COLUMNS, batch_list->get_xposition(), batch_list->get_yposition(), batch_list->get_highlighted_item(), // Flat index of item cursor is over 1, // set all autoplace flags to 1 1); } }
char* BC_FileBox::get_path(int selection) { if(selection == 0) { return get_submitted_path(); } else { BC_ListBoxItem *item = listbox->get_selection( column_of_type(FILEBOX_NAME), selection - 1); if(item) { fs->join_names(string, directory, item->get_text()); return string; } } return 0; }
int BC_FileBoxListBox::selection_changed() { BC_ListBoxItem *item = get_selection( filebox->column_of_type(FILEBOX_NAME), 0); if(item) { char path[BCTEXTLEN]; strcpy(path, item->get_text()); filebox->textbox->update(path); filebox->fs->extract_dir(filebox->directory, path); filebox->fs->extract_name(filebox->filename, path); filebox->fs->complete_path(path); strcpy(filebox->current_path, path); strcpy(filebox->submitted_path, path); } return 1; }
void TitleWindow::create_objects() { int x = 10, y = 10; int margin = client->get_theme()->widget_border; char string[BCTEXTLEN]; #define COLOR_W 50 #define COLOR_H 30 client->build_fonts(); client->build_previews(this); encodings.append(new BC_ListBoxItem("ISO8859-1")); encodings.append(new BC_ListBoxItem("ISO8859-2")); encodings.append(new BC_ListBoxItem("ISO8859-3")); encodings.append(new BC_ListBoxItem("ISO8859-4")); encodings.append(new BC_ListBoxItem("ISO8859-5")); encodings.append(new BC_ListBoxItem("ISO8859-6")); encodings.append(new BC_ListBoxItem("ISO8859-7")); encodings.append(new BC_ListBoxItem("ISO8859-8")); encodings.append(new BC_ListBoxItem("ISO8859-9")); encodings.append(new BC_ListBoxItem("ISO8859-10")); encodings.append(new BC_ListBoxItem("ISO8859-11")); encodings.append(new BC_ListBoxItem("ISO8859-12")); encodings.append(new BC_ListBoxItem("ISO8859-13")); encodings.append(new BC_ListBoxItem("ISO8859-14")); encodings.append(new BC_ListBoxItem("ISO8859-15")); encodings.append(new BC_ListBoxItem("KOI8")); encodings.append(new BC_ListBoxItem("UTF-8")); sizes.append(new BC_ListBoxItem("8")); sizes.append(new BC_ListBoxItem("9")); sizes.append(new BC_ListBoxItem("10")); sizes.append(new BC_ListBoxItem("11")); sizes.append(new BC_ListBoxItem("12")); sizes.append(new BC_ListBoxItem("13")); sizes.append(new BC_ListBoxItem("14")); sizes.append(new BC_ListBoxItem("16")); sizes.append(new BC_ListBoxItem("18")); sizes.append(new BC_ListBoxItem("20")); sizes.append(new BC_ListBoxItem("22")); sizes.append(new BC_ListBoxItem("24")); sizes.append(new BC_ListBoxItem("26")); sizes.append(new BC_ListBoxItem("28")); sizes.append(new BC_ListBoxItem("32")); sizes.append(new BC_ListBoxItem("36")); sizes.append(new BC_ListBoxItem("40")); sizes.append(new BC_ListBoxItem("48")); sizes.append(new BC_ListBoxItem("56")); sizes.append(new BC_ListBoxItem("64")); sizes.append(new BC_ListBoxItem("72")); sizes.append(new BC_ListBoxItem("100")); sizes.append(new BC_ListBoxItem("128")); sizes.append(new BC_ListBoxItem("256")); sizes.append(new BC_ListBoxItem("512")); sizes.append(new BC_ListBoxItem("1024")); paths.append(new BC_ListBoxItem(TitleMain::motion_to_text(NO_MOTION))); paths.append(new BC_ListBoxItem(TitleMain::motion_to_text(BOTTOM_TO_TOP))); paths.append(new BC_ListBoxItem(TitleMain::motion_to_text(TOP_TO_BOTTOM))); paths.append(new BC_ListBoxItem(TitleMain::motion_to_text(RIGHT_TO_LEFT))); paths.append(new BC_ListBoxItem(TitleMain::motion_to_text(LEFT_TO_RIGHT))); // Construct font list for(int i = 0; i < client->fonts->size(); i++) { int exists = 0; for(int j = 0; j < fonts.size(); j++) { if(!strcasecmp(fonts.get(j)->get_text(), client->fonts->get(i)->fixed_title)) { exists = 1; break; } } BC_ListBoxItem *item = 0; if(!exists) { fonts.append(item = new BC_ListBoxItem(client->fonts->get(i)->fixed_title)); if(!strcmp(client->config.font, item->get_text())) item->set_selected(1); if(client->fonts->values[i]->image) { VFrame *vframe = client->fonts->get(i)->image; BC_Pixmap *icon = new BC_Pixmap(this, vframe, PIXMAP_ALPHA); item->set_icon(icon); item->set_icon_vframe(vframe); } } } // Sort font list int done = 0; while(!done) { done = 1; for(int i = 0; i < fonts.size() - 1; i++) { if(strcmp(fonts.values[i]->get_text(), fonts.values[i + 1]->get_text()) > 0) { BC_ListBoxItem *temp = fonts.values[i + 1]; fonts.values[i + 1] = fonts.values[i]; fonts.values[i] = temp; done = 0; } } } add_tool(font_title = new BC_Title(x, y, _("Font:"))); font = new TitleFont(client, this, x, y + font_title->get_h()); font->create_objects(); x += font->get_w() + margin; add_subwindow(font_tumbler = new TitleFontTumble(client, this, x, y + 20)); x += font_tumbler->get_w() + margin; add_tool(size_title = new BC_Title(x, y, _("Size:"))); sprintf(string, "%d", client->config.size); size = new TitleSize(client, this, x, y + 20, string); size->create_objects(); x += size->get_w() + margin; add_subwindow(size_tumbler = new TitleSizeTumble(client, this, x, y + 20)); x += size_tumbler->get_w() + margin; add_tool(style_title = new BC_Title(x, y, _("Style:"))); add_tool(italic = new TitleItalic(client, this, x, y + 20)); add_tool(bold = new TitleBold(client, this, x, y + 50)); #ifdef USE_OUTLINE add_tool(stroke = new TitleStroke(client, this, x, y + 80)); #endif x += 90; add_tool(justify_title = new BC_Title(x, y, _("Justify:"))); add_tool(left = new TitleLeft(client, this, x, y + 20)); add_tool(center = new TitleCenter(client, this, x, y + 50)); add_tool(right = new TitleRight(client, this, x, y + 80)); x += 80; add_tool(top = new TitleTop(client, this, x, y + 20)); add_tool(mid = new TitleMid(client, this, x, y + 50)); add_tool(bottom= new TitleBottom(client, this, x, y + 80)); y += 50; x = 10; add_tool(x_title = new BC_Title(x, y, _("X:"))); title_x = new TitleX(client, this, x, y + 20); title_x->create_objects(); x += 90; add_tool(y_title = new BC_Title(x, y, _("Y:"))); title_y = new TitleY(client, this, x, y + 20); title_y->create_objects(); x += 90; add_tool(motion_title = new BC_Title(x, y, _("Motion type:"))); motion = new TitleMotion(client, this, x, y + 20); motion->create_objects(); x += 150; add_tool(loop = new TitleLoop(client, x, y + 20)); x += 100; x = 10; y += 50; add_tool(dropshadow_title = new BC_Title(x, y, _("Drop shadow:"))); dropshadow = new TitleDropShadow(client, this, x, y + 20); dropshadow->create_objects(); x += 100; add_tool(fadein_title = new BC_Title(x, y, _("Fade in (sec):"))); add_tool(fade_in = new TitleFade(client, this, &client->config.fade_in, x, y + 20)); x += 100; add_tool(fadeout_title = new BC_Title(x, y, _("Fade out (sec):"))); add_tool(fade_out = new TitleFade(client, this, &client->config.fade_out, x, y + 20)); x += 110; add_tool(speed_title = new BC_Title(x, y, _("Speed:"))); speed = new TitleSpeed(client, this, x, y + 20); speed->create_objects(); x += 110; color_x = x; color_y = y + 20; x += COLOR_W + 5; add_tool(color_button = new TitleColorButton(client, this, x, y + 20, 0)); x += color_button->get_w(); color_thread = new TitleColorThread(client, this, 0); x = color_x; y += 50; outline_color_x = x; outline_color_y = y + 20; x += COLOR_W + 5; add_tool(outline_color_button = new TitleColorButton(client, this, x, y + 20, 1)); x += outline_color_button->get_w(); outline_color_thread = new TitleColorThread(client, this, 1); x = 10; // y += 50; add_tool(outline_title = new BC_Title(x, y, _("Outline:"))); outline = new TitleOutline(client, this, x, y + outline_title->get_h() + margin); outline->create_objects(); x += outline->get_w() + margin; #ifndef X_HAVE_UTF8_STRING add_tool(encoding_title = new BC_Title(x, y + 3, _("Encoding:"))); encoding = new TitleEncoding(client, this, x, y + encoding_title->get_h() + margin); encoding->create_objects(); x += 100; #endif y += outline_title->get_h() + margin; add_tool(timecode = new TitleTimecode(client, x, y)); x += timecode->get_w() + margin; add_tool(timecode_format = new TitleTimecodeFormat( client, x, y, Units::print_time_format(client->config.timecode_format, string))); for(int i = 0; i < sizeof(timecode_formats) / sizeof(int); i++) { timecode_format->add_item(new BC_MenuItem( Units::print_time_format(timecode_formats[i], string))); } x = 10; y += timecode_format->get_h() + margin; add_tool(text_title = new BC_Title(x, y + 3, _("Text:"))); x = 10; y += text_title->get_h() + margin; text = new TitleText(client, this, x, y, get_w() - x - 10, get_h() - y - 10); text->create_objects(); update_color(); show_window(1); }
int ExportEDLWindow::create_objects() { int x = 5, y = 5; add_subwindow(new BC_Title(x, y, _("Select a file to export to:"))); y += 25; add_subwindow(path_textbox = new ExportEDLPathText(x, y, this)); x += 300; path_recent = new BC_RecentList("EDLPATH", mwindow->defaults, path_textbox, 10, x, y, 300, 100); add_subwindow(path_recent); // FIX path_recent->load_items("EDLPATH"); x += 24; add_subwindow(path_button = new BrowseButton( mwindow, this, path_textbox, x, y - 4, exportasset->path, _("Output to file"), _("Select a file to write to:"), 0)); y += 34; x = 5; add_subwindow(new BC_Title(x, y, _("Select track to be exported:"))); y += 25; items_tracks[0].remove_all_objects(); items_tracks[1].remove_all_objects(); int serial = 0; if (exportasset->track_number == -1) exportasset->track_number = 0; for(Track *track = mwindow->edl->tracks->first; track; track = track->next) { char tmp[10]; sprintf(tmp, "%i\n", serial+1); BC_ListBoxItem *listitem = new BC_ListBoxItem(tmp); if (serial == exportasset->track_number) listitem->set_selected(1); items_tracks[0].append(listitem); items_tracks[1].append(new BC_ListBoxItem(track->title)); serial ++; } add_subwindow(track_list = new ExportEDLWindowTrackList(this, x, y, 400, 200, items_tracks)); y += 5 + track_list->get_h(); add_subwindow(new BC_Title(x, y, _("Currently only CMX 3600 format is supported"))); add_subwindow(new BC_OKButton(this)); add_subwindow(new BC_CancelButton(this)); show_window(); return 0; }