/* 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_IBufferDropImpl_HPP
#define NMM_IBufferDropImpl_HPP

#include "nmm/nmm_prefix.hpp"

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

#include "nmm/multimedia/INodeImpl.hpp"

#include "visibility.hpp"

namespace NMM
{

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

    virtual ~IBufferDropImpl() {};

  protected:
    /**
     * Sets which buffers should be dropped (e.g. a '2' meaning every second buffer
     * should be dropped; a '3' meaning every third buffer)
     */

    virtual void setBufferToDrop(const nmm_uint32& buffer_num) = 0;
    /**
     * Use this method to specify a drop ratio, e.g. dropping of 5 out
     * of 25 frames.
     * \param numerator The numerator of the ratio.
     * \param denominator The denominator of the ratio.
     */

    virtual void setDropRatio(const nmm_uint32& numerator, const nmm_uint32& denominator) = 0;


  private:
    void registerEvents();
  };

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

    virtual ~ITimedBufferDropImpl() {};

  protected:
    /**
     * Adds an in and out point for removing timestamped buffers froms stream
     */

    virtual void addInOutPoint(const nmm_uint32& in_secs, const nmm_uint32& in_millisecs, const nmm_uint32& out_secs, const nmm_uint32& out_millisecs) /* limited(INode::CONSTRUCTED) */ = 0;
    /**
     * If true, all inout-points have to be specified relative to first timestamp in stream
     */

    virtual void useRelativeInOutPoints(const nmm_bool& relative) /* limited(INode::CONSTRUCTED) */ = 0;
    /**
     * Gets the status of relative or absolute inout-points
     */

    virtual nmm_bool isRelativeInOutPoints() = 0;


  private:
    void registerEvents();
  };

}

#include "nmm/nmm_suffix.hpp"

#endif
