/* Network-Integrated Multimedia Middleware (NMM)
 * http://www.motama.com/nmm.html
 *
 * Copyright (C) 2006-2007
 * Motama GmbH, Saarbruecken, Germany
 * http://www.motama.com
 *
 * This file is part of NMM. 
 * 
 * NMM is free software; you can redistribute it and/or modify it    
 * under the terms of the GNU General Public License as published by 
 * the Free Software Foundation; only version 2 of the License.      
 * 
 * NMM is distributed in the hope that it will be useful, but WITHOUT 
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 
 * License for more details.  
 * 
 * You should have received a copy of the GNU General Public License 
 * along with NMM; if not, write to the Free Software Foundation,    
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 */


module NMM {
  interface IVISCACamera {
    /**
     * IF_Clear 
     * 
     * Clears the command buffers in the camera and 
     * cancels the command currently beeing executed.
     *
     * this function will be called automaticly by the init
     * function 
     *
     * input  : the number of the camera [1;7,8]
     *          camera_id 8 means broadcast, all 
     *          cameras will clear their command
     *          buffers
     * output : SUCCESS when success, else FAILURE
     */
    Result IF_Clear( in nmm_uchar  value);
    
    /**
     * AddressSet
     *
     * Scan all cameras connected to the VISCA-bus 
     * and dispatch one VISCA-address for each camera found.
     *
     * This function will be called automaticly by the 
     * init function
     *
     * input  : none
     * output : SUCCESS when success, else FAILURE
     */
    Result AddressSet();
    
    /**
     * getNumberOfCameras
     *
     * Returns the number of cameras connected to the VISCA-bus
     *
     * input  : none
     * output : number of cameras found
     */
    Result getNumberOfCameras(out nmm_uchar value);
    
    
    /**
     * CommandCancel
     * 
     * Cancel the command currently executed by the camera
     * with the address <camera identificator> and the socket
     * number <socket id>.
     *
     * input  : camera identificator and socket id
     * output : SUCCESS, if the command is canceled
     *          FAILURE, if not
     */
    Result CommandCancel( in nmm_uchar value1, in nmm_uchar  value2);
    
    
    /**
     * Power functions
     *
     * The following functions controlls the powerstate 
     * of the cameras. Each camera can be controlled seperatly,
     * selectecd by the <camera id>. The AutoPowerOff-function sets 
     * the timer after the camera goes in standby-mode, when no 
     * VISCA-cammand arrived 
     *
     * input  : camera id
     * output : SUCCESS if success, else FAILURE
     */
    Result PowerOn( in nmm_uchar  value);
    Result PowerOff( in nmm_uchar  value);
    Result AutoPowerOff( in nmm_uchar value1, in nmm_int32  value2);
    
    
    /**
     * Zoom functions
     *
     * The following functions controls the zoom of the camera. 
     * All that functions expect the <camera_id> as parameter.
     * Some of them allow additional speed settings 
     *
     * - The Range for the Zoom:
     *   optical zoom : [    0;16384]
     *   digital zoom : [16384;28672]
     * - ZoomDZoom(On|Off) turn the DigitalZoom On or Off.
     */
    Result ZoomStop( in nmm_uchar  value);
    Result ZoomTeleStd( in nmm_uchar  value);
    Result ZoomWideStd( in nmm_uchar  value);
    Result ZoomTeleVar( in nmm_uchar value1, in nmm_uchar value2);
    Result ZoomWideVar( in nmm_uchar value1, in nmm_uchar value2);
    Result ZoomDirect( in nmm_uchar value1, in nmm_int32  value2); 
    Result ZoomDigitalZoomOnOff(in nmm_uchar value1, in nmm_bool value2);
    
    
    /**
     * Focus functions
     * 
     * the Focus* functions are controling the settings of te
     * camera's focus. All functions expect the <camera_id> 
     * as first parameter, some an additional parameter
     */
    Result FocusStop(in nmm_uchar value);
    Result FocusFarStd(in nmm_uchar value);
    Result FocusNearStd(in nmm_uchar value);
    Result FocusFarVar(in nmm_uchar value1,in nmm_uchar value2);
    Result FocusNearVar(in nmm_uchar value1,in nmm_uchar value2);
    Result FocusDirect(in nmm_uchar value1,in nmm_uint16 value2);
    Result FocusAutoFocus(in nmm_uchar value); 
    Result FocusManualFocus(in nmm_uchar value);
    Result FocusAutoManual(in nmm_uchar value);
    Result FocusOnePushTrigger(in nmm_uchar value);
    Result FocusInfinity(in nmm_uchar value);
    Result FocusAFSensHigh(in nmm_uchar value);
    Result FocusAFSensLow(in nmm_uchar value);
    Result FocusNearLimit(in nmm_uchar value1,in nmm_uint16 value2);
    
    
    /**
     * WhiteBalance
     */
    Result WhiteBalance(in nmm_uchar value1,in nmm_uchar value2,in nmm_uchar value3);
    Result WhiteBalanceAuto(in nmm_uchar value);
    Result WhiteBalanceIndoor(in nmm_uchar value);
    Result WhiteBalanceOutdoor(in nmm_uchar value);
    Result WhiteBalanceOnePush(in nmm_uchar value);
    Result WhiteBalanceAT(in nmm_uchar value);
    Result WhiteBalanceManual(in nmm_uchar value);
    Result WhiteBalanceOnePushTrigger(in nmm_uchar value);
    
    
    /**
     * RGain
     */
    Result RGainReset(in nmm_uchar value);
    Result RGainUp(in nmm_uchar value);
    Result RGainDown(in nmm_uchar value);
    Result RGainDirect(in nmm_uchar value1,in nmm_uint16 value2);
    
    
    
    /**
     * BGain
     */
    Result BGainReset(in nmm_uchar value);
    Result BGainUp(in nmm_uchar value);
    Result BGainDown(in nmm_uchar value);
    Result BGainDirect(in nmm_uchar value1,in nmm_uint16 value2);
    
    
    /**
     * Automatic Exposure 
     */
    Result AutomaticExposureFull(in nmm_uchar value);
    Result AutomaticExposureManual(in nmm_uchar value);
    Result AutomaticExposureShutterPriority(in nmm_uchar value);
    Result AutomaticExposureIrisPriority(in nmm_uchar value);
    Result AutomaticExposureGainPriority(in nmm_uchar value);
    Result AutomaticExposureBright(in nmm_uchar value);
    Result AutomaticExposureShutterAuto(in nmm_uchar value);
    Result AutomaticExposureIrisAuto(in nmm_uchar value);
    Result AutomaticExposureGainAuto(in nmm_uchar value);
    
    /**
     * Slow Shutter
     */
    Result SlowShutter(in nmm_uchar value1,in nmm_bool value2);
    
    /**
     * Shutter
     */
    Result ShutterReset(in nmm_uchar value);
    Result ShutterUp(in nmm_uchar value);
    Result ShutterDown(in nmm_uchar value);
    Result ShutterDirect(in nmm_uchar value1,in nmm_uint16 value2);
    

    /**
     * Iris
     */
    Result IrisReset(in nmm_uchar value);
    Result IrisUp(in nmm_uchar value);
    Result IrisDown(in nmm_uchar value);
    Result IrisDirect(in nmm_uchar value1,in nmm_uint16 value2);


    /**
     * Gain
     */
    Result GainReset(in nmm_uchar value);
    Result GainUp(in nmm_uchar value);
    Result GainDown(in nmm_uchar value);
    Result GainDirect(in nmm_uchar value1,in nmm_uint16 value2);

    /**
     * Bright
     */
    Result BrightReset(in nmm_uchar value);
    Result BrightUp(in nmm_uchar value);
    Result BrightDown(in nmm_uchar value);
    Result BrightDirect(in nmm_uchar value1,in nmm_uint16 value2);
    
    /**
     * Exposure Compensation
     */
    Result ExposureCompensationOnOff(in nmm_uchar value1,in nmm_bool value2);
    Result ExposureCompensationReset(in nmm_uchar value);
    Result ExposureCompensationUp(in nmm_uchar value);
    Result ExposureCompensationDown(in nmm_uchar value);
    Result ExposureCompensationDirect(in nmm_uchar value1,in nmm_uint16 value2);
    
    /** 
     * BackLight
     */
    Result BackLightOnOff(in nmm_uchar value1,in nmm_bool value2);
    
    
    /**
     * Aperture
     */
    Result ApertureReset(in nmm_uchar value);
    Result ApertureUp(in nmm_uchar value);
    Result ApertureDown(in nmm_uchar value);
    Result ApertureDirect(in nmm_uchar value1,in nmm_uint16 value2);
    
    
    /**
     * Wide Mode
     */
    Result WideModeOff(in nmm_uchar value);
    Result WideModeCinema(in nmm_uchar value);
    Result WideMode16to9Full(in nmm_uchar value);
    
    
    /**
     *  Mirror image on or off
     */
    Result LR_Reverse(in nmm_uchar value1, in nmm_bool value2);
    
    /**
     *  Freeze image on or off
     */
    Result Freeze(in nmm_uchar value1, in nmm_bool value2);
    
    
    /**
     * Picture Effects
     *
     * These functions allows to turn internal effects on or off. 
     * They expect as parameter the <camera_id>.
     */
    Result PictureEffectOff( in nmm_uchar  value);
    Result PictureEffectPastel( in nmm_uchar  value);
    Result PictureEffectNegArt( in nmm_uchar  value);
    Result PictureEffectSepia( in nmm_uchar  value);
    Result PictureEffectBW( in nmm_uchar  value);
    Result PictureEffectSolarize( in nmm_uchar  value);
    Result PictureEffectMosaic( in nmm_uchar  value);
    Result PictureEffectSlim( in nmm_uchar  value);
    Result PictureEffectStretch( in nmm_uchar  value);
    

    /**
     * Digital Effects
     *
     * These functions allows to turn internal digital effects 
     * on or off. They expect as parameter the <camera_id>.
     *
     * Please don't call DigitalEffect( in nmm_uchar value1, in nmm_uchar ), its a parent
     * functions for all the other effect functions  
     */
    Result DigitalEffectOff( in nmm_uchar  value);
    Result DigitalEffectStill( in nmm_uchar  value);
    Result DigitalEffectFlash( in nmm_uchar  value);
    Result DigitalEffectLumi( in nmm_uchar  value);
    Result DigitalEffectTrail( in nmm_uchar  value);
    Result DigitalEffectLevel( in nmm_uchar  value1, in nmm_uchar value2, in nmm_uchar value3);
    

    /**
     * Memory (user defined presets)
     */
    Result Memory(in nmm_uchar value1,in nmm_uchar value2, in nmm_uchar value3);
    Result MemoryReset( in nmm_uchar value1, in nmm_uchar  value2);
    Result MemorySet( in nmm_uchar value1, in nmm_uchar  value2);
    Result MemoryRecall( in nmm_uchar value1, in nmm_uchar  value2);
    
    
    /**
     * DataScreen (OSD)
     */
    Result DataScreenOnOff(in nmm_uchar value1,in nmm_bool value2);
    

    /**
     * IR (remote controller)
     */
    Result IRReceiveOnOff(in nmm_uchar value1, in nmm_bool value2);
    Result IRReceiveReturn(in nmm_uchar value1, in nmm_bool value2);
    

    /** 
     * PanTiltDriveMotion
     *
     * input  : camera-identifier value1,
     *          motion x-direction, motion y-direction, 
     *          speed x-direction, speed y-direction
     * output : SUCCESS, if command send with success
     *          FAILURE, if an error occured
     * 
     * used for PanTiltDrive-motion functions
     */
    Result PanTiltDriveMotion(in nmm_uchar value1, in nmm_uchar value2, in nmm_uchar value3, in nmm_uchar value4, in nmm_uchar value5);
    
    Result PanTiltDriveUp( in nmm_uchar value1, in nmm_uchar value2, in nmm_uchar value3);
    Result PanTiltDriveDown( in nmm_uchar value1, in nmm_uchar value2, in nmm_uchar value3);
    Result PanTiltDriveLeft( in nmm_uchar value1, in nmm_uchar value2, in nmm_uchar value3);
    Result PanTiltDriveRight( in nmm_uchar value1, in nmm_uchar value2, in nmm_uchar value3);
    Result PanTiltDriveUpLeft( in nmm_uchar value1, in nmm_uchar value2, in nmm_uchar value3);
    Result PanTiltDriveUpRight( in nmm_uchar value1, in nmm_uchar value2, in nmm_uchar value3);
    Result PanTiltDriveDownLeft( in nmm_uchar value1, in nmm_uchar value2, in nmm_uchar value3);
    Result PanTiltDriveDownRight( in nmm_uchar value1, in nmm_uchar value2, in nmm_uchar value3);
    Result PanTiltDriveStop( in nmm_uchar value1, in nmm_uchar value2, in nmm_uchar value3);
    
    /** 
     * PanTiltDrivePosition
     *
     * input  : camera-identifier,
     *          position-mode (relative or absolute)
     *          motion x-direction in coordinates
     *          morion y-direction in coordinates
     *          speed x-direction, speed y-direction
     * output : SUCCESS, if command send with success
     *          FAILURE, if an error occured
     * 
     * used for PanTiltDrive-position functions
     */
    Result PanTiltDrivePosition( in nmm_uchar value1, in nmm_uchar value2, in nmm_int32 value3, in nmm_int32 value4, in nmm_uchar value5, in nmm_uchar value6);
    Result PanTiltDriveAbsolute( in nmm_uchar value1, in nmm_int32 value2, in nmm_int32 value3, in nmm_uchar value4, in nmm_uchar value5);
    Result PanTiltDriveRelative( in nmm_uchar value1, in nmm_int32 value2, in nmm_int32 value3, in nmm_uchar value4, in nmm_uchar value5);
    
    Result PanTiltDriveAbsoluteDeg( in nmm_uchar value1, in nmm_int32 value2, in nmm_int32 value3, in nmm_uchar value4, in nmm_uchar value5);
    Result PanTiltDriveRelativeDeg( in nmm_uchar value1, in nmm_int32 value2, in nmm_int32 value3, in nmm_uchar value4, in nmm_uchar value5);
    
    Result PanTiltDriveHome( in nmm_uchar  value);
    Result PanTiltDriveReset( in nmm_uchar  value);
    Result PanTiltLimitSet( in nmm_uchar value1, in nmm_uchar value2, in nmm_int32 value3, in nmm_int32 value4);
    Result PanTiltLimitClear( in nmm_uchar value1, in nmm_uchar  value2);
    
    
    /**
     * Inquiry Command List 
     */
    
    /**
     * PowerInq
     *
     * input : The camera ID
     * ouput : The status of the Camera
     *          true = On
     *          false =Off(Standby)
     */
    Result PowerInq( in nmm_uchar value1,out nmm_bool  value2);
    Result AutoPowerOffInq( in nmm_uchar value1,out nmm_uint16  value2);
    Result DZoomModeInq(in nmm_uchar value1, out nmm_bool value2);
    Result ZoomPosInq(in nmm_uchar value1, out nmm_uint16 value2);
    Result FocusModeInq(in nmm_uchar value1,out nmm_bool value2);
    Result FocusPosInq(in nmm_uchar value1,out nmm_uint16 value2);
    Result AFModeInq(in nmm_uchar value1,out nmm_bool value2);
    Result FocusNearLimitInq(in nmm_uchar value1,out nmm_uint16 value2);
    Result WhiteBalanceModeInq(in nmm_uchar value1,out nmm_uchar value2);
    Result RGainInq(in nmm_uchar value1,out nmm_uchar value2);
    Result BGainInq(in nmm_uchar value1,out nmm_uint16 value2);
    Result AutoExposureModeInq(in nmm_uchar value1,out nmm_uchar value2);
    Result SlowShutterModeInq(in nmm_uchar value1,out nmm_bool value2);
    Result ShutterPosInq(in nmm_uchar value1,out nmm_uint16 value2);
    Result IrisPosInq(in nmm_uchar value1,out nmm_uint16 value2);
    Result GainPosInq(in nmm_uchar value1,out nmm_uint16 value2);
    Result BrightPosInq(in nmm_uchar value1,out nmm_uint16 value2);
    Result ExposureCompensationModeInq(in nmm_uchar value1,out nmm_bool value2);
    Result ExposureCompensationPosInq(in nmm_uchar value1,out nmm_uint16 value2);
    Result BackLightModeInq(in nmm_uchar value1,out nmm_bool value2);
    Result ApertureInq(in nmm_uchar value1,out nmm_uint16 value2);
    Result WideModeInq(in nmm_uchar value1,out nmm_uchar value2);
    Result LR_ReverseModeInq(in nmm_uchar value1, out nmm_bool value2);
    Result FreezeModeInq(in nmm_uchar value1, out nmm_bool value2);
    Result PictureEffectModeInq(in nmm_uchar value1, out nmm_uchar value2);
    Result DigitalEffectModeInq(in nmm_uchar value1, out nmm_uchar value2);
    Result DigitalEffectLevelInq(in nmm_uchar value1, out nmm_uchar value2);
    Result MemoryInq(in nmm_uchar value1,out nmm_uchar value2);
    Result DatascreenInq(in nmm_uchar value1,out nmm_bool value2);
    Result PanTiltModeInq(in nmm_uchar value1,out nmm_uint16 value2);
    Result PanTiltMaxSpeedInq(in nmm_uchar value1,out nmm_uchar  value2,out nmm_uchar value3);
    Result PanTiltPosInq(in nmm_uchar value1, out nmm_int32 value2, out nmm_int32 value3);
    Result VideoSystemInq(in nmm_uchar value1,out nmm_uchar value2);
    Result DeviceTypeInq(in nmm_uchar value1, out nmm_uint16 value2, out nmm_uint16 value3, out nmm_uint16 value4, out nmm_uchar value5);
    
    /**
     * misc stuff
     */
    void verbose(in string value1, in string value2);
    nmm_bool islocked(in nmm_uchar value);
  };
}
