Пример #1
0
void TimeBar::draw_range()
{
 	int x1 = 0, x2 = get_w();


//printf("TimeBar::draw_range %d %p\n", __LINE__, get_edl());
 	if(get_edl())
 	{
// 		get_preview_pixels(x1, x2);
// 
// //printf("TimeBar::draw_range %f %d %d\n", edl_length, x1, x2);
// 		draw_3segmenth(0, 0, x1, mwindow->theme->timebar_view_data);
 		draw_top_background(get_parent(), x1, 0, x2 - x1, get_h());
// 		draw_3segmenth(x2, 0, get_w() - x2, mwindow->theme->timebar_view_data);
// 
// 		set_color(BLACK);
// 		draw_line(x1, 0, x1, get_h());
// 		draw_line(x2, 0, x2, get_h());
// 		

//  		EDL *edl = get_edl();
//  		if(edl)
//  		{
//  			int64_t pixel = position_to_pixel(
//  				edl->local_session->get_selectionstart(1));
// // Draw insertion point position if this timebar belongs to a window which 
// // has something other than the master EDL.
//  			set_color(mwindow->theme->timebar_cursor_color);
//  			draw_line(pixel, 0, pixel, get_h());
//  		}
 	}
 	else
		draw_top_background(get_parent(), 0, 0, get_w(), get_h());
}
Пример #2
0
int BC_PixmapSW::draw()
{
	draw_top_background(parent_window, 0, 0, get_w(), get_h());
	draw_pixmap(thepixmap);
	flash();
	return 0;
}
Пример #3
0
int BC_ProgressBar::draw(int force, int flush)
{
	char string[32];
	int new_pixel;

	new_pixel = (int)(((float)position / length) * get_w());

	if(new_pixel != pixel || force)
	{
		pixel = new_pixel;
// Clear background
		draw_top_background(parent_window, 0, 0, get_w(), get_h());
		draw_3segmenth(0, 0, pixel, 0, get_w(), images[PROGRESS_HI]);
		draw_3segmenth(pixel, 0, get_w() - pixel, 0, get_w(), images[PROGRESS_UP]);


		if(do_text)
		{
			set_font(MEDIUMFONT);
			set_color(get_resources()->progress_text);     // draw decimal percentage
			sprintf(string, "%d%%", (int)(100 * (float)position / length + 0.5 / w));
			draw_center_text(w / 2, h / 2 + get_text_ascent(MEDIUMFONT) / 2, string);
		}
		flash(flush);
	}
	return 0;
}
Пример #4
0
int MButtons::resize_event()
{
	reposition_window(mwindow->theme->mbuttons_x, 
 		mwindow->theme->mbuttons_y, 
		mwindow->theme->mbuttons_w, 
		mwindow->theme->mbuttons_h);
	draw_top_background(get_parent(), 0, 0, get_w(), get_h());
	flash(0);
}
Пример #5
0
void ZoomBar::create_objects()
{
	int x = 3;
	int y = get_h() / 2 - 
		mwindow->theme->get_image_set("zoombar_menu", 0)[0]->get_h() / 2;

	draw_top_background(get_parent(), 0, 0, get_w(), get_h());
	sample_zoom = new SampleZoomPanel(mwindow, this, x, y);
	sample_zoom->set_menu_images(mwindow->theme->get_image_set("zoombar_menu", 0));
	sample_zoom->set_tumbler_images(mwindow->theme->get_image_set("zoombar_tumbler", 0));
	sample_zoom->create_objects();
	x += sample_zoom->get_w();
	amp_zoom = new AmpZoomPanel(mwindow, this, x, y);
	amp_zoom->set_menu_images(mwindow->theme->get_image_set("zoombar_menu", 0));
	amp_zoom->set_tumbler_images(mwindow->theme->get_image_set("zoombar_tumbler", 0));
	amp_zoom->create_objects();
	x += amp_zoom->get_w();
	track_zoom = new TrackZoomPanel(mwindow, this, x, y);
	track_zoom->set_menu_images(mwindow->theme->get_image_set("zoombar_menu", 0));
	track_zoom->set_tumbler_images(mwindow->theme->get_image_set("zoombar_tumbler", 0));
	track_zoom->create_objects();
	x += track_zoom->get_w() + 10;

#define DEFAULT_TEXT "000.00 - 000.00"
	add_subwindow(auto_zoom_popup = new AutoZoomPopup(
		mwindow, 
		this, 
		x, 
		y,
		get_text_width(MEDIUMFONT, DEFAULT_TEXT) + 20));
	auto_zoom_popup->create_objects();
	x += auto_zoom_popup->get_w() + 5;
// 	add_subwindow(auto_zoom_text = new BC_Title(
// 		x, 
// 		get_h() / 2 - BC_Title::calculate_h(this, "0") / 2, 
// 		DEFAULT_TEXT));
// 	x += auto_zoom_text->get_w() + 5;
	add_subwindow(auto_zoom = new AutoZoom(mwindow, this, x, y));
	update_autozoom();
	x += auto_zoom->get_w() + 5;

	add_subwindow(from_value = new FromTextBox(mwindow, this, x, y));
	x += from_value->get_w() + 5;
	add_subwindow(length_value = new LengthTextBox(mwindow, this, x, y));
	x += length_value->get_w() + 5;
	add_subwindow(to_value = new ToTextBox(mwindow, this, x, y));
	x += to_value->get_w() + 5;

	update_formatting(from_value);
	update_formatting(length_value);
	update_formatting(to_value);

	add_subwindow(playback_value = new BC_Title(x, 100, _("--"), MEDIUMFONT, RED));

	add_subwindow(zoom_value = new BC_Title(x, 100, _("--"), MEDIUMFONT, BLACK));
	update();
}
Пример #6
0
int BC_Pot::draw(int flush)
{
	int x1, y1, x2, y2;
	draw_top_background(parent_window, 0, 0, get_w(), get_h());
	draw_pixmap(images[status]);
	set_color(get_resources()->pot_needle_color);

	angle_to_coords(x1, y1, x2, y2, percentage_to_angle(get_percentage()));
	draw_line(x1, y1, x2, y2);

	flash(flush);
	return 0;
}
Пример #7
0
void BC_Pan::draw(int flash, int flush)
{
	draw_top_background(parent_window, 0, 0, w, h);

	draw_pixmap(images[highlighted ? PAN_HI : PAN_UP]);
	get_channel_positions(value_x,
		value_y,
		value_positions,
		virtual_r,
		total_values);

// draw channels
	int x1, y1;
	float scale = (float)(get_w() - PICON_W) / (virtual_r * 2);
	set_color(RED);

	for(int i = 0; i < total_values; i++)
	{
// printf("BC_Pan::draw 1 %d %d %d %d\n",
// 	i,
// 	value_positions[i],
// 	value_x[i],
// 	value_y[i]);
		x1 = (int)(value_x[i] * scale);
		y1 = (int)(value_y[i] * scale);
//printf("BC_Pan::draw 2 %d %d\n", x1, y1);
		CLAMP(x1, 0, get_w() - PICON_W);
		CLAMP(y1, 0, get_h() - PICON_H);
		draw_pixmap(images[PAN_CHANNEL_SMALL], x1, y1);
//		draw_box(x1, y1, PICON_W, PICON_H);
	}

// draw stick
 	set_color(GREEN);
 	x1 = (int)(stick_x * scale);
 	y1 = (int)(stick_y * scale);

//printf("BC_Pan::draw 2 %d %d\n", x1, y1);
	CLAMP(x1, 0, get_w() - PICON_W);
	CLAMP(y1, 0, get_h() - PICON_H);

	draw_pixmap(images[PAN_STICK_SMALL], x1, y1);
//  	x2 = x1 + PICON_W;
//  	y2 = y1 + PICON_H;
//  	draw_line(x1, y1, x2, y2);
//  	draw_line(x2, y1, x1, y2);

	if(flash) this->flash(0);
	if(flush) this->flush();
}
Пример #8
0
int BC_Title::draw(int flush)
{
	int i, j, x, y;

// Fix background for block fonts.
// This should eventually be included in a BC_WindowBase::is_blocked_font()

 	if(font == MEDIUM_7SEGMENT)
 	{
		//leave it up to the theme to decide if we need a background or not.
		if (top_level->get_resources()->draw_clock_background) {
			BC_WindowBase::set_color(get_bg_color());
			draw_box(0, 0, w, h);
		}
 	}
	else
 		draw_top_background(parent_window, 0, 0, w, h);

	set_font(font);
	BC_WindowBase::set_color(color);
	int text_len = strlen(text);
	j = 0;  x = 0;  y = get_text_ascent(font);
	for(i = 0; i <= text_len; i++)
	{
		if(text[i] == '\n' || text[i] == 0)
		{
			if(centered)
			{
				draw_center_text(get_w() / 2,
					y,
					&text[j],
					i - j);
				j = i + 1;
			}
			else
			{
				draw_text(x,
					y,
					&text[j],
					i - j);
				j = i + 1;
			}
			y += get_text_height(font);
		}
	}
	set_font(MEDIUMFONT);    // reset
	flash(flush);
	return 0;
}
Пример #9
0
void MButtons::create_objects()
{
	int x = 3, y = 0;
	BC_SubWindow *button;
	draw_top_background(get_parent(), 0, 0, get_w(), get_h());
	transport = new MainTransport(mwindow, this, x, y);
	transport->create_objects();
	transport->set_engine(mwindow->cwindow->playback_engine);
	x += transport->get_w();
	x += mwindow->theme->mtransport_margin;

	edit_panel = new MainEditing(mwindow, this, x, y);

	edit_panel->create_objects();
	
	x += edit_panel->get_w();
	flash(0);
}
Пример #10
0
void ZoomBar::resize_event()
{
	hide_window(0);
	reposition_window(mwindow->theme->mzoom_x,
		mwindow->theme->mzoom_y,
		mwindow->theme->mzoom_w,
		mwindow->theme->mzoom_h);

	draw_top_background(get_parent(), 0, 0, get_w(), get_h());
// 	int x = 3, y = 1;
// 	sample_zoom->reposition_window(x, y);
// 	x += sample_zoom->get_w();
// 	amp_zoom->reposition_window(x, y);
// 	x += amp_zoom->get_w();
// 	track_zoom->reposition_window(x, y);
	flash(0);
	show_window(0);
}
Пример #11
0
void MButtons::create_objects()
{
	int x = 3, y = 0;
	draw_top_background(get_parent(), 0, 0, get_w(), get_h());
	transport = new MainTransport(mwindow, this, x, y);
	transport->create_objects();
	transport->set_engine(mwindow->cwindow->playback_engine);
	x += transport->get_w();
	x += mwindow->theme->mtransport_margin;

	edit_panel = new MainEditing(mwindow, this, x, y);

	edit_panel->create_objects();
	
	x += edit_panel->get_w();
	ffmpeg_toggle = new MainFFMpegToggle(mwindow, this, get_w()-30, 0);
	add_subwindow(ffmpeg_toggle);
	flash(0);
}