void Component_OnNewEvent(object sender, QsysInternalEventsArgs e) { if (e.Name == "gain") { /*if (e.Value >= min && e.Value <= max) * { * currentLvl = (int)Math.Round((65535 / (max - min)) * (e.Value + (min * (-1)))); * QsysFaderEvent(this, new QsysEventsArgs(eQscEventIds.GainChange, cName, true, currentLvl, currentLvl.ToString())); * }*/ currentLvl = (int)Math.Round(QsysProcessor.ScaleUp(e.Position)); QsysFaderEvent(this, new QsysEventsArgs(eQscEventIds.GainChange, cName, true, currentLvl, currentLvl.ToString(), null)); } else if (e.Name == "mute") { if (e.Value == 1) { QsysFaderEvent(this, new QsysEventsArgs(eQscEventIds.MuteChange, cName, true, 1, "true", null)); currentMute = true; } else if (e.Value == 0) { QsysFaderEvent(this, new QsysEventsArgs(eQscEventIds.MuteChange, cName, false, 0, "false", null)); currentMute = false; } } else if (e.Name == "max_gain") { max = e.Value; } else if (e.Name == "min_gain") { min = e.Value; } }
//add event handling private void Control_OnNewEvent(object o, QsysInternalEventsArgs e) { int intValue; if (IsInteger == 0) { QsysNamedControlEvent(this, new QsysEventsArgs(eQscEventIds.NamedControlChange, e.Name, Convert.ToBoolean(e.Value), Convert.ToUInt16(e.Value), e.SValue, null)); } else { intValue = (int)Math.Round(QsysProcessor.ScaleUp(e.Position)); QsysNamedControlEvent(this, new QsysEventsArgs(eQscEventIds.NamedControlChange, e.Name, Convert.ToBoolean(intValue), intValue, Convert.ToString(e.Position), null)); } }