diff --git a/Cavern.QuickEQ.Format/ConfigurationFile/ConvolutionBoxFormatConfigurationFile.cs b/Cavern.QuickEQ.Format/ConfigurationFile/ConvolutionBoxFormatConfigurationFile.cs index bebb2f6..93d63c8 100644 --- a/Cavern.QuickEQ.Format/ConfigurationFile/ConvolutionBoxFormatConfigurationFile.cs +++ b/Cavern.QuickEQ.Format/ConfigurationFile/ConvolutionBoxFormatConfigurationFile.cs @@ -70,15 +70,14 @@ public ConvolutionBoxFormatConfigurationFile(string path) : base(Path.GetFileNam } stream.Position = 8; // Sample rate is read in the constructor int entries = stream.ReadInt32(); - List<(string name, FilterGraphNode root)> inputChannels = new List<(string, FilterGraphNode)>(); + List<(int index, FilterGraphNode root)> inputChannels = new List<(int, FilterGraphNode)>(); Dictionary lastNodes = new Dictionary(); FilterGraphNode GetChannel(int index) { // Get an actual channel's last node if (lastNodes.ContainsKey(index)) { return lastNodes[index]; } - string name = "CH" + (index + 1); - FilterGraphNode newChannel = new FilterGraphNode(new InputChannel(name)); - inputChannels.Add((name, newChannel)); + FilterGraphNode newChannel = new FilterGraphNode(new InputChannel("CH" + (index + 1))); + inputChannels.Add((index, newChannel)); return newChannel; } @@ -118,7 +117,7 @@ FilterGraphNode GetChannel(int index) { // Get an actual channel's last node } } - inputChannels.Sort((a, b) => a.name.CompareTo(b.name)); + inputChannels.Sort((a, b) => a.index.CompareTo(b.index)); foreach (KeyValuePair node in lastNodes) { if (node.Key >= 0) { // TODO: many points make input or output channels from channels, create them from names instead @@ -130,7 +129,7 @@ FilterGraphNode GetChannel(int index) { // Get an actual channel's last node } } } - return inputChannels.ToArray(); + return inputChannels.Select(x => (((InputChannel)x.root.Filter).Name, x.root)).ToArray(); } ///