/* 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_IBufferDrop_HPP
#define NMM_IBufferDrop_HPP

#include "nmm/nmm_prefix.hpp"

#include "nmm/comm/Interface.hpp"
#include "nmm/comm/messaging/Event.hpp"
#include "nmm/comm/messaging/IllegalStateException.hpp"
#include <memory>

#include "nmm/multimedia/INode.hpp"

#include "visibility.hpp"

namespace NMM
{

  class DLLEXPORT IBufferDrop : virtual public NMM::Interface { 
  public:
    IBufferDrop() : NMM::Interface(IBufferDrop::IBufferDrop_type, "NMM") { };

    IBufferDrop(NMM::NMMObject& parent) : NMM::Interface (parent, IBufferDrop::IBufferDrop_type, "NMM") { };

    virtual ~IBufferDrop() {};

    static const char* IBufferDrop_type;

    virtual  string getInterfaceType() const { return IBufferDrop_type; }

    NMM::Interface* copy() const { return new IBufferDrop(*this); }
    static void used(); 
    static const char* setBufferToDrop_event;
    static const char* setDropRatio_event;
    /**
     * 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)
      throw(const NMM::SerializedException&);
    /**
     * 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)
      throw(const NMM::SerializedException&);


  };

  typedef auto_ptr<IBufferDrop> IBufferDrop_var;



  class DLLEXPORT ITimedBufferDrop : virtual public NMM::Interface { 
  public:
    ITimedBufferDrop() : NMM::Interface(ITimedBufferDrop::ITimedBufferDrop_type, "NMM") { };

    ITimedBufferDrop(NMM::NMMObject& parent) : NMM::Interface (parent, ITimedBufferDrop::ITimedBufferDrop_type, "NMM") { };

    virtual ~ITimedBufferDrop() {};

    static const char* ITimedBufferDrop_type;

    virtual  string getInterfaceType() const { return ITimedBufferDrop_type; }

    NMM::Interface* copy() const { return new ITimedBufferDrop(*this); }
    static void used(); 
    static const char* addInOutPoint_event;
    static const char* useRelativeInOutPoints_event;
    static const char* isRelativeInOutPoints_event;
    /**
     * 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) */
      throw(const NMM::SerializedException&, const NMM::IllegalStateException&);
    /**
     * 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) */
      throw(const NMM::SerializedException&, const NMM::IllegalStateException&);
    /**
     * Gets the status of relative or absolute inout-points
     */

    virtual nmm_bool isRelativeInOutPoints()
      throw(const NMM::SerializedException&);


  };

  typedef auto_ptr<ITimedBufferDrop> ITimedBufferDrop_var;




}

#include "nmm/nmm_suffix.hpp"

#endif
