public MssMsg(MssMsgType type, double data1, double data2, double data3) { this.Type = type; this.Data1 = data1; this.Data2 = data2; this.Data3 = data3; }
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); }
protected void MsgTypeComboChanged(ComboBox msgTypeCombo, IoType ioCategory, ref MssMsgRangeEntryMetadata msgMetadata) { MssMsgType msgType = GetMessageTypeFromCombo(msgTypeCombo); msgMetadata = MsgMetadataFactory.Create(msgType); msgMetadata.AttachToDlg(this, ioCategory); }
/// <summary> /// Initializes this MssMsgRangeEntryMetadata and sets the default properties for controls on the mapping /// dialog /// </summary> /// <param name="mappingDlg">The mapping dialog this is associated with</param> /// <param name="io">Specifies wheather this associated with the input or output entry fields.</param> public void AttachToDlg(MappingDlg mappingDlg, IoType io) { this.msgRange = new MssMsgRange(); this.msgRange.MsgType = this.MsgType; this.ioCatagory = io; this.mappingDlg = mappingDlg; InitOutMssMsgTypeNames(); //Contains the type combo box that did not trigger the creation of this class ComboBox otherTypeCombo; //For each MSS message type selected for input there are only a subset of MSS message types that are //considered valid output. When the input type changes then the output combo box must be repopulated if (io == IoType.Input) { otherTypeCombo = mappingDlg.outTypeCombo; otherTypeCombo.Items.Clear(); otherTypeCombo.Items.AddRange(outMssMsgTypeNames.ToArray()); //This will cause the output MssMsgRangeEntryMetadata to be created. otherTypeCombo.SelectedIndex = 0; } else if (io == IoType.Output) { otherTypeCombo = mappingDlg.inTypeCombo; } else { //Unknown IO type Debug.Assert(false); return; } MssMsgType otherMsgType = mappingDlg.GetMessageTypeFromCombo(otherTypeCombo); if (io == IoType.Input) { if (this.canSelectSameAsInput) { mappingDlg.outSameAsInCheckBox.Enabled = true; } else { mappingDlg.outSameAsInCheckBox.Checked = false; mappingDlg.outSameAsInCheckBox.Enabled = false; } } SetMappingDlgEntryFieldsDefaultProperties(); SetMappingDlgEntryFieldCustomProperties(); }
/// <summary> /// Initializes the public member varialbes of this class. This method does not need to /// be called as the public members can be initialized individually. /// </summary> public void InitPublicMembers(MssMsgType msgType, double data1RangeBottom, double data1RangeTop, double data2RangeBottom, double data2RangeTop) { this.MsgType = msgType; this.Data1RangeBottom = data1RangeBottom; this.Data1RangeTop = data1RangeTop; this.Data2RangeBottom = data2RangeBottom; this.Data2RangeTop = data2RangeTop; }
private void inTypeCombo_SelectedIndexChanged(object sender, EventArgs e) { MsgTypeComboChanged((ComboBox)sender, IoType.Input, ref this.inMsgMetadata); if (this.outSameAsInCheckBox.Checked == true) { //we cannot just set the outTypeCombo's selected index to the same as in inTypeCombo's selected index //because they may not contain all of the same items. MssMsgType inType = GetMessageTypeFromCombo((ComboBox)sender); string inTypeName = MssMsg.MssMsgTypeNames[(int)inType]; this.outTypeCombo.SelectedIndex = this.outTypeCombo.FindStringExact(inTypeName); } UpdateOutEntryFieldsEnabledStatus(); }
/// <summary> /// Attempts to create an MssEvent representation of <paramref name="midiEvent"/>. /// </summary> /// <returns>The MssEvent representation of midiEvent or null of there is no valid conversion.</returns> protected static MssEvent ConvertVstMidiEventToMssEvent(VstMidiEvent midiEvent, long sampleTimeAtStartOfProcessingCycle, double sampleRate) { MssEvent mssEvent = new MssEvent(); //Sets the sample time for mssEvent. mssEvent.sampleTime = sampleTimeAtStartOfProcessingCycle + midiEvent.DeltaFrames; MssMsgType msgType = MidiUtil.GetMssTypeFromMidiData(midiEvent.Data); mssEvent.mssMsg.Type = msgType; //If msgType is "Unsupported" then midiEvent cannot be represented as an MssEvent if (msgType == MssMsgType.Unsupported) { return(null); } //Sets mssEvent's Data1 (midi channel). //Adds one because channels in an MssMsg start at 1 but channels in a VstMidiEvent start at 0 mssEvent.mssMsg.Data1 = (midiEvent.Data[0] & 0x0F) + 1; //Sets mssEvent's Data2 and Data3 (the midi message's data bytes). if (msgType == MssMsgType.PitchBend) { //The two data bytes for pitch bend are used to store one 14-bit number so this number is stored in //mssEvent.Data3 and mssEvent.Data2 is not used. mssEvent.mssMsg.Data2 = MssMsgUtil.UNUSED_MSS_MSG_DATA; //data1 contains the least significant 7 bits of the pitch bend value and data2 contains the most //significant 7 bits mssEvent.mssMsg.Data3 = (midiEvent.Data[2] << 7) + midiEvent.Data[1]; } else if (msgType == MssMsgType.ChanAftertouch) { mssEvent.mssMsg.Data2 = MssMsgUtil.UNUSED_MSS_MSG_DATA; mssEvent.mssMsg.Data3 = midiEvent.Data[1]; } else { mssEvent.mssMsg.Data2 = midiEvent.Data[1]; mssEvent.mssMsg.Data3 = midiEvent.Data[2]; } return(mssEvent); }
/// <summary> /// Converts an mssMsgType into the status byte for a midi message. The channel half of the status byte is /// left as 0000. /// </summary> /// <returns>True if a valid conversion exists. False otherwise.</returns> public static bool GetStatusFromMssMsgType(MssMsgType mssMsgType, out byte statusByte) { bool validConversionExists; statusByte = 0x00; switch (mssMsgType) { case MssMsgType.NoteOff: validConversionExists = true; statusByte = 0x80; break; case MssMsgType.NoteOn: validConversionExists = true; statusByte = 0x90; break; case MssMsgType.PolyAftertouch: validConversionExists = true; statusByte = 0xA0; break; case MssMsgType.CC: validConversionExists = true; statusByte = 0xB0; break; case MssMsgType.ChanAftertouch: validConversionExists = true; statusByte = 0xD0; break; case MssMsgType.PitchBend: validConversionExists = true; statusByte = 0xE0; break; default: validConversionExists = false; break; } return(validConversionExists); }
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); }
public static byte[] CreateMidiData(MssMsgType msgType, int channel, byte byte2, byte byte3) { Debug.Assert(channel >= 1 && channel <= 16); //Ensures the first bit is 0 Debug.Assert((byte2 >> 7) == 0); Debug.Assert((byte3 >> 7) == 0); byte[] midiData = new byte[3]; byte statusByte; bool successfullyConvertedType = GetStatusFromMssMsgType(msgType, out statusByte); Debug.Assert(successfullyConvertedType); statusByte |= (byte)(channel - 1); midiData[0] = statusByte; midiData[1] = byte2; midiData[2] = byte3; return midiData; }
public static byte[] CreateMidiData(MssMsgType msgType, int channel, byte byte2, byte byte3) { Debug.Assert(channel >= 1 && channel <= 16); //Ensures the first bit is 0 Debug.Assert((byte2 >> 7) == 0); Debug.Assert((byte3 >> 7) == 0); byte[] midiData = new byte[3]; byte statusByte; bool successfullyConvertedType = GetStatusFromMssMsgType(msgType, out statusByte); Debug.Assert(successfullyConvertedType); statusByte |= (byte)(channel - 1); midiData[0] = statusByte; midiData[1] = byte2; midiData[2] = byte3; return(midiData); }
private void outSameAsInCheckBox_CheckedChanged(object sender, EventArgs e) { bool enabledStatus = !((CheckBox)sender).Checked; if (((CheckBox)sender).Checked == true) { //we cannot just set the outTypeCombo's selected index to the same as in inTypeCombo's selected index //because they may not contain all of the same items. MssMsgType inType = GetMessageTypeFromCombo(this.inTypeCombo); string inTypeName = MssMsg.MssMsgTypeNames[(int)inType]; this.outTypeCombo.SelectedIndex = this.outTypeCombo.FindStringExact(inTypeName); this.outEntryField1TextBox.Text = this.inEntryField1TextBox.Text; this.errorProvider.SetError(this.outEntryField1TextBox, ""); this.outEntryField1Combo.SelectedIndex = this.inEntryField1Combo.SelectedIndex; this.outEntryField2TextBox.Text = this.inEntryField2TextBox.Text; this.errorProvider.SetError(this.outEntryField2TextBox, ""); this.outEntryField2Combo.SelectedIndex = this.inEntryField2Combo.SelectedIndex; } UpdateOutEntryFieldsEnabledStatus(); }
/// <summary> /// Converts an mssMsgType into the status byte for a midi message. The channel half of the status byte is /// left as 0000. /// </summary> /// <returns>True if a valid conversion exists. False otherwise.</returns> public static bool GetStatusFromMssMsgType(MssMsgType mssMsgType, out byte statusByte) { bool validConversionExists; statusByte = 0x00; switch (mssMsgType) { case MssMsgType.NoteOff: validConversionExists = true; statusByte = 0x80; break; case MssMsgType.NoteOn: validConversionExists = true; statusByte = 0x90; break; case MssMsgType.PolyAftertouch: validConversionExists = true; statusByte = 0xA0; break; case MssMsgType.CC: validConversionExists = true; statusByte = 0xB0; break; case MssMsgType.ChanAftertouch: validConversionExists = true; statusByte = 0xD0; break; case MssMsgType.PitchBend: validConversionExists = true; statusByte = 0xE0; break; default: validConversionExists = false; break; } return validConversionExists; }
//*******************************Helpers******************************* //if testMssToMidi is true then this method tests ConvertMssEventToVstMidiEvent. Otherwise this method tests ConvertVstMidiEventToMssEvent protected void Test_MsgConversion(MssMsgType msgType, int midiChannel, int midiParam1, int midiParam2, bool testMssToMidi) { long sampleTimeAtStartOfCycle = 12345; int deltaFrames = 789; MidiHandlerProtectedWrapper midiHandler = Factory_MidiHandler_Basic(); MssEvent mssEvent = new MssEvent(); if (msgType == MssMsgType.PitchBend) { mssEvent.mssMsg = new MssMsg(msgType, midiChannel, MssMsgUtil.UNUSED_MSS_MSG_DATA, (midiParam2 << 7) + midiParam1); } else { mssEvent.mssMsg = new MssMsg(msgType, midiChannel, midiParam1, midiParam2); } mssEvent.sampleTime = sampleTimeAtStartOfCycle + deltaFrames; byte[] midiData = MidiUtil.CreateMidiData(msgType, midiChannel, (byte)midiParam1, (byte)midiParam2); VstMidiEvent midiEvent = new VstMidiEvent(deltaFrames, 0, 0, midiData, 0, 0x00); if (testMssToMidi == true) { MssEvent convertedMssEvent = midiHandler.ConvertVstMidiEventToMssEventWrapper( midiEvent, sampleTimeAtStartOfCycle, this.hostInfoOutputPort.SampleRate); Assert.AreEqual(mssEvent, convertedMssEvent); } else { VstMidiEvent ConvertedMidiEvent = midiHandler.ConvertMssEventToVstMidiEventWrapper( mssEvent, sampleTimeAtStartOfCycle, this.hostInfoOutputPort.SampleRate); Assert.AreEqual(midiEvent.Data, ConvertedMidiEvent.Data); Assert.AreEqual(midiEvent.DeltaFrames, ConvertedMidiEvent.DeltaFrames); } }
protected MssMsg Factory_MssMsg(MssMsgType msgType, int data1, int data2, int data3) { return new MssMsg(msgType, data1, data2, data3); }
protected byte[] CreateMidiDataWithDefaultValues(MssMsgType msgType) { return MidiUtil.CreateMidiData(msgType, 1, 0x00, 0x00); }
public MssMsg(MssMsgType type, double data1, double data2, double data3) { this.Type = type; this.Data1 = data1; this.Data2 = data2; this.Data3 = data3; }
/// <summary> /// Initializes the public member varialbes of this class. When this method is used to /// initialize the class, a MssMsg will have to match data1 and data2 exactally to fall /// into this range. /// </summary> public void InitPublicMembers(MssMsgType msgType, double data1, double data2) { InitPublicMembers(msgType, data1, data1, data2, data2); }
protected MssMsg Factory_MssMsg_CustomTypeAndData1(MssMsgType msgType, double data1) { return new MssMsg(msgType, data1, MssMsgUtil.UNUSED_MSS_MSG_DATA, 0); }
public static IStaticMssMsgInfo Create(MssMsgType msgInfoType) { IStaticMssMsgInfo msgInfo; switch (msgInfoType) { case MssMsgType.Note: { msgInfo = new StaticNoteMsgInfo(); break; } case MssMsgType.NoteOn: { msgInfo = new StaticNoteOnMsgInfo(); break; } case MssMsgType.NoteOff: { msgInfo = new StaticNoteOffMsgInfo(); break; } case MssMsgType.CC: { msgInfo = new StaticCCMsgInfo(); break; } case MssMsgType.PitchBend: { msgInfo = new StaticPitchBendMsgInfo(); break; } case MssMsgType.PolyAftertouch: { msgInfo = new StaticPolyAftertouchMsgInfo(); break; } case MssMsgType.ChanAftertouch: { msgInfo = new StaticChanAftertouchMsgInfo(); break; } case MssMsgType.Generator: { msgInfo = new StaticGeneratorMsgInfo(); break; } case MssMsgType.GeneratorModify: { msgInfo = new StaticGeneratorModifyMsgInfo(); break; } case MssMsgType.RelBarPeriodPos: { msgInfo = new StaticRelBarPeriodPosMsgInfo(); break; } case MssMsgType.RelTimePeriodPos: { msgInfo = new StaticRelTimePeriodPosMsgInfo(); break; } case MssMsgType.Parameter: { msgInfo = new StaticParameterMsgInfo(); break; } default: { //Unknown type Debug.Assert(false); msgInfo = null; break; } } return msgInfo; }
public IMssMsgInfo Create(MssMsgType msgInfoType) { IMssMsgInfo msgInfo; switch (msgInfoType) { case MssMsgType.Note: { msgInfo = new NoteMsgInfo(); break; } case MssMsgType.NoteOn: { msgInfo = new NoteOnMsgInfo(); break; } case MssMsgType.NoteOff: { msgInfo = new NoteOffMsgInfo(); break; } case MssMsgType.CC: { msgInfo = new CCMsgInfo(); break; } case MssMsgType.PitchBend: { msgInfo = new PitchBendMsgInfo(); break; } case MssMsgType.PolyAftertouch: { msgInfo = new PolyAftertouchMsgInfo(); break; } case MssMsgType.ChanAftertouch: { msgInfo = new ChanAftertouchMsgInfo(); break; } case MssMsgType.Generator: { GeneratorMsgInfo genMsgInfo = new GeneratorMsgInfo(); genMsgInfo.Init(this.genMappingMgr); msgInfo = genMsgInfo; break; } case MssMsgType.GeneratorModify: { GeneratorModifyMsgInfo genToggleMsgInfo = new GeneratorModifyMsgInfo(); genToggleMsgInfo.Init(this.genMappingMgr); msgInfo = genToggleMsgInfo; break; } case MssMsgType.RelBarPeriodPos: { msgInfo = new RelBarPeriodPosMsgInfo(); break; } case MssMsgType.RelTimePeriodPos: { msgInfo = new RelTimePeriodPosMsgInfo(); break; } case MssMsgType.Parameter: { ParameterMsgInfo paramMsgInfo = new ParameterMsgInfo(); paramMsgInfo.Init(this.paramViewer); msgInfo = paramMsgInfo; break; } default: { //Unknown type Debug.Assert(false); msgInfo = null; break; } } return(msgInfo); }
protected MssMsg Factory_MssMsg_InitializedValues(MssMsgType msgType, int data1, int data2, int data3) { return(new MssMsg(msgType, data1, data2, data3)); }
protected MssMsg Factory_MssMsg(MssMsgType msgType, int data1, int data2, int data3) { return(new MssMsg(msgType, data1, data2, data3)); }
protected byte[] CreateMidiDataWithDefaultValues(MssMsgType msgType) { return(MidiUtil.CreateMidiData(msgType, 1, 0x00, 0x00)); }
public MssMsgRangeEntryMetadata Create(MssMsgType type) { MssMsgRangeEntryMetadata msgMetadata; switch (type) { case MssMsgType.Note: { msgMetadata = new NoteMsgRangeEntryMetadata(); break; } case MssMsgType.NoteOn: { msgMetadata = new NoteOnMsgRangeEntryMetadata(); break; } case MssMsgType.NoteOff: { msgMetadata = new NoteOffMsgRangeEntryMetadata(); break; } case MssMsgType.CC: { msgMetadata = new CCMsgRangeEntryMetadata(); break; } case MssMsgType.PitchBend: { msgMetadata = new PitchBendMsgRangeEntryMetadata(); break; } case MssMsgType.PolyAftertouch: { msgMetadata = new PolyAftertouchMsgRangeEntryMetadata(); break; } case MssMsgType.ChanAftertouch: { msgMetadata = new ChanAftertouchMsgRangeEntryMetadata(); break; } case MssMsgType.Generator: { var genMsgMetadata = new GeneratorMsgRangeEntryMetadata(); genMsgMetadata.Init(this.genMappingMgr); msgMetadata = genMsgMetadata; break; } case MssMsgType.GeneratorModify: { var genToggleMsgMetadata = new GeneratorModifyMsgRangeEntryMetadata(); genToggleMsgMetadata.Init(this.genMappingMgr); msgMetadata = genToggleMsgMetadata; break; } case MssMsgType.Parameter: { var paramMsgRangeMetadata = new ParameterMsgRangeEntryMetadata(); paramMsgRangeMetadata.Init(this.paramViewer); msgMetadata = paramMsgRangeMetadata; break; } default: { //Unknown type Debug.Assert(false); msgMetadata = null; break; } } return(msgMetadata); }
public bool TypeIsInRange(MssMsgType msgType) { return(staticInfo.TypeIsInRange(msgType)); }
public virtual bool TypeIsInRange(MssMsgType msgType) { return (msgType == this.MsgType); }
//*******************************Helpers******************************* //if testMssToMidi is true then this method tests ConvertMssEventToVstMidiEvent. Otherwise this method tests ConvertVstMidiEventToMssEvent protected void Test_MsgConversion(MssMsgType msgType, int midiChannel, int midiParam1, int midiParam2, bool testMssToMidi) { long sampleTimeAtStartOfCycle = 12345; int deltaFrames = 789; MidiHandlerProtectedWrapper midiHandler = Factory_MidiHandler_Basic(); MssEvent mssEvent = new MssEvent(); if (msgType == MssMsgType.PitchBend) { mssEvent.mssMsg = new MssMsg(msgType, midiChannel, MssMsgUtil.UNUSED_MSS_MSG_DATA, (midiParam2 << 7) + midiParam1); } else { mssEvent.mssMsg = new MssMsg(msgType, midiChannel, midiParam1, midiParam2); } mssEvent.sampleTime = sampleTimeAtStartOfCycle + deltaFrames; byte[] midiData = MidiUtil.CreateMidiData(msgType, midiChannel, (byte)midiParam1, (byte)midiParam2); VstMidiEvent midiEvent = new VstMidiEvent(deltaFrames, 0, 0, midiData, 0, 0x00); if (testMssToMidi == true) { MssEvent convertedMssEvent = midiHandler.ConvertVstMidiEventToMssEventWrapper( midiEvent, sampleTimeAtStartOfCycle, this.hostInfoOutputPort.SampleRate); Assert.AreEqual(mssEvent, convertedMssEvent); } else { VstMidiEvent ConvertedMidiEvent = midiHandler.ConvertMssEventToVstMidiEventWrapper( mssEvent, sampleTimeAtStartOfCycle, this.hostInfoOutputPort.SampleRate); Assert.AreEqual(midiEvent.Data, ConvertedMidiEvent.Data); Assert.AreEqual(midiEvent.DeltaFrames, ConvertedMidiEvent.DeltaFrames); } }
public override bool TypeIsInRange(MssMsgType msgType) { return (msgType == MssMsgType.NoteOn || msgType == MssMsgType.NoteOff); }
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; }
public override bool TypeIsInRange(MssMsgType msgType) { return(msgType == MssMsgType.NoteOn || msgType == MssMsgType.NoteOff); }
public virtual bool TypeIsInRange(MssMsgType msgType) { return(msgType == this.MsgType); }
protected MssMsg Factory_MssMsg_CustomTypeAndData1(MssMsgType msgType, double data1) { return(new MssMsg(msgType, data1, MssMsgUtil.UNUSED_MSS_MSG_DATA, 0)); }
public static IStaticMssMsgInfo Create(MssMsgType msgInfoType) { IStaticMssMsgInfo msgInfo; switch (msgInfoType) { case MssMsgType.Note: { msgInfo = new StaticNoteMsgInfo(); break; } case MssMsgType.NoteOn: { msgInfo = new StaticNoteOnMsgInfo(); break; } case MssMsgType.NoteOff: { msgInfo = new StaticNoteOffMsgInfo(); break; } case MssMsgType.CC: { msgInfo = new StaticCCMsgInfo(); break; } case MssMsgType.PitchBend: { msgInfo = new StaticPitchBendMsgInfo(); break; } case MssMsgType.PolyAftertouch: { msgInfo = new StaticPolyAftertouchMsgInfo(); break; } case MssMsgType.ChanAftertouch: { msgInfo = new StaticChanAftertouchMsgInfo(); break; } case MssMsgType.Generator: { msgInfo = new StaticGeneratorMsgInfo(); break; } case MssMsgType.GeneratorModify: { msgInfo = new StaticGeneratorModifyMsgInfo(); break; } case MssMsgType.RelBarPeriodPos: { msgInfo = new StaticRelBarPeriodPosMsgInfo(); break; } case MssMsgType.RelTimePeriodPos: { msgInfo = new StaticRelTimePeriodPosMsgInfo(); break; } case MssMsgType.Parameter: { msgInfo = new StaticParameterMsgInfo(); break; } default: { //Unknown type Debug.Assert(false); msgInfo = null; break; } } return(msgInfo); }
/// <summary> /// Initializes the public member varialbes of this class. This method does not need to /// be called as the public members can be initialized individually. /// </summary> public void InitPublicMembers(MssMsgType msgType, double data1RangeBottom, double data1RangeTop, double data2RangeBottom, double data2RangeTop) { this.MsgType = msgType; this.Data1RangeBottom = data1RangeBottom; this.Data1RangeTop = data1RangeTop; this.Data2RangeBottom = data2RangeBottom; this.Data2RangeTop = data2RangeTop; }
public bool TypeIsInRange(MssMsgType msgType) { return staticInfo.TypeIsInRange(msgType); }
/// <summary> /// Initializes the public member varialbes of this class. When this method is used to /// initialize the class, a MssMsg will have to match data1 and data2 exactally to fall /// into this range. /// </summary> public void InitPublicMembers(MssMsgType msgType, double data1, double data2) { InitPublicMembers(msgType, data1, data1, data2, data2); }
public MssMsgRangeEntryMetadata Create(MssMsgType type) { MssMsgRangeEntryMetadata msgMetadata; switch (type) { case MssMsgType.Note: { msgMetadata = new NoteMsgRangeEntryMetadata(); break; } case MssMsgType.NoteOn: { msgMetadata = new NoteOnMsgRangeEntryMetadata(); break; } case MssMsgType.NoteOff: { msgMetadata = new NoteOffMsgRangeEntryMetadata(); break; } case MssMsgType.CC: { msgMetadata = new CCMsgRangeEntryMetadata(); break; } case MssMsgType.PitchBend: { msgMetadata = new PitchBendMsgRangeEntryMetadata(); break; } case MssMsgType.PolyAftertouch: { msgMetadata = new PolyAftertouchMsgRangeEntryMetadata(); break; } case MssMsgType.ChanAftertouch: { msgMetadata = new ChanAftertouchMsgRangeEntryMetadata(); break; } case MssMsgType.Generator: { var genMsgMetadata = new GeneratorMsgRangeEntryMetadata(); genMsgMetadata.Init(this.genMappingMgr); msgMetadata = genMsgMetadata; break; } case MssMsgType.GeneratorModify: { var genToggleMsgMetadata = new GeneratorModifyMsgRangeEntryMetadata(); genToggleMsgMetadata.Init(this.genMappingMgr); msgMetadata = genToggleMsgMetadata; break; } case MssMsgType.Parameter: { var paramMsgRangeMetadata = new ParameterMsgRangeEntryMetadata(); paramMsgRangeMetadata.Init(this.paramViewer); msgMetadata = paramMsgRangeMetadata; break; } default: { //Unknown type Debug.Assert(false); msgMetadata = null; break; } } return msgMetadata; }
public IMssMsgInfo Create(MssMsgType msgInfoType) { IMssMsgInfo msgInfo; switch (msgInfoType) { case MssMsgType.Note: { msgInfo = new NoteMsgInfo(); break; } case MssMsgType.NoteOn: { msgInfo = new NoteOnMsgInfo(); break; } case MssMsgType.NoteOff: { msgInfo = new NoteOffMsgInfo(); break; } case MssMsgType.CC: { msgInfo = new CCMsgInfo(); break; } case MssMsgType.PitchBend: { msgInfo = new PitchBendMsgInfo(); break; } case MssMsgType.PolyAftertouch: { msgInfo = new PolyAftertouchMsgInfo(); break; } case MssMsgType.ChanAftertouch: { msgInfo = new ChanAftertouchMsgInfo(); break; } case MssMsgType.Generator: { GeneratorMsgInfo genMsgInfo = new GeneratorMsgInfo(); genMsgInfo.Init(this.genMappingMgr); msgInfo = genMsgInfo; break; } case MssMsgType.GeneratorModify: { GeneratorModifyMsgInfo genToggleMsgInfo = new GeneratorModifyMsgInfo(); genToggleMsgInfo.Init(this.genMappingMgr); msgInfo = genToggleMsgInfo; break; } case MssMsgType.RelBarPeriodPos: { msgInfo = new RelBarPeriodPosMsgInfo(); break; } case MssMsgType.RelTimePeriodPos: { msgInfo = new RelTimePeriodPosMsgInfo(); break; } case MssMsgType.Parameter: { ParameterMsgInfo paramMsgInfo = new ParameterMsgInfo(); paramMsgInfo.Init(this.paramViewer); msgInfo = paramMsgInfo; break; } default: { //Unknown type Debug.Assert(false); msgInfo = null; break; } } return msgInfo; }