- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List

# taglist.h

Go to the documentation of this file.

    00001 // -*- c++ -*-
    00002 // Generated by gtkmmproc -- DO NOT MODIFY!
    00003 #ifndef _GSTREAMERMM_TAGLIST_H
    00004 #define _GSTREAMERMM_TAGLIST_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/gsttaglist.h>
    00029 #include <gstreamermm/structure.h>
    00030
    00031 namespace Gst
    00032 {
    00033
    00039 enum TagMergeMode
    00040 {
    00041   TAG_MERGE_UNDEFINED,
    00042   TAG_MERGE_REPLACE_ALL,
    00043   TAG_MERGE_REPLACE,
    00044   TAG_MERGE_APPEND,
    00045   TAG_MERGE_PREPEND,
    00046   TAG_MERGE_KEEP,
    00047   TAG_MERGE_KEEP_ALL,
    00048   TAG_MERGE_COUNT
    00049 };
    00050
    00051 } // namespace Gst
    00052
    00053
    00054 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00055 namespace Glib
    00056 {
    00057
    00058 template <>
    00059 class Value<Gst::TagMergeMode> : public Glib::Value_Enum<Gst::TagMergeMode>
    00060 {
    00061 public:
    00062   static GType value_type() G_GNUC_CONST;
    00063 };
    00064
    00065 } // namespace Glib
    00066 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
    00067
    00068
    00069 namespace Gst
    00070 {
    00071
    00075 enum TagFlag
    00076 {
    00077   TAG_FLAG_UNDEFINED,
    00078   TAG_FLAG_META,
    00079   TAG_FLAG_ENCODED,
    00080   TAG_FLAG_DECODED,
    00081   TAG_FLAG_COUNT
    00082 };
    00083
    00084 } // namespace Gst
    00085
    00086
    00087 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00088 namespace Glib
    00089 {
    00090
    00091 template <>
    00092 class Value<Gst::TagFlag> : public Glib::Value_Enum<Gst::TagFlag>
    00093 {
    00094 public:
    00095   static GType value_type() G_GNUC_CONST;
    00096 };
    00097
    00098 } // namespace Glib
    00099 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
    00100
    00101
    00102 namespace Gst
    00103 {
    00104
    00105
    00106 // When adding tags, make sure that they are added to this enum and then in the
    00107 // ccg file in the correct order.  Also make sure that the size of the array of
    00108 // strings is updated in the declaration below and in the ccg file.
    00109 enum Tag
    00110 {
    00114 TAG_TITLE,
    00115
    00121 TAG_TITLE_SORTNAME,
    00122
    00127 TAG_ARTIST,
    00128
    00135 TAG_ARTIST_SORTNAME,
    00136
    00140 TAG_ALBUM,
    00141
    00147 TAG_ALBUM_SORTNAME,
    00148
    00151 TAG_DATE,
    00152
    00155 TAG_GENRE,
    00156
    00159 TAG_COMMENT,
    00160
    00170 TAG_EXTENDED_COMMENT,
    00171
    00174 TAG_TRACK_NUMBER,
    00175
    00178 TAG_TRACK_COUNT,
    00179
    00182 TAG_ALBUM_VOLUME_NUMBER,
    00183
    00186 TAG_ALBUM_VOLUME_COUNT,
    00187
    00190 TAG_LOCATION,
    00191
    00194 TAG_DESCRIPTION,
    00195
    00198 TAG_VERSION,
    00199
    00203 TAG_ISRC,
    00204
    00207 TAG_ORGANIZATION,
    00208
    00211 TAG_COPYRIGHT,
    00212
    00216 TAG_COPYRIGHT_URI,
    00217
    00221 TAG_COMPOSER,
    00222
    00225 TAG_CONTACT,
    00226
    00229 TAG_LICENSE,
    00230
    00234 TAG_LICENSE_URI,
    00235
    00238 TAG_PERFORMER,
    00239
    00242 TAG_DURATION,
    00243
    00246 TAG_CODEC,
    00247
    00250 TAG_VIDEO_CODEC,
    00251
    00254 TAG_AUDIO_CODEC,
    00255
    00258 TAG_BITRATE,
    00259
    00262 TAG_NOMINAL_BITRATE,
    00263
    00266 TAG_MINIMUM_BITRATE,
    00267
    00270 TAG_MAXIMUM_BITRATE,
    00271
    00274 TAG_SERIAL,
    00275
    00278 TAG_ENCODER,
    00279
    00282 TAG_ENCODER_VERSION,
    00283
    00286 TAG_TRACK_GAIN,
    00287
    00290 TAG_TRACK_PEAK,
    00291
    00294 TAG_ALBUM_GAIN,
    00295
    00298 TAG_ALBUM_PEAK,
    00299
    00303 TAG_REFERENCE_LEVEL,
    00304
    00307 TAG_LANGUAGE_CODE,
    00308
    00313 TAG_IMAGE,
    00314
    00319 TAG_PREVIEW_IMAGE,
    00320
    00326 TAG_ATTACHMENT,
    00327
    00331 TAG_BEATS_PER_MINUTE,
    00332
    00337 TAG_KEYWORDS,
    00338
    00344 TAG_GEO_LOCATION_NAME,
    00345
    00352 TAG_GEO_LOCATION_LATITUDE,
    00353
    00360 TAG_GEO_LOCATION_LONGITUDE,
    00361
    00367 TAG_GEO_LOCATION_ELEVATION
    00368 };
    00369
    00372 std::ostream& operator<<(std::ostream& stream, Tag tag);
    00373
    00374 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00375 // The size should be the last enum of Gst::Tag (above) + 1.
    00376 extern const char* tagStrings[TAG_GEO_LOCATION_ELEVATION + 1];
    00377 #endif
    00378
    00395 class TagList : public Structure
    00396 {
    00397   public:
    00398 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00399   typedef TagList CppObjectType;
    00400   typedef GstTagList BaseObjectType;
    00401
    00402   static GType get_type() G_GNUC_CONST;
    00403 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
    00404
    00405   TagList();
    00406
    00407   explicit TagList(GstTagList* gobject, bool make_a_copy = true);
    00408
    00409   TagList(const TagList& other);
    00410   TagList& operator=(const TagList& other);
    00411
    00412   ~TagList();
    00413
    00414   void swap(TagList& other);
    00415
    00417   GstTagList*       gobj()       { return gobject_; }
    00418
    00420   const GstTagList* gobj() const { return gobject_; }
    00421
    00423   GstTagList* gobj_copy() const;
    00424
    00425 protected:
    00426   GstTagList* gobject_;
    00427
    00428 private:
    00429
    00430
    00431 public:
    00432
    00437   static bool exists(const Glib::ustring& tag);
    00438
    00443   static GType get_type(const Glib::ustring& tag);
    00444
    00449   static Glib::ustring get_nick(const Glib::ustring& tag);
    00450
    00455   static Glib::ustring get_description(const Glib::ustring& tag);
    00456
    00461   static TagFlag get_flag(const Glib::ustring& tag);
    00462
    00468   static bool is_fixed(const Glib::ustring& tag);
    00469
    00475   bool is_empty() const;
    00476
    00481   void insert(const Gst::TagList& other, TagMergeMode mode=TAG_MERGE_PREPEND);
    00482
    00489   Gst::TagList merge(const Gst::TagList& other, TagMergeMode mode=TAG_MERGE_PREPEND);
    00490
    00495   guint size(const Glib::ustring& tag) const;
    00496
    00503   void add(Tag tag, const Glib::ValueBase& value, TagMergeMode mode=TAG_MERGE_PREPEND);
    00504
    00512   void add(Tag tag, const char* data, TagMergeMode mode=TAG_MERGE_PREPEND);
    00513
    00521   template <class DataType>
    00522   void add(Tag tag, const DataType& data, TagMergeMode mode=TAG_MERGE_PREPEND);
    00523
    00524
    00528   void remove_tag(Tag tag);
    00529
    00533   typedef sigc::slot<void, const Glib::ustring&> SlotForeach;
    00534
    00540   void foreach(const SlotForeach& slot);
    00541
    00542
    00551   bool get(Tag tag, Glib::ValueBase& dest) const;
    00552
    00553
    00562   bool get(Tag tag, guint index, Glib::ValueBase& dest) const;
    00563
    00564
    00572   template<class DataType>
    00573   bool get(Tag tag, DataType& value) const;
    00574
    00575
    00583   template<class DataType>
    00584   bool get(Tag tag, guint index, DataType& value) const;
    00585
    00586
    00587   //Variable argument functions are ignored.
    00588
    00589
    00590 };
    00591
    00592 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00593
    00594 /***************************** Gst::TagList *****************************/
    00595
    00596 template <class DataType>
    00597 void TagList::add(Tag tag, const DataType& data, TagMergeMode mode)
    00598 {
    00599   typedef Glib::Value<DataType> ValueType;
    00600
    00601   ValueType value;
    00602   value.init(ValueType::value_type());
    00603   value.set(data);
    00604   this->add(tag, (Glib::ValueBase) value, mode);
    00605 }
    00606
    00607 template<class DataType>
    00608 bool TagList::get(Tag tag, DataType& data) const
    00609 {
    00610   Glib::Value<DataType> value;
    00611   bool result = this->get(tag, (Glib::ValueBase&) value);
    00612
    00613   if(result)
    00614     data = value.get();
    00615
    00616   return result;
    00617 }
    00618
    00619 template<class DataType>
    00620 bool TagList::get(Tag tag, guint index, DataType& data) const
    00621 {
    00622   Glib::Value<DataType> value;
    00623   bool result = this->get(tag, index, (Glib::ValueBase&) value);
    00624
    00625   if(result)
    00626     data = value.get();
    00627
    00628   return result;
    00629 }
    00630
    00631 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
    00632
    00633 } //namespace Gst
    00634
    00635
    00636 namespace Gst
    00637 {
    00638
    00643 inline void swap(TagList& lhs, TagList& rhs)
    00644   { lhs.swap(rhs); }
    00645
    00646 } // namespace Gst
    00647
    00648 namespace Glib
    00649 {
    00650
    00660 Gst::TagList wrap(GstTagList* object, int dummy, bool take_copy = false);
    00661
    00662 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00663 template <>
    00664 class Value<Gst::TagList> : public Glib::Value_Boxed<Gst::TagList>
    00665 {};
    00666 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
    00667
    00668 } // namespace Glib
    00669
    00670
    00671 #endif /* _GSTREAMERMM_TAGLIST_H */
    00672