private void channelSelector_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (waveOut != null)
StartStopSineWave();
selectedChannels = (sender as ComboBox).SelectedIndex + 1;
if (selectedChannels == 2)
{
_ink.Visibility = Visibility.Visible;
}
history.Clear();
inverse_history.Clear();
channelLabel = new int[selectedChannels];
velocity = new int[selectedChannels];
displacement = new int[selectedChannels];
instant_displacement = new int[selectedChannels];
prev_displacement = new int[selectedChannels];
towards_displacement = new int[selectedChannels];
for (int i = 0; i < selectedChannels; i++)
{
history.Add(new List<int> { 0 });
inverse_history.Add(new List<int> { 0 });
channelLabel[i] = i + 1;
velocity[i] = 0;
instant_displacement[i] = 0;
prev_displacement[i] = 0;
towards_displacement[i] = 1;
displacement[i] = 0;
}
}