@@ -0,0 +1,1987 @@
+package com.thegongoliers.input.vision;%0A%0Aimport edu.wpi.cscore.MjpegServer;%0Aimport edu.wpi.cscore.VideoCamera;%0Aimport edu.wpi.first.cameraserver.CameraServer;%0A%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0A/**%0A * A camera server which allows for swapping between multiple cameras (only one streams at a time)%0A */%0Apublic class MultipleCameraServer %7B%0A%0A    private MjpegServer server;%0A    private Map%3CString, VideoCamera%3E cameras;%0A    private String currentCamera;%0A%0A    /**%0A     * Default constructor%0A     * @param name the name of the camera server on SmartDashboard%0A     */%0A    public MultipleCameraServer(String name)%7B%0A        server = CameraServer.getInstance().addSwitchedCamera(name);%0A        cameras = new HashMap%3C%3E();%0A        currentCamera = null;%0A    %7D%0A%0A    /**%0A     * Add a camera to the server. If no camera is currently displayed, the passed in camera will be.%0A     * @param name the unique name of the camera%0A     * @param camera the camera to add%0A     */%0A    public void addCamera(String name, VideoCamera camera)%7B%0A        if (name == null %7C%7C camera == null)%7B%0A            return;%0A        %7D%0A        cameras.put(name, camera);%0A        if (currentCamera == null)%7B%0A            switchToCamera(name);%0A        %7D%0A    %7D%0A%0A    /**%0A     * @return the name of the current camera, or null if no camera is set.%0A     */%0A    public String getCurrentCameraName()%7B%0A        return currentCamera;%0A    %7D%0A%0A    /**%0A     * @return the current camera, of null if no camera is set.%0A     */%0A    public VideoCamera getCurrentCamera()%7B%0A        if (currentCamera == null)%7B%0A            return null;%0A        %7D%0A        return cameras.get(currentCamera);%0A    %7D%0A%0A    /**%0A     * Switch the display to a different camera%0A     * @param name the name of the camera to switch to%0A     */%0A    public void switchToCamera(String name)%7B%0A        VideoCamera camera = cameras.get(name);%0A        if (camera == null)%7B%0A            return;%0A        %7D%0A        currentCamera = name;%0A        server.setSource(camera);%0A    %7D%0A%0A%0A%0A%7D%0A

Add MultipleCameraServer