Ejemplo n.º 1
0
int main(int argc, char *argv[])
{
	new BC_Signals;
	TestWindow window;
	int angles[] = { 180, 0 };
	float values[] = { 1, 0 };

	window.add_tool(new BC_Pan(10, 
		120, 
		100, 
		1, 
		2, 
		angles, 
		-1, 
		-1,
		values));
	window.add_tool(new BC_TextBox(10, 10, 200, 5, _("Mary Egbert\nhad a little lamb.")));
	BC_Title *title;
	window.add_tool(title = new BC_Title(10, 210, _("Hello world")));
	title->update("xyz");
	window.show_window();

sleep(2);
	title->update("abc");

	window.run_window();

//	thread_fork();
}
Ejemplo n.º 2
0
void TimeFrontWindow::create_objects()
{
	int x = 10, y = 10;
	BC_Title *title;

	add_subwindow(title = new BC_Title(x, y, _("Type:")));
	add_subwindow(shape = new TimeFrontShape(plugin, 
		this, 
		x + title->get_w() + 10, 
		y));
	shape->create_objects();
	y += 40;
	shape_x = x;
	shape_y = y;
	y += 140;
	add_subwindow(title = new BC_Title(x, y, _("Time range:")));
	add_subwindow(frame_range = new TimeFrontFrameRange(plugin, x + title->get_w() + 10, y));
	frame_range_x = x + frame_range->get_w() + 10;
	frame_range_y = y;
	y += 35;
	update_shape();
	
	add_subwindow(invert = new TimeFrontInvert(plugin, x, y));
	add_subwindow(show_grayscale = new TimeFrontShowGrayscale(plugin, x+ 100, y));


	show_window();
	flush();
}
Ejemplo n.º 3
0
void ClipEditWindow::create_objects()
{
	lock_window("ClipEditWindow::create_objects");
	this->create_it = thread->create_it;

	int x = 10, y = 10;
	int x1 = x;
	BC_TextBox *textbox;
	BC_TextBox *titlebox;
	BC_Title *title;

	add_subwindow(title = new BC_Title(x1, y, _("Title:")));
	y += title->get_h() + 5;
	add_subwindow(titlebox = new ClipEditTitle(this, x1, y, get_w() - x1 * 2));
	y += titlebox->get_h() + 10;
	add_subwindow(title = new BC_Title(x1, y, _("Comments:")));
	y += title->get_h() + 5;
	add_subwindow(textbox = new ClipEditComments(this, 
		x1, 
		y, 
		get_w() - x1 * 2, 
		BC_TextBox::pixels_to_rows(this, 
			MEDIUMFONT, 
			get_h() - 10 - BC_OKButton::calculate_h() - y)));



	add_subwindow(new BC_OKButton(this));
	add_subwindow(new BC_CancelButton(this));
	show_window();
	titlebox->activate();
	unlock_window();
}
Ejemplo n.º 4
0
void BlurWindow::create_objects()
{
	int x = 10, y = 10;
	BC_Title *title;

	add_subwindow(new BC_Title(x, y, _("Blur")));
	y += 20;
	add_subwindow(horizontal = new BlurHorizontal(client, this, x, y));
	y += 30;
	add_subwindow(vertical = new BlurVertical(client, this, x, y));
	y += 35;
	add_subwindow(title = new BC_Title(x, y, _("Radius:")));
	y += title->get_h() + 10;
	add_subwindow(radius = new BlurRadius(client, this, x, y));
	add_subwindow(radius_text = new BlurRadiusText(client, this, x + radius->get_w() + 10, y, 100));
	y += radius->get_h() + 10;
	add_subwindow(a_key = new BlurAKey(client, x, y));
	y += 30;
	add_subwindow(a = new BlurA(client, x, y));
	y += 30;
	add_subwindow(r = new BlurR(client, x, y));
	y += 30;
	add_subwindow(g = new BlurG(client, x, y));
	y += 30;
	add_subwindow(b = new BlurB(client, x, y));
	
	show_window();
	flush();
}
Ejemplo n.º 5
0
void OverlayWindow::create_objects()
{
	int x = 10, y = 10;

	BC_Title *title;
	add_subwindow(title = new BC_Title(x, y, _("Mode:")));
	add_subwindow(mode = new OverlayMode(plugin,
		x + title->get_w() + 5,
		y));
	mode->create_objects();

	y += 30;
	add_subwindow(title = new BC_Title(x, y, _("Layer order:")));
	add_subwindow(direction = new OverlayDirection(plugin,
		x + title->get_w() + 5,
		y));
	direction->create_objects();

	y += 30;
	add_subwindow(title = new BC_Title(x, y, _("Output layer:")));
	add_subwindow(output = new OverlayOutput(plugin,
		x + title->get_w() + 5,
		y));
	output->create_objects();

	show_window();
	flush();
}
Ejemplo n.º 6
0
void ChromaKeyWindow::create_objects()
{
	int x = 10, y = 10, x1 = 100;

	BC_Title *title;
	add_subwindow(title = new BC_Title(x, y, _("Color:")));
	x += title->get_w() + 10;
	add_subwindow(color = new ChromaKeyColor(plugin, this, x, y));
	x += color->get_w() + 10;
	add_subwindow(sample = new BC_SubWindow(x, y, 100, 50));
	y += sample->get_h() + 10;
	x = 10;

	add_subwindow(new BC_Title(x, y, _("Slope:")));
	add_subwindow(slope = new ChromaKeySlope(plugin, x1, y));

	y += 30;
	add_subwindow(new BC_Title(x, y, _("Threshold:")));
	add_subwindow(threshold = new ChromaKeyThreshold(plugin, x1, y));


	y += 30;
	add_subwindow(use_value = new ChromaKeyUseValue(plugin, x1, y));

	y += 30;
	add_subwindow(use_colorpicker = new ChromaKeyUseColorPicker(plugin, this, x1, y));

	color_thread = new ChromaKeyColorThread(plugin, this);

	update_sample();
	show_window();
	flush();
}
Ejemplo n.º 7
0
int YUVConfigVideo::create_objects()
{
	BC_Title *bt;
	int init_x = 10;
	int init_y = 10;
	
	int x = init_x;
	int y = init_y;

	add_subwindow(new BC_Title(init_x, y, _("Output Path:")));
	add_subwindow(path_textbox = new BC_TextBox(init_x + 100, y, 350, 1, asset->path));
	add_subwindow(path_recent = new BC_RecentList("PATH", defaults, path_textbox, 10, init_x + 450, y, path_textbox->get_w(), 100));
	path_recent->load_items(FILE_FORMAT_PREFIX(asset->format));

	x = init_x;
	y += 30;

	add_subwindow(bt = new BC_Title(init_x, y, _("Use Pipe:")));
	add_subwindow(pipe_checkbox = new PipeCheckBox(init_x + bt->get_w(), y, asset->use_pipe));
	add_subwindow(pipe_textbox = new BC_TextBox(init_x + 100, y, 350, 1, asset->pipe));
	add_subwindow(pipe_recent = new BC_RecentList("PIPE", defaults, pipe_textbox, 10, init_x + 450, y, pipe_textbox->get_w(), 100));
	pipe_recent->load_items(FILE_FORMAT_PREFIX(asset->format));

	pipe_checkbox->textbox = pipe_textbox;
	if (!asset->use_pipe) pipe_textbox->disable();

	x = init_x;
	y += 30;
	add_subwindow(new BC_Title(x, y, _("Stream Header:"), MEDIUMFONT, RED));

	x = init_x + 20;
	y += 30;
	add_subwindow(bt = new BC_Title(x, y, _("Interlacing:")));
	char string[BCTEXTLEN];
	ilacemode_to_text(string,asset->interlace_mode);
	add_subwindow(new BC_Title(x + bt->get_w() + 5, y, string, MEDIUMFONT, YELLOW));

	x = init_x;
	y += 30;
	add_subwindow(new BC_Title(x, y, _("Pipe Presets:")));

	x += 130;
	add_subwindow(mpeg2enc = new PipePreset(x, y, "mpeg2enc", pipe_textbox, pipe_checkbox));
	// NOTE: the '%' character will be replaced by the current path
	// NOTE: to insert a real '%' double it up: '%%' -> '%'
	// NOTE: preset items must have a '|' before the actual command
	mpeg2enc->add_item(new BC_MenuItem ("(DVD) | mpeg2enc -f 8 -o %"));
	mpeg2enc->add_item(new BC_MenuItem ("(VCD) | mpeg2enc -f 2 -o %"));

	x += 180;
	add_subwindow(ffmpeg = new PipePreset(x, y, "ffmpeg", pipe_textbox, pipe_checkbox));
	ffmpeg->add_item(new BC_MenuItem("(DVD) | ffmpeg -f yuv4mpegpipe -i - -y -target dvd -ilme -ildct -hq -f mpeg2video %"));
	ffmpeg->add_item(new BC_MenuItem("(VCD) | ffmpeg -f yuv4mpegpipe -i - -y -target vcd -hq -f mpeg2video %"));

	add_subwindow(new BC_OKButton(this));
	add_subwindow(new BC_CancelButton(this));
	show_window();
	return 0;
}
Ejemplo n.º 8
0
void CreateDVD_GUI::create_objects()
{
	lock_window("CreateDVD_GUI::create_objects");
	int pady = BC_TextBox::calculate_h(this, MEDIUMFONT, 0, 1) + 5;
	int padx = BC_Title::calculate_w(this, (char*)"X", MEDIUMFONT);
	int x = padx/2, y = pady/2;
	BC_Title *title = new BC_Title(x, y, "Title:", MEDIUMFONT, YELLOW);
	add_subwindow(title);
	at_x = x + title->get_w();  at_y = y;
	asset_title = new CreateDVD_AssetTitle(this, at_x, at_y, get_w()-at_x-10);
	add_subwindow(asset_title);
	y += title->get_h() + pady/2;
	title = new BC_Title(x, y, "tmp path:", MEDIUMFONT, YELLOW);
	add_subwindow(title);
	tmp_x = x + title->get_w();  tmp_y = y;
	tmp_path = new CreateDVD_TmpPath(this, tmp_x, tmp_y,  get_w()-tmp_x-10);
	add_subwindow(tmp_path);
	y += title->get_h() + pady/2;
	disk_space = new CreateDVD_DiskSpace(this, x, y);
	add_subwindow(disk_space);
	disk_space->update();
	y += disk_space->get_h() + pady/2;
	need_deinterlace = new CreateDVD_Deinterlace(this, x, y);
	add_subwindow(need_deinterlace);
	int x1 = x + 150, x2 = x1 + 150;
	need_inverse_telecine = new CreateDVD_InverseTelecine(this, x1, y);
	add_subwindow(need_inverse_telecine);
	need_use_ffmpeg = new CreateDVD_UseFFMpeg(this, x2, y);
	add_subwindow(need_use_ffmpeg);
	y += need_deinterlace->get_h() + pady/2;
	need_scale = new CreateDVD_Scale(this, x, y);
	add_subwindow(need_scale);
	need_wide_audio = new CreateDVD_WideAudio(this, x1, y);
	add_subwindow(need_wide_audio);
	need_resize_tracks = new CreateDVD_ResizeTracks(this, x2, y);
	add_subwindow(need_resize_tracks);
	y += need_scale->get_h() + pady/2;
	need_histogram = new CreateDVD_Histogram(this, x, y);
	add_subwindow(need_histogram);
	need_wide_aspect = new CreateDVD_WideAspect(this, x1, y);
	add_subwindow(need_wide_aspect);
	need_label_chapters = new CreateDVD_LabelChapters(this, x2, y);
	add_subwindow(need_label_chapters);
	ok_w = BC_OKButton::calculate_w();
	ok_h = BC_OKButton::calculate_h();
	ok_x = 10;
	ok_y = get_h() - ok_h - 10;
	ok = new CreateDVD_OK(this, ok_x, ok_y);
	add_subwindow(ok);
	cancel_w = BC_CancelButton::calculate_w();
	cancel_h = BC_CancelButton::calculate_h();
	cancel_x = get_w() - cancel_w - 10,
	cancel_y = get_h() - cancel_h - 10;
	cancel = new CreateDVD_Cancel(this, cancel_x, cancel_y);
	add_subwindow(cancel);
	show_window();
	unlock_window();
}
Ejemplo n.º 9
0
void PhotoScaleWindow::create_objects()
{
	int x = 10, y = 10;
	BC_Title *title;

	int x2 = x + BC_Title::calculate_w(this, _("Height:")) + plugin->get_theme()->widget_border;
	add_subwindow(title = new BC_Title(x, 
		y, 
		_("Output size:")));

	y += title->get_h() + plugin->get_theme()->widget_border;
	add_subwindow(title = new BC_Title(x, y, _("Width:")));
	add_subwindow(output_size[0] = new PhotoScaleSizeText(
		plugin,
		this,
		x2, 
		y, 
		100,
		&(plugin->config.width)));

	y += output_size[0]->get_h() + plugin->get_theme()->widget_border;
	add_subwindow(title = new BC_Title(x, y, _("Height:")));
	add_subwindow(output_size[1] = new PhotoScaleSizeText(
		plugin,
		this,
		x2, 
		y, 
		100,
		&(plugin->config.height)));

	FrameSizePulldown *pulldown;
	add_subwindow(pulldown = new FrameSizePulldown(plugin->get_theme(), 
		output_size[0], 
		output_size[1], 
		x + title->get_w() + output_size[1]->get_w() + plugin->get_theme()->widget_border, 
		y));

	add_subwindow(new PhotoScaleSwapExtents(
		plugin, 
		this, 
		x + title->get_w() + output_size[1]->get_w() + plugin->get_theme()->widget_border + pulldown->get_w(),
		y));

	y += pulldown->get_h() + plugin->get_theme()->widget_border;
	add_subwindow(file = new PhotoScaleFile(plugin, 
		this, 
		x, 
		y));

	y += file->get_h() + plugin->get_theme()->widget_border;
	add_subwindow(scan = new PhotoScaleScan(plugin, 
		this, 
		x, 
		y));

	show_window();
	flush();
}
Ejemplo n.º 10
0
void TimeAvgWindow::create_objects()
{
	int x = 10, y = 10;
	BC_Bar *bar;
	BC_Title *title;
	
	add_tool(title = new BC_Title(x, y, _("Frame count:")));
	y += title->get_h() + 5;
	add_tool(total_frames = new TimeAvgSlider(client, x, y));
	y += 30;
	add_tool(paranoid = new TimeAvgParanoid(client, x, y));
	y += 30;
	add_tool(no_subtract = new TimeAvgNoSubtract(client, x, y));
	y += 30;
	add_tool(bar = new BC_Bar(x, y, get_w() - x * 2));
	y += bar->get_h() + 5;


	
	add_tool(avg = new TimeAvgAvg(client, this, x, y));
	y += 30;
	add_tool(accum = new TimeAvgAccum(client, this, x, y));
	y += 30;
	add_tool(bar = new BC_Bar(x, y, get_w() - x * 2));
	y += bar->get_h() + 5;



	add_tool(replace = new TimeAvgReplace(client, this, x, y));
	y += 30;
	add_tool(new BC_Title(x, y, _("Threshold:")));
	y += title->get_h() + 5;
	add_tool(threshold = new TimeThresholdSlider(client, x, y));
	y += 30;
	add_tool(new BC_Title(x, y, _("Border:")));
	y += title->get_h() + 5;
	add_tool(border = new TimeBorderSlider(client, x, y));
	y += 30;



	add_tool(bar = new BC_Bar(x, y, get_w() - x * 2));
	y += bar->get_h() + 5;


	add_tool(greater = new TimeAvgGreater(client, this, x, y));
	y += 30;
	add_tool(less = new TimeAvgLess(client, this, x, y));
	y += 30;

	update_toggles();
	show_window();
	flush();
}
Ejemplo n.º 11
0
void ConfirmScan::create_objects()
{
	int x = 10, y = 10;
	int y2 = 0, x2 = 0;
	BC_Title *title;
	add_subwindow(title = new BC_Title(x, y, _("Set parameters for channel scanning.")));
	y += title->get_h() + 10;
	y2 = y;

	add_subwindow(title = new BC_Title(x, y, _("Frequency table:")));
	x2 = title->get_w();
	y += BC_PopupMenu::calculate_h();
	add_subwindow(title = new BC_Title(x, y, _("Norm:")));
	x2 = MAX(x2, title->get_w());
	y += BC_PopupMenu::calculate_h();
	add_subwindow(title = new BC_Title(x, y, _("Input:")));
	x2 = MAX(x2, title->get_w());
	y += BC_PopupMenu::calculate_h();
	x2 += x + 5;

	y = y2;
	x = x2;
	ChannelEditEditFreqtable *table;
	add_subwindow(table = new ChannelEditEditFreqtable(x, 
		y, 
		0, 
		gui->thread));
	table->add_items();
	y += table->get_h() + 10;

	ChannelEditEditNorm *norm;
	add_subwindow(norm = new ChannelEditEditNorm(x, 
		y, 
		0,
		gui->thread));
	norm->add_items();
	y += norm->get_h() + 10;

	ChannelEditEditInput *input;
	add_subwindow(input = new ChannelEditEditInput(x, 
		y, 
		0, 
		gui->thread));
	input->add_items();


	add_subwindow(new BC_OKButton(this));
	add_subwindow(new BC_CancelButton(this));
	show_window();
}
Ejemplo n.º 12
0
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();
}
Ejemplo n.º 13
0
int LiveVideoWindow::resize_event(int w, int h)
{
	int list_bottom = get_h() - list->get_y() - list->get_h();
	int list_side = get_w() - list->get_x() - list->get_w();
	int select_top = get_h() - select->get_y();

	title->reposition_window(title->get_x(), title->get_y());

	list->reposition_window(list->get_x(),
		list->get_y(),
		w - list->get_x() - list_side,
		h - list->get_y() - list_bottom);
	select->reposition_window(select->get_x(),
		h - select_top);
	plugin->w = w;
	plugin->h = h;
	return 1;
}
Ejemplo n.º 14
0
void PitchWindow::create_objects()
{
	int x1 = 10, x = 10, y = 10;
	
	BC_Title *title;
	add_subwindow(title = new BC_Title(x, y, _("Scale:")));
	x += title->get_w() + plugin->get_theme()->widget_border;
	add_subwindow(scale = new PitchScale(plugin, x, y));
	x = x1;
	y += scale->get_h() + plugin->get_theme()->widget_border;
	add_subwindow(title = new BC_Title(x, y, _("Window Size:")));
	y += title->get_h() + plugin->get_theme()->widget_border;
	add_subwindow(size = new PitchSize(this, plugin, x, y));
	size->create_objects();
	size->update(plugin->config.size);
	show_window();
	flush();
}
Ejemplo n.º 15
0
int GradientWindow::create_objects()
{
	int x = 10, y = 10;
	BC_Title *title;

	add_subwindow(title = new BC_Title(x, y, _("Shape:")));
	add_subwindow(shape = new GradientShape(plugin, 
		this, 
		x + title->get_w() + 10, 
		y));
	shape->create_objects();
	y += 40;
	shape_x = x;
	shape_y = y;
	y += 40;
	add_subwindow(title = new BC_Title(x, y, _("Rate:")));
	add_subwindow(rate = new GradientRate(plugin,
		x + title->get_w() + 10,
		y));
	rate->create_objects();
	y += 40;
	add_subwindow(title = new BC_Title(x, y, _("Inner radius:")));
	add_subwindow(in_radius = new GradientInRadius(plugin, x + title->get_w() + 10, y));
	y += 30;
	add_subwindow(title = new BC_Title(x, y, _("Outer radius:")));
	add_subwindow(out_radius = new GradientOutRadius(plugin, x + title->get_w() + 10, y));
	y += 35;
	add_subwindow(in_color = new GradientInColorButton(plugin, this, x, y));
	in_color_x = x + in_color->get_w() + 10;
	in_color_y = y;
	y += 35;
	add_subwindow(out_color = new GradientOutColorButton(plugin, this, x, y));
	out_color_x = x + out_color->get_w() + 10;
	out_color_y = y;
	in_color_thread = new GradientInColorThread(plugin, this);
	out_color_thread = new GradientOutColorThread(plugin, this);
	update_in_color();
	update_out_color();
	update_shape();

	show_window();
	flush();
	return 0;
}
Ejemplo n.º 16
0
void OverlayAudioWindow::create_objects()
{
	int x = 10, y = 10;
	int x1 = x;
	BC_Title *title;
	add_subwindow(title = new BC_Title(x, y, "Output track:"));
	x += title->get_w() + plugin->get_theme()->widget_border;
	add_subwindow(output = new OutputTrack(plugin, x, y));
	output->create_objects();

	y += output->get_h() + plugin->get_theme()->widget_border;
	x = x1;
	add_subwindow(title = new BC_Title(x, y, "Mode:"));
	x += title->get_w() + plugin->get_theme()->widget_border;
	add_subwindow(mode = new OverlayMode(plugin, x, y));
	mode->create_objects();
	
	
	show_window();
}
Ejemplo n.º 17
0
void VocoderWindow::create_objects()
{
	int x = plugin->get_theme()->widget_border;
	int y = plugin->get_theme()->widget_border;
	BC_Title *title = 0;

	int x1 = x;
	int y1 = y;
	add_subwindow(title = new BC_Title(x, y, _("Wetness:")));
	int x2 = x + title->get_w() + plugin->get_theme()->widget_border;
	y += BC_Pot::calculate_h() + plugin->get_theme()->widget_border;
	add_subwindow(title = new BC_Title(x, y, _("Level:")));
	x2 = MAX(x2, x + title->get_w() + plugin->get_theme()->widget_border);

	x = x2;
	y = y1;
	add_subwindow(wetness = new VocoderWetness(plugin, x, y));
	y += wetness->get_h() + plugin->get_theme()->widget_border;
	add_subwindow(level = new VocoderLevel(plugin, x, y));
	y += level->get_h() + plugin->get_theme()->widget_border;

	x = x1;
	add_subwindow(title = new BC_Title(x, y, _("Carrier Track:")));
	output = new VocoderCarrier(plugin, 
		this, 
		x + title->get_w() + plugin->get_theme()->widget_border, 
		y);
	output->create_objects();
	y += output->get_h() + plugin->get_theme()->widget_border;

	add_subwindow(title = new BC_Title(x, y, _("Bands:")));
	bands = new VocoderBands(plugin, 
		this, 
		x + title->get_w() + plugin->get_theme()->widget_border, 
		y);
	bands->create_objects();
	y += bands->get_h() + plugin->get_theme()->widget_border;

	show_window();
}
Ejemplo n.º 18
0
void ManualGotoWindow::create_objects()
{
    int x = 76, y = 5;
    int x1 = x;
    int boxwidth = 26;

    BC_Title *title;
    add_subwindow(title = new BC_Title(x1 - 2, y, _("hour  min     sec     msec"), SMALLFONT));
    y += title->get_h() + 3;

    add_subwindow(signtitle = new BC_Title(x1 - 17, y, "=", LARGEFONT));
    add_subwindow(boxhours = new ManualGotoNumber(this, x1, y, 16, 0, 9, 1));
    x1 += boxhours->get_w() + 4;
    add_subwindow(boxminutes = new ManualGotoNumber(this, x1, y, 26, 0, 59, 2));
    x1 += boxminutes->get_w() + 4;
    add_subwindow(boxseconds = new ManualGotoNumber(this, x1, y, 26, 0, 59, 2));
    x1 += boxseconds->get_w() + 4;
    add_subwindow(boxmsec = new ManualGotoNumber(this, x1, y, 34, 0, 999, 3));
    y += boxhours->get_h() + 10;

    add_subwindow(new BC_OKButton(this));
    add_subwindow(new BC_CancelButton(this));
}
Ejemplo n.º 19
0
void TimeStretchWindow::create_objects()
{
	int x = 10, y = 10;

	BC_Title *title;
	add_subwindow(title = new BC_Title(x, y, _("Fraction of original speed:")));
	y += title->get_h() + plugin->get_theme()->widget_border;
	
	TimeStretchFraction *fraction;
	add_subwindow(fraction = new TimeStretchFraction(plugin, x, y));

	y += fraction->get_h() + plugin->get_theme()->widget_border;
	add_subwindow(freq = new TimeStretchFreq(plugin, this, x, y));
	y += freq->get_h() + plugin->get_theme()->widget_border;
	add_subwindow(time = new TimeStretchTime(plugin, this, x, y));

	add_subwindow(new BC_OKButton(this));
	add_subwindow(new BC_CancelButton(this));
	show_window();



	flush();
}
Ejemplo n.º 20
0
void ShapeWipeWindow::create_objects()
{
	BC_Title *title = 0;
	lock_window("ShapeWipeWindow::create_objects");
	int widget_border = plugin->get_theme()->widget_border;
	int window_border = plugin->get_theme()->window_border;
	int x = window_border, y = window_border;

	plugin->init_shapes();
	for(int i = 0; i < plugin->shape_titles.size(); i++)
	{
		shapes.append(new BC_ListBoxItem(plugin->shape_titles.get(i)));
	}
	
	add_subwindow(title = new BC_Title(x, y, _("Direction:")));
	x += title->get_w() + widget_border;
	add_subwindow(left = new ShapeWipeW2B(plugin, 
		this,
		x,
		y));
	x += left->get_w() + widget_border;
	add_subwindow(right = new ShapeWipeB2W(plugin, 
		this,
		x,
		y));
	x = window_border;
	y += right->get_h() + widget_border;


	add_subwindow(title = new BC_Title(x, y, _("Shape:")));
	x += title->get_w() + widget_border;

// 	add_subwindow(filename_widget = new 
// 	ShapeWipeFilename(plugin, 
// 		this,
// 		plugin->filename,
// 		x,
// 		y));
// 	x += 200;
// 	add_subwindow(new ShapeWipeBrowseButton(
// 		plugin, 
// 		this,
// 		filename_widget,
// 		x,
// 		y));

	shape_text = new ShapeWipeShape(plugin, 
		this, 
		x, 
		y, 
		150,
		200);
	shape_text->create_objects();
	x += shape_text->get_w() + widget_border;
	add_subwindow(new ShapeWipeTumble(plugin, 
		this, 
		x, 
		y));
	x = window_border;
	y += shape_text->get_h() + widget_border;

	ShapeWipeAntiAlias *anti_alias;
	add_subwindow(anti_alias = new ShapeWipeAntiAlias(
		plugin, 
		this,
		x,
		y));
	y += anti_alias->get_h() + widget_border;
	ShapeWipePreserveAspectRatio *aspect_ratio;
	add_subwindow(aspect_ratio = new ShapeWipePreserveAspectRatio(
		plugin, 
		this,
		x,
		y));
	y += aspect_ratio->get_h() + widget_border;

	show_window();
	unlock_window();
}
Ejemplo n.º 21
0
void MotionWindow::create_objects()
{
	int x1 = 10, x = 10, y = 10;
	int x2 = 310;
	BC_Title *title;



	add_subwindow(global = new MotionGlobal(plugin,
		this,
		x1,
		y));

	add_subwindow(rotate = new MotionRotate(plugin,
		this,
		x2,
		y));
	y += 50;

	add_subwindow(title = new BC_Title(x1, 
		y, 
		_("Translation search radius:\n(W/H Percent of image)")));
	add_subwindow(global_range_w = new GlobalRange(plugin, 
		x1 + title->get_w() + 10, 
		y,
		&plugin->config.global_range_w));
	add_subwindow(global_range_h = new GlobalRange(plugin, 
		x1 + title->get_w() + 10 + global_range_w->get_w(), 
		y,
		&plugin->config.global_range_h));

	add_subwindow(title = new BC_Title(x2, 
		y, 
		_("Rotation search radius:\n(Degrees)")));
	add_subwindow(rotation_range = new RotationRange(plugin, 
		x2 + title->get_w() + 10, 
		y));

	y += 50;
	add_subwindow(title = new BC_Title(x1, 
		y, 
		_("Translation block size:\n(W/H Percent of image)")));
	add_subwindow(global_block_w = new BlockSize(plugin, 
		x1 + title->get_w() + 10, 
		y,
		&plugin->config.global_block_w));
	add_subwindow(global_block_h = new BlockSize(plugin, 
		x1 + title->get_w() + 10 + global_block_w->get_w(), 
		y,
		&plugin->config.global_block_h));

// 	add_subwindow(title = new BC_Title(x2, 
// 		y, 
// 		_("Rotation block size:\n(W/H Percent of image)")));
// 	add_subwindow(rotation_block_w = new BlockSize(plugin, 
// 		x2 + title->get_w() + 10, 
// 		y,
// 		&plugin->config.rotation_block_w));
// 	add_subwindow(rotation_block_h = new BlockSize(plugin, 
// 		x2 + title->get_w() + 10 + rotation_block_w->get_w(), 
// 		y,
// 		&plugin->config.rotation_block_h));

	y += 50;
	add_subwindow(title = new BC_Title(x1, y, _("Translation search steps:")));
	add_subwindow(global_search_positions = new GlobalSearchPositions(plugin, 
		x1 + title->get_w() + 10, 
		y, 
		80));
	global_search_positions->create_objects();

	add_subwindow(title = new BC_Title(x2, y, _("Rotation search steps:")));
	add_subwindow(rotation_search_positions = new RotationSearchPositions(plugin, 
		x2 + title->get_w() + 10, 
		y, 
		80));
	rotation_search_positions->create_objects();

	y += 50;
	add_subwindow(title = new BC_Title(x, y, _("Translation direction:")));
	add_subwindow(track_direction = new TrackDirection(plugin, 
		this, 
		x + title->get_w() + 10, 
		y));
	track_direction->create_objects();

	y += 40;
	add_subwindow(title = new BC_Title(x, y + 10, _("Block X:")));
	add_subwindow(block_x = new MotionBlockX(plugin, 
		this, 
		x + title->get_w() + 10, 
		y));
	add_subwindow(block_x_text = new MotionBlockXText(plugin, 
		this, 
		x + title->get_w() + 10 + block_x->get_w() + 10, 
		y + 10));

	add_subwindow(title = new BC_Title(x2, y, _("Rotation center:")));
	add_subwindow(rotation_center = new RotationCenter(plugin,
		x2 + title->get_w() + 10,
		y));



	int y1 = y;
	y += 50;
	add_subwindow(title = new BC_Title(x2, y + 10, _("Maximum angle offset:")));
	add_subwindow(rotate_magnitude = new MotionRMagnitude(plugin, 
		x2 + title->get_w() + 10, 
		y));

	y += 40;
	add_subwindow(title = new BC_Title(x2, y + 10, _("Rotation settling speed:")));
	add_subwindow(rotate_return_speed = new MotionRReturnSpeed(plugin,
		x2 + title->get_w() + 10, 
		y));



	y = y1;
	y += 40;
	add_subwindow(title = new BC_Title(x, y + 10, _("Block Y:")));
	add_subwindow(block_y = new MotionBlockY(plugin, 
		this, 
		x + title->get_w() + 10, 
		y));
	add_subwindow(block_y_text = new MotionBlockYText(plugin, 
		this, 
		x + title->get_w() + 10 + block_y->get_w() + 10, 
		y + 10));

	y += 50;
	add_subwindow(title = new BC_Title(x, y + 10, _("Maximum absolute offset:")));
	add_subwindow(magnitude = new MotionMagnitude(plugin, 
		x + title->get_w() + 10, 
		y));

	y += 40;
	add_subwindow(title = new BC_Title(x, y + 10, _("Motion settling speed:")));
	add_subwindow(return_speed = new MotionReturnSpeed(plugin,
		x + title->get_w() + 10, 
		y));



	y += 40;
	add_subwindow(vectors = new MotionDrawVectors(plugin,
		this,
		x,
		y));


	y += 40;
	add_subwindow(track_single = new TrackSingleFrame(plugin, 
		this,
		x, 
		y));
	add_subwindow(title = new BC_Title(x + track_single->get_w() + 20, 
		y, 
		_("Frame number:")));
	add_subwindow(track_frame_number = new TrackFrameNumber(plugin, 
		this,
		x + track_single->get_w() + title->get_w() + 20, 
		y));

	y += 20;
	add_subwindow(track_previous = new TrackPreviousFrame(plugin, 
		this,
		x, 
		y));

	y += 20;
	add_subwindow(previous_same = new PreviousFrameSameBlock(plugin, 
		this,
		x, 
		y));

	y += 40;
	y1 = y;
	add_subwindow(title = new BC_Title(x, y, _("Master layer:")));
	add_subwindow(master_layer = new MasterLayer(plugin, 
		this,
		x + title->get_w() + 10, 
		y));
	master_layer->create_objects();
	y += 30;


	add_subwindow(title = new BC_Title(x, y, _("Action:")));
	add_subwindow(action_type = new ActionType(plugin, 
		this,
		x + title->get_w() + 10, 
		y));
	action_type->create_objects();
	y += 30;




	add_subwindow(title = new BC_Title(x, y, _("Calculation:")));
	add_subwindow(tracking_type = new TrackingType(plugin, 
		this, 
		x + title->get_w() + 10, 
		y));
	tracking_type->create_objects();



	show_window();
	flush();
}
Ejemplo n.º 22
0
void
ChromaKeyWindow::create_objects ()
{
  int y = 10, y1, x1 = 0, x2 = 10;
  int x = 30;

  BC_Title *title;
  BC_Bar *bar;
  int ymargin = get_text_height(MEDIUMFONT) + 5;
  int ymargin2 = get_text_height(MEDIUMFONT) + 10;

  add_subwindow (title = new BC_Title (x2, y, _("Color:")));

  add_subwindow (color = new ChromaKeyColor (plugin, this, x, y + 25));

  add_subwindow (sample =
		 new BC_SubWindow (x + color->get_w () + 10, y, 100, 50));
  y += sample->get_h () + 10;

  add_subwindow (use_colorpicker =
		 new ChromaKeyUseColorPicker (plugin, this, x, y));
  y += use_colorpicker->get_h() + 10;
  add_subwindow (show_mask = new ChromaKeyShowMask (plugin, x2, y));
	y += show_mask->get_h() + 5;

	add_subwindow(bar = new BC_Bar(x2, y, get_w() - x2 * 2));
	y += bar->get_h() + 5;
	y1 = y;
  add_subwindow (new BC_Title (x2, y, _("Key parameters:")));
  y += ymargin;
  add_subwindow (title = new BC_Title (x, y, _("Hue Tolerance:")));
  if(title->get_w() > x1) x1 = title->get_w();
  y += ymargin;
  add_subwindow (title = new BC_Title (x, y, _("Min. Brightness:")));
  if(title->get_w() > x1) x1 = title->get_w();
  y += ymargin;
  add_subwindow (title = new BC_Title (x, y, _("Max. Brightness:")));
  if(title->get_w() > x1) x1 = title->get_w();
  y += ymargin;
  add_subwindow (title = new BC_Title (x, y, _("Saturation Offset:")));
  if(title->get_w() > x1) x1 = title->get_w();
  y += ymargin;
  add_subwindow (title = new BC_Title (x, y, _("Min Saturation:")));
  if(title->get_w() > x1) x1 = title->get_w();
  y += ymargin2;

	add_subwindow(bar = new BC_Bar(x2, y, get_w() - x2 * 2));
	y += bar->get_h() + 5;
  add_subwindow (title = new BC_Title (x2, y, _("Mask tweaking:")));
  y += ymargin;
  add_subwindow (title = new BC_Title (x, y, _("In Slope:")));
  if(title->get_w() > x1) x1 = title->get_w();
  y += ymargin;
  add_subwindow (title = new BC_Title (x, y, _("Out Slope:")));
  if(title->get_w() > x1) x1 = title->get_w();
  y += ymargin;
  add_subwindow (title = new BC_Title (x, y, _("Alpha Offset:")));
  if(title->get_w() > x1) x1 = title->get_w();
  y += ymargin2;



	add_subwindow(bar = new BC_Bar(x2, y, get_w() - x2 * 2));
	y += bar->get_h() + 5;
  add_subwindow (title = new BC_Title (x2, y, _("Spill light control:")));
  y += ymargin;
  add_subwindow (title = new BC_Title (x, y, _("Spill Threshold:")));
  if(title->get_w() > x1) x1 = title->get_w();
  y += ymargin;
  add_subwindow (title = new BC_Title (x, y, _("Spill Compensation:")));
  if(title->get_w() > x1) x1 = title->get_w();
  y += ymargin;


	y = y1;
  y += ymargin;
	x1 += x;



  add_subwindow (tolerance = new ChromaKeyTolerance (plugin, x1, y));
  y += ymargin;
  add_subwindow (min_brightness = new ChromaKeyMinBrightness (plugin, x1, y));
  y += ymargin;
  add_subwindow (max_brightness = new ChromaKeyMaxBrightness (plugin, x1, y));
  y += ymargin;
  add_subwindow (saturation = new ChromaKeySaturation (plugin, x1, y));
  y += ymargin;
  add_subwindow (min_saturation = new ChromaKeyMinSaturation (plugin, x1, y));
  y += ymargin;

	y += bar->get_h() + 5;
  y += ymargin2;
  add_subwindow (in_slope = new ChromaKeyInSlope (plugin, x1, y));
  y += ymargin;
  add_subwindow (out_slope = new ChromaKeyOutSlope (plugin, x1, y));
  y += ymargin;
  add_subwindow (alpha_offset = new ChromaKeyAlphaOffset (plugin, x1, y));
   y += ymargin;

	y += bar->get_h() + 5;
  y += ymargin2;
  add_subwindow (spill_threshold = new ChromaKeySpillThreshold (plugin, x1, y));
  y += ymargin;
  add_subwindow (spill_amount = new ChromaKeySpillAmount (plugin, x1, y));

  color_thread = new ChromaKeyColorThread (plugin, this);

  update_sample ();
  show_window ();
}
Ejemplo n.º 23
0
void ParametricWindow::create_objects()
{
	int y = 35;
SET_TRACE	
	
	add_subwindow(new BC_Title(X1, 10, _("Freq")));
	add_subwindow(new BC_Title(X2, 10, _("Qual")));
	add_subwindow(new BC_Title(X3, 10, _("Level")));
	add_subwindow(new BC_Title(X4, 10, _("Mode")));
	for(int i = 0; i < BANDS; i++)
	{
		bands[i] = new ParametricBandGUI(plugin, this, 10, y, i);
		bands[i]->create_objects();
		y += 50;
	}

SET_TRACE	
	BC_Title *title;
	int x = plugin->get_theme()->widget_border;
	add_subwindow(title = new BC_Title(x, y + 10, _("Wetness:")));
	x += title->get_w() + plugin->get_theme()->widget_border;
	add_subwindow(wetness = new ParametricWetness(plugin, 
		x, 
		y));
	x += wetness->get_w() + plugin->get_theme()->widget_border;

	add_subwindow(title = new BC_Title(x, y + 10, _("Window:")));
	x += title->get_w() + plugin->get_theme()->widget_border;
	add_subwindow(size = new ParametricSize(this, 
		plugin, 
		x, 
		y + 10));
	size->create_objects();
	size->update(plugin->config.window_size);



	y += 50;
	int canvas_x = 30;
	int canvas_y = y;
	int canvas_w = get_w() - canvas_x - 10;
	int canvas_h = get_h() - canvas_y - 30;
	add_subwindow(canvas = new BC_SubWindow(canvas_x, 
		canvas_y, 
		canvas_w, 
		canvas_h, 
		BLACK));

SET_TRACE	
// Draw canvas titles
	set_font(SMALLFONT);
#define MAJOR_DIVISIONS 4
#define MINOR_DIVISIONS 5
	for(int i = 0; i <= MAJOR_DIVISIONS; i++)
	{
		int y1 = canvas_y + canvas_h - i * (canvas_h / MAJOR_DIVISIONS) - 2;
		int y2 = y1 + 3;
		int x1 = canvas_x - 25;
		int x2 = canvas_x - 10;
		int x3 = canvas_x - 2;

		char string[BCTEXTLEN];
		if(i == 0)
			sprintf(string, "oo");
		else
			sprintf(string, "%d", i * 5 - 5);

		set_color(BLACK);
		draw_text(x1 + 1, y2 + 1, string);
		draw_line(x2 + 1, y1 + 1, x3 + 1, y1 + 1);
		set_color(RED);
		draw_text(x1, y2, string);
		draw_line(x2, y1, x3, y1);

		if(i < MAJOR_DIVISIONS)
		{
			for(int j = 1; j < MINOR_DIVISIONS; j++)
			{
				int y3 = y1 - j * (canvas_h / MAJOR_DIVISIONS) / MINOR_DIVISIONS;
				int x4 = x3 - 5;
				set_color(BLACK);
				draw_line(x4 + 1, y3 + 1, x3 + 1, y3 + 1);
				set_color(RED);
				draw_line(x4, y3, x3, y3);
			}
		}
	}

SET_TRACE	
#undef MAJOR_DIVISIONS
#define MAJOR_DIVISIONS 5
	for(int i = 0; i <= MAJOR_DIVISIONS; i++)
	{
		int freq = Freq::tofreq(i * TOTALFREQS / MAJOR_DIVISIONS);
		int x1 = canvas_x + i * canvas_w / MAJOR_DIVISIONS;
		int y1 = canvas_y + canvas_h + 20;
		char string[BCTEXTLEN];
		sprintf(string, "%d", freq);
		int x2 = x1 - get_text_width(SMALLFONT, string);
		int y2 = y1 - 10;
		int y3 = y2 - 5;
		int y4 = canvas_y + canvas_h;
		
		set_color(BLACK);
		draw_text(x2 + 1, y1 + 1, string);
		draw_line(x1 + 1, y4 + 1, x1 + 1, y2 + 1);
		set_color(RED);
		draw_text(x2, y1, string);
		draw_line(x1, y4, x1, y2);

		if(i < MAJOR_DIVISIONS)
		{
#undef MINOR_DIVISIONS
#define MINOR_DIVISIONS 5
			for(int j = 0; j < MINOR_DIVISIONS; j++)
			{
				int x3 = (int)(x1 + 
					(canvas_w / MAJOR_DIVISIONS) -
					exp(-(double)j * 0.7) * 
					(canvas_w / MAJOR_DIVISIONS));
				set_color(BLACK);
				draw_line(x3 + 1, y4 + 1, x3 + 1, y3 + 1);
				set_color(RED);
				draw_line(x3, y4, x3, y3);
			}
		}
	}

SET_TRACE	
	update_canvas();
	show_window();
SET_TRACE	
}
Ejemplo n.º 24
0
void RecordGUI::create_objects()
{
	char string[BCTEXTLEN];
	flash_color = RED;

	lock_window("RecordGUI::create_objects");
	status_thread = new RecordStatusThread(mwindow, this);
	status_thread->start();
	set_icon(mwindow->theme->get_image("record_icon"));

	mwindow->theme->get_recordgui_sizes(this, get_w(), get_h());
//printf("RecordGUI::create_objects 1\n");
	mwindow->theme->draw_rwindow_bg(this);


	monitor_video = 0;
	monitor_audio = 0;
	total_dropped_frames = 0;
	batch_list = 0;
	update_batches();
	modes.append(new BC_ListBoxItem(Batch::mode_to_text(RECORD_INFINITE)));
	modes.append(new BC_ListBoxItem(Batch::mode_to_text(RECORD_TIMED)));
//	modes.append(new BC_ListBoxItem(Batch::mode_to_text(RECORD_LOOP)));
//	modes.append(new BC_ListBoxItem(Batch::mode_to_text(RECORD_SCENETOSCENE)));

	int x = 10;
	int y = 10;
	int x1 = 0;
	BC_Title *title;
	int pad = MAX(BC_TextBox::calculate_h(this, MEDIUMFONT, 1, 1), 
		BC_Title::calculate_h(this, "X")) + 5;
	int button_y = 0;

// Curent batch
	add_subwindow(title = new BC_Title(x, y, _("Path:")));
	x1 = MAX(title->get_w(), x1);
	y += pad;
	add_subwindow(title = new BC_Title(x, y, _("Start time:")));
	x1 = MAX(title->get_w(), x1);
	y += pad;
	add_subwindow(title = new BC_Title(x, y, _("Duration time:")));
	x1 = MAX(title->get_w(), x1);
	y += pad;
	add_subwindow(title = new BC_Title(x, y, _("Source:")));
	x1 = MAX(title->get_w(), x1);
	y += pad;
	add_subwindow(title = new BC_Title(x, y, _("Mode:")));
	x1 = MAX(title->get_w(), x1);
	y += pad;
	add_subwindow(title = new BC_Title(x, y, _("Transport:")));
	x1 = MAX(title->get_w(), x1);
	y += pad;

	button_y = MAX(y, button_y);



	int x2 = 0;
	y = 10;
	x = x1 + 20;
	add_subwindow(batch_path = new RecordPath(mwindow, record, x, y));
	add_subwindow(batch_browse = new BrowseButton(mwindow, 
		this, 
		batch_path, 
		batch_path->get_x() + batch_path->get_w(), 
		y,
		record->default_asset->path,
		PROGRAM_NAME ": Record path",
		_("Select a file to record to:"),
		0));
	x2 = MAX(x2, batch_path->get_w() + batch_browse->get_w());
	y += pad;
	batch_start = new RecordStart(mwindow, record, x, y);
	batch_start->create_objects();
	x2 = MAX(x2, batch_start->get_w());
	y += pad;
	batch_duration = new RecordDuration(mwindow, record, x, y);
	batch_duration->create_objects();
	x2 = MAX(x2, batch_duration->get_w());
	y += pad;
	batch_source = new RecordSource(mwindow, record, this, x, y);
	batch_source->create_objects();
	x2 = MAX(x2, batch_source->get_w());
	y += pad;
	batch_mode = new RecordMode(mwindow, record, this, x, y);
	batch_mode->create_objects();
	x2 = MAX(x2, batch_mode->get_w());
	y += pad;
	record_transport = new RecordTransport(mwindow, 
		record, 
		this, 
		x,
		y);
	record_transport->create_objects();
	x2 = MAX(x2, record_transport->get_w());




// Compression settings
	x = x2 + x1 + 30;
	y = 10;
	int x3 = 0;
	pad = BC_Title::calculate_h(this, "X") + 5;
	add_subwindow(title = new BC_Title(x, y, _("Format:")));
	x3 = MAX(title->get_w(), x3);
	y += pad;

	if(record->default_asset->audio_data)
	{
		add_subwindow(title = new BC_Title(x, y, _("Audio compression:")));
		x3 = MAX(title->get_w(), x3);
		y += pad;
		add_subwindow(title = new BC_Title(x, y, _("Samplerate:")));
		x3 = MAX(title->get_w(), x3);
		y += pad;
		add_subwindow(title = new BC_Title(x, y, _("Clipped samples:")));
		x3 = MAX(title->get_w(), x3);
		y += pad;
	}

	if(record->default_asset->video_data)
	{
		add_subwindow(title = new BC_Title(x, y, _("Video compression:")));
		x3 = MAX(title->get_w(), x3);
		y += pad;
		add_subwindow(title = new BC_Title(x, y, _("Framerate:")));
		x3 = MAX(title->get_w(), x3);
		y += pad;
		add_subwindow(title = new BC_Title(x, y, _("Frames behind:")));
		x3 = MAX(title->get_w(), x3);
		y += pad;
	}

	add_subwindow(title = new BC_Title(x, y, _("Position:")));
	x3 = MAX(title->get_w(), x3);
	y += pad;
	add_subwindow(title = new BC_Title(x, y, _("Prev label:")));
	x3 = MAX(title->get_w(), x3);
	y += pad;

	button_y = MAX(y, button_y);
	y = 10;
	x = x3 + x2 + x1 + 40;

	add_subwindow(new BC_Title(x, 
		y, 
		File::formattostr(mwindow->plugindb, 
			record->default_asset->format), 
		MEDIUMFONT, 
		mwindow->theme->recordgui_fixed_color));
	y += pad;

	if(record->default_asset->audio_data)
	{
		add_subwindow(new BC_Title(x, 
			y, 
			FileMOV::compressiontostr(record->default_asset->acodec),
//			File::bitstostr(record->default_asset->bits), 
			MEDIUMFONT, 
			mwindow->theme->recordgui_fixed_color));

		y += pad;
		sprintf(string, "%d", record->default_asset->sample_rate);
		add_subwindow(new BC_Title(x, 
			y, 
			string, 
			MEDIUMFONT, 
			mwindow->theme->recordgui_fixed_color));

		y += pad;
		add_subwindow(samples_clipped = new BC_Title(x, 
			y, 
			"0", 
			MEDIUMFONT, 
			mwindow->theme->recordgui_variable_color));
		y += pad;
	}

	if(record->default_asset->video_data)
	{
		add_subwindow(new BC_Title(x, 
			y, 
			FileMOV::compressiontostr(record->default_asset->vcodec), 
			MEDIUMFONT, 
			mwindow->theme->recordgui_fixed_color));
	
		y += pad;
		sprintf(string, "%0.2f", record->default_asset->frame_rate);
		add_subwindow(new BC_Title(x, 
			y, 
			string, 
			MEDIUMFONT, 
			mwindow->theme->recordgui_fixed_color));
	
		y += pad;
		add_subwindow(frames_dropped = new BC_Title(x, 
			y, 
			"0", 
			MEDIUMFONT, 
			mwindow->theme->recordgui_variable_color));
		y += pad;
	}

	add_subwindow(position_title = new BC_Title(x, 
		y, 
		"", 
		MEDIUMFONT, 
		mwindow->theme->recordgui_variable_color));

	y += pad;
	add_subwindow(prev_label_title = new BC_Title(x, 
		y, 
		_("None"), 
		MEDIUMFONT, 
		mwindow->theme->recordgui_variable_color));

	y += pad + 10;
	button_y = MAX(y, button_y);
	
	
	







// Buttons
	x = 10;
	y = button_y;


	add_subwindow(title = new BC_Title(x,y, _("Batches:")));
	x += title->get_w() + 5;
	add_subwindow(activate_batch = new RecordGUIActivateBatch(mwindow, record, x, y));
	x += activate_batch->get_w();
	add_subwindow(start_batches = new RecordGUIStartBatches(mwindow, record, x, y));
	x += start_batches->get_w();
	add_subwindow(delete_batch = new RecordGUIDeleteBatch(mwindow, record, x, y));
	x += delete_batch->get_w();
	add_subwindow(new_batch = new RecordGUINewBatch(mwindow, record, x, y));
	x += new_batch->get_w();
	add_subwindow(label_button = new RecordGUILabel(mwindow, record, x, y));



	x = 10;
	y += MAX(label_button->get_h(), record_transport->get_h()) + 5;

	fill_frames = 0;
	monitor_video = 0;
	monitor_audio = 0;
	if(record->default_asset->video_data) 
	{
		add_subwindow(fill_frames = new RecordGUIFillFrames(mwindow, record, x, y));
		x += fill_frames->get_w() + 5;
		add_subwindow(monitor_video = new RecordGUIMonitorVideo(mwindow, record, x, y));
		x += monitor_video->get_w() + 5;
	}

	if(record->default_asset->audio_data) 
		add_subwindow(monitor_audio = new RecordGUIMonitorAudio(mwindow, record, x, y));

// Batches
	x = 10;
	y += 5;
	if(fill_frames) y += 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;


	add_subwindow(batch_list = new RecordGUIBatches(record, 
		this, 
		x, 
		y,
		get_w() - 20,
		get_h() - y - bottom_margin - 10));
	y += batch_list->get_h() + 5;

// Controls
	int loadmode_w = LoadMode::calculate_w(this, mwindow->theme, 1, 0);
	load_mode = new LoadMode(mwindow,
		this, 
		get_w() / 2 - loadmode_w / 2, 
		y, 
		&record->load_mode, 
		1,
		0);
	load_mode->create_objects();
	y += load_mode->get_h() + 5;

	add_subwindow(new RecordGUIOK(record, this));

	interrupt_thread = new EndRecordThread(record, this);
//	add_subwindow(new RecordGUISave(record, this));
	add_subwindow(new RecordGUICancel(record, this));

	startover_thread = new RecordStartoverThread(record, this);

	unlock_window();
}
Ejemplo n.º 25
0
void InterfacePrefs::create_objects()
{
	int x, y;
	BC_Resources *resources = BC_WindowBase::get_resources();
	int margin = mwindow->theme->widget_border;
	char string[BCTEXTLEN];
	x = mwindow->theme->preferencesoptions_x;
	y = mwindow->theme->preferencesoptions_y;

	add_subwindow(new BC_Title(x, y, 
		_("Time Format"), 
		LARGEFONT, 
		resources->text_default));

	y += get_text_height(LARGEFONT) + 5;


	add_subwindow(hms = new TimeFormatHMS(pwindow, this, 
		pwindow->thread->edl->session->time_format == TIME_HMS, 
		x, y));
	y += 20;
	add_subwindow(hmsf = new TimeFormatHMSF(pwindow, this, 
		pwindow->thread->edl->session->time_format == TIME_HMSF, 
		x, y));
	y += 20;
	add_subwindow(samples = new TimeFormatSamples(pwindow, this, 
		pwindow->thread->edl->session->time_format == TIME_SAMPLES, 
		x, y));
	y += 20;
	add_subwindow(hex = new TimeFormatHex(pwindow, this, 
		pwindow->thread->edl->session->time_format == TIME_SAMPLES_HEX, 
		x, y));
	y += 20;
	add_subwindow(frames = new TimeFormatFrames(pwindow, this, 
		pwindow->thread->edl->session->time_format == TIME_FRAMES, 
		x, y));
	y += 20;
	int x1 = x;
	add_subwindow(feet = new TimeFormatFeet(pwindow, this, 
		pwindow->thread->edl->session->time_format == TIME_FEET_FRAMES, 
		x1, y));
	x1 += feet->get_w() + margin;
	BC_Title *title;
	add_subwindow(title = new BC_Title(x1, y, _("Frames per foot:")));
	x1 += title->get_w() + margin;
	sprintf(string, "%0.2f", pwindow->thread->edl->session->frames_per_foot);
	add_subwindow(new TimeFormatFeetSetting(pwindow, 
		x1, y - 5, 	string));
	y += 20;
	add_subwindow(seconds = new TimeFormatSeconds(pwindow, this, 
		pwindow->thread->edl->session->time_format == TIME_SECONDS, 
		x, y));

	y += 35;
	add_subwindow(new UseTipWindow(pwindow, x, y));
	add_subwindow(new UseWarnIndecies(pwindow, x+200, y));

	y += 35;
	add_subwindow(new BC_Bar(5, y, 	get_w() - 10));
	y += 5;

	add_subwindow(new BC_Title(x, y, _("Index files"), LARGEFONT, resources->text_default));


	y += 25;
	add_subwindow(new BC_Title(x, y + 5, 
		_("Index files go here:"), MEDIUMFONT, resources->text_default));
	add_subwindow(ipathtext = new IndexPathText(x + 230, y, 
		pwindow, 
		pwindow->thread->preferences->index_directory));
	add_subwindow(ipath = new BrowseButton(mwindow, this,
		ipathtext, 
		x + 230 + ipathtext->get_w(), y, 
		pwindow->thread->preferences->index_directory,
		_("Index Path"), 
		_("Select the directory for index files"),
		1));

	y += 30;
	add_subwindow(new BC_Title(x, y + 5, 
		_("Size of index file:"), 
		MEDIUMFONT, 
		resources->text_default));
	sprintf(string, "" _LD "", pwindow->thread->preferences->index_size);
	x1 = x + 230;
	add_subwindow(isize = new IndexSize(x + 230, y, pwindow, string));
	add_subwindow(new ScanCommercials(pwindow, 350,y));
	y += 30;
	add_subwindow(new BC_Title(x, y + 5, _("Number of index files to keep:"), MEDIUMFONT, resources->text_default));
	sprintf(string, "%ld", (long)pwindow->thread->preferences->index_count);
	add_subwindow(icount = new IndexCount(x + 230, y, pwindow, string));
	add_subwindow(deleteall = new DeleteAllIndexes(mwindow, pwindow, 350, y));





	y += 35;
	add_subwindow(new BC_Bar(5, y, 	get_w() - 10));
	y += 5;

	add_subwindow(new BC_Title(x, y, _("Editing"), LARGEFONT, resources->text_default));

	y += 35;

	add_subwindow(thumbnails = new ViewThumbnails(x, y, pwindow));

	int x2 = x + 320, y2 = y;
	AndroidRemote *android_remote = new AndroidRemote(pwindow, x2, y2);
	add_subwindow(android_remote);
	y2 += android_remote->get_h() + 10;
	add_subwindow(title = new BC_Title(x2, y2, _("Port:")));
	int x3 = x2 + title->get_w() + margin;
	AndroidPort *android_port = new AndroidPort(pwindow, x3, y2);
	add_subwindow(android_port);
	y2 += title->get_h() + 10;
	add_subwindow(title = new BC_Title(x2, y2, _("PIN:")));
	AndroidPIN *android_pin = new AndroidPIN(pwindow, x3, y2);
	add_subwindow(android_pin);

	y += 35;
	add_subwindow(new BC_Title(x, y, _("Clicking on edit boundaries does what:")));
	y += 25;
	add_subwindow(new BC_Title(x, y, _("Button 1:")));
	
	ViewBehaviourText *text;
	add_subwindow(text = new ViewBehaviourText(80, y - 5, 
		behavior_to_text(pwindow->thread->edl->session->edit_handle_mode[0]), 
			pwindow, 
			&(pwindow->thread->edl->session->edit_handle_mode[0])));
	text->create_objects();
	y += 30;
	add_subwindow(new BC_Title(x, y, _("Button 2:")));
	add_subwindow(text = new ViewBehaviourText(80, 
		y - 5, 
		behavior_to_text(pwindow->thread->edl->session->edit_handle_mode[1]), 
			pwindow, 
			&(pwindow->thread->edl->session->edit_handle_mode[1])));
	text->create_objects();
	y += 30;
	add_subwindow(new BC_Title(x, y, _("Button 3:")));
	add_subwindow(text = new ViewBehaviourText(80, 
		y - 5, 
		behavior_to_text(pwindow->thread->edl->session->edit_handle_mode[2]), 
			pwindow, 
			&(pwindow->thread->edl->session->edit_handle_mode[2])));
	text->create_objects();

	y += 40;
	x1 = x;
	add_subwindow(title = new BC_Title(x, y + 5, _("Min DB for meter:")));
	x += title->get_w() + 10;
	sprintf(string, "%d", pwindow->thread->edl->session->min_meter_db);
	add_subwindow(min_db = new MeterMinDB(pwindow, string, x, y));

	x += min_db->get_w() + 10;
	add_subwindow(title = new BC_Title(x, y + 5, _("Max DB:")));
	x += title->get_w() + 10;
	sprintf(string, "%d", pwindow->thread->edl->session->max_meter_db);
	add_subwindow(max_db = new MeterMaxDB(pwindow, string, x, y));

	x = x1;
	y += 30;
	ViewTheme *theme;
	add_subwindow(new BC_Title(x, y, _("Theme:")));
	x += 60;
	add_subwindow(theme = new ViewTheme(x, y, pwindow));
	theme->create_objects();

}
Ejemplo n.º 26
0
void LensGUI::create_objects()
{
	int x = 10;
	int y = 10;
	int x1;
	BC_Title *title;
	LensToggle *toggle;
	
	for(int i = 0; i < FOV_CHANNELS; i++)
	{
		switch(i)
		{
			case 0: add_tool(title = new BC_Title(x, y, _("R Field of View:"))); break;
			case 1: add_tool(title = new BC_Title(x, y, _("G Field of View:"))); break;
			case 2: add_tool(title = new BC_Title(x, y, _("B Field of View:"))); break;
			case 3: add_tool(title = new BC_Title(x, y, _("A Field of View:"))); break;
		}

		y += title->get_h() + 5;
		add_tool(fov_slider[i] = new LensSlider(client, 
			this,
			0,
			&client->config.fov[i], 
			x, 
			y, 
			0.0001,
			1.0));
		x1 = x + fov_slider[i]->get_w() + 5;
		add_tool(fov_text[i] = new LensText(client, 
			this,
			fov_slider[i],
			&client->config.fov[i], 
			x1, 
			y));
		fov_slider[i]->text = fov_text[i];
		y += fov_text[i]->get_h() + 5;
	}

	add_tool(toggle = new LensToggle(client, 
		&client->lock, 
		x, 
		y,
		"Lock"));
	y += toggle->get_h() + 10;
	
	BC_Bar *bar;
	add_tool(bar = new BC_Bar(x, y, get_w() - x * 2));
	y += bar->get_h() + 5;

	add_tool(title = new BC_Title(x, y, _("Aspect Ratio:")));
	y += title->get_h() + 5;
	add_tool(aspect_slider = new LensSlider(client, 
		this,
		0,
		&client->config.aspect, 
		x, 
		y, 
		0.333,
		3.0));
	x1 = x + aspect_slider->get_w() + 5;
	add_tool(aspect_text = new LensText(client, 
		this,
		aspect_slider,
		&client->config.aspect, 
		x1, 
		y));
	aspect_slider->text = aspect_text;
	y += aspect_text->get_h() + 5;


	add_tool(title = new BC_Title(x, y, _("Radius:")));
	y += title->get_h() + 5;
	add_tool(radius_slider = new LensSlider(client, 
		this,
		0,
		&client->config.radius, 
		x, 
		y, 
		0.333,
		3.0));
	x1 = x + radius_slider->get_w() + 5;
	add_tool(radius_text = new LensText(client, 
		this,
		radius_slider,
		&client->config.radius, 
		x1, 
		y));
	radius_slider->text = radius_text;
	y += radius_text->get_h() + 5;


	add_tool(title = new BC_Title(x, y, _("Center X:")));
	y += title->get_h() + 5;
	add_tool(centerx_slider = new LensSlider(client, 
		this,
		0,
		&client->config.center_x, 
		x, 
		y, 
		0.0,
		99.0));
	x1 = x + centerx_slider->get_w() + 5;
	add_tool(centerx_text = new LensText(client, 
		this,
		centerx_slider,
		&client->config.center_x, 
		x1, 
		y));
	centerx_slider->text = centerx_text;
	centerx_slider->set_precision(1.0);
	y += centerx_text->get_h() + 5;


	add_tool(title = new BC_Title(x, y, _("Center Y:")));
	y += title->get_h() + 5;
	add_tool(centery_slider = new LensSlider(client, 
		this,
		0,
		&client->config.center_y, 
		x, 
		y, 
		0.0,
		99.0));
	x1 = x + centery_slider->get_w() + 5;
	add_tool(centery_text = new LensText(client, 
		this,
		centery_slider,
		&client->config.center_y, 
		x1, 
		y));
	centery_slider->text = centery_text;
	centery_slider->set_precision(1.0);
	y += centery_text->get_h() + 10;

	add_tool(bar = new BC_Bar(x, y, get_w() - x * 2));
	y += bar->get_h() + 5;


// 	add_tool(reverse = new LensToggle(client, 
// 		&client->config.reverse, 
// 		x, 
// 		y,
// 		_("Reverse")));
// 	y += reverse->get_h() + 5;

	add_tool(draw_guides = new LensToggle(client, 
		&client->config.draw_guides, 
		x, 
		y,
		_("Draw center")));
	y += draw_guides->get_h() + 5;

	
	add_tool(title = new BC_Title(x, y, _("Mode:")));
	add_tool(mode = new LensMode(client, 
		this, 
		x + title->get_w() + 5, 
		y));
	mode->create_objects();
	y += mode->get_h() + 5;


// 	add_tool(title = new BC_Title(x, y, _("Preset:")));
// 	add_tool(presets = new LensPresets(client, 
// 		this, 
// 		x + title->get_w() + 5, 
// 		y,
// 		get_w() - x - title->get_w() - 50));
// 	presets->create_objects();
// 	y += presets->get_h() + 5;
// 
// 	add_tool(save_preset = new LensSavePreset(client,
// 		this,
// 		x, 
// 		y));
// 	add_tool(preset_text = new LensPresetText(client,
// 		this,
// 		x + save_preset->get_w() + 5,
// 		y,
// 		get_w() - x - save_preset->get_w() - 10));
// 	y += preset_text->get_h() + 5;
// 	add_tool(delete_preset = new LensDeletePreset(client,
// 		this,
// 		x,
// 		y));

	show_window();
	flush();
}
Ejemplo n.º 27
0
int RecordPrefs::create_objects()
{
	int x, y, x2;
	char string[BCTEXTLEN];
	BC_Resources *resources = BC_WindowBase::get_resources();
	BC_Title *title;
	BC_WindowBase *win;
	int maxw, curw, ybix[5];

	x = mwindow->theme->preferencesoptions_x;
	y = mwindow->theme->preferencesoptions_y;

	add_subwindow(title = new BC_Title(x, 
		y, 
		_("File Format:"), 
		LARGEFONT, 
		resources->text_default));
	y += title->get_h() + 5;

	recording_format = 
		new FormatTools(mwindow,
			this, 
			pwindow->thread->edl->session->recording_format);
	recording_format->create_objects(x, 
		y, 
		1,  // Include tools for audio
		1,  // Include tools for video
		1,  // Include checkbox for audio
		1,  // Include checkbox for video
		0,
		1,
		0,  // Select compressors to be offered
		1,  // Prompt for recording options
		0,  // If nonzero, prompt for insertion strategy
		0, // Supply file formats for background rendering
		1); // Horizontal layout




// Audio hardware
	add_subwindow(new BC_Bar(5, y, get_w() - 10));
	y += 5;


	add_subwindow(title = new BC_Title(x, 
		y, 
		_("Audio In"), 
		LARGEFONT, 
		resources->text_default));

	y += title->get_h();

	win = add_subwindow(new BC_Title(x, y, _("Record Driver:"), MEDIUMFONT, resources->text_default));
	y += win->get_h();
	audio_in_device = new ADevicePrefs(x + 55,
		y, 
		pwindow, 
		this, 
		0,
		pwindow->thread->edl->session->aconfig_in, 
		MODERECORD);
	audio_in_device->initialize(1);
	y += audio_in_device->get_h(1);


	BC_TextBox *textbox;
	BC_Title *title1, *title2, *title3;

	ybix[0] = y;
	add_subwindow(title1 = new BC_Title(x, y, _("Samples to write to disk at a time:")));
	ybix[1] = y += title1->get_h() + 8;
	add_subwindow(title2 = new BC_Title(x, y, _("Sample rate for recording:")));
	ybix[2] = y += title2->get_h() + 8;
	add_subwindow(title3 = new BC_Title(x, y, _("Channels to record:")));
	x2 = MAX(title1->get_w(), title2->get_w()) + 10;
	x2 = MAX(x2, title3->get_w() + 10);

	sprintf(string, "%jd", pwindow->thread->edl->session->record_write_length);
	add_subwindow(textbox = new RecordWriteLength(mwindow, 
		pwindow, 
		x2, 
		ybix[0],
		string));

	add_subwindow(textbox = new SampleRateSelection(x2, ybix[1], this,
		&pwindow->thread->edl->session->aconfig_in->in_samplerate));
		textbox->update(pwindow->thread->edl->session->aconfig_in->in_samplerate);

	RecordChannels *channels = new RecordChannels(pwindow, this, x2, ybix[2]);
	channels->create_objects();

	y += title3->get_h() + 15;
	x = 5;



// Video hardware
	add_subwindow(new BC_Bar(5, y, get_w() - 10));
	y += 5;


	win = add_subwindow(new BC_Title(x, y, _("Video In"), LARGEFONT, resources->text_default));
	y += win->get_h();

	win = add_subwindow(new BC_Title(x,
		y, 
		_("Record Driver:"), 
		MEDIUMFONT, 
		resources->text_default));
	y += win->get_h() + 5;
	video_in_device = new VDevicePrefs(x + 55,
		y, 
		pwindow, 
		this, 
		0, 
		pwindow->thread->edl->session->vconfig_in, 
		MODERECORD);
	video_in_device->initialize(1);

	ybix[0] = y += 50;
	win = add_subwindow(new BC_Title(x, y, _("Frames to record to disk at a time:")));
	ybix[1] = y += win->get_h() + 8;
	maxw = win->get_w();

	win = add_subwindow(new BC_Title(x, y, _("Frames to buffer in device:")));
	y += win->get_h() + 8;
	if((curw = win->get_w()) > maxw)
		maxw = curw;

	win = add_subwindow(new RecordSoftwareTimer(pwindow,
		pwindow->thread->edl->session->record_software_position, 
		x, 
		y));
	y += win->get_h();
	win = add_subwindow(new RecordSyncDrives(pwindow,
		pwindow->thread->edl->session->record_sync_drives, 
		x, 
		y));
	ybix[2] = y += win->get_h() + 5;

	win = add_subwindow(new BC_Title(x, y, _("Size of captured frame:")));
	ybix[3] = y += win->get_h() + 8;
	if((curw = win->get_w()) > maxw)
		maxw = curw;

	win = add_subwindow(new BC_Title(x, y, _("Frame rate for recording:")));
	ybix[4] = y += win->get_h() + 15;
	if((curw = win->get_w()) > maxw)
		maxw = curw;
	maxw += x + 10;

// Frames to record to disk at a time
	sprintf(string, "%d", pwindow->thread->edl->session->video_write_length);
	add_subwindow(textbox = new VideoWriteLength(pwindow, string, maxw, ybix[0]));
	add_subwindow(new CaptureLengthTumbler(pwindow, textbox, textbox->get_x() + textbox->get_w(), ybix[0]));
// Frames to buffer in device
	sprintf(string, "%d", pwindow->thread->edl->session->vconfig_in->capture_length);
	add_subwindow(textbox = new VideoCaptureLength(pwindow, string, maxw, ybix[1]));
	add_subwindow(new CaptureLengthTumbler(pwindow, textbox, textbox->get_x() + textbox->get_w(), ybix[1]));

// Size of captured frame
	BC_TextBox *w_text, *h_text;
	x = maxw;
	y = ybix[2];
	FrameSizeSelection *fselector;
	add_subwindow(fselector = new FrameSizeSelection(x, y,
		x + SELECTION_TB_WIDTH + 12, y, this,
		&pwindow->thread->edl->session->vconfig_in->w,
		&pwindow->thread->edl->session->vconfig_in->h));
	fselector->update(pwindow->thread->edl->session->vconfig_in->w,
		pwindow->thread->edl->session->vconfig_in->h);
	y = ybix[3];
	x = maxw;
	add_subwindow(textbox = new FrameRateSelection(x, y, this,
		&pwindow->thread->edl->session->vconfig_in->in_framerate));
	textbox->update(pwindow->thread->edl->session->vconfig_in->in_framerate);
	y = ybix[4];
	x = 5;

	add_subwindow(new BC_Bar(5, y,  get_w() - 10));
	y += 5;

	add_subwindow(new BC_Title(x, y, _("Images"), LARGEFONT, get_resources()->text_default));
	y += 25;
	win = add_subwindow(new StillImageUseDuration(pwindow,
		pwindow->thread->edl->session->si_useduration, 
		x, 
		y));
	x += win->get_w() + 10;
	win = add_subwindow(new StillImageDuration(pwindow, x, y));
	x += win->get_w() + 10;
	y += 3;
	add_subwindow(new BC_Title(x, y, _("Seconds")));

	return 0;
}