// Generated by gtkmmproc -- DO NOT MODIFY!


#include <glibmm.h>

#include <gstreamermm/mixer.h>
#include <gstreamermm/private/mixer_p.h>


/* gstreamermm - a C++ wrapper for gstreamer
 *
 * Copyright 2008 The gstreamermm Development Team
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#include <gstreamermm/mixeroptions.h>
#include <glibmm/vectorutils.h>

namespace Gst
{

MessageMixerMuteToggled::MessageMixerMuteToggled(GstMessage* castitem)
: Message(castitem)
{}

void MessageMixerMuteToggled::parse(Glib::RefPtr<Gst::MixerTrack>& track,
  bool& mute) const
{
  GstMixerTrack* gst_track = 0;
  gboolean gst_mute = 0;

  gst_mixer_message_parse_mute_toggled(const_cast<GstMessage*>(gobj()),
    &gst_track, &gst_mute);
  track = Glib::wrap(gst_track);
  mute = gst_mute;
}

Glib::RefPtr<Gst::MixerTrack> MessageMixerMuteToggled::parse()
{
  GstMixerTrack* gst_track = 0;
  gst_mixer_message_parse_mute_toggled(gobj(), &gst_track, 0);
  return Glib::wrap(gst_track);
}

Glib::RefPtr<const Gst::MixerTrack> MessageMixerMuteToggled::parse() const
{
  return parse();
}

bool MessageMixerMuteToggled::parse_mute() const
{
  gboolean gst_mute = 0;
  gst_mixer_message_parse_mute_toggled(const_cast<GstMessage*>(gobj()),
    0, &gst_mute);
  return gst_mute;
}

MessageMixerRecordToggled::MessageMixerRecordToggled(GstMessage* castitem)
: Message(castitem)
{}

void MessageMixerRecordToggled::parse(Glib::RefPtr<Gst::MixerTrack>& track,
  bool& record) const
{
  GstMixerTrack* gst_track = 0;
  gboolean gst_record = 0;

  gst_mixer_message_parse_record_toggled(const_cast<GstMessage*>(gobj()),
    &gst_track, &gst_record);
  track = Glib::wrap(gst_track);
  record = gst_record;
}

Glib::RefPtr<Gst::MixerTrack> MessageMixerRecordToggled::parse()
{
  GstMixerTrack* gst_track = 0;
  gst_mixer_message_parse_record_toggled(gobj(), &gst_track, 0);
  return Glib::wrap(gst_track);
}

Glib::RefPtr<const Gst::MixerTrack> MessageMixerRecordToggled::parse() const
{
  return parse();
}

bool MessageMixerRecordToggled::parse_record() const
{
  gboolean gst_record = 0;
  gst_mixer_message_parse_record_toggled(const_cast<GstMessage*>(gobj()),
    0, &gst_record);
  return gst_record;
}

MessageMixerVolumeChanged::MessageMixerVolumeChanged(GstMessage* castitem)
: Message(castitem)
{}

void MessageMixerVolumeChanged::parse(Glib::RefPtr<Gst::MixerTrack>& track,
  std::vector<int>& volumes) const
{
  GstMixerTrack* gst_track = 0;
  gint* gst_volumes = 0;
  gint gst_num_channels = 0;

  gst_mixer_message_parse_volume_changed(const_cast<GstMessage*>(gobj()),
    &gst_track, &gst_volumes, &gst_num_channels);

  track = Glib::wrap(gst_track);

  volumes = Glib::ArrayHandler<int>::array_to_vector(gst_volumes,
    gst_num_channels, Glib::OWNERSHIP_DEEP);
}

Glib::RefPtr<Gst::MixerTrack> MessageMixerVolumeChanged::parse()
{
  GstMixerTrack* gst_track = 0;
  gst_mixer_message_parse_volume_changed(gobj(), &gst_track, 0, 0);
  return Glib::wrap(gst_track);
}

Glib::RefPtr<const Gst::MixerTrack> MessageMixerVolumeChanged::parse() const
{
  return parse();
}

std::vector<int> MessageMixerVolumeChanged::parse_volumes() const
{
  gint* gst_volumes = 0;
  gint gst_num_channels = 0;

  gst_mixer_message_parse_volume_changed(const_cast<GstMessage*>(gobj()),
    0, &gst_volumes, &gst_num_channels);

  return Glib::ArrayHandle<int>(gst_volumes, gst_num_channels,
    Glib::OWNERSHIP_DEEP);
}

MessageMixerOptionChanged::MessageMixerOptionChanged(GstMessage* castitem)
: Message(castitem)
{}

void MessageMixerOptionChanged::parse(Glib::RefPtr<Gst::MixerOptions>& options,
  Glib::ustring& value) const
{
  GstMixerOptions* gst_options = 0;
  const gchar* gst_value = 0;

  gst_mixer_message_parse_option_changed(const_cast<GstMessage*>(gobj()),
    &gst_options, &gst_value);
  options = Glib::wrap(gst_options);
  value = gst_value;
}

Glib::RefPtr<Gst::MixerOptions> MessageMixerOptionChanged::parse()
{
  GstMixerOptions* gst_options = 0;
  gst_mixer_message_parse_option_changed(gobj(), &gst_options, 0);
  return Glib::wrap(gst_options);
}

Glib::RefPtr<const Gst::MixerOptions> MessageMixerOptionChanged::parse() const
{
  return parse();
}

Glib::ustring MessageMixerOptionChanged::parse_value() const
{
  const gchar* gst_value = 0;
  gst_mixer_message_parse_option_changed(const_cast<GstMessage*>(gobj()),
    0, &gst_value);
  return gst_value;
}

MessageMixerOptionsListChanged::MessageMixerOptionsListChanged(GstMessage* castitem)
: Message(castitem)
{}

Glib::RefPtr<Gst::MixerOptions> MessageMixerOptionsListChanged::parse()
{
  GstMixerOptions* gst_options = 0;
  gst_mixer_message_parse_options_list_changed(gobj(), &gst_options);
  return Glib::wrap(gst_options);
}

Glib::RefPtr<const Gst::MixerOptions> MessageMixerOptionsListChanged::parse()
  const
{
  return parse();
}

MessageMixerChanged::MessageMixerChanged(GstMessage* castitem)
: Message(castitem)
{}

std::vector<int> Mixer::get_volume(const Glib::RefPtr<const Gst::MixerTrack>& track) const
{
  const guint32 num_channels = track->get_num_channels();
  int* volumes = g_new(int, num_channels);

  gst_mixer_get_volume(const_cast<GstMixer*>(gobj()),
    const_cast<GstMixerTrack*>(Glib::unwrap(track)), volumes);

  return Glib::ArrayHandle<int>(volumes, num_channels, Glib::OWNERSHIP_DEEP);
}

// This vfunc wrapper is manually written, because we want the C++ vfunc to
// return the result instead of passing in a pointer in which to store it.

void Mixer_Class::get_volume_vfunc_callback(GstMixer* self, GstMixerTrack* track, gint* volumes)
{
  CppObjectType *const obj = dynamic_cast<CppObjectType*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj && obj->is_derived_())
  {
    try // Trap C++ exceptions which would normally be lost because this is a C callback.
    {
      // Call the virtual member method, which derived classes might override.
      std::vector<int> result = obj->get_volume_vfunc(Glib::wrap(track, true));
      for(guint i = 0; i < result.size(); i++)
      {
        volumes[i] = result[i];
      }
    }
    catch(...)
    {
      Glib::exception_handlers_invoke();
    }
  }
  else
  {
    BaseClassType *const base = static_cast<BaseClassType*>(
        g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
)    );

    // Call the original underlying C function:
    if(base && base->get_volume)
      return (*base->get_volume)(self, track, volumes);
  }
}
std::vector<int> Gst::Mixer::get_volume_vfunc(const Glib::RefPtr<const Gst::MixerTrack>& track) const
{
  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
)  );

  if(base && base->get_volume)
  {
    const guint32 num_channels = track->get_num_channels();

    int* volumes = new int[num_channels];
    (*base->get_volume)(const_cast<GstMixer*>(gobj()),
      const_cast<GstMixerTrack*>(Glib::unwrap(track)), volumes);

    return Glib::ArrayHandle<int>(volumes, num_channels, Glib::OWNERSHIP_DEEP);
  }

  typedef Glib::ArrayHandle<int> RType;
  return RType(0, 0, Glib::OWNERSHIP_DEEP);
}
const GList* Mixer_Class::list_tracks_vfunc_callback(GstMixer* self)
{
  Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
        // Call the virtual member method, which derived classes might override.
        return
          Glib::ListHandler< Glib::RefPtr<Gst::MixerTrack> >::vector_to_list(
          obj->list_tracks_vfunc()).data();
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
    }
  }
  
  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
)  );

  // Call the original underlying C function:
  if(base && base->list_tracks)
    return (*base->list_tracks)(self);


  typedef const GList* RType;
  return RType();
}
std::vector< Glib::RefPtr<Gst::MixerTrack> > Gst::Mixer::list_tracks_vfunc()
{
  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
)  );

  if(base && base->list_tracks)
    return Glib::ListHandle< Glib::RefPtr<Gst::MixerTrack> >(const_cast<GList*>((*base->list_tracks)(const_cast<GstMixer*>(gobj()))), Glib::OWNERSHIP_NONE);

  typedef Glib::ListHandle< Glib::RefPtr<Gst::MixerTrack> > RType;
  return RType(0, Glib::OWNERSHIP_NONE);
}

} // namespace Gst

namespace
{
} // anonymous namespace

// static
GType Glib::Value<Gst::MixerType>::value_type()
{
  return gst_mixer_type_get_type();
}

// static
GType Glib::Value<Gst::MixerFlags>::value_type()
{
  return gst_mixer_flags_get_type();
}

// static
GType Glib::Value<Gst::MixerMessageType>::value_type()
{
  return gst_mixer_message_type_get_type();
}


namespace Glib
{

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

} // namespace Glib


namespace Gst
{


/* The *_Class implementation: */

const Glib::Interface_Class& Mixer_Class::init()
{
  if(!gtype_) // create the GType if necessary
  {
    // Glib::Interface_Class has to know the interface init function
    // in order to add interfaces to implementing types.
    class_init_func_ = &Mixer_Class::iface_init_function;

    // We can not derive from another interface, and it is not necessary anyway.
    gtype_ = gst_mixer_get_type();
  }

  return *this;
}

void Mixer_Class::iface_init_function(void* g_iface, void*)
{
  BaseClassType *const klass = static_cast<BaseClassType*>(g_iface);

  //This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect.
  //This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc
  g_assert(klass != 0); 

  klass->set_volume = &set_volume_vfunc_callback;
  klass->set_mute = &set_mute_vfunc_callback;
  klass->set_record = &set_record_vfunc_callback;
  klass->set_option = &set_option_vfunc_callback;
  klass->get_option = &get_option_vfunc_callback;
  klass->get_mixer_flags = &get_mixer_flags_vfunc_callback;
  klass->get_volume = &get_volume_vfunc_callback;
  klass->list_tracks = &list_tracks_vfunc_callback;
  
}

void Mixer_Class::set_volume_vfunc_callback(GstMixer* self, GstMixerTrack* track, gint* volumes)
{
  Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
      #endif //GLIBMM_EXCEPTIONS_ENABLED
        // Call the virtual member method, which derived classes might override.
        obj->set_volume_vfunc(Glib::wrap((track), true)
, Glib::ArrayHandler<int>::array_to_vector((volumes), Glib::OWNERSHIP_NONE)
);
        return;
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
      #endif //GLIBMM_EXCEPTIONS_ENABLED
    }
  }

  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
)  );

  // Call the original underlying C function:
  if(base && base->set_volume)
  {
    (*base->set_volume)(self, track, volumes);
  }

}
void Mixer_Class::set_mute_vfunc_callback(GstMixer* self, GstMixerTrack* track, gboolean mute)
{
  Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
      #endif //GLIBMM_EXCEPTIONS_ENABLED
        // Call the virtual member method, which derived classes might override.
        obj->set_mute_vfunc(Glib::wrap((track), true)
, mute
);
        return;
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
      #endif //GLIBMM_EXCEPTIONS_ENABLED
    }
  }

  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
)  );

  // Call the original underlying C function:
  if(base && base->set_mute)
  {
    (*base->set_mute)(self, track, mute);
  }

}
void Mixer_Class::set_record_vfunc_callback(GstMixer* self, GstMixerTrack* track, gboolean record)
{
  Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
      #endif //GLIBMM_EXCEPTIONS_ENABLED
        // Call the virtual member method, which derived classes might override.
        obj->set_record_vfunc(Glib::wrap((track), true)
, record
);
        return;
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
      #endif //GLIBMM_EXCEPTIONS_ENABLED
    }
  }

  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
)  );

  // Call the original underlying C function:
  if(base && base->set_record)
  {
    (*base->set_record)(self, track, record);
  }

}
void Mixer_Class::set_option_vfunc_callback(GstMixer* self, GstMixerOptions* opts, gchar* value)
{
  Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
      #endif //GLIBMM_EXCEPTIONS_ENABLED
        // Call the virtual member method, which derived classes might override.
        obj->set_option_vfunc(Glib::wrap((opts), true)
, Glib::convert_const_gchar_ptr_to_ustring(value)
);
        return;
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
      #endif //GLIBMM_EXCEPTIONS_ENABLED
    }
  }

  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
)  );

  // Call the original underlying C function:
  if(base && base->set_option)
  {
    (*base->set_option)(self, opts, value);
  }

}
const gchar* Mixer_Class::get_option_vfunc_callback(GstMixer* self, GstMixerOptions* opts)
{
  Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
      #endif //GLIBMM_EXCEPTIONS_ENABLED
        // Call the virtual member method, which derived classes might override.
        return (obj->get_option_vfunc(Glib::wrap((opts), true)
)).c_str();
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
      #endif //GLIBMM_EXCEPTIONS_ENABLED
    }
  }

  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
)  );

  // Call the original underlying C function:
  if(base && base->get_option)
  {
    const gchar* result = (*base->get_option)(self, opts);
    return result;
  }


  typedef const gchar* RType;
  return RType();
}
GstMixerFlags Mixer_Class::get_mixer_flags_vfunc_callback(GstMixer* self)
{
  Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
      #endif //GLIBMM_EXCEPTIONS_ENABLED
        // Call the virtual member method, which derived classes might override.
        return ((GstMixerFlags)(obj->get_mixer_flags_vfunc()));
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
      #endif //GLIBMM_EXCEPTIONS_ENABLED
    }
  }

  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
)  );

  // Call the original underlying C function:
  if(base && base->get_mixer_flags)
  {
    GstMixerFlags result = (*base->get_mixer_flags)(self);
    return result;
  }


  typedef GstMixerFlags RType;
  return RType();
}


Glib::ObjectBase* Mixer_Class::wrap_new(GObject* object)
{
  return new Mixer((GstMixer*)(object));
}


/* The implementation: */

Mixer::Mixer()
:
  Glib::Interface(mixer_class_.init())
{}

Mixer::Mixer(GstMixer* castitem)
:
  Glib::Interface((GObject*)(castitem))
{}

Mixer::Mixer(const Glib::Interface_Class& interface_class)
: Glib::Interface(interface_class)
{
}

Mixer::~Mixer()
{}

// static
void Mixer::add_interface(GType gtype_implementer)
{
  mixer_class_.init().add_interface(gtype_implementer);
}

Mixer::CppClassType Mixer::mixer_class_; // initialize static member

GType Mixer::get_type()
{
  return mixer_class_.init().get_type();
}


GType Mixer::get_base_type()
{
  return gst_mixer_get_type();
}


std::vector< Glib::RefPtr<Gst::MixerTrack> > Mixer::list_tracks()
{
  return Glib::ListHandler< Glib::RefPtr<Gst::MixerTrack> >::list_to_vector(const_cast<GList*>(gst_mixer_list_tracks(gobj())), Glib::OWNERSHIP_NONE);
}

std::vector< Glib::RefPtr<const Gst::MixerTrack> > Mixer::list_tracks() const
{
  return Glib::ListHandler< Glib::RefPtr<const Gst::MixerTrack> >::list_to_vector(const_cast<GList*>(gst_mixer_list_tracks(const_cast<GstMixer*>(gobj()))), Glib::OWNERSHIP_NONE);
}

void Mixer::set_volume(const Glib::RefPtr<Gst::MixerTrack>& track, const std::vector<int>& volumes)
{
  gst_mixer_set_volume(gobj(), Glib::unwrap(track), Glib::ArrayHandler<int>::vector_to_array(volumes).data());
}

void Mixer::set_mute(const Glib::RefPtr<Gst::MixerTrack>& track, bool mute)
{
  gst_mixer_set_mute(gobj(), Glib::unwrap(track), static_cast<int>(mute));
}

void Mixer::set_record(const Glib::RefPtr<Gst::MixerTrack>& track, bool record)
{
  gst_mixer_set_record(gobj(), Glib::unwrap(track), static_cast<int>(record));
}

void Mixer::set_option(const Glib::RefPtr<Gst::MixerOptions>& opts, const Glib::ustring& value)
{
  gst_mixer_set_option(gobj(), Glib::unwrap(opts), const_cast<gchar*>(value.c_str()));
}

void Mixer::mute_toggled(const Glib::RefPtr<Gst::MixerTrack>& track, bool mute)
{
  gst_mixer_mute_toggled(gobj(), Glib::unwrap(track), static_cast<int>(mute));
}

void Mixer::record_toggled(const Glib::RefPtr<Gst::MixerTrack>& track, bool record)
{
  gst_mixer_record_toggled(gobj(), Glib::unwrap(track), static_cast<int>(record));
}

void Mixer::volume_changed(const Glib::RefPtr<Gst::MixerTrack>& track, const std::vector<int>& volumes)
{
  gst_mixer_volume_changed(gobj(), Glib::unwrap(track), Glib::ArrayHandler<int>::vector_to_array(volumes).data());
}

void Mixer::option_changed(const Glib::RefPtr<Gst::MixerOptions>& opts, const Glib::ustring& value)
{
  gst_mixer_option_changed(gobj(), Glib::unwrap(opts), value.c_str());
}

void Mixer::options_list_changed(const Glib::RefPtr<Gst::MixerOptions>& opts)
{
  gst_mixer_options_list_changed(gobj(), Glib::unwrap(opts));
}

Glib::ustring Mixer::get_option(const Glib::RefPtr<const Gst::MixerOptions>& opts) const
{
  return Glib::convert_const_gchar_ptr_to_ustring(gst_mixer_get_option(const_cast<GstMixer*>(gobj()), const_cast<GstMixerOptions*>(Glib::unwrap(opts))));
}

void Mixer::mixer_changed()
{
  gst_mixer_mixer_changed(gobj());
}

Gst::MixerFlags Mixer::get_mixer_flags() const
{
  return ((Gst::MixerFlags)(gst_mixer_get_mixer_flags(const_cast<GstMixer*>(gobj()))));
}

Gst::MixerType Mixer::get_mixer_type() const
{
  return ((Gst::MixerType)(gst_mixer_get_mixer_type(const_cast<GstMixer*>(gobj()))));
}

Gst::MixerMessageType Mixer::get_message_type(const Glib::RefPtr<Gst::Message>& message)
{
  return (Gst::MixerMessageType)(gst_mixer_message_get_type(Gst::unwrap(message)));
}


void Gst::Mixer::set_volume_vfunc(const Glib::RefPtr<Gst::MixerTrack>& track, const std::vector<int>& volumes) 
{
  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
)  );

  if(base && base->set_volume)
  {
    (*base->set_volume)(gobj(),Glib::unwrap(track),Glib::ArrayHandler<int>::vector_to_array(volumes).data());
  }
}
void Gst::Mixer::set_mute_vfunc(const Glib::RefPtr<Gst::MixerTrack>& track, bool mute) 
{
  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
)  );

  if(base && base->set_mute)
  {
    (*base->set_mute)(gobj(),Glib::unwrap(track),static_cast<int>(mute));
  }
}
void Gst::Mixer::set_record_vfunc(const Glib::RefPtr<Gst::MixerTrack>& track, bool record) 
{
  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
)  );

  if(base && base->set_record)
  {
    (*base->set_record)(gobj(),Glib::unwrap(track),static_cast<int>(record));
  }
}
void Gst::Mixer::set_option_vfunc(const Glib::RefPtr<Gst::MixerOptions>& opts, const Glib::ustring& value) 
{
  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
)  );

  if(base && base->set_option)
  {
    (*base->set_option)(gobj(),Glib::unwrap(opts),const_cast<gchar*>(value.c_str()));
  }
}
Glib::ustring Gst::Mixer::get_option_vfunc(const Glib::RefPtr<const Gst::MixerOptions>& opts) const
{
  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
)  );

  if(base && base->get_option)
  {
    Glib::ustring result(Glib::convert_const_gchar_ptr_to_ustring((*base->get_option)(const_cast<GstMixer*>(gobj()),const_cast<GstMixerOptions*>(Glib::unwrap(opts)))));
    return result;
  }

  typedef Glib::ustring RType;
  return RType();
}
Gst::MixerFlags Gst::Mixer::get_mixer_flags_vfunc() const
{
  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
)  );

  if(base && base->get_mixer_flags)
  {
    Gst::MixerFlags result(((Gst::MixerFlags)((*base->get_mixer_flags)(const_cast<GstMixer*>(gobj())))));
    return result;
  }

  typedef Gst::MixerFlags RType;
  return RType();
}


} // namespace Gst


