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
00400 Gst::MixerType get_mixer_type() const;
00401
00411 static Gst::MixerMessageType get_message_type(const Glib::RefPtr<Gst::Message>& message);
00412
00413
00414
00415
00416
00417
00418 #ifdef GLIBMM_VFUNCS_ENABLED
00419 virtual Glib::ArrayHandle<int> get_volume_vfunc(const Glib::RefPtr<const Gst::MixerTrack>& track) const;
00420 virtual Glib::ListHandle< Glib::RefPtr<Gst::MixerTrack> > list_tracks_vfunc() const;
00421 #endif //GLIBMM_VFUNCS_ENABLED
00422
00423
00424 #ifdef GLIBMM_VFUNCS_ENABLED
00425 virtual void set_volume_vfunc(const Glib::RefPtr<Gst::MixerTrack>& track, const Glib::ArrayHandle<int>& volumes);
00426 #endif //GLIBMM_VFUNCS_ENABLED
00427
00428
00429 #ifdef GLIBMM_VFUNCS_ENABLED
00430 virtual void set_mute_vfunc(const Glib::RefPtr<Gst::MixerTrack>& track, bool mute);
00431 #endif //GLIBMM_VFUNCS_ENABLED
00432
00433 #ifdef GLIBMM_VFUNCS_ENABLED
00434 virtual void set_record_vfunc(const Glib::RefPtr<Gst::MixerTrack>& track, bool record);
00435 #endif //GLIBMM_VFUNCS_ENABLED
00436
00437
00438 #ifdef GLIBMM_VFUNCS_ENABLED
00439 virtual void set_option_vfunc(const Glib::RefPtr<Gst::MixerOptions>& opts, const Glib::ustring& value);
00440 #endif //GLIBMM_VFUNCS_ENABLED
00441
00442
00443 #ifdef GLIBMM_VFUNCS_ENABLED
00444 virtual Glib::ustring get_option_vfunc(const Glib::RefPtr<const Gst::MixerOptions>& opts) const;
00445 #endif //GLIBMM_VFUNCS_ENABLED
00446
00447
00448 #ifdef GLIBMM_VFUNCS_ENABLED
00449 virtual Gst::MixerFlags get_mixer_flags_vfunc() const;
00450 #endif //GLIBMM_VFUNCS_ENABLED
00451
00452
00453 protected:
00454
00455
00456 public:
00457
00458 public:
00459
00460 #ifdef GLIBMM_VFUNCS_ENABLED
00461 #endif //GLIBMM_VFUNCS_ENABLED
00462
00463 protected:
00464
00465 #ifdef GLIBMM_VFUNCS_ENABLED
00466 #endif //GLIBMM_VFUNCS_ENABLED
00467
00468
00469 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00470 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00471
00472
00473 };
00474
00477 class MessageMixerMuteToggled : public Message
00478 {
00479 public:
00480 explicit MessageMixerMuteToggled(GstMessage* castitem);
00481
00492 void parse(Glib::RefPtr<Gst::MixerTrack>& track, bool& mute) const;
00493
00494
00502 Glib::RefPtr<Gst::MixerTrack> parse();
00503
00511 Glib::RefPtr<const Gst::MixerTrack> parse() const;
00512
00519 bool parse_mute() const;
00520 };
00521
00524 class MessageMixerRecordToggled : public Message
00525 {
00526 public:
00527 explicit MessageMixerRecordToggled(GstMessage* castitem);
00528
00539 void parse(Glib::RefPtr<Gst::MixerTrack>& track, bool& record) const;
00540
00541
00549 Glib::RefPtr<Gst::MixerTrack> parse();
00550
00558 Glib::RefPtr<const Gst::MixerTrack> parse() const;
00559
00565 bool parse_record() const;
00566 };
00567
00570 class MessageMixerVolumeChanged : public Message
00571 {
00572 public:
00573 explicit MessageMixerVolumeChanged(GstMessage* castitem);
00574
00575
00577
00578
00579
00580
00581
00582
00583
00584
00585
00586
00587
00588
00589
00590
00598 Glib::RefPtr<Gst::MixerTrack> parse();
00599
00607 Glib::RefPtr<const Gst::MixerTrack> parse() const;
00608
00614 Glib::ArrayHandle<int> parse_volumes() const;
00615 };
00616
00619 class MessageMixerOptionChanged : public Message
00620 {
00621 public:
00622 explicit MessageMixerOptionChanged(GstMessage* castitem);
00623
00634 void parse(Glib::RefPtr<Gst::MixerOptions>& options,
00635 Glib::ustring& value) const;
00636
00637
00645 Glib::RefPtr<Gst::MixerOptions> parse();
00646
00654 Glib::RefPtr<const Gst::MixerOptions> parse() const;
00655
00661 Glib::ustring parse_value() const;
00662 };
00663
00667 class MessageMixerOptionsListChanged : public Message
00668 {
00669 public:
00670 explicit MessageMixerOptionsListChanged(GstMessage* castitem);
00671
00679 Glib::RefPtr<Gst::MixerOptions> parse();
00680
00681
00689 Glib::RefPtr<const Gst::MixerOptions> parse() const;
00690 };
00691
00696 class MessageMixerChanged : public Message
00697 {
00698 public:
00699 explicit MessageMixerChanged(GstMessage* castitem);
00700 };
00701
00702 }
00703
00704
00705 namespace Glib
00706 {
00715 Glib::RefPtr<Gst::Mixer> wrap(GstMixer* object, bool take_copy = false);
00716
00717 }
00718
00719
00720 #endif
00721