public void scanLines()
	{
		// initially 0 of everything found
		int numMixers = 0;
		int numTargetLines = 0;
		int numSourceLines = 0;
		int numTargetPorts = 0;
		int numSourcePorts = 0;
		
		lineToMixerTable.clear();
		
		// start arrays with tons of room (truncated later)
		mixers = new Mixer[MAX_COUNT];
		targetDataLines = new TargetDataLine[MAX_COUNT];
		sourceDataLines = new SourceDataLine[MAX_COUNT];
		targetPorts = new Port[MAX_COUNT];
		sourcePorts = new Port[MAX_COUNT];
		
		// cycle through mixers
		Mixer.Info[] mixerInfo = AudioSystem.getMixerInfo();
		for (int i = 0; i < mixerInfo.length; i++)
		{
			Mixer mixer = AudioSystem.getMixer(mixerInfo[i]);
			mixers[numMixers++] = mixer;
			
			Line.Info[] targetInfo = mixer.getTargetLineInfo();
			Line.Info[] sourceInfo = mixer.getSourceLineInfo();
			int j;
			
			// target lines
			for (j = 0; j < targetInfo.length; j++)
			{
				Line line;
				try
				{
					line = mixer.getLine(targetInfo[j]);
					lineToMixerTable.put(line, mixer);
					if (line instanceof TargetDataLine)
					{
						TargetDataLine targetLine = (TargetDataLine)line;
						targetDataLines[numTargetLines++] = targetLine;
					}
					else if (line instanceof Port)
					{
						Port targetPort = (Port)line;
						targetPorts[numTargetPorts++] = targetPort;
					}
				} catch (LineUnavailableException e)
				{
					System.out.println("unable to open line..");
				}
			}
			
			// source lines
			for (j = 0; j < sourceInfo.length; j++)
			{
				Line line;
				try
				{
					line = mixer.getLine(sourceInfo[j]);
					lineToMixerTable.put(line, mixer);
					if (line instanceof SourceDataLine)
					{
						SourceDataLine sourceLine = (SourceDataLine)line;
						sourceDataLines[numSourceLines++] = sourceLine;
					}
					else if (line instanceof Port)
					{
						Port sourcePort = (Port)line;
						sourcePorts[numSourcePorts++] = sourcePort;
					}
				} catch (LineUnavailableException e)
				{
					System.out.println("unable to open line..");
				}
			}
			
		}
		
		// truncate
		mixers = Arrays.copyOf(mixers, numMixers);
		targetDataLines = Arrays.copyOf(targetDataLines, numTargetLines);
		sourceDataLines = Arrays.copyOf(sourceDataLines, numSourceLines);
		targetPorts = Arrays.copyOf(targetPorts, numTargetPorts);
		sourcePorts = Arrays.copyOf(sourcePorts, numSourcePorts);
		
	}