// Generated by gtkmmproc -- DO NOT MODIFY!


#include <gstreamermm/inputselector.h>
#include <gstreamermm/private/inputselector_p.h>

// Generated by generate_plugin_gmmproc_file. Don't edit this file.


extern "C"
{

GType gst_input_selector_get_type()
{
  static GType type = 0;
  GstElementFactory* factory = 0;
  GstPluginFeature* feature = 0;

  if(!type)
  {
    factory = gst_element_factory_find("input-selector");
    // Make sure that the feature is actually loaded:
    if(factory)
    {
      feature =
        gst_plugin_feature_load(GST_PLUGIN_FEATURE(factory));

      g_object_unref(factory);
      factory = GST_ELEMENT_FACTORY(feature);
      type = gst_element_factory_get_element_type(factory);
      g_object_unref(factory);
    }
  }

  return type;
}

} // extern "C"

namespace Gst
{

InputSelector::InputSelector()
: // Mark this class as non-derived to allow C++ vfuncs to be skipped.
  Glib::ObjectBase(0),
  Gst::Element(Glib::ConstructParams(inputselector_class_.init(), "name",static_cast<char*>(0), static_cast<char*>(0)))
{}

InputSelector::InputSelector(const Glib::ustring& name)
: // Mark this class as non-derived to allow C++ vfuncs to be skipped.
  Glib::ObjectBase(0),
  Gst::Element(Glib::ConstructParams(inputselector_class_.init(), "name",name.c_str(), static_cast<char*>(0)))
{}

gint64 InputSelector::block()
{
  gint64 result;
  g_signal_emit_by_name(gobj(), "block", &result, static_cast<void*>(0));
  return result;
}

}

namespace
{


static gint64 InputSelector_signal_block_callback(GstInputSelector* self, void* data)
{
  using namespace Gst;
  typedef sigc::slot< gint64 > SlotType;

  // Do not try to call a signal on a disassociated wrapper.
  if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
  {
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    try
    {
    #endif //GLIBMM_EXCEPTIONS_ENABLED
      if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
        return (*static_cast<SlotType*>(slot))();
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    }
    catch(...)
    {
      Glib::exception_handlers_invoke();
    }
    #endif //GLIBMM_EXCEPTIONS_ENABLED
  }

  typedef gint64 RType;
  return RType();
}

static gint64 InputSelector_signal_block_notify_callback(GstInputSelector* self,  void* data)
{
  using namespace Gst;
  typedef sigc::slot< void > SlotType;

  // Do not try to call a signal on a disassociated wrapper.
  if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
  {
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    try
    {
    #endif //GLIBMM_EXCEPTIONS_ENABLED
      if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
        (*static_cast<SlotType*>(slot))();
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    }
    catch(...)
    {
      Glib::exception_handlers_invoke();
    }
    #endif //GLIBMM_EXCEPTIONS_ENABLED
  }

  typedef gint64 RType;
  return RType();
}

static const Glib::SignalProxyInfo InputSelector_signal_block_info =
{
  "block",
  (GCallback) &InputSelector_signal_block_callback,
  (GCallback) &InputSelector_signal_block_notify_callback
};


static void InputSelector_signal_switch_callback(GstInputSelector* self, GstPad* p0,gint64 p1,gint64 p2,void* data)
{
  using namespace Gst;
  typedef sigc::slot< void,const Glib::RefPtr<Gst::Pad>&,gint64,gint64 > SlotType;

  // Do not try to call a signal on a disassociated wrapper.
  if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
  {
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    try
    {
    #endif //GLIBMM_EXCEPTIONS_ENABLED
      if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
        (*static_cast<SlotType*>(slot))(Glib::wrap(p0, true)
, p1, p2);
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    }
    catch(...)
    {
      Glib::exception_handlers_invoke();
    }
    #endif //GLIBMM_EXCEPTIONS_ENABLED
  }
}

static const Glib::SignalProxyInfo InputSelector_signal_switch_info =
{
  "switch",
  (GCallback) &InputSelector_signal_switch_callback,
  (GCallback) &InputSelector_signal_switch_callback
};


} // anonymous namespace


namespace Glib
{

Glib::RefPtr<Gst::InputSelector> wrap(GstInputSelector* object, bool take_copy)
{
  return Glib::RefPtr<Gst::InputSelector>( dynamic_cast<Gst::InputSelector*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
  //We use dynamic_cast<> in case of multiple inheritance.
}

} /* namespace Glib */


namespace Gst
{


/* The *_Class implementation: */

const Glib::Class& InputSelector_Class::init()
{
  if(!gtype_) // create the GType if necessary
  {
    // Glib::Class has to know the class init function to clone custom types.
    class_init_func_ = &InputSelector_Class::class_init_function;

    // This is actually just optimized away, apparently with no harm.
    // Make sure that the parent type has been created.
    //CppClassParent::CppObjectType::get_type();

    // Create the wrapper type, with the same class/instance size as the base type.
    register_derived_type(gst_input_selector_get_type());

    // Add derived versions of interfaces, if the C type implements any interfaces:

  }

  return *this;
}


void InputSelector_Class::class_init_function(void* g_class, void* class_data)
{
  BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
  CppClassParent::class_init_function(klass, class_data);


}


Glib::ObjectBase* InputSelector_Class::wrap_new(GObject* object)
{
  return new InputSelector((GstInputSelector*)object);
}


/* The implementation: */

GstInputSelector* InputSelector::gobj_copy()
{
  reference();
  return gobj();
}

InputSelector::InputSelector(const Glib::ConstructParams& construct_params)
:
  Gst::Element(construct_params)
{

}

InputSelector::InputSelector(GstInputSelector* castitem)
:
  Gst::Element((GstElement*)(castitem))
{}


InputSelector::~InputSelector()
{}


InputSelector::CppClassType InputSelector::inputselector_class_; // initialize static member

GType InputSelector::get_type()
{
  return inputselector_class_.init().get_type();
}


GType InputSelector::get_base_type()
{
  return gst_input_selector_get_type();
}


Glib::RefPtr<InputSelector> InputSelector::create()
{
  return Glib::RefPtr<InputSelector>( new InputSelector() );
}

Glib::RefPtr<InputSelector> InputSelector::create(const Glib::ustring& name)
{
  return Glib::RefPtr<InputSelector>( new InputSelector(name) );
}


Glib::SignalProxy0< gint64 > InputSelector::signal_block()
{
  return Glib::SignalProxy0< gint64 >(this, &InputSelector_signal_block_info);
}


Glib::SignalProxy3< void,const Glib::RefPtr<Gst::Pad>&,gint64,gint64 > InputSelector::signal_switch()
{
  return Glib::SignalProxy3< void,const Glib::RefPtr<Gst::Pad>&,gint64,gint64 >(this, &InputSelector_signal_switch_info);
}


#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_ReadOnly<guint> InputSelector::property_n_pads() const
{
  return Glib::PropertyProxy_ReadOnly<guint>(this, "n-pads");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy< Glib::RefPtr<Gst::Pad> > InputSelector::property_active_pad() 
{
  return Glib::PropertyProxy< Glib::RefPtr<Gst::Pad> >(this, "active-pad");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gst::Pad> > InputSelector::property_active_pad() const
{
  return Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gst::Pad> >(this, "active-pad");
}
#endif //GLIBMM_PROPERTIES_ENABLED


} // namespace Gst


