Symphonary.ChannelSelector.Refresh C# (CSharp) Method

Refresh() public method

public Refresh ( MidiInfo &midiInfo, int i_Channel ) : void
midiInfo MidiInfo
i_Channel int
return void
        public void Refresh(ref MidiInfo midiInfo, int i_Channel)
        {
            _Channels.Clear();

            for (int i = 0; i < midiInfo.a_UsedChannels.Length; i++)
            {
                if (midiInfo.a_UsedChannels[i])
                {
                    _Channels.Add(new Channel
                                      {
                                          i_ChannelNumber = i,
                                          s_Instrument = midiInfo.a_ChannelInstrumentNames[i],
                                          i_NoteCount = midiInfo.notesForAllChannels[i].Count
                                          //i_NoteCount = -1
                                      });
                }
            }

            if (i_Channel >= 0)
            {
                for (int i = 0; i < channelsListView.Items.Count; i++)
                {
                    if (i_Channel == ((Channel)channelsListView.Items[i]).i_ChannelNumber)
                    {
                        channelsListView.SelectedIndex = i;
                        break;
                    }
                }
            }
        }