private static bool DeltaSupportsType(ParamDeltaType delta, ParamDataType type) { switch (delta) { case ParamDeltaType.Constant: return(type == ParamDataType.Bool || type == ParamDataType.Float || type == ParamDataType.Integer); case ParamDeltaType.Linear: return(type == ParamDataType.Integer || type == ParamDataType.Float); case ParamDeltaType.LinearCapped: return(type == ParamDataType.Integer || type == ParamDataType.Float); case ParamDeltaType.Threshold: return(type == ParamDataType.Bool || type == ParamDataType.Integer || type == ParamDataType.Float); case ParamDeltaType.InheritLinear: return(type == ParamDataType.Integer || type == ParamDataType.Float); case ParamDeltaType.InheritLinearCapped: return(type == ParamDataType.Integer || type == ParamDataType.Float); default: return(false); } }
private static int DeltaParameterLength(ParamDeltaType delta) { switch (delta) { case ParamDeltaType.Constant: return(1); case ParamDeltaType.Linear: // Two delta params: starting value and rate of change per measure return(2); case ParamDeltaType.LinearCapped: // Three delta params: starting value, rate of change per measure, and ending value return(3); case ParamDeltaType.Threshold: // Two delta params: measure count at which change activates and new value after threshold return(2); case ParamDeltaType.InheritLinear: // One delta param: rate of change per measure return(1); case ParamDeltaType.InheritLinearCapped: // Two delta params: rate of change per measure and ending value return(2); default: return(0); } }
public ParameterModifier(string paramPath, ParamDataType paramType, ParamDeltaType paramDelta, string[] paramList, MusicState[] stateList) { ParamPath = paramPath; ParamType = paramType; ParamDelta = paramDelta; ParamList = paramList; StateList = stateList; }
public ParameterAdjustor(string paramPath, ParamDataType type, ParamDeltaType delta, List <string> paramList, List <MusicState> stateList) { ParamPath = paramPath; ParamType = type; ParamDelta = delta; ParamList = paramList; StateList = stateList; activeStates = new HashSet <MusicState>(); foreach (MusicState state in StateList) { activeStates.Add(state); } paramFieldInfo = null; Validate(); }