/// <summary>
        /// populate mappingEntry's members based on the information in genInfo
        /// </summary>
        protected void InitializeEntryFromGenInfo(GenEntryConfigInfo genInfo, int id,
                                                  IGeneratorMappingEntry mappingEntry)
        {
            //Sets mappingEntry.Id
            mappingEntry.Id = id;

            //Sets mappingEntry.GeneratorInfo
            mappingEntry.GenConfigInfo = genInfo;

            //Sets mappingEntry.inMsgRange
            IMssMsgRange inMsgRange = new MssMsgRange();

            switch (genInfo.PeriodType)
            {
            case GenPeriodType.Bars:
            case GenPeriodType.BeatSynced:
                inMsgRange.InitPublicMembers(MssMsgType.RelBarPeriodPos,
                                             id,
                                             MssMsgUtil.UNUSED_MSS_MSG_DATA);
                break;

            case GenPeriodType.Time:
                inMsgRange.InitPublicMembers(MssMsgType.RelTimePeriodPos,
                                             id,
                                             MssMsgUtil.UNUSED_MSS_MSG_DATA);
                break;

            default:
                //Unknown period type
                Debug.Assert(false);
                break;
            }

            mappingEntry.InMssMsgRange = inMsgRange;

            //Sets mappingEntry.outMsgRange
            IMssMsgRange outMsgRange = new MssMsgRange();

            outMsgRange.InitPublicMembers(MssMsgType.Generator,
                                          id,
                                          MssMsgUtil.UNUSED_MSS_MSG_DATA);

            mappingEntry.OutMssMsgRange = outMsgRange;

            //Sets mappingEntry.OverrideDuplicates
            mappingEntry.OverrideDuplicates = false;

            //Sets mappingEntry.CurveShapeInfo. This function is also used to reinitialize
            //mappingEntry so sometimes CurveShapeInfo will already be initialized.
            if (mappingEntry.CurveShapeInfo == null)
            {
                mappingEntry.CurveShapeInfo = new CurveShapeInfo();
                mappingEntry.CurveShapeInfo.InitWithDefaultValues();
            }
        }
        protected IMappingEntry Factory_IMappingEntry_MapsIdenticalMidiMsgRanges(
            MssMsgType msgType,
            int chanRangeBottom, int chanRamgeTop,
            int paramRangeBottom, int paramRangeTop)
        {
            MssMsgRange inMsgRange = new MssMsgRange();

            inMsgRange.InitPublicMembers(msgType, chanRangeBottom, chanRamgeTop, paramRangeBottom, paramRangeTop);

            MssMsgRange outMsgRange = new MssMsgRange();

            outMsgRange.InitPublicMembers(msgType, chanRangeBottom, chanRamgeTop, paramRangeBottom, paramRangeTop);

            IMappingEntry mapEntry = new MappingEntry();

            mapEntry.InMssMsgRange      = inMsgRange;
            mapEntry.OutMssMsgRange     = outMsgRange;
            mapEntry.OverrideDuplicates = DEFAULT_OVERRIDE_DUPLICATES;

            CurveShapeInfo curveInfo = new CurveShapeInfo();

            curveInfo.InitWithDefaultValues();
            mapEntry.CurveShapeInfo = curveInfo;

            return(mapEntry);
        }
Beispiel #3
0
        protected IMappingEntry Factory_IMappingEntry(
            MssMsgType inMsgType, int inData1Bottom, int inData1Top, int inData2Bottom, int inData2Top,
            MssMsgType outMsgType, int outData1Bottom, int outData1Top, int outData2Bottom, int outData2Top)
        {
            MssMsgRange inMsgRange = new MssMsgRange();

            inMsgRange.InitPublicMembers(inMsgType, inData1Bottom, inData1Top, inData2Bottom, inData2Top);

            MssMsgRange outMsgRange = new MssMsgRange();

            outMsgRange.InitPublicMembers(outMsgType, outData1Bottom, outData1Top, outData2Bottom, outData2Top);

            IMappingEntry mappingEntry = new MappingEntry();

            mappingEntry.InitAllMembers(inMsgRange, outMsgRange, false, DEFAULT_CURVE_SHAPE_INFO);

            return(mappingEntry);
        }