private void LoadChannel(ChannelDesc ch) { using (var param = Engine.GetParam(ch.Type)) { ch.List.Items.Clear(); for (int i = 0; i < param.KeyCount; i++) { ch.List.Items.Add(param.GetKeyTime(i)); } } }
private void CopyKeyFrames(ChannelDesc dst, ChannelDesc src) { using (var dstParam = Engine.GetParam(dst.Type)) using (var srcParam = Engine.GetParam(src.Type)) { // 1. engine: remove old keyframes dst.List.Items.Clear(); dstParam.Reset(); // 2. engine: create new ones for (int i = 0; i < srcParam.KeyCount; i++) { Engine.CreateKey(dst.Type, srcParam.GetKeyTime(i)); } } LoadChannel(dst); }
// XXX collectioner: Refactor this f*****g shit! private void UpdateEngineValue(PostProcessParamType paramType, decimal value) { KeyValuePair <PostProcessParamType, List <PostProcessParamType> > relationPair = TypesRelationships.FirstOrDefault(item => item.Value.Contains(paramType)); PostProcessParamType searchedType = relationPair.Equals(default(KeyValuePair <PostProcessParamType, List <PostProcessParamType> >)) ? paramType : relationPair.Key; ChannelDesc channel = _chInfo.FirstOrDefault(ch => ch.Type == searchedType); if (channel == null || channel.SelectedKey == -1) { return; } Engine.UpdateValue(channel.SelectedKey, paramType, value); }