Tone: Add 'valueChanged' signal

This commit is contained in:
Jonas Kulla 2014-08-12 21:21:16 +02:00
parent 3550cc0ff5
commit d95e90db34
2 changed files with 11 additions and 0 deletions

View File

@ -180,30 +180,39 @@ void Tone::set(double red, double green, double blue, double gray)
this->gray = gray;
updateInternal();
valueChanged();
}
void Tone::setRed(double value)
{
red = value;
norm.x = (float) clamp<double>(value, -255, 255) / 255;
valueChanged();
}
void Tone::setGreen(double value)
{
green = value;
norm.y = (float) clamp<double>(value, -255, 255) / 255;
valueChanged();
}
void Tone::setBlue(double value)
{
blue = value;
norm.z = (float) clamp<double>(value, -255, 255) / 255;
valueChanged();
}
void Tone::setGray(double value)
{
gray = value;
norm.w = (float) clamp<double>(value, 0, 255) / 255;
valueChanged();
}
/* Serializable */

View File

@ -134,6 +134,8 @@ struct Tone : public Serializable
/* Normalized (-1.0 ~ 1.0) */
Vec4 norm;
sigc::signal<void> valueChanged;
};
struct Rect : public Serializable