Commit d895d85a authored by Claes Sjofors's avatar Claes Sjofors

Bugfix in connect for AnalogColor with more than one instance

parent 21151f2d
......@@ -4642,23 +4642,33 @@ void GeAnalogColor::set_attribute( grow_tObject object, const char *attr_name, i
{
(*cnt)--;
if ( *cnt == 0) {
char msg[200];
GeDynElem *elem;
GeAnalogColor *e;
bool found = false;
strncpy( attribute, attr_name, sizeof( attribute));
if ( instance == ge_mInstance_1) {
if ( dyn->total_dyn_type & ge_mDynType_Tone)
sprintf( msg, "AnalogTone.Attribute = %s", attr_name);
else
sprintf( msg, "AnalogColor.Attribute = %s", attr_name);
}
// Set attribute for instance 1
if ( instance == ge_mInstance_1)
e = this;
else {
if ( dyn->total_dyn_type & ge_mDynType_Tone)
sprintf( msg, "AnalogTone%d.Attribute = %s", GeDyn::instance_to_number( instance),
attr_name);
else
sprintf( msg, "AnalogColor%d.Attribute = %s", GeDyn::instance_to_number( instance),
attr_name);
for ( elem = dyn->elements; elem; elem = elem->next) {
if ( elem->dyn_type == ge_mDynType_AnalogColor &&
elem->instance == ge_mInstance_1) {
found = true;
break;
}
}
if ( !found)
return;
e = (GeAnalogColor *)elem;
}
char msg[200];
strncpy( e->attribute, attr_name, sizeof( attribute));
if ( dyn->total_dyn_type & ge_mDynType_Tone)
sprintf( msg, "AnalogTone.Attribute = %s", attr_name);
else
sprintf( msg, "AnalogColor.Attribute = %s", attr_name);
dyn->graph->message( 'I', msg);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment