gstreamermm: mixer.h Source File

- Main Page
- Modules
- Namespaces
- Classes
- Files

# mixer.h

Go to the documentation of this file.

    00001 // -*- c++ -*-
    00002 // Generated by gtkmmproc -- DO NOT MODIFY!
    00003 #ifndef _GSTREAMERMM_MIXER_H
    00004 #define _GSTREAMERMM_MIXER_H
    00005
    00006
    00007 #include <glibmm.h>
    00008
    00009 /* gstreamermm - a C++ wrapper for gstreamer
    00010  *
    00011  * Copyright 2008 The gstreamermm Development Team
    00012  *
    00013  * This library is free software; you can redistribute it and/or
    00014  * modify it under the terms of the GNU Lesser General Public
    00015  * License as published by the Free Software Foundation; either
    00016  * version 2.1 of the License, or (at your option) any later version.
    00017  *
    00018  * This library is distributed in the hope that it will be useful,
    00019  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    00020  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00021  * Lesser General Public License for more details.
    00022  *
    00023  * You should have received a copy of the GNU Lesser General Public
    00024  * License along with this library; if not, write to the Free
    00025  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    00026  */
    00027
    00028 #include <gst/interfaces/mixeroptions.h>
    00029 #include <gstreamermm/mixertrack.h>
    00030 #include <glibmm/interface.h>
    00031
    00032
    00033 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00034 typedef struct _GstMixer GstMixer;
    00035 typedef struct _GstMixerClass GstMixerClass;
    00036 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
    00037
    00038
    00039 namespace Gst
    00040 { class Mixer_Class; } // namespace Gst
    00041 namespace Gst
    00042 {
    00043
    00049 enum MixerType
    00050 {
    00051   MIXER_HARDWARE,
    00052   MIXER_SOFTWARE
    00053 };
    00054
    00055 } // namespace Gst
    00056
    00057
    00058 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00059 namespace Glib
    00060 {
    00061
    00062 template <>
    00063 class Value<Gst::MixerType> : public Glib::Value_Enum<Gst::MixerType>
    00064 {
    00065 public:
    00066   static GType value_type() G_GNUC_CONST;
    00067 };
    00068
    00069 } // namespace Glib
    00070 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
    00071
    00072
    00073 namespace Gst
    00074 {
    00075
    00087 enum MixerFlags
    00088 {
    00089   MIXER_FLAG_NONE = 0,
    00090   MIXER_FLAG_AUTO_NOTIFICATIONS = 1<<0
    00091 };
    00092
    00094 inline MixerFlags operator|(MixerFlags lhs, MixerFlags rhs)
    00095   { return static_cast<MixerFlags>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs)); }
    00096
    00098 inline MixerFlags operator&(MixerFlags lhs, MixerFlags rhs)
    00099   { return static_cast<MixerFlags>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs)); }
    00100
    00102 inline MixerFlags operator^(MixerFlags lhs, MixerFlags rhs)
    00103   { return static_cast<MixerFlags>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs)); }
    00104
    00106 inline MixerFlags operator~(MixerFlags flags)
    00107   { return static_cast<MixerFlags>(~static_cast<unsigned>(flags)); }
    00108
    00110 inline MixerFlags& operator|=(MixerFlags& lhs, MixerFlags rhs)
    00111   { return (lhs = static_cast<MixerFlags>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs))); }
    00112
    00114 inline MixerFlags& operator&=(MixerFlags& lhs, MixerFlags rhs)
    00115   { return (lhs = static_cast<MixerFlags>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs))); }
    00116
    00118 inline MixerFlags& operator^=(MixerFlags& lhs, MixerFlags rhs)
    00119   { return (lhs = static_cast<MixerFlags>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs))); }
    00120
    00121 } // namespace Gst
    00122
    00123
    00124 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00125 namespace Glib
    00126 {
    00127
    00128 template <>
    00129 class Value<Gst::MixerFlags> : public Glib::Value_Flags<Gst::MixerFlags>
    00130 {
    00131 public:
    00132   static GType value_type() G_GNUC_CONST;
    00133 };
    00134
    00135 } // namespace Glib
    00136 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
    00137
    00138
    00139 namespace Gst
    00140 {
    00141
    00145 enum MixerMessageType
    00146 {
    00147   MIXER_MESSAGE_INVALID,
    00148   MIXER_MESSAGE_MUTE_TOGGLED,
    00149   MIXER_MESSAGE_RECORD_TOGGLED,
    00150   MIXER_MESSAGE_VOLUME_CHANGED,
    00151   MIXER_MESSAGE_OPTION_CHANGED,
    00152   MIXER_MESSAGE_OPTIONS_LIST_CHANGED,
    00153   MIXER_MESSAGE_MIXER_CHANGED
    00154 };
    00155
    00156 } // namespace Gst
    00157
    00158
    00159 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00160 namespace Glib
    00161 {
    00162
    00163 template <>
    00164 class Value<Gst::MixerMessageType> : public Glib::Value_Enum<Gst::MixerMessageType>
    00165 {
    00166 public:
    00167   static GType value_type() G_GNUC_CONST;
    00168 };
    00169
    00170 } // namespace Glib
    00171 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
    00172
    00173
    00174 namespace Gst
    00175 {
    00176
    00177
    00178 class MixerOptions;
    00179 class MixerTrack;
    00180
    00185 class Mixer : public Glib::Interface
    00186 {
    00187
    00188 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00189
    00190 public:
    00191   typedef Mixer CppObjectType;
    00192   typedef Mixer_Class CppClassType;
    00193   typedef GstMixer BaseObjectType;
    00194   typedef GstMixerClass BaseClassType;
    00195
    00196 private:
    00197   friend class Mixer_Class;
    00198   static CppClassType mixer_class_;
    00199
    00200   // noncopyable
    00201   Mixer(const Mixer&);
    00202   Mixer& operator=(const Mixer&);
    00203
    00204 protected:
    00205   Mixer(); // you must derive from this class
    00206
    00213   explicit Mixer(const Glib::Interface_Class& interface_class);
    00214
    00215 public:
    00216   // This is public so that C++ wrapper instances can be
    00217   // created for C instances of unwrapped types.
    00218   // For instance, if an unexpected C type implements the C interface.
    00219   explicit Mixer(GstMixer* castitem);
    00220
    00221 protected:
    00222 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
    00223
    00224 public:
    00225   virtual ~Mixer();
    00226
    00227   static void add_interface(GType gtype_implementer);
    00228
    00229 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00230   static GType get_type()      G_GNUC_CONST;
    00231   static GType get_base_type() G_GNUC_CONST;
    00232 #endif
    00233
    00235   GstMixer*       gobj()       { return reinterpret_cast<GstMixer*>(gobject_); }
    00236
    00238   const GstMixer* gobj() const { return reinterpret_cast<GstMixer*>(gobject_); }
    00239
    00240 private:
    00241
    00242
    00243 public:
    00244
    00245
    00249   Glib::ListHandle< Glib::RefPtr<Gst::MixerTrack> > list_tracks();
    00250
    00251
    00255   Glib::ListHandle< Glib::RefPtr<const Gst::MixerTrack> > list_tracks() const;
    00256
    00263   Glib::ArrayHandle<int> get_volume(const Glib::RefPtr<const Gst::MixerTrack>& track) const;
    00264
    00265
    00276   void set_volume(const Glib::RefPtr<Gst::MixerTrack>& track, const Glib::ArrayHandle<int>& volumes);
    00277
    00278
    00285   void set_mute(const Glib::RefPtr<Gst::MixerTrack>& track, bool mute);
    00286
    00295   void set_record(const Glib::RefPtr<Gst::MixerTrack>& track, bool record);
    00296
    00301   void set_option(const Glib::RefPtr<Gst::MixerOptions>& opts, const Glib::ustring& value);
    00302
    00312   void mute_toggled(const Glib::RefPtr<Gst::MixerTrack>& track, bool mute);
    00313
    00323   void record_toggled(const Glib::RefPtr<Gst::MixerTrack>& track, bool record);
    00324
    00334   void volume_changed(const Glib::RefPtr<Gst::MixerTrack>& track, const Glib::ArrayHandle<int>& volumes);
    00335
    00345   void option_changed(const Glib::RefPtr<Gst::MixerOptions>& opts, const Glib::ustring& value);
    00346
    00362   void options_list_changed(const Glib::RefPtr<Gst::MixerOptions>& opts);
    00363
    00368   Glib::ustring get_option(const Glib::RefPtr<const Gst::MixerOptions>& opts) const;
    00369
    00380   void mixer_changed();
    00381
    00385   Gst::MixerFlags get_mixer_flags() const;
    00386
    00387   /* TODO:
    00388   _WRAP_METHOD(satic Gst::MixerMessageType message_get_type(GstMessage *message), gst_mixer_message_get_type)
    00389   _WRAP_METHOD(static void message_parse_mute_toggled(GstMessage *message, GstMixerTrack **track, gboolean *mute), gst_mixer_message_parse_mute_toggled)
    00390   _WRAP_METHOD(static void message_parse_option_changed(GstMessage *message, GstMixerOptions **options, const gchar **value), gst_mixer_message_parse_option_changed)
    00391   _WRAP_METHOD(static void message_parse_record_toggled(GstMessage *message, GstMixerTrack **track, gboolean *record), gst_mixer_message_parse_record_toggled)
    00392   _WRAP_METHOD(static void message_parse_volume_changed(GstMessage *message, GstMixerTrack **track, gint **volumes, gint *num_channels), gst_mixer_message_parse_volume_changed)
    00393   _WRAP_METHOD(static void message_parse_options_list_changed(GstMessage *message, GstMixerOptions **options), gst_mixer_message_parse_options_list_changed)
    00394   */
    00395
    00396 //TODO:
    00397 //#m4 __CONVERSION(`Glib::ListHandle< Glib::RefPtr<Gst::MixerTrack> >', `const GList*', `($3).data()')
    00398   //_WRAP_VFUNC(Glib::ListHandle< Glib::RefPtr<Gst::MixerTrack> > list_tracks() const, "list_tracks")
    00399
    00400 #ifdef GLIBMM_VFUNCS_ENABLED
    00401 // This vfunc is handcoded because we want to have it return the result instead
    00402 // of requiring a pointer parameter in which to put it like the C API does.
    00403   virtual Glib::ArrayHandle<int> get_volume_vfunc(const Glib::RefPtr<const Gst::MixerTrack>& track) const;
    00404 #endif //GLIBMM_VFUNCS_ENABLED
    00405
    00406
    00407 //TODO:
    00408   //_WRAP_VFUNC(void set_volume(const Glib::RefPtr<Gst::MixerTrack>& track, const Glib::ArrayHandle<int>& volumes), "set_volume")
    00409
    00410   #ifdef GLIBMM_VFUNCS_ENABLED
    00411   virtual void set_mute_vfunc(const Glib::RefPtr<Gst::MixerTrack>& track, bool mute);
    00412 #endif //GLIBMM_VFUNCS_ENABLED
    00413
    00414   #ifdef GLIBMM_VFUNCS_ENABLED
    00415   virtual void set_record_vfunc(const Glib::RefPtr<Gst::MixerTrack>& track, bool record);
    00416 #endif //GLIBMM_VFUNCS_ENABLED
    00417
    00418
    00419   #ifdef GLIBMM_VFUNCS_ENABLED
    00420   virtual void set_option_vfunc(const Glib::RefPtr<Gst::MixerOptions>& opts, const Glib::ustring& value);
    00421 #endif //GLIBMM_VFUNCS_ENABLED
    00422
    00423
    00424   //TODO:
    00425   //_WRAP_VFUNC(Glib::ustring get_option(const Glib::RefPtr<const Gst::MixerOptions>& opts) const, "get_option")
    00426
    00427 protected:
    00428
    00429
    00430 public:
    00431
    00432 public:
    00433   //C++ methods used to invoke GTK+ virtual functions:
    00434 #ifdef GLIBMM_VFUNCS_ENABLED
    00435 #endif //GLIBMM_VFUNCS_ENABLED
    00436
    00437 protected:
    00438   //GTK+ Virtual Functions (override these to change behaviour):
    00439 #ifdef GLIBMM_VFUNCS_ENABLED
    00440 #endif //GLIBMM_VFUNCS_ENABLED
    00441
    00442   //Default Signal Handlers::
    00443 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
    00444 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
    00445
    00446
    00447 };
    00448
    00449 } // namespace Gst
    00450
    00451
    00452 namespace Glib
    00453 {
    00462   Glib::RefPtr<Gst::Mixer> wrap(GstMixer* object, bool take_copy = false);
    00463
    00464 } // namespace Glib
    00465
    00466
    00467 #endif /* _GSTREAMERMM_MIXER_H */
    00468