- 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/mixer.h>
    00029 #include <gst/interfaces/mixeroptions.h>
    00030 #include <gstreamermm/mixertrack.h>
    00031 #include <gstreamermm/message.h>
    00032 #include <glibmm/interface.h>
    00033
    00034
    00035 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00036 typedef struct _GstMixer GstMixer;
    00037 typedef struct _GstMixerClass GstMixerClass;
    00038 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
    00039
    00040
    00041 namespace Gst
    00042 { class Mixer_Class; } // namespace Gst
    00043 namespace Gst
    00044 {
    00045
    00051 enum MixerType
    00052 {
    00053   MIXER_HARDWARE,
    00054   MIXER_SOFTWARE
    00055 };
    00056
    00057 } // namespace Gst
    00058
    00059
    00060 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00061 namespace Glib
    00062 {
    00063
    00064 template <>
    00065 class Value<Gst::MixerType> : public Glib::Value_Enum<Gst::MixerType>
    00066 {
    00067 public:
    00068   static GType value_type() G_GNUC_CONST;
    00069 };
    00070
    00071 } // namespace Glib
    00072 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
    00073
    00074
    00075 namespace Gst
    00076 {
    00077
    00089 enum MixerFlags
    00090 {
    00091   MIXER_FLAG_NONE = 0,
    00092   MIXER_FLAG_AUTO_NOTIFICATIONS = 1<<0,
    00093   MIXER_FLAG_HAS_WHITELIST = 1<<1,
    00094   MIXER_FLAG_GROUPING = 1<<2
    00095 };
    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 lhs, MixerFlags rhs)
    00107   { return static_cast<MixerFlags>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs)); }
    00108
    00110 inline MixerFlags operator~(MixerFlags flags)
    00111   { return static_cast<MixerFlags>(~static_cast<unsigned>(flags)); }
    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
    00122 inline MixerFlags& operator^=(MixerFlags& lhs, MixerFlags rhs)
    00123   { return (lhs = static_cast<MixerFlags>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs))); }
    00124
    00125 } // namespace Gst
    00126
    00127
    00128 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00129 namespace Glib
    00130 {
    00131
    00132 template <>
    00133 class Value<Gst::MixerFlags> : public Glib::Value_Flags<Gst::MixerFlags>
    00134 {
    00135 public:
    00136   static GType value_type() G_GNUC_CONST;
    00137 };
    00138
    00139 } // namespace Glib
    00140 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
    00141
    00142
    00143 namespace Gst
    00144 {
    00145
    00149 enum MixerMessageType
    00150 {
    00151   MIXER_MESSAGE_INVALID,
    00152   MIXER_MESSAGE_MUTE_TOGGLED,
    00153   MIXER_MESSAGE_RECORD_TOGGLED,
    00154   MIXER_MESSAGE_VOLUME_CHANGED,
    00155   MIXER_MESSAGE_OPTION_CHANGED,
    00156   MIXER_MESSAGE_OPTIONS_LIST_CHANGED,
    00157   MIXER_MESSAGE_MIXER_CHANGED
    00158 };
    00159
    00160 } // namespace Gst
    00161
    00162
    00163 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00164 namespace Glib
    00165 {
    00166
    00167 template <>
    00168 class Value<Gst::MixerMessageType> : public Glib::Value_Enum<Gst::MixerMessageType>
    00169 {
    00170 public:
    00171   static GType value_type() G_GNUC_CONST;
    00172 };
    00173
    00174 } // namespace Glib
    00175 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
    00176
    00177
    00178 namespace Gst
    00179 {
    00180
    00181
    00182 class MixerOptions;
    00183 class MixerTrack;
    00184
    00189 class Mixer : public Glib::Interface
    00190 {
    00191
    00192 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00193
    00194 public:
    00195   typedef Mixer CppObjectType;
    00196   typedef Mixer_Class CppClassType;
    00197   typedef GstMixer BaseObjectType;
    00198   typedef GstMixerClass BaseClassType;
    00199
    00200 private:
    00201   friend class Mixer_Class;
    00202   static CppClassType mixer_class_;
    00203
    00204   // noncopyable
    00205   Mixer(const Mixer&);
    00206   Mixer& operator=(const Mixer&);
    00207
    00208 protected:
    00209   Mixer(); // you must derive from this class
    00210
    00217   explicit Mixer(const Glib::Interface_Class& interface_class);
    00218
    00219 public:
    00220   // This is public so that C++ wrapper instances can be
    00221   // created for C instances of unwrapped types.
    00222   // For instance, if an unexpected C type implements the C interface.
    00223   explicit Mixer(GstMixer* castitem);
    00224
    00225 protected:
    00226 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
    00227
    00228 public:
    00229   virtual ~Mixer();
    00230
    00231   static void add_interface(GType gtype_implementer);
    00232
    00233 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00234   static GType get_type()      G_GNUC_CONST;
    00235   static GType get_base_type() G_GNUC_CONST;
    00236 #endif
    00237
    00239   GstMixer*       gobj()       { return reinterpret_cast<GstMixer*>(gobject_); }
    00240
    00242   const GstMixer* gobj() const { return reinterpret_cast<GstMixer*>(gobject_); }
    00243
    00244 private:
    00245
    00246
    00247 public:
    00248
    00249
    00255   Glib::ListHandle< Glib::RefPtr<Gst::MixerTrack> > list_tracks();
    00256
    00257
    00263   Glib::ListHandle< Glib::RefPtr<const Gst::MixerTrack> > list_tracks() const;
    00264
    00271   Glib::ArrayHandle<int> get_volume(const Glib::RefPtr<const Gst::MixerTrack>& track) const;
    00272
    00273
    00284   void set_volume(const Glib::RefPtr<Gst::MixerTrack>& track, const Glib::ArrayHandle<int>& volumes);
    00285
    00286
    00293   void set_mute(const Glib::RefPtr<Gst::MixerTrack>& track, bool mute);
    00294
    00303   void set_record(const Glib::RefPtr<Gst::MixerTrack>& track, bool record);
    00304
    00309   void set_option(const Glib::RefPtr<Gst::MixerOptions>& opts, const Glib::ustring& value);
    00310
    00320   void mute_toggled(const Glib::RefPtr<Gst::MixerTrack>& track, bool mute);
    00321
    00331   void record_toggled(const Glib::RefPtr<Gst::MixerTrack>& track, bool record);
    00332
    00342   void volume_changed(const Glib::RefPtr<Gst::MixerTrack>& track, const Glib::ArrayHandle<int>& volumes);
    00343
    00353   void option_changed(const Glib::RefPtr<Gst::MixerOptions>& opts, const Glib::ustring& value);
    00354
    00370   void options_list_changed(const Glib::RefPtr<Gst::MixerOptions>& opts);
    00371
    00376   Glib::ustring get_option(const Glib::RefPtr<const Gst::MixerOptions>& opts) const;
    00377
    00388   void mixer_changed();
    00389
    00393   Gst::MixerFlags get_mixer_flags() const;
    00394
    00404   static Gst::MixerMessageType get_message_type(const Glib::RefPtr<Gst::Message>& message);
    00405
    00406   //TODO: Wrap signals if necessary.
    00407
    00408 #ifdef GLIBMM_VFUNCS_ENABLED
    00409   virtual Glib::ArrayHandle<int> get_volume_vfunc(const Glib::RefPtr<const Gst::MixerTrack>& track) const;
    00410   virtual Glib::ListHandle< Glib::RefPtr<Gst::MixerTrack> > list_tracks_vfunc() const;
    00411 #endif //GLIBMM_VFUNCS_ENABLED
    00412
    00413
    00414   #ifdef GLIBMM_VFUNCS_ENABLED
    00415   virtual void set_volume_vfunc(const Glib::RefPtr<Gst::MixerTrack>& track, const Glib::ArrayHandle<int>& volumes);
    00416 #endif //GLIBMM_VFUNCS_ENABLED
    00417
    00418
    00419   #ifdef GLIBMM_VFUNCS_ENABLED
    00420   virtual void set_mute_vfunc(const Glib::RefPtr<Gst::MixerTrack>& track, bool mute);
    00421 #endif //GLIBMM_VFUNCS_ENABLED
    00422
    00423   #ifdef GLIBMM_VFUNCS_ENABLED
    00424   virtual void set_record_vfunc(const Glib::RefPtr<Gst::MixerTrack>& track, bool record);
    00425 #endif //GLIBMM_VFUNCS_ENABLED
    00426
    00427
    00428   #ifdef GLIBMM_VFUNCS_ENABLED
    00429   virtual void set_option_vfunc(const Glib::RefPtr<Gst::MixerOptions>& opts, const Glib::ustring& value);
    00430 #endif //GLIBMM_VFUNCS_ENABLED
    00431
    00432
    00433   #ifdef GLIBMM_VFUNCS_ENABLED
    00434   virtual Glib::ustring get_option_vfunc(const Glib::RefPtr<const Gst::MixerOptions>& opts) const;
    00435 #endif //GLIBMM_VFUNCS_ENABLED
    00436
    00437
    00438   #ifdef GLIBMM_VFUNCS_ENABLED
    00439   virtual Gst::MixerFlags get_mixer_flags_vfunc() const;
    00440 #endif //GLIBMM_VFUNCS_ENABLED
    00441
    00442
    00443 protected:
    00444
    00445
    00446 public:
    00447
    00448 public:
    00449   //C++ methods used to invoke GTK+ virtual functions:
    00450 #ifdef GLIBMM_VFUNCS_ENABLED
    00451 #endif //GLIBMM_VFUNCS_ENABLED
    00452
    00453 protected:
    00454   //GTK+ Virtual Functions (override these to change behaviour):
    00455 #ifdef GLIBMM_VFUNCS_ENABLED
    00456 #endif //GLIBMM_VFUNCS_ENABLED
    00457
    00458   //Default Signal Handlers::
    00459 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
    00460 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
    00461
    00462
    00463 };
    00464
    00467 class MessageMixerMuteToggled : public Message
    00468 {
    00469 public:
    00470   explicit MessageMixerMuteToggled(GstMessage* castitem);
    00471
    00482   void parse(Glib::RefPtr<Gst::MixerTrack>& track, bool& mute) const;
    00483
    00484
    00492   Glib::RefPtr<Gst::MixerTrack> parse();
    00493
    00501   Glib::RefPtr<const Gst::MixerTrack> parse() const;
    00502
    00509   bool parse_mute() const;
    00510 };
    00511
    00514 class MessageMixerRecordToggled : public Message
    00515 {
    00516 public:
    00517   explicit MessageMixerRecordToggled(GstMessage* castitem);
    00518
    00529   void parse(Glib::RefPtr<Gst::MixerTrack>& track, bool& record) const;
    00530
    00531
    00539   Glib::RefPtr<Gst::MixerTrack> parse();
    00540
    00548   Glib::RefPtr<const Gst::MixerTrack> parse() const;
    00549
    00555   bool parse_record() const;
    00556 };
    00557
    00560 class MessageMixerVolumeChanged : public Message
    00561 {
    00562 public:
    00563   explicit MessageMixerVolumeChanged(GstMessage* castitem);
    00564
    00565   //TODO: Include when = operator is available for Glib::ArrayHandle<>.
    00567    //* object it refers to, as well as an array of volumes and the size of the
    00568    //* volumes array.
    00569    //*
    00570    //* The track object remains valid until the message is freed.
    00571    //*
    00572    //* @param track A reference to hold a Gst::MixerTrack object.
    00573    //* @param volumes A reference to receive an array of int values.
    00574    //*
    00575    //* Since 0.10.14.
    00576    //*/
    00577   //void parse(Glib::RefPtr<Gst::MixerTrack>& track,
    00578     //Glib::ArrayHandle<int> volumes);
    00579
    00580
    00588   Glib::RefPtr<Gst::MixerTrack> parse();
    00589
    00597   Glib::RefPtr<const Gst::MixerTrack> parse() const;
    00598
    00604   Glib::ArrayHandle<int> parse_volumes() const;
    00605 };
    00606
    00609 class MessageMixerOptionChanged : public Message
    00610 {
    00611 public:
    00612   explicit MessageMixerOptionChanged(GstMessage* castitem);
    00613
    00624   void parse(Glib::RefPtr<Gst::MixerOptions>& options,
    00625     Glib::ustring& value) const;
    00626
    00627
    00635   Glib::RefPtr<Gst::MixerOptions> parse();
    00636
    00644   Glib::RefPtr<const Gst::MixerOptions> parse() const;
    00645
    00651   Glib::ustring parse_value() const;
    00652 };
    00653
    00657 class MessageMixerOptionsListChanged : public Message
    00658 {
    00659 public:
    00660   explicit MessageMixerOptionsListChanged(GstMessage* castitem);
    00661
    00669   Glib::RefPtr<Gst::MixerOptions> parse();
    00670
    00671
    00679   Glib::RefPtr<const Gst::MixerOptions> parse() const;
    00680 };
    00681
    00686 class MessageMixerChanged : public Message
    00687 {
    00688 public:
    00689   explicit MessageMixerChanged(GstMessage* castitem);
    00690 };
    00691
    00692 } // namespace Gst
    00693
    00694
    00695 namespace Glib
    00696 {
    00705   Glib::RefPtr<Gst::Mixer> wrap(GstMixer* object, bool take_copy = false);
    00706
    00707 } // namespace Glib
    00708
    00709
    00710 #endif /* _GSTREAMERMM_MIXER_H */
    00711