예제 #1
0
파일: MidiData.cs 프로젝트: RugCode/drg-pt
		/// <summary>
		/// Initializes a new instance of the SysExMessage class with 
		/// another instance of the SysExMessage class.
		/// </summary>
		/// <param name="message">
		/// The SysExMessage instance to use for initialization.
		/// </param>
		public SysExMessage(SysExMessage message)
		{
			type = message.type;

			this.message = new StringBuilder(message.Message);
		}
예제 #2
0
파일: MidiPort.cs 프로젝트: RugCode/drg-pt
        /// <summary>
        /// Dispatch a MIDI System Exclusive message
        /// </summary>
        /// <param name="header"></param>
        /// <param name="timeStamp"></param>
        private void DispatchSysExMessage(MidiLibWrap.MidiHeader header, uint timeStamp)
		{
			// Create array for holding system exclusive data.
			byte[] data = new byte[header.bytesRecorded - 1];

			// Get status byte.
			byte status = Marshal.ReadByte(header.data);
                
			// Copy system exclusive data into array (status byte is excluded).
			for(int i = 1; i < header.bytesRecorded; i++)
			{
				data[i - 1] = Marshal.ReadByte(header.data, i);
			}

			// Create message.
			SysExMessage msg = new SysExMessage((SysExType)status, data);

			// Raise event.
			//SysExReceived(this, new SysExEventArgs(msg, timeStamp));

			// Fire our specific Input Data Event
			if(OnMidiInputPortData!=null)
			{
				ObjectEventArgs e = new ObjectEventArgs( msg );
				OnMidiInputPortData( this, e );
			}

			// Fire the All Midi Input Data event
            //ProjectMidi.ProjectMidiParent.FireAllSysExInputData(msg as ISysExMessage, timeStamp);
		}