/* 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_ISwitch_HPP
#define NMM_ISwitch_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>

/* Network-Integrated Multimedia Middleware (NMM)
 * http://www.motama.com/nmm.html
 *
 * Copyright (C) 2006-2007
 * Motama GmbH, Saarbruecken, Germany
 * http://www.motama.com
 *
 * See file LICENCE for terms and conditions of usage
 *
 */

#include "nmm/comm/messaging/Timestamp.hpp"

#include "visibility.hpp"

namespace NMM
{
  /** Interface for output switching of a node.
   * This interface is used for switching the outputs of a node. It defines instream events used during
   * output switching and provides methods for enabling and disabling the usage of these events when
   * output jacks are connected.
   *
   * @deprecated Output switching is deprecated
   */

  class DLLEXPORT ISwitch : virtual public NMM::Interface { 
  public:
    ISwitch() : NMM::Interface(ISwitch::ISwitch_type, "NMM") { };

    ISwitch(NMM::NMMObject& parent) : NMM::Interface (parent, ISwitch::ISwitch_type, "NMM") { };

    virtual ~ISwitch() {};

    static const char* ISwitch_type;

    virtual  string getInterfaceType() const { return ISwitch_type; }

    NMM::Interface* copy() const { return new ISwitch(*this); }
    static void used(); 
    static const char* switchOutputs_event;
    static const char* flushOutputs_event;
    static const char* setSwitchOutputsEnabled_event;
    static const char* getSwitchOutputsEnabled_event;
    /** Perform switch operation.
     * This instream event is sent when outputs are switched. Plug-ins that receive this event and
     * implement this interface may perform whatever operation is required when switching outputs.
     *
     * @deprecated Output switching is deprecated
     */

    virtual void switchOutputs()
      throw(const NMM::SerializedException&);
    /** Flush internal output queue.
     * This method flushes the internal output queue which is used for output switching.
     *
     * @param ts Flush timestamp
     *
     * @deprecated Output switching is deprecated
     */

    virtual void flushOutputs(const Timestamp& ts)
      throw(const NMM::SerializedException&);
    /** Enable or disable output switching.
     * This method enables or disables special handling for output switching.
     * If enabled, the node sends a switchOutputs event whenever a new output jack is connected.
     *
     * @param enable @c true to enable, @c false to disable output switching
     *
     * @deprecated Output switching is deprecated
     */

    virtual void setSwitchOutputsEnabled(const nmm_bool& enable)
      throw(const NMM::SerializedException&);
    /** Check if output switching is enabled.
     *
     * @return @c true if output switching is enabled, @c false if it is disabled
     *
     * @deprecated Output switching is deprecated
     */

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


  };

  typedef auto_ptr<ISwitch> ISwitch_var;




}

#include "nmm/nmm_suffix.hpp"

#endif
