Example #1
0
void MainWindow::save_effects(int slot, char *name, int fx_num, bool mod, bool dly, bool rev)
{
    struct fx_pedal_settings effects[2];

    if(fx_num == 1)
    {
        if(mod)
        {
            effect2->get_settings(effects[0]);
            set_effect(effects[0]);
        }
        else if(dly)
        {
            effect3->get_settings(effects[0]);
            set_effect(effects[0]);
        }
        else if(rev)
        {
            effect4->get_settings(effects[0]);
            set_effect(effects[0]);
        }
    }
    else
    {
        effect3->get_settings(effects[0]);
        set_effect(effects[0]);
        effect4->get_settings(effects[1]);
        set_effect(effects[1]);
    }

    amp_ops->save_effects(slot, name, fx_num, effects);
}
Example #2
0
void				ft_print_list(t_list *list, int tr)
{
	int				i;
	t_cursor		*cursor;

	cursor = init_cursor(0, 0);
	list->curr_elem = list->first_elem;
	i = 0;
	if (is_win_too_small(list) != 0)
		ft_putstr_fd("window too small", list->fd);
	else
	{
		while (i++ < list->nb_elem)
		{
			if (cursor->y == tr)
			{
				cursor->y = 0;
				cursor->x += list->longest + 4;
			}
			list->curr_elem->posx = cursor->x;
			list->curr_elem->posy = cursor->y;
			move_cursor(cursor);
			set_effect(list->curr_elem, list->fd);
			list->curr_elem = list->curr_elem->next;
			cursor->y++;
		}
	}
}
Example #3
0
/* Set status of additional camera capabilities */
static int gc0329_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
{
	struct gc0329_priv *priv = to_gc0329(sd);
	struct i2c_client *client =
			(struct i2c_client *) v4l2_get_subdevdata(sd);

	switch (ctrl->id) {
	case V4L2_CID_VFLIP:
		priv->flag_vflip = ctrl->value;
		return set_flip(client, priv->flag_vflip);
		break;
	case V4L2_CID_HFLIP:
		priv->flag_hflip = ctrl->value;
		PDBG("set H-FLIP:%d\n", priv->flag_hflip);
		return set_mirror(client, priv->flag_hflip);
		break;
	case V4L2_CID_BRIGHTNESS:
		if (ctrl->value < -4 || ctrl->value > 4) {
			return -EINVAL;
		}
                priv->brightness = ctrl->value;
		return set_brightness(client, priv->brightness);
                break;
	case V4L2_CID_CONTRAST:
		if (ctrl->value < -3 || ctrl->value > 3) {
			return -EINVAL;
		}
                priv->contrast = ctrl->value;
		return set_contrast(client, priv->contrast);
                break;
	case V4L2_CID_SATURATION:
		if (ctrl->value < -3 || ctrl->value > 3) {
			return -EINVAL;
		}
                priv->sat = ctrl->value;
		return set_sat(client, priv->sat);
                break;
	case V4L2_CID_CAMERA_SPECIAL_EFFECT:
		if (ctrl->value < 0 || ctrl->value > 8) {
			return -EINVAL;
		}
                priv->effect = ctrl->value;
		return set_effect(client, priv->effect);
                break;
	case V4L2_CID_DO_WHITE_BALANCE:
		if (ctrl->value < 0 || ctrl->value > 4) {
			return -EINVAL;
		}
                priv->wh_bal = ctrl->value;
		return set_wh_bal(client, priv->wh_bal);
                break;
	default:
		return -EINVAL;
	}

	return 0;
}
Example #4
0
/* Start/Stop streaming from the device */
static int gc0309_s_stream(struct v4l2_subdev *sd, int enable)
{
    struct i2c_client *client = v4l2_get_subdevdata(sd);
    struct gc0309_priv *priv = to_gc0309(sd);
    int ret = 0;

    /* Program orientation register. */
    ret = set_flip(client, priv->flag_vflip);
    if (ret < 0)
        return ret;

    ret = set_brightness(client, priv->brightness);
    if (ret < 0)
        return ret;

    ret = set_contrast(client, priv->contrast);
    if (ret < 0)
        return ret;

    ret = set_sat(client, priv->sat);
    if (ret < 0)
        return ret;

    ret = set_effect(client, priv->effect);
    if (ret < 0)
        return ret;

    ret = set_wh_bal(client, priv->wh_bal);
    if (ret < 0)
        return ret;

    ret = set_mirror(client, priv->flag_hflip);
    if (ret < 0)
        return ret;

    if (enable) {
        PDBG("Enabling Streaming\n");
        /* Start Streaming */
        ret = gc0309_write(client, 0x25, 0x0f);
        if (ret)
            goto out;
        
    } else {
        PDBG( "Disabling Streaming\n");
        
        ret = gc0309_write(client, 0x25, 0x00);
    }

out:
    return ret;
}
Example #5
0
/* Start/Stop streaming from the device */
static int gc0329_s_stream(struct v4l2_subdev *sd, int enable)
{
	struct i2c_client *client = v4l2_get_subdevdata(sd);
	struct gc0329_priv *priv = to_gc0329(sd);
	int ret = 0;
	u8 val;

	/* Program orientation register. */
	ret = set_flip(client, priv->flag_vflip);
	if (ret < 0)
		return ret;

	ret = set_brightness(client, priv->brightness);
	if (ret < 0)
		return ret;

	ret = set_contrast(client, priv->contrast);
	if (ret < 0)
		return ret;

	ret = set_sat(client, priv->sat);
	if (ret < 0)
		return ret;

	ret = set_effect(client, priv->effect);
	if (ret < 0)
		return ret;

	ret = set_wh_bal(client, priv->wh_bal);
	if (ret < 0)
		return ret;

	ret = set_mirror(client, priv->flag_hflip);
	if (ret < 0)
		return ret;

	if (enable) {
		dev_dbg(&client->dev, "Enabling Streaming\n");
		/* Start Streaming */
	} else {
		dev_dbg(&client->dev, "Disabling Streaming\n");
	}



out:
	return ret;
}
Example #6
0
static int gc0311_s_stream(struct v4l2_subdev *sd, int enable)
{
    struct i2c_client *client = v4l2_get_subdevdata(sd);
    struct gc0311_priv *priv = to_gc0311(sd);
    int ret = 0;

    ret = set_flip(client, priv->flag_vflip);
    if (ret < 0)
        return ret;

    ret = set_brightness(client, priv->brightness);
    if (ret < 0)
        return ret;

    ret = set_contrast(client, priv->contrast);
    if (ret < 0)
        return ret;

    ret = set_sat(client, priv->sat);
    if (ret < 0)
        return ret;

    ret = set_effect(client, priv->effect);
    if (ret < 0)
        return ret;

    ret = set_wh_bal(client, priv->wh_bal);
    if (ret < 0)
        return ret;

    ret = set_mirror(client, priv->flag_hflip);
    if (ret < 0)
        return ret;

    if (enable) {
        ret = gc0311_write(client, 0x25, 0x0f);
        if (ret)
            goto out;
    } else {
        ret = gc0311_write(client, 0x25, 0x00);
    }

out:
    return ret;
}
	void MaterialDescription::load_xml(const xmlNodePtr node)
	{
		xmlNodePtr it;
		Uint32 i;
		SamplerParameterType sampler;

		if (node == 0)
		{
			EL_THROW_EXCEPTION(InvalidParameterException()
				<< errinfo_message(UTF8("parameter is zero"))
				<< errinfo_parameter_name(UTF8("node")));
		}

		if (xmlStrcmp(node->name, BAD_CAST UTF8("material")) != 0)
		{
			return;
		}

		it = XmlUtil::children(node, true);

		do
		{
			for (i = 0; i < m_textures.size(); ++i)
			{
				sampler = static_cast<SamplerParameterType>(i);

				if (xmlStrcmp(it->name, BAD_CAST
					SamplerParameterUtil::get_str(
						sampler).get().c_str()) == 0)
				{
					set_texture(XmlUtil::get_string_value(
						it), sampler);
					set_sRGB(XmlUtil::get_bool_property(it,
						String(UTF8("sRGB"))), sampler);
					set_rectangle(
						XmlUtil::get_bool_property(it,
							String(UTF8(
								"rectangle")),
							false), sampler);
				}
			}

			if (xmlStrcmp(it->name, BAD_CAST UTF8("name")) == 0)
			{
				set_name(XmlUtil::get_string_value(it));
			}

			if (xmlStrcmp(it->name, BAD_CAST UTF8("effect")) == 0)
			{
				set_effect(XmlUtil::get_string_value(it));
			}

			if (xmlStrcmp(it->name, BAD_CAST UTF8("script")) == 0)
			{
				set_script(XmlUtil::get_string_value(it));
			}

			if (xmlStrcmp(it->name,
				BAD_CAST UTF8("texture_matrix_0")) == 0)
			{
				set_texture_matrix(
					XmlUtil::get_mat2x3_value(it), 0);
			}

			if (xmlStrcmp(it->name,
				BAD_CAST UTF8("texture_matrix_1")) == 0)
			{
				set_texture_matrix(
					XmlUtil::get_mat2x3_value(it), 1);
			}

			if (xmlStrcmp(it->name, BAD_CAST UTF8("color")) == 0)
			{
				set_color(XmlUtil::get_vec4_value(it));
			}

			if (xmlStrcmp(it->name,
				BAD_CAST UTF8("dudv_scale_offset")) == 0)
			{
				set_dudv_scale_offset(XmlUtil::get_vec4_value(
					it));
			}

			if (xmlStrcmp(it->name, BAD_CAST UTF8("cast_shadows"))
				== 0)
			{
				set_cast_shadows(XmlUtil::get_bool_value(it));
			}

			if (xmlStrcmp(it->name, BAD_CAST UTF8("culling")) == 0)
			{
				set_culling(XmlUtil::get_bool_value(it));
			}
		}
		while (XmlUtil::next(it, true));
	}