/* 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.
 *
 */


#ifndef NMM_CAMERA1394_HPP
#define NMM_CAMERA1394_HPP

#include "nmm/nmm_prefix.hpp"



#include "GenericFireWireNode.hpp"
#include "nmm/plugins/video/camera/ICameraImpl.hpp"

namespace L1394 {
  class Camera;
}

namespace NMM{


/* \class Camera1394
 * This class creates a wrapper-node for a FireWire device.
 *
 * A Camera1394 controls a L1394::Device object.
 */

class Camera1394 : public GenericFireWireNode, public ICameraImpl
{
public:

/**
  * Constructor
  */
  Camera1394(const char* name = "Camera1394");

/**
  * Destructor
  */
  virtual ~Camera1394(){};
protected:
  virtual Result doActivate();

  /* \fn doStart()
   * \brief This function starts the current device
   */
  virtual Result doStart();

  /* \fn doStop()
   * \brief This function stops a started device
   */
  virtual Result doStop();

  virtual Result doInit();


protected: //event methods

  virtual void setBrightness(const nmm_int32& value);
  virtual void setAutoExposure(const nmm_int32& value);
  virtual void setSharpness(const nmm_int32& value);
  virtual void setWhiteBalance(const nmm_int32& value);
  virtual void setBlueBalance(const nmm_int32& value);
  virtual void setRedBalance(const nmm_int32& value);

  virtual void setHue(const nmm_int32& value)      ;
  virtual void setSaturation(const nmm_int32& value);
  virtual void setGamma(const nmm_int32& value)    ;
  virtual void setShutter(const nmm_int32& value)  ;
  virtual void setGain(const nmm_int32& value)     ;
  virtual void setIris(const nmm_int32& value)     ;
  virtual void setFocus(const nmm_int32& value)    ;
  virtual void setZoom(const nmm_int32& value)     ;
  virtual void onePush()              ;


  virtual nmm_int32 getBrightness()        const;
  virtual nmm_int32 getAutoExposure()      const;
  virtual nmm_int32 getSharpness()         const;
  virtual nmm_int32 getWhiteBalance()      const;
  virtual nmm_int32 getBlueBalance()       const;
  virtual nmm_int32 getRedBalance()        const;

  virtual nmm_int32 getHue()               const;
  virtual nmm_int32 getSaturation()        const;
  virtual nmm_int32 getGamma()             const;
  virtual nmm_int32 getShutter()           const;
  virtual nmm_int32 getGain()              const;
  virtual nmm_int32 getIris()              const;
  virtual nmm_int32 getFocus()             const;
  virtual nmm_int32 getZoom()              const;


  virtual pair<nmm_int32, nmm_int32> getBrightnessRange()           const;
  virtual pair<nmm_int32, nmm_int32> getAutoExposureRange()  const;
  virtual pair<nmm_int32, nmm_int32> getSharpnessRange()     const;
  virtual pair<nmm_int32, nmm_int32> getWhiteBalanceRange()  const;
  virtual pair<nmm_int32, nmm_int32> getHueRange()           const;
  virtual pair<nmm_int32, nmm_int32> getSaturationRange()    const;
  virtual pair<nmm_int32, nmm_int32> getGammaRange()         const;
  virtual pair<nmm_int32, nmm_int32> getShutterRange()       const;
  virtual pair<nmm_int32, nmm_int32> getGainRange()          const;
  virtual pair<nmm_int32, nmm_int32> getIrisRange()          const;
  virtual pair<nmm_int32, nmm_int32> getFocusRange()         const;
  virtual pair<nmm_int32, nmm_int32> getZoomRange()          const;


  virtual nmm_bool hasBrightness()     const;
  virtual nmm_bool hasAutoExposure()   const;
  virtual nmm_bool hasSharpness()      const;
  virtual nmm_bool hasWhiteBalance()   const;
  virtual nmm_bool hasHue()            const;
  virtual nmm_bool hasSaturation()     const;
  virtual nmm_bool hasGamma()          const;
  virtual nmm_bool hasShutter()        const;
  virtual nmm_bool hasGain()           const;
  virtual nmm_bool hasIris()           const;
  virtual nmm_bool hasFocus()          const;
  virtual nmm_bool hasZoom()           const;


private:
  L1394::Camera* camera;
  bool automatic;
};
}

#include "nmm/nmm_suffix.hpp"

#endif

