static int lv_morph_flash_cleanup (VisPluginData *plugin)
{
    FlashPrivate *priv = visual_object_get_private (VISUAL_OBJECT (plugin));

    visual_palette_free (priv->whitepal);

    visual_mem_free (priv);

    return 0;
}
int visual_transform_set_palette (VisTransform *transform, VisPalette *palette)
{
    visual_return_val_if_fail (transform != NULL, -VISUAL_ERROR_TRANSFORM_NULL);

    if (transform->pal)
        visual_palette_free (transform->pal);

    transform->pal = palette ? visual_palette_clone (palette) : 0;

    return VISUAL_OK;
}
Exemple #3
0
int visual_video_set_palette (VisVideo *video, VisPalette *pal)
{
	visual_return_val_if_fail (video != NULL, -VISUAL_ERROR_VIDEO_NULL);

	if (video->pal) {
		visual_palette_free (video->pal);
	}

	video->pal = pal ? visual_palette_clone (pal) : NULL;

	return VISUAL_OK;
}
static int transform_dtor (VisObject *object)
{
    VisTransform *transform = VISUAL_TRANSFORM (object);

    if (transform->pal)
        visual_palette_free (transform->pal);

    if (transform->plugin != NULL)
        visual_plugin_unload (transform->plugin);

    transform->plugin = NULL;

    return VISUAL_OK;
}
int act_infinite_cleanup (VisPluginData *plugin)
{
	InfinitePrivate *priv;

	visual_return_val_if_fail (plugin != NULL, -1);

	priv = visual_object_get_private (VISUAL_OBJECT (plugin));

	_inf_close_renderer (priv);

	visual_palette_free (priv->pal);
	visual_mem_free (priv);

	return 0;
}
static int morph_dtor (VisObject *object)
{
    VisMorph *morph = VISUAL_MORPH (object);

    visual_time_free (morph->morphtime);
    visual_timer_free (morph->timer);

    if (morph->plugin != NULL)
        visual_plugin_unload (morph->plugin);

    visual_palette_free (morph->morphpal);

    morph->plugin = NULL;

    return VISUAL_OK;
}
const VisPluginInfo *get_plugin_info (void)
{
	static VisActorPlugin actor = {
		.requisition = act_bumpscope_requisition,
		.palette     = act_bumpscope_palette,
		.render      = act_bumpscope_render,
		.vidoptions.depth = VISUAL_VIDEO_DEPTH_8BIT
	};

	static VisPluginInfo info = {
		.type     = VISUAL_PLUGIN_TYPE_ACTOR,

		.plugname = "bumpscope",
		.name     = "Bumpscope plugin",
		.author   = N_("Original by: Zinx Verituse <*****@*****.**>, Port by: Dennis Smit <*****@*****.**>"),
		.version  = "0.0.1",
		.about    = N_("Bumpscope visual plugin"),
		.help     = N_("This is the libvisual port of the xmms Bumpscope plugin"),
		.license  = VISUAL_PLUGIN_LICENSE_GPL,

		.init     = act_bumpscope_init,
		.cleanup  = act_bumpscope_cleanup,
		.events   = act_bumpscope_events,
		.plugin   = &actor
	};

	return &info;
}

static int act_bumpscope_init (VisPluginData *plugin)
{
#if ENABLE_NLS
	bindtextdomain (GETTEXT_PACKAGE, LOCALE_DIR);
#endif

	VisParamList *params = visual_plugin_get_params (plugin);
	visual_param_list_add_many (params,
                                visual_param_new_color_rgb ("color",
                                                            N_("The light's color"),
                                                            122, 204, 255,
                                                            NULL),
                                visual_param_new_integer   ("light_size",
                                                            N_("The size of the light"),
                                                            256,
                                                            visual_param_in_range_integer (0, 1000)),
                                visual_param_new_bool      ("color_cycle",
                                                            N_("Whether to cycle colors"),
                                                            TRUE,
                                                            NULL),
                                visual_param_new_bool      ("moving_light",
                                                            N_("Whether the light moves with the mouse"),
                                                            TRUE,
                                                            NULL),
                                visual_param_new_bool      ("diamond",
                                                            N_("Whether to use a diamond shape light"),
                                                            FALSE,
                                                            NULL),
                                NULL);

	BumpscopePrivate *priv = visual_mem_new0 (BumpscopePrivate, 1);
	visual_plugin_set_private (plugin, priv);

	priv->phongres = 256;
	priv->rcontext = visual_plugin_get_random_context (plugin);
	priv->pal      = visual_palette_new (256);
	priv->pcmbuf   = visual_buffer_new_allocate (512 * sizeof (float));

	return TRUE;
}

static void act_bumpscope_cleanup (VisPluginData *plugin)
{
	BumpscopePrivate *priv = visual_plugin_get_private (plugin);

	__bumpscope_cleanup (priv);

	visual_palette_free (priv->pal);

	visual_buffer_unref (priv->pcmbuf);

	visual_mem_free (priv);
}