Beispiel #1
0
int BC_Pan::button_press_event()
{
	// there are two modes of operation...
	if (popup)
	{	if (popup->is_event_win() && get_button_down() && get_buttonpress() == 1)
		{
			active = 1;
			x_origin = popup->get_cursor_x();
			y_origin = popup->get_cursor_y();
			stick_x_origin = stick_x;
			stick_y_origin = stick_y;
			return 1;
		} else
		{
			deactivate();
			return 0;
		}
	}
	if(is_event_win() && get_button_down() && get_buttonpress() == 1)
	{
		hide_tooltip();
		activate();
		active = 1;
		x_origin = get_cursor_x();
		y_origin = get_cursor_y();
		stick_x_origin = stick_x;
		stick_y_origin = stick_y;
		draw_popup();
		return 1;
	}
	return 0;
}
Beispiel #2
0
int RecordMonitorGUI::button_press_event()
{
	if(mwindow->session->rwindow_fullscreen && canvas && canvas->get_canvas())
		return canvas->button_press_event_base(canvas->get_canvas());
		
	if( get_buttonpress() == 2 ) {
		return 0;
	}
	else
// Right button
	if( get_buttonpress() == 3 ) {
		monitor_menu->activate_menu();
		return 1;
	}
	return 0;
}
Beispiel #3
0
int CreateDVD_Cancel::button_press_event()
{
        if(get_buttonpress() == 1 && is_event_win() && cursor_inside()) {
                gui->set_done(1);
                return 1;
        }
        return 0;
}
int TimeBar::button_press_event()
{
	if(is_event_win() && cursor_inside() && get_buttonpress() == 1)
	{
// Change time format
		if(ctrl_down())
		{
			if(get_buttonpress() == 1)
				mwindow->next_time_format();
			else
			if(get_buttonpress() == 2)
				mwindow->prev_time_format();
			return 1;
		}
		else
// 		if(test_preview(1))
// 		{
// 		}
// 		else
		{
			stop_playback();

// Select region between two labels
			if(get_double_click())
			{
				double position = pixel_to_position(get_cursor_x());
// Test labels
				select_region(position);
				return 1;
			}
			else
// Reposition highlight cursor
			if(is_event_win() && cursor_inside())
			{
				update_cursor();
				current_operation = TIMEBAR_DRAG;
				activate_timeline();
				return 1;
			}
		}
	}
	return 0;
}
int CompressorTrigger::button_press_event()
{
	if(is_event_win())
	{
		if(get_buttonpress() < 4) return BC_TextBox::button_press_event();
		if(get_buttonpress() == 4)
		{
			plugin->config.trigger++;
		}
		else
		if(get_buttonpress() == 5)
		{
			plugin->config.trigger--;
		}
		update((int64_t)plugin->config.trigger);
		plugin->send_configure_change();
		return 1;
	}
	return 0;
}
int CompressorDecay::button_press_event()
{
	if(is_event_win())
	{
		if(get_buttonpress() < 4) return BC_TextBox::button_press_event();
		if(get_buttonpress() == 4)
		{
			plugin->config.decay_len += 0.1;
		}
		else
		if(get_buttonpress() == 5)
		{
			plugin->config.decay_len -= 0.1;
		}
		update((float)plugin->config.decay_len);
		plugin->send_configure_change();
		return 1;
	}
	return 0;
}
Beispiel #7
0
int BC_Pot::button_press_event()
{
	if(!tooltip_on) top_level->hide_tooltip();
	if(top_level->event_win == win && enabled)
	{
		if(status == POT_HIGH || status == POT_UP)
		{
			if(get_buttonpress() == 4)
			{
				increase_value();
				show_value_tooltip();
				draw(1);
				handle_event();
			}
			else
			if(get_buttonpress() == 5)
			{
				decrease_value();
				show_value_tooltip();
				draw(1);
				handle_event();
			}
			else
			{
				status = POT_DN;
				start_cursor_angle = coords_to_angle(get_cursor_x(), get_cursor_y());
				start_needle_angle = percentage_to_angle(get_percentage());
				angle_offset = start_cursor_angle - start_needle_angle;
				prev_angle = start_cursor_angle;
				angle_correction = 0;
				draw(1);
				top_level->deactivate();
				top_level->active_subwindow = this;
				show_value_tooltip();
			}
			return 1;
		}
	}
	return 0;
}
Beispiel #8
0
int BC_Pan::cursor_motion_event()
{
	if(popup && get_button_down() && get_buttonpress() == 1)
	{
		stick_x = stick_x_origin + get_cursor_x() - x_origin;
		stick_y = stick_y_origin + get_cursor_y() - y_origin;
		CLAMP(stick_x, 0, virtual_r * 2);
		CLAMP(stick_y, 0, virtual_r * 2);
		stick_to_values();
		draw_popup();
		handle_event();
		return 1;
	}
	return 0;
}