00001
00002
00003 #ifndef _GSTREAMERMM_MIXER_H
00004 #define _GSTREAMERMM_MIXER_H
00005
00006
00007 #include <glibmm.h>
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
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
00039
00040
00041 namespace Gst
00042 { class Mixer_Class; }
00043 namespace Gst
00044 {
00045
00051 enum MixerType
00052 {
00053 MIXER_HARDWARE,
00054 MIXER_SOFTWARE
00055 };
00056
00057 }
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 }
00072 #endif
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 }
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 }
00140 #endif
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 }
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 }
00175 #endif
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
00205 Mixer(const Mixer&);
00206 Mixer& operator=(const Mixer&);
00207
00208 protected:
00209 Mixer();
00210
00217 explicit Mixer(const Glib::Interface_Class& interface_class);
00218
00219 public:
00220
00221
00222
00223 explicit Mixer(GstMixer* castitem);
00224
00225 protected:
00226 #endif
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
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
00450 #ifdef GLIBMM_VFUNCS_ENABLED
00451 #endif //GLIBMM_VFUNCS_ENABLED
00452
00453 protected:
00454
00455 #ifdef GLIBMM_VFUNCS_ENABLED
00456 #endif //GLIBMM_VFUNCS_ENABLED
00457
00458
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
00567
00568
00569
00570
00571
00572
00573
00574
00575
00576
00577
00578
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 }
00693
00694
00695 namespace Glib
00696 {
00705 Glib::RefPtr<Gst::Mixer> wrap(GstMixer* object, bool take_copy = false);
00706
00707 }
00708
00709
00710 #endif
00711