package com.github.sarxos.webcam;

import java.util.ArrayList;
import java.util.List;


public class WebcamCompositeDriver implements WebcamDriver {

	private List<WebcamDriver> drivers = new ArrayList<WebcamDriver>();

	public WebcamCompositeDriver(WebcamDriver... drivers) {
		for (WebcamDriver driver : drivers) {
			this.drivers.add(driver);
		}
	}

	public void add(WebcamDriver driver) {
		drivers.add(driver);
	}

	public List<WebcamDriver> getDrivers() {
		return drivers;
	}

	@Override
	public List<WebcamDevice> getDevices() {
		List<WebcamDevice> all = new ArrayList<WebcamDevice>();
		for (WebcamDriver driver : drivers) {
			all.addAll(driver.getDevices());
		}
		return all;
	}

	@Override
	public boolean isThreadSafe() {
		boolean safe = true;
		for (WebcamDriver driver : drivers) {
			safe &= driver.isThreadSafe();
			if (!safe) {
				break;
			}
		}
		return safe;
	}
}

@@ -145,16 +145,40 @@
 amDriver
+, WebcamDiscoverySupport
  %7B%0D%0A%0D%0A%09p
@@ -243,24 +243,59 @@
 iver%3E();%0D%0A%0D%0A
+%09private int scanInterval = -1;%0D%0A%0D%0A
 %09public Webc
@@ -984,12 +984,318 @@
 fe;%0D%0A%09%7D%0D
+%0A%0D%0A%09public void setScanInterval(int scanInterval) %7B%0D%0A%09%09this.scanInterval = scanInterval;%0D%0A%09%7D%0D%0A%0D%0A%09@Override%0D%0A%09public long getScanInterval() %7B%0D%0A%09%09if (scanInterval %3C= 0) %7B%0D%0A%09%09%09return DEFAULT_SCAN_INTERVAL;%0D%0A%09%09%7D%0D%0A%09%09return scanInterval;%0D%0A%09%7D%0D%0A%0D%0A%09@Override%0D%0A%09public boolean isScanPossible() %7B%0D%0A%09%09return true;%0D%0A%09%7D%0D
 %0A%7D%0D%0A

Add discovery support in composite driver, refs #332