/* 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_IVideoMuxImpl_HPP
#define NMM_IVideoMuxImpl_HPP

#include "nmm/nmm_prefix.hpp"

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


#include "visibility.hpp"

namespace NMM
{
  /** Video mux  interface */

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

    virtual ~IVideoMuxImpl() {};

  protected:
    /**
     * Returns the current sync_time of the latest timestamp in the media stream
     */

    virtual Time getCurrentSyncTime() = 0;
    /**
     * Sets x and y position for specified input
     */

    virtual void setPosition(const string& input_jack_tag, const nmm_int32& x, const nmm_int32& y) = 0;
    /**
     * Sets start/end time and start/end value for x position for specified input
     */

    virtual void setXPositionControl(const string& input_jack_tag, const Time& start_time, const Time& end_time, const nmm_int32& start_x, const nmm_int32& end_x) = 0;
    /**
     * Sets start/end time and start/end value for y position for specified input
     */

    virtual void setYPositionControl(const string& input_jack_tag, const Time& start_time, const Time& end_time, const nmm_int32& start_y, const nmm_int32& end_y) = 0;
    /**
     * Sets size for specified input
     */

    virtual void setSize(const string& input_jack_tag, const nmm_int32& size_x, const nmm_int32& size_y) = 0;
    /**
     * Sets start/end time and start/end values for width for specified input
     */

    virtual void setWidthControl(const string& input_jack_tag, const Time& start_time, const Time& end_time, const nmm_int32& start_width, const nmm_int32& end_width, const IVideoMux::Alignment& align) = 0;
    /**
     * Sets start/end time and start/end values for height for specified input
     */

    virtual void setHeightControl(const string& input_jack_tag, const Time& start_time, const Time& end_time, const nmm_int32& start_height, const nmm_int32& end_height, const IVideoMux::Alignment& align) = 0;
    /**
     * Enables/disables the coupling of width and height for the
     * specified input. If enabled, only one of width or height needs
     * to be controlled, the other dimension is updated automatically
     * according to the aspect ratio.
     */

    virtual void setWidthHeightCouplingEnabled(const string& input_jack_tag, const nmm_bool& enable) = 0;
    /**
     * Get the width of specified input
     */

    virtual nmm_int32 getWidth(const string& input_jack_tag) = 0;
    /**
     * Get the height of specified input
     */

    virtual nmm_int32 getHeight(const string& input_jack_tag) = 0;
    /**
     * Get the x position of specified input
     */

    virtual nmm_int32 getXPos(const string& input_jack_tag) = 0;
    /**
     * Get the y position of specified input
     */

    virtual nmm_int32 getYPos(const string& input_jack_tag) = 0;


  private:
    void registerEvents();
  };

}

#include "nmm/nmm_suffix.hpp"

#endif
