/* 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_ITVImpl_HPP
#define NMM_ITVImpl_HPP

#include "nmm/nmm_prefix.hpp"

#include "nmm/comm/NMMObject.hpp"
#include "ITV.hpp"

#include "nmm/multimedia/INodeImpl.hpp"

#include "visibility.hpp"

namespace NMM
{
  /** Interface for a Video4Linux based TVCard.
   */

  class DLLEXPORT ITVImpl  : public virtual NMM::NMMObject { 
  public:
    ITVImpl() { addInterface(new ITV(*this)); registerEvents(); };

    virtual ~ITVImpl() {};

  protected:
    /** @name Audio Inputs
     */
//@{
    /** This method returns the number of available audio inputs.
     */

    virtual nmm_uint32 getAudioCount() const /* limited(INode::INITIALIZED) */ /* limited(INode::ACTIVATED) */ /* limited(INode::STARTED) */ /* limited(INode::OUTPUT_INITIALIZED) */ = 0;
    /** This method returns the properties of the specified audio input.
     * @param index Index of audio input, ranges from 0 to getAudioCount()-1
     */

    virtual TVAudio getAudio(const nmm_uint32& index) const /* limited(INode::INITIALIZED) */ /* limited(INode::ACTIVATED) */ /* limited(INode::STARTED) */ /* limited(INode::OUTPUT_INITIALIZED) */ = 0;
    /** This method returns the list of available audio inputs.
     */

    virtual list<TVAudio >  getAudioList() const /* limited(INode::INITIALIZED) */ /* limited(INode::ACTIVATED) */ /* limited(INode::STARTED) */ /* limited(INode::OUTPUT_INITIALIZED) */ = 0;
    /** This method returns the index of the current audio input.
     */

    virtual nmm_uint32 getCurrentAudio() const /* limited(INode::INITIALIZED) */ /* limited(INode::ACTIVATED) */ /* limited(INode::STARTED) */ /* limited(INode::OUTPUT_INITIALIZED) */ = 0;
    /** This method sets the index of the current audio input.
     * @param index Index of audio input, ranges from 0 to getAudioCount()-1
     */

    virtual void setCurrentAudio(const nmm_uint32& index) /* limited(INode::INITIALIZED) */ /* limited(INode::ACTIVATED) */ /* limited(INode::STARTED) */ /* limited(INode::OUTPUT_INITIALIZED) */ = 0;
//@}
    /** @name Inputs
     */
//@{
    /** This method returns the number of available inputs.
     */

    virtual nmm_uint32 getInputCount() const /* limited(INode::INITIALIZED) */ /* limited(INode::ACTIVATED) */ /* limited(INode::STARTED) */ /* limited(INode::OUTPUT_INITIALIZED) */ = 0;
    /** This method returns the properties of the specified input.
     * @param num Input number, ranges from 0 to getInputCount()-1
     */

    virtual TVInput getInput(const nmm_uint32& num) const /* limited(INode::INITIALIZED) */ /* limited(INode::ACTIVATED) */ /* limited(INode::STARTED) */ /* limited(INode::OUTPUT_INITIALIZED) */ = 0;
    /** This method returns the list of available inputs.
     */

    virtual list<TVInput >  getInputList() const /* limited(INode::INITIALIZED) */ /* limited(INode::ACTIVATED) */ /* limited(INode::STARTED) */ /* limited(INode::OUTPUT_INITIALIZED) */ = 0;
    /** This method returns the current input.
     */

    virtual nmm_uint32 getCurrentInput() const /* limited(INode::INITIALIZED) */ /* limited(INode::ACTIVATED) */ /* limited(INode::STARTED) */ /* limited(INode::OUTPUT_INITIALIZED) */ = 0;
    /** This method sets the current input.
     * @param num Input number, ranges from 0 to getInputCount()-1
     */

    virtual void setCurrentInput(const nmm_uint32& num) /* limited(INode::INITIALIZED) */ /* limited(INode::ACTIVATED) */ /* limited(INode::STARTED) */ /* limited(INode::OUTPUT_INITIALIZED) */ = 0;
//@}
    /** @name Standards
     */
//@{
    /** This method returns the identifier of the standard which matches the given name.
     * If no such standard is found, zero is returned.
     */

    virtual nmm_uint32 getStandardByName(const string& name) const /* limited(INode::INITIALIZED) */ /* limited(INode::ACTIVATED) */ /* limited(INode::STARTED) */ /* limited(INode::OUTPUT_INITIALIZED) */ = 0;
    /** This method returns the properties of the specified standard.
     * @param num Standard number
     */

    virtual TVStandard getStandard(const nmm_uint32& num) const /* limited(INode::INITIALIZED) */ /* limited(INode::ACTIVATED) */ /* limited(INode::STARTED) */ /* limited(INode::OUTPUT_INITIALIZED) */ = 0;
    /** This method returns the list of supported standards
     */

    virtual list<TVStandard >  getStandardList() const /* limited(INode::INITIALIZED) */ /* limited(INode::ACTIVATED) */ /* limited(INode::STARTED) */ /* limited(INode::OUTPUT_INITIALIZED) */ = 0;
    /** This method returns the standard set for the current input.
     */

    virtual nmm_uint32 getCurrentStandard() const /* limited(INode::INITIALIZED) */ /* limited(INode::ACTIVATED) */ /* limited(INode::STARTED) */ /* limited(INode::OUTPUT_INITIALIZED) */ = 0;
    /** This method sets the standard for the current input
     * @param num Standard number
     */

    virtual void setCurrentStandard(const nmm_uint32& standard) /* limited(INode::INITIALIZED) */ /* limited(INode::ACTIVATED) */ /* limited(INode::STARTED) */ /* limited(INode::OUTPUT_INITIALIZED) */ = 0;
    /** This method sets the standard for the current input by name.
     */

    virtual void setStandardByName(const string& name) /* limited(INode::INITIALIZED) */ /* limited(INode::ACTIVATED) */ /* limited(INode::STARTED) */ /* limited(INode::OUTPUT_INITIALIZED) */ = 0;
//@}
    /** @name Tuners.
     */
//@{
    /** This method returns the number of tuners.
     */

    virtual nmm_uint32 getTunerCount() const /* limited(INode::INITIALIZED) */ /* limited(INode::ACTIVATED) */ /* limited(INode::STARTED) */ /* limited(INode::OUTPUT_INITIALIZED) */ = 0;
    /** This method returns information about a tuner.
     * @param index Index of tuner, ranges from 0 to getTunerCount()-1
     */

    virtual TVTuner getTuner(const nmm_uint32& index) const /* limited(INode::INITIALIZED) */ /* limited(INode::ACTIVATED) */ /* limited(INode::STARTED) */ /* limited(INode::OUTPUT_INITIALIZED) */ = 0;
    /** This method returns the list of tuners.
     */

    virtual list<TVTuner >  getTunerList() const /* limited(INode::INITIALIZED) */ /* limited(INode::ACTIVATED) */ /* limited(INode::STARTED) */ /* limited(INode::OUTPUT_INITIALIZED) */ = 0;
    /** This method returns the current frequency of a tuner.
     * @param tuner Number of the tuner
     * @return The current frequency in MHz
     */

    virtual nmm_float getFrequency(const nmm_uint32& tuner) const /* limited(INode::INITIALIZED) */ /* limited(INode::ACTIVATED) */ /* limited(INode::STARTED) */ /* limited(INode::OUTPUT_INITIALIZED) */ = 0;
    /** This method sets the frequency of a tuner.
     * @param tuner Number of the tuner
     * @param frequency The frequency to set in MHz
     */

    virtual void setFrequency(const nmm_uint32& tuner, const nmm_float& frequency) /* limited(INode::INITIALIZED) */ /* limited(INode::ACTIVATED) */ /* limited(INode::STARTED) */ /* limited(INode::OUTPUT_INITIALIZED) */ = 0;
//@}
    /** @name Controls.
     */
//@{
    /** This method gets the current brightness.
     */

    virtual nmm_uint32 getBrightness() const /* limited(INode::INITIALIZED) */ /* limited(INode::ACTIVATED) */ /* limited(INode::STARTED) */ /* limited(INode::OUTPUT_INITIALIZED) */ = 0;
    /** This method gets the current contrast.
     */

    virtual nmm_uint32 getContrast() const /* limited(INode::INITIALIZED) */ /* limited(INode::ACTIVATED) */ /* limited(INode::STARTED) */ /* limited(INode::OUTPUT_INITIALIZED) */ = 0;
    /** This method gets the current saturation.
     */

    virtual nmm_uint32 getSaturation() const /* limited(INode::INITIALIZED) */ /* limited(INode::ACTIVATED) */ /* limited(INode::STARTED) */ /* limited(INode::OUTPUT_INITIALIZED) */ = 0;
    /** This method gets the current hue.
     */    

    virtual nmm_int32 getHue() const /* limited(INode::INITIALIZED) */ /* limited(INode::ACTIVATED) */ /* limited(INode::STARTED) */ /* limited(INode::OUTPUT_INITIALIZED) */ = 0;
    /** This method gets the current volume.
     */

    virtual nmm_uint32 getVolume() const /* limited(INode::INITIALIZED) */ /* limited(INode::ACTIVATED) */ /* limited(INode::STARTED) */ /* limited(INode::OUTPUT_INITIALIZED) */ = 0;
    /** This method gets the mute status.
     */

    virtual nmm_bool getMute() const /* limited(INode::INITIALIZED) */ /* limited(INode::ACTIVATED) */ /* limited(INode::STARTED) */ /* limited(INode::OUTPUT_INITIALIZED) */ = 0;
    /** This method sets the brightness.
     * @param brightness Brightness (0 to 255)
     */

    virtual void setBrightness(const nmm_uint32& brightness) /* limited(INode::INITIALIZED) */ /* limited(INode::ACTIVATED) */ /* limited(INode::STARTED) */ /* limited(INode::OUTPUT_INITIALIZED) */ = 0;
    /** This method sets the contrast.
     * @param contrast Contrast (0 to 127)
     */

    virtual void setContrast(const nmm_uint32& contrast) /* limited(INode::INITIALIZED) */ /* limited(INode::ACTIVATED) */ /* limited(INode::STARTED) */ /* limited(INode::OUTPUT_INITIALIZED) */ = 0;
    /** This method sets the saturation.
     * @param saturation Saturation (0 to 127)
     */

    virtual void setSaturation(const nmm_uint32& saturation) /* limited(INode::INITIALIZED) */ /* limited(INode::ACTIVATED) */ /* limited(INode::STARTED) */ /* limited(INode::OUTPUT_INITIALIZED) */ = 0;
    /** This method sets the hue.
     * @param hue Hue offset (-128 to 127)
     */

    virtual void setHue(const nmm_int32& hue) /* limited(INode::INITIALIZED) */ /* limited(INode::ACTIVATED) */ /* limited(INode::STARTED) */ /* limited(INode::OUTPUT_INITIALIZED) */ = 0;
    /** This method sets the volume.
     * @param volume Volume (0 to 65535)
     */

    virtual void setVolume(const nmm_uint32& volume) /* limited(INode::INITIALIZED) */ /* limited(INode::ACTIVATED) */ /* limited(INode::STARTED) */ /* limited(INode::OUTPUT_INITIALIZED) */ = 0;
    /** This method sets the mute state.
     */

    virtual void setMute(const nmm_bool& mute) /* limited(INode::INITIALIZED) */ /* limited(INode::ACTIVATED) */ /* limited(INode::STARTED) */ /* limited(INode::OUTPUT_INITIALIZED) */ = 0;
//@}
    /** @name Frequency tables
     */
//@{
    /** This method returns the available frequency tables.
     */

    virtual list<string >  getFrequencyTableList() const /* limited(INode::INITIALIZED) */ /* limited(INode::ACTIVATED) */ /* limited(INode::STARTED) */ /* limited(INode::OUTPUT_INITIALIZED) */ = 0;
    /** This method returns the current frequency table.
     */

    virtual string getFrequencyTable() const /* limited(INode::INITIALIZED) */ /* limited(INode::ACTIVATED) */ /* limited(INode::STARTED) */ /* limited(INode::OUTPUT_INITIALIZED) */ = 0;
    /** This method sets the current frequency table.
     * @param name Name of the frequency table
     */

    virtual void setFrequencyTable(const string& table) /* limited(INode::INITIALIZED) */ /* limited(INode::ACTIVATED) */ /* limited(INode::STARTED) */ /* limited(INode::OUTPUT_INITIALIZED) */ = 0;
    /** This method set input-/output-properties in the MSP-matrix
     * @param input input-value
     * @param output output-value
    */

    virtual void setInputOutput(const nmm_int32& input, const nmm_int32& output) /* limited(INode::ACTIVATED) */ /* limited(INode::STARTED) */ /* limited(INode::OUTPUT_INITIALIZED) */ = 0;

//@}

  private:
    void registerEvents();
  };

}

#include "nmm/nmm_suffix.hpp"

#endif
