コード例 #1
0
        private void dataGridView1_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
        {
            if (e.RowIndex >= eventStore.Count)
            {
                return;
            }
            MidiMonitorRecord eventInfo = eventStore[e.RowIndex];

            // Set the cell value to paint
            // first row is always RowIndex
            if (e.ColumnIndex > 0)
            {
                e.Value = GetStringDataByColumnIndex(e.ColumnIndex, eventInfo);
            }
            else
            {
                e.Value = e.RowIndex;
            }
        }
コード例 #2
0
 string GetStringDataByColumnIndex(int columnIndex, MidiMonitorRecord rec)
 {
     if (columnIndex == 1)
     {
         return(rec.eventDate.ToString());
     }
     else if (columnIndex == 2)
     {
         return(rec.eventType);
     }
     else if (columnIndex == 3)
     {
         return(rec.channel.ToString());
     }
     else if (columnIndex == 4)
     {
         return(rec.controlNumber.ToString());
     }
     else if (columnIndex == 5)
     {
         return(rec.controlValue.ToString());
     }
     else if (columnIndex == 6)
     {
         return(rec.programNumber.ToString());
     }
     else if (columnIndex == 7)
     {
         return(rec.noteNumber.ToString());
     }
     else if (columnIndex == 8)
     {
         return(rec.noteVelocity.ToString());
     }
     else
     {
         return(nv);
     }
 }
コード例 #3
0
        private void HandleOnRecieve(object sender, MidiEventReceivedEventArgs args)
        {
            MidiMonitorRecord r = new MidiMonitorRecord(DateTime.Now, args.Event);

            eventStore.Add(r);
        }