示例#1
0
VISUAL_C_LINKAGE
int lv_gforce_events (VisPluginData *plugin, VisEventQueue *events)
{
    GForcePrivate *priv = (GForcePrivate *) visual_object_get_private (VISUAL_OBJECT (plugin));
    VisEvent ev;

    while (visual_event_queue_poll (events, &ev)) {
        switch (ev.type) {
        case VISUAL_EVENT_RESIZE:
            lv_gforce_resize (plugin, ev.event.resize.width, ev.event.resize.height);
            break;

        case VISUAL_EVENT_MOUSEMOTION:
            break;

        case VISUAL_EVENT_MOUSEBUTTONDOWN:
        case VISUAL_EVENT_MOUSEBUTTONUP:
            break;

        case VISUAL_EVENT_KEYDOWN:
            priv->gGF->HandleKey (ev.event.keyboard.keysym.sym);
            break;

        default:
            break;
        }
    }

    return 0;
}
示例#2
0
static int act_bumpscope_events (VisPluginData *plugin, VisEventQueue *events)
{
	BumpscopePrivate *priv = visual_plugin_get_private (plugin);
	VisEvent ev;
	VisParam *param;
	VisColor *tmp;

	while (visual_event_queue_poll (events, &ev)) {
		switch (ev.type) {
			case VISUAL_EVENT_RESIZE:
				act_bumpscope_resize (plugin, ev.event.resize.width, ev.event.resize.height);
				break;

			case VISUAL_EVENT_MOUSEMOTION:
				if (ev.event.mousemotion.state == VISUAL_MOUSE_DOWN) {
					priv->light_x = ev.event.mousemotion.x;
					priv->light_y = ev.event.mousemotion.y;
				}

				break;

			case VISUAL_EVENT_PARAM:
				param = ev.event.param.param;

				if (visual_param_has_name (param, "color")) {
					tmp = visual_param_get_value_color (param);
					visual_color_copy (&priv->color, tmp);

					__bumpscope_generate_palette (priv, &priv->color);

				} else if (visual_param_has_name (param, "light size")) {
					priv->phongres = visual_param_get_value_integer (param);

					__bumpscope_cleanup (priv);
					__bumpscope_init (priv);

				} else if (visual_param_has_name (param, "color_cycle")) {
					priv->color_cycle = visual_param_get_value_bool (param);

				} else if (visual_param_has_name (param, "moving_light")) {
					priv->moving_light = visual_param_get_value_bool (param);

				} else if (visual_param_has_name (param, "diamond")) {
					priv->diamond = visual_param_get_value_bool (param);

					__bumpscope_generate_phongdat (priv);
				}

				break;

			default: /* to avoid warnings */
				break;
		}
	}

	return TRUE;
}
示例#3
0
static int act_jakdaw_events (VisPluginData *plugin, VisEventQueue *events)
{
	JakdawPrivate *priv = visual_object_get_private (VISUAL_OBJECT (plugin));
	VisEvent ev;
	VisParamEntry *param;

	while (visual_event_queue_poll (events, &ev)) {
		switch (ev.type) {
			case VISUAL_EVENT_RESIZE:
				act_jakdaw_resize (plugin, ev.event.resize.width, ev.event.resize.height);
				break;

			case VISUAL_EVENT_PARAM:
				param = ev.event.param.param;

				visual_log (VISUAL_LOG_DEBUG, "Param changed: %s", param->name);

				if (visual_param_entry_is (param, "zoom mode")) {
					visual_log (VISUAL_LOG_DEBUG, "New value for the zoom mode param: %d",
							param->numeric.integer);

					priv->zoom_mode = visual_param_entry_get_integer (param);

					_jakdaw_feedback_reset (priv, priv->xres, priv->yres);
				}
				else if (visual_param_entry_is (param, "plotter trigger")) {
					visual_log (VISUAL_LOG_DEBUG, "New value for the plotter trigger param: %d",
							param->numeric.integer);

					priv->plotter_colortype = visual_param_entry_get_integer (param);

				}
				else if (visual_param_entry_is (param, "plotter type")) {
					visual_log (VISUAL_LOG_DEBUG, "New value for the plotter type param: %d",
							param->numeric.integer);

					priv->plotter_scopetype = visual_param_entry_get_integer (param);

					_jakdaw_feedback_reset (priv, priv->xres, priv->yres);
				}

				break;

			default: /* to avoid warnings */
				break;
		}
	}

	return 0;
}
示例#4
0
static int act_infinite_events (VisPluginData *plugin, VisEventQueue *events)
{
	VisEvent ev;

	while (visual_event_queue_poll (events, &ev)) {
		switch (ev.type) {
			case VISUAL_EVENT_RESIZE:
				act_infinite_resize (plugin, ev.event.resize.width, ev.event.resize.height);
				break;
			default: /* to avoid warnings */
				break;
		}
	}

	return 0;
}
示例#5
0
static int lv_nebulus_events (VisPluginData *plugin, VisEventQueue *events)
{
	VisEvent ev;

	while (visual_event_queue_poll (events, &ev)) {
		switch (ev.type) {
			case VISUAL_EVENT_RESIZE:
				lv_nebulus_resize (plugin, ev.event.resize.width, ev.event.resize.height);
				break;
			default:
				break;
		}
	}

	return 0;
}
示例#6
0
static int inp_debug_events (VisPluginData *plugin, VisEventQueue *events)
{
    VisEvent ev;

    while (visual_event_queue_poll (events, &ev)) {
        switch (ev.type) {
        case VISUAL_EVENT_PARAM: {
            VisParamEntry *param = ev.event.param.param;
            change_param (plugin, param);
        }
        default:; /* discard */
        }
    }

    return 0;
}
/* This is the main event loop, where all kind of events can be handled, more information
 * regarding these can be found at:
 * http://libvisual.sourceforge.net/newdocs/docs/html/union__VisEvent.html
 */
extern "C" int lv_projectm_events (VisPluginData *plugin, VisEventQueue *events)
{
	ProjectmPrivate *priv = (ProjectmPrivate*)visual_object_get_private (VISUAL_OBJECT (plugin));
	VisEvent ev;
	VisParamEntry *param;

	projectMEvent evt;
        projectMKeycode key;
        projectMModifier mod;

	while (visual_event_queue_poll (events, &ev))
	  {
	    switch (ev.type)
	      {
	      case VISUAL_EVENT_KEYUP:

		evt = lv2pmEvent( ev.type );
		key = lv2pmKeycode( ev.event.keyboard.keysym.sym );
		mod = lv2pmModifier( ev.event.keyboard.keysym.mod );
		priv->PM->key_handler(PROJECTM_KEYDOWN, key,mod);

		break;
	      case VISUAL_EVENT_RESIZE:
		lv_projectm_dimension (plugin, ev.event.resize.video,
				       ev.event.resize.width, ev.event.resize.height);
		break;
	      case VISUAL_EVENT_NEWSONG:
		priv->PM->projectM_setTitle(ev.event.newsong.songinfo->songname);

		break;

	      default: /* to avoid warnings */
		break;
	      }
	}

	return 0;
}
示例#8
0
static int act_gdkpixbuf_events (VisPluginData *plugin, VisEventQueue *events)
{
	PixbufPrivate *priv = visual_plugin_get_private (plugin);
	VisParam *param;
	VisEvent ev;

	while (visual_event_queue_poll (events, &ev)) {
		switch (ev.type) {
			case VISUAL_EVENT_RESIZE:
				act_gdkpixbuf_resize (plugin, ev.event.resize.width, ev.event.resize.height);
				break;

			case VISUAL_EVENT_PARAM:
				param = ev.event.param.param;

				if (visual_param_has_name (param, "filename")) {
					visual_log (VISUAL_LOG_DEBUG, "New file to be loaded: %s",
							visual_param_get_value_string (param));

					act_gdkpixbuf_load_file (priv, visual_param_get_value_string (param));

				} else if (visual_param_has_name (param, "scaled")) {
					priv->set_scaled = visual_param_get_value_bool (param);

					act_gdkpixbuf_update_image (priv);

				} else if (visual_param_has_name (param, "aspect")) {
					priv->aspect = visual_param_get_value_bool (param);

					act_gdkpixbuf_update_image (priv);

				} else if (visual_param_has_name (param, "center")) {
					priv->center = visual_param_get_value_bool (param);

				} else if (visual_param_has_name (param, "set size")) {
					priv->set_size = visual_param_get_value_bool (param);

					act_gdkpixbuf_update_image (priv);

				} else if (visual_param_has_name (param, "width")) {
					priv->set_width = visual_param_get_value_integer (param);

					act_gdkpixbuf_update_image (priv);

				} else if (visual_param_has_name (param, "height")) {
					priv->set_height = visual_param_get_value_integer (param);

					act_gdkpixbuf_update_image (priv);

				} else if (visual_param_has_name (param, "x")) {
					priv->x_offset = visual_param_get_value_integer (param);

				} else if (visual_param_has_name (param, "y")) {
					priv->y_offset = visual_param_get_value_integer (param);

				} else if (visual_param_has_name (param, "interpolate")) {
					priv->interpolate = visual_param_get_value_integer (param);

					act_gdkpixbuf_update_image (priv);
				}

			default: /* to avoid warnings */
				break;
		}
	}

	return TRUE;
}