QtGStreamer  0.10.2
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
taglist.cpp
00001 /*
00002     Copyright (C) 2010  Collabora Multimedia.
00003       @author Mauricio Piacentini <mauricio.piacentini@collabora.co.uk>
00004     Copyright (C) 2011  Collabora Ltd.
00005       @author George Kiagiadakis <george.kiagiadakis@collabora.co.uk>
00006 
00007     This library is free software; you can redistribute it and/or modify
00008     it under the terms of the GNU Lesser General Public License as published
00009     by the Free Software Foundation; either version 2.1 of the License, or
00010     (at your option) any later version.
00011 
00012     This program is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015     GNU Lesser General Public License for more details.
00016 
00017     You should have received a copy of the GNU Lesser General Public License
00018     along with this program.  If not, see <http://www.gnu.org/licenses/>.
00019 */
00020 #include "taglist.h"
00021 #include "../QGlib/string_p.h"
00022 #include <gst/gsttaglist.h>
00023 #include <gst/gstvalue.h>
00024 //#include <gst/gstdatetime.h>
00025 #include <QtCore/QDebug>
00026 #include <QtCore/QDate>
00027 #include <QGst/Buffer>
00028 
00029 namespace QGst {
00030 
00031 QString getStringTag(GstTagList * list, const gchar * tag, int index)
00032 {
00033     gchar * value;
00034     if (gst_tag_list_get_string_index(list, tag, index, &value)) {
00035         return QGlib::Private::stringFromGCharPtr(value);
00036     }
00037     return QString::null;
00038 }
00039 
00040 quint32 getUintTag(GstTagList * list, const gchar * tag, int index)
00041 {
00042     guint value = 0;
00043     gst_tag_list_get_uint_index(list, tag, index, &value);
00044     return value;
00045 }
00046 
00047 double getDoubleTag(GstTagList * list, const gchar * tag, int index)
00048 {
00049     double value = 0;
00050     gst_tag_list_get_double_index(list, tag, index, &value);
00051     return value;
00052 }
00053 
00054 QGst::BufferPtr getBufferTag(GstTagList * list, const gchar * tag, int index)
00055 {
00056     GstBuffer * value = 0;
00057     gst_tag_list_get_buffer_index(list, tag, index, &value);
00058     //Buffer is already refd()
00059     return QGst::BufferPtr::wrap(value, false);
00060 }
00061 
00062 #ifndef DOXYGEN_RUN
00063 
00064 struct QTGSTREAMER_NO_EXPORT TagList::Data : public QSharedData
00065 {
00066     Data();
00067     Data(const GstTagList *tl);
00068     Data(const Data & other);
00069     ~Data();
00070 
00071     GstTagList *taglist;
00072 };
00073 
00074 TagList::Data::Data()
00075     : QSharedData()
00076 {
00077     taglist = gst_tag_list_new();
00078 }
00079 
00080 TagList::Data::Data(const GstTagList *tl)
00081     : QSharedData()
00082 {
00083     if (tl && gst_is_tag_list(tl)) {
00084         taglist = gst_tag_list_copy(tl);
00085     } else {
00086         taglist = gst_tag_list_new();
00087     }
00088 }
00089 
00090 TagList::Data::Data(const TagList::Data & other)
00091     : QSharedData(other)
00092 {
00093     taglist = gst_tag_list_copy(other.taglist);
00094 }
00095 
00096 TagList::Data::~Data()
00097 {
00098     gst_tag_list_free(taglist);
00099 }
00100 
00101 #endif //DOXYGEN_RUN
00102 
00103 TagList::TagList()
00104     : d(new Data)
00105 {
00106 }
00107 
00108 TagList::TagList(const GstTagList *taglist)
00109     : d(new Data(taglist))
00110 {
00111 }
00112 
00113 TagList::~TagList()
00114 {
00115 }
00116 
00117 TagList::TagList(const TagList & other)
00118     : d(other.d)
00119 {
00120 }
00121 
00122 TagList & TagList::operator=(const TagList & other)
00123 {
00124     d = other.d;
00125     return *this;
00126 }
00127 
00128 bool TagList::isEmpty() const
00129 {
00130     return gst_tag_list_is_empty(d->taglist);
00131 }
00132 
00133 void TagList::insert(const TagList & other, TagMergeMode mode)
00134 {
00135     gst_tag_list_insert(d->taglist, other.d->taglist, static_cast<GstTagMergeMode>(mode));
00136 }
00137 
00138 //static
00139 TagList TagList::merge(const TagList & firstList, const TagList & secondList, TagMergeMode mode)
00140 {
00141     GstTagList *taglist = gst_tag_list_merge(firstList, secondList,
00142                                              static_cast<GstTagMergeMode>(mode));
00143 
00144     //avoid copying the merged taglist by freeing the new one and assigning this one to d->taglist
00145     TagList tl;
00146     gst_tag_list_free(tl.d->taglist);
00147     tl.d->taglist = taglist;
00148     return tl;
00149 }
00150 
00151 QGlib::Value TagList::tagValue(const char *tag, int index) const
00152 {
00153     return QGlib::Value(gst_tag_list_get_value_index(d->taglist, tag, index));
00154 }
00155 
00156 void TagList::setTagValue(const char *tag, const QGlib::Value & value, TagMergeMode mode)
00157 {
00158     gst_tag_list_add_value(d->taglist, static_cast<GstTagMergeMode>(mode), tag, value);
00159 }
00160 
00161 int TagList::tagValueCount(const char *tag) const
00162 {
00163     return gst_tag_list_get_tag_size(d->taglist, tag);
00164 }
00165 
00166 void TagList::clear()
00167 {
00168     gst_tag_list_free(d->taglist);
00169     d->taglist = gst_tag_list_new();
00170 }
00171 
00172 void TagList::removeTag(const char *tag)
00173 {
00174     gst_tag_list_remove_tag(d->taglist, tag);
00175 }
00176 
00177 TagList::operator GstTagList*()
00178 {
00179     return d->taglist;
00180 }
00181 
00182 TagList::operator const GstTagList*() const
00183 {
00184     return d->taglist;
00185 }
00186 
00187 QString TagList::title(int index) const
00188 {
00189     return getStringTag(d->taglist, GST_TAG_TITLE, index);
00190 }
00191 
00192 void TagList::setTitle(const QString & value, TagMergeMode mode)
00193 {
00194     gst_tag_list_add_value(d->taglist, static_cast<GstTagMergeMode>(mode),
00195                            GST_TAG_TITLE, QGlib::Value::create(value));
00196 }
00197 
00198 int TagList::titleCount() const
00199 {
00200     return gst_tag_list_get_tag_size(d->taglist, GST_TAG_TITLE);
00201 }
00202 
00203 QString TagList::titleSortName() const
00204 {
00205     return getStringTag(d->taglist, GST_TAG_TITLE_SORTNAME, 0);
00206 }
00207 
00208 void TagList::setTitleSortName(const QString & value)
00209 {
00210     gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
00211                            GST_TAG_TITLE_SORTNAME, QGlib::Value::create(value));
00212 }
00213 
00214 QString TagList::artist(int index) const
00215 {
00216     return getStringTag(d->taglist, GST_TAG_ARTIST, index);
00217 }
00218 
00219 void TagList::setArtist(const QString & value, TagMergeMode mode)
00220 {
00221     gst_tag_list_add_value(d->taglist, static_cast<GstTagMergeMode>(mode),
00222                            GST_TAG_ARTIST, QGlib::Value::create(value));
00223 }
00224 
00225 int TagList::artistCount() const
00226 {
00227     return gst_tag_list_get_tag_size(d->taglist, GST_TAG_ARTIST);
00228 }
00229 
00230 QString TagList::artistSortName() const
00231 {
00232     return getStringTag(d->taglist, GST_TAG_ARTIST_SORTNAME, 0);
00233 }
00234 
00235 void TagList::setArtistSortName(const QString & value)
00236 {
00237     gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
00238                            GST_TAG_ARTIST_SORTNAME, QGlib::Value::create(value));
00239 }
00240 
00241 QString TagList::composer(int index) const
00242 {
00243     return getStringTag(d->taglist, GST_TAG_COMPOSER, index);
00244 }
00245 
00246 void TagList::setComposer(const QString & value, TagMergeMode mode)
00247 {
00248     gst_tag_list_add_value(d->taglist, static_cast<GstTagMergeMode>(mode),
00249                            GST_TAG_COMPOSER, QGlib::Value::create(value));
00250 }
00251 
00252 int TagList::composerCount() const
00253 {
00254     return gst_tag_list_get_tag_size(d->taglist, GST_TAG_COMPOSER);
00255 }
00256 
00257 QDate TagList::date() const
00258 {
00259     GDate * value;
00260     if (gst_tag_list_get_date(d->taglist, GST_TAG_DATE, &value)) {
00261         QDate ret = QDate::fromJulianDay(g_date_get_julian(value));
00262         g_date_free(value);
00263         return ret;
00264     }
00265     return QDate();
00266 }
00267 
00268 void TagList::setDate(const QDate & value)
00269 {
00270     GDate * date = g_date_new_julian(value.toJulianDay());
00271     gst_tag_list_add (d->taglist, GST_TAG_MERGE_REPLACE_ALL, GST_TAG_DATE, date, NULL);
00272 }
00273 
00274 QString TagList::genre(int index) const
00275 {
00276     return getStringTag(d->taglist, GST_TAG_GENRE, index);
00277 }
00278 
00279 void TagList::setGenre(const QString & value, TagMergeMode mode)
00280 {
00281     gst_tag_list_add_value(d->taglist, static_cast<GstTagMergeMode>(mode),
00282                            GST_TAG_GENRE, QGlib::Value::create(value));
00283 }
00284 
00285 int TagList::genreCount() const
00286 {
00287     return gst_tag_list_get_tag_size(d->taglist, GST_TAG_GENRE);
00288 }
00289 
00290 QString TagList::comment(int index) const
00291 {
00292     return getStringTag(d->taglist, GST_TAG_COMMENT, index);
00293 }
00294 
00295 void TagList::setComment(const QString & value, TagMergeMode mode)
00296 {
00297     gst_tag_list_add_value(d->taglist, static_cast<GstTagMergeMode>(mode),
00298                            GST_TAG_COMMENT, QGlib::Value::create(value));
00299 }
00300 
00301 int TagList::commentCount() const
00302 {
00303     return gst_tag_list_get_tag_size(d->taglist, GST_TAG_COMMENT);
00304 }
00305 
00306 QString TagList::extendedComment(int index) const
00307 {
00308     return getStringTag(d->taglist, GST_TAG_EXTENDED_COMMENT, index);
00309 }
00310 
00311 void TagList::setExtendedComment(const QString & value, TagMergeMode mode)
00312 {
00313     gst_tag_list_add_value(d->taglist, static_cast<GstTagMergeMode>(mode),
00314                            GST_TAG_EXTENDED_COMMENT, QGlib::Value::create(value));
00315 }
00316 
00317 int TagList::extendedCommentCount() const
00318 {
00319         return gst_tag_list_get_tag_size(d->taglist, GST_TAG_EXTENDED_COMMENT);
00320 }
00321 
00322 quint32 TagList::trackNumber() const
00323 {
00324     return getUintTag(d->taglist, GST_TAG_TRACK_NUMBER, 0);
00325 }
00326 
00327 void TagList::setTrackNumber(quint32 value)
00328 {
00329     gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL, GST_TAG_TRACK_NUMBER, value, NULL);
00330 }
00331 
00332 quint32 TagList::trackCount() const
00333 {
00334     return getUintTag(d->taglist, GST_TAG_TRACK_COUNT, 0);
00335 }
00336 
00337 void TagList::setTrackCount(quint32 value)
00338 {
00339     gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL, GST_TAG_TRACK_COUNT, value, NULL);
00340 }
00341 
00342 quint32 TagList::albumVolumeNumber() const
00343 {
00344     return getUintTag(d->taglist, GST_TAG_ALBUM_VOLUME_NUMBER, 0);
00345 }
00346 
00347 void TagList::setAlbumVolumeNumber(quint32 value)
00348 {
00349     gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL, GST_TAG_ALBUM_VOLUME_NUMBER, value, NULL);
00350 }
00351 
00352 quint32 TagList::albumVolumeCount() const
00353 {
00354     return getUintTag(d->taglist, GST_TAG_ALBUM_VOLUME_COUNT, 0);
00355 }
00356 
00357 void TagList::setAlbumVolumeCount(quint32 value)
00358 {
00359     gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL, GST_TAG_ALBUM_VOLUME_COUNT, value, NULL);
00360 }
00361 
00362 QString TagList::location(int index) const
00363 {
00364     return getStringTag(d->taglist, GST_TAG_LOCATION, index);
00365 }
00366 
00367 void TagList::setLocation(const QString & value, TagMergeMode mode)
00368 {
00369     gst_tag_list_add_value(d->taglist, static_cast<GstTagMergeMode>(mode),
00370                            GST_TAG_LOCATION, QGlib::Value::create(value));
00371 }
00372 
00373 int TagList::locationCount() const
00374 {
00375     return gst_tag_list_get_tag_size(d->taglist, GST_TAG_LOCATION);
00376 }
00377 
00378 QString TagList::homepage(int index) const
00379 {
00380     return getStringTag(d->taglist, GST_TAG_HOMEPAGE, index);
00381 }
00382 
00383 void TagList::setHomepage(const QString & value, TagMergeMode mode)
00384 {
00385     gst_tag_list_add_value(d->taglist, static_cast<GstTagMergeMode>(mode),
00386                            GST_TAG_HOMEPAGE, QGlib::Value::create(value));
00387 }
00388 
00389 int TagList::homepageCount() const
00390 {
00391     return gst_tag_list_get_tag_size(d->taglist, GST_TAG_HOMEPAGE);
00392 }
00393 
00394 QString TagList::description(int index) const
00395 {
00396     return getStringTag(d->taglist, GST_TAG_DESCRIPTION, index);
00397 }
00398 
00399 void TagList::setDescription(const QString & value, TagMergeMode mode)
00400 {
00401     gst_tag_list_add_value(d->taglist, static_cast<GstTagMergeMode>(mode),
00402                            GST_TAG_DESCRIPTION, QGlib::Value::create(value));
00403 }
00404 
00405 int TagList::descriptionCount() const
00406 {
00407     return gst_tag_list_get_tag_size(d->taglist, GST_TAG_DESCRIPTION);
00408 }
00409 
00410 QString TagList::version() const
00411 {
00412     return getStringTag(d->taglist, GST_TAG_VERSION, 0);
00413 }
00414 
00415 void TagList::setVersion(const QString & value)
00416 {
00417     gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
00418                            GST_TAG_VERSION, QGlib::Value::create(value));
00419 }
00420 
00421 QString TagList::isrc() const
00422 {
00423     return getStringTag(d->taglist, GST_TAG_ISRC, 0);
00424 }
00425 
00426 void TagList::setIsrc(const QString & value)
00427 {
00428     gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
00429                            GST_TAG_ISRC, QGlib::Value::create(value));
00430 }
00431 
00432 QString TagList::organization(int index) const
00433 {
00434     return getStringTag(d->taglist, GST_TAG_ORGANIZATION, index);
00435 }
00436 
00437 void TagList::setOrganization(const QString & value, TagMergeMode mode)
00438 {
00439     gst_tag_list_add_value(d->taglist, static_cast<GstTagMergeMode>(mode),
00440                            GST_TAG_ORGANIZATION, QGlib::Value::create(value));
00441 }
00442 
00443 int TagList::organizationCount() const
00444 {
00445     return gst_tag_list_get_tag_size(d->taglist, GST_TAG_ORGANIZATION);
00446 }
00447 
00448 QString TagList::copyright() const
00449 {
00450     return getStringTag(d->taglist, GST_TAG_COPYRIGHT, 0);
00451 }
00452 
00453 void TagList::setCopyright(const QString & value)
00454 {
00455     gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
00456                            GST_TAG_COPYRIGHT, QGlib::Value::create(value));
00457 }
00458 
00459 QString TagList::copyrightUri() const
00460 {
00461     return getStringTag(d->taglist, GST_TAG_COPYRIGHT_URI, 0);
00462 }
00463 
00464 void TagList::setCopyrightUri(const QString & value)
00465 {
00466     gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
00467                            GST_TAG_COPYRIGHT_URI, QGlib::Value::create(value));
00468 }
00469 
00470 QString TagList::contact(int index) const
00471 {
00472     return getStringTag(d->taglist, GST_TAG_CONTACT, index);
00473 }
00474 
00475 void TagList::setContact(const QString & value, TagMergeMode mode)
00476 {
00477     gst_tag_list_add_value(d->taglist, static_cast<GstTagMergeMode>(mode),
00478                            GST_TAG_CONTACT, QGlib::Value::create(value));
00479 }
00480 
00481 int TagList::contactCount() const
00482 {
00483     return gst_tag_list_get_tag_size(d->taglist, GST_TAG_CONTACT);
00484 }
00485 
00486 QString TagList::license() const
00487 {
00488     return getStringTag(d->taglist, GST_TAG_LICENSE, 0);
00489 }
00490 
00491 void TagList::setLicense(const QString & value)
00492 {
00493     gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
00494                            GST_TAG_LICENSE, QGlib::Value::create(value));
00495 }
00496 
00497 QString TagList::licenseUri() const
00498 {
00499     return getStringTag(d->taglist, GST_TAG_LICENSE_URI, 0);
00500 }
00501 
00502 void TagList::setLicenseUri(const QString & value)
00503 {
00504     gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
00505                            GST_TAG_LICENSE_URI, QGlib::Value::create(value));
00506 }
00507 
00508 QString TagList::performer(int index) const
00509 {
00510     return getStringTag(d->taglist, GST_TAG_PERFORMER, index);
00511 }
00512 
00513 void TagList::setPerformer(const QString & value, TagMergeMode mode)
00514 {
00515     gst_tag_list_add_value(d->taglist, static_cast<GstTagMergeMode>(mode),
00516                            GST_TAG_PERFORMER, QGlib::Value::create(value));
00517 }
00518 
00519 int TagList::performerCount() const
00520 {
00521     return gst_tag_list_get_tag_size(d->taglist, GST_TAG_PERFORMER);
00522 }
00523 
00524 quint64 TagList::duration() const
00525 {
00526         guint64 value = 0;
00527         gst_tag_list_get_uint64_index(d->taglist, GST_TAG_DURATION, 0, &value);
00528         return value;
00529 }
00530 
00531 void TagList::setDuration(quint64 value)
00532 {
00533     gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL, GST_TAG_DURATION, value, NULL);
00534 }
00535 
00536 QString TagList::codec() const
00537 {
00538     return getStringTag(d->taglist, GST_TAG_CODEC, 0);
00539 }
00540 
00541 void TagList::setCodec(const QString & value)
00542 {
00543     gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
00544                            GST_TAG_CODEC, QGlib::Value::create(value));
00545 }
00546 
00547 QString TagList::videoCodec() const
00548 {
00549     return getStringTag(d->taglist, GST_TAG_VIDEO_CODEC, 0);
00550 }
00551 
00552 void TagList::setVideoCodec(const QString & value)
00553 {
00554     gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
00555                            GST_TAG_VIDEO_CODEC, QGlib::Value::create(value));
00556 }
00557 
00558 QString TagList::audioCodec() const
00559 {
00560     return getStringTag(d->taglist, GST_TAG_AUDIO_CODEC, 0);
00561 }
00562 
00563 void TagList::setAudioCodec(const QString & value)
00564 {
00565     gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
00566                            GST_TAG_AUDIO_CODEC, QGlib::Value::create(value));
00567 }
00568 
00569 QString TagList::subtitleCodec() const
00570 {
00571     return getStringTag(d->taglist, GST_TAG_SUBTITLE_CODEC, 0);
00572 }
00573 
00574 void TagList::setSubtitleCodec(const QString & value)
00575 {
00576     gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
00577                            GST_TAG_SUBTITLE_CODEC, QGlib::Value::create(value));
00578 }
00579 
00580 QString TagList::containerFormat() const
00581 {
00582     return getStringTag(d->taglist, GST_TAG_CONTAINER_FORMAT, 0);
00583 }
00584 
00585 void TagList::setContainerFormat(const QString & value)
00586 {
00587     gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
00588                            GST_TAG_CONTAINER_FORMAT, QGlib::Value::create(value));
00589 }
00590 
00591 quint32 TagList::bitrate() const
00592 {
00593     return getUintTag(d->taglist, GST_TAG_BITRATE, 0);
00594 }
00595 
00596 void TagList::setBitrate(quint32 value)
00597 {
00598     gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL, GST_TAG_BITRATE, value, NULL);
00599 }
00600 
00601 quint32 TagList::nominalBitrate() const
00602 {
00603     return getUintTag(d->taglist, GST_TAG_NOMINAL_BITRATE, 0);
00604 }
00605 
00606 void TagList::setNominalBitrate(quint32 value)
00607 {
00608     gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL, GST_TAG_NOMINAL_BITRATE, value, NULL);
00609 }
00610 
00611 quint32 TagList::minimumBitrate() const
00612 {
00613     return getUintTag(d->taglist, GST_TAG_MINIMUM_BITRATE, 0);
00614 }
00615 
00616 void TagList::setMinimumBitrate(quint32 value)
00617 {
00618     gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL, GST_TAG_MINIMUM_BITRATE, value, NULL);
00619 }
00620 
00621 quint32 TagList::maximumBitrate() const
00622 {
00623     return getUintTag(d->taglist, GST_TAG_MAXIMUM_BITRATE, 0);
00624 }
00625 
00626 void TagList::setMaximumBitrate(quint32 value)
00627 {
00628     gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL, GST_TAG_MAXIMUM_BITRATE, value, NULL);
00629 }
00630 
00631 quint32 TagList::serial() const
00632 {
00633     return getUintTag(d->taglist, GST_TAG_SERIAL, 0);
00634 }
00635 
00636 void TagList::setSerial(quint32 value)
00637 {
00638     gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL, GST_TAG_SERIAL, value, NULL);
00639 }
00640 
00641 QString TagList::encoder() const
00642 {
00643     return getStringTag(d->taglist, GST_TAG_ENCODER, 0);
00644 }
00645 
00646 void TagList::setEncoder(const QString & value)
00647 {
00648     gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
00649                            GST_TAG_ENCODER, QGlib::Value::create(value));
00650 }
00651 
00652 quint32 TagList::encoderVersion() const
00653 {
00654     return getUintTag(d->taglist, GST_TAG_ENCODER_VERSION, 0);
00655 }
00656 
00657 void TagList::setEncoderVersion(quint32 value)
00658 {
00659     gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL, GST_TAG_ENCODER_VERSION, value, NULL);
00660 }
00661 
00662 double TagList::trackGain() const
00663 {
00664     return getDoubleTag(d->taglist, GST_TAG_TRACK_GAIN, 0);
00665 }
00666 
00667 void TagList::setTrackGain(double value)
00668 {
00669     gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL, GST_TAG_TRACK_GAIN, value, NULL);
00670 }
00671 
00672 double TagList::trackPeak() const
00673 {
00674     return getDoubleTag(d->taglist, GST_TAG_TRACK_PEAK, 0);
00675 }
00676 
00677 void TagList::setTrackPeak(double value)
00678 {
00679     gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL, GST_TAG_TRACK_PEAK, value, NULL);
00680 }
00681 
00682 double TagList::albumGain() const
00683 {
00684     return getDoubleTag(d->taglist, GST_TAG_ALBUM_GAIN, 0);
00685 }
00686 
00687 void TagList::setAlbumGain(double value)
00688 {
00689     gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL, GST_TAG_ALBUM_GAIN, value, NULL);
00690 }
00691 
00692 double TagList::albumPeak() const
00693 {
00694     return getDoubleTag(d->taglist, GST_TAG_ALBUM_PEAK, 0);
00695 }
00696 
00697 void TagList::setAlbumPeak(double value)
00698 {
00699     gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL, GST_TAG_ALBUM_PEAK, value, NULL);
00700 }
00701 
00702 double TagList::referenceLevel() const
00703 {
00704     return getDoubleTag(d->taglist, GST_TAG_REFERENCE_LEVEL, 0);
00705 }
00706 
00707 void TagList::setReferenceLevel(double value)
00708 {
00709     gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL, GST_TAG_REFERENCE_LEVEL, value, NULL);
00710 }
00711 
00712 QString TagList::languageCode() const
00713 {
00714     return getStringTag(d->taglist, GST_TAG_LANGUAGE_CODE, 0);
00715 }
00716 
00717 void TagList::setLanguageCode(const QString & value)
00718 {
00719     gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
00720                            GST_TAG_LANGUAGE_CODE, QGlib::Value::create(value));
00721 }
00722 
00723 BufferPtr TagList::image(int index) const
00724 {
00725     return getBufferTag(d->taglist, GST_TAG_IMAGE, index);
00726 }
00727 
00728 void TagList::setImage(const BufferPtr & value, TagMergeMode mode)
00729 {
00730     gst_tag_list_add_value(d->taglist, static_cast<GstTagMergeMode>(mode),
00731                            GST_TAG_IMAGE, QGlib::Value::create(value));
00732 }
00733 
00734 int TagList::imageCount() const
00735 {
00736     return gst_tag_list_get_tag_size(d->taglist, GST_TAG_IMAGE);
00737 }
00738 
00739 BufferPtr TagList::previewImage() const
00740 {
00741     return getBufferTag(d->taglist, GST_TAG_PREVIEW_IMAGE, 0);
00742 }
00743 
00744 void TagList::setPreviewImage(const BufferPtr & value)
00745 {
00746     gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
00747                            GST_TAG_PREVIEW_IMAGE, QGlib::Value::create(value));
00748 }
00749 
00750 BufferPtr TagList::attachment(int index) const
00751 {
00752     return getBufferTag(d->taglist, GST_TAG_ATTACHMENT, index);
00753 }
00754 
00755 void TagList::setAttachment(const BufferPtr & value, TagMergeMode mode)
00756 {
00757     gst_tag_list_add_value(d->taglist, static_cast<GstTagMergeMode>(mode),
00758                            GST_TAG_ATTACHMENT, QGlib::Value::create(value));
00759 }
00760 
00761 int TagList::attachmentCount() const
00762 {
00763     return gst_tag_list_get_tag_size(d->taglist, GST_TAG_ATTACHMENT);
00764 }
00765 
00766 double TagList::beatsPerMinute() const
00767 {
00768     return getDoubleTag(d->taglist, GST_TAG_BEATS_PER_MINUTE, 0);
00769 }
00770 
00771 void TagList::setBeatsPerMinute(double value)
00772 {
00773     gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL, GST_TAG_BEATS_PER_MINUTE, value, NULL);
00774 }
00775 
00776 QString TagList::keywords(int index) const
00777 {
00778     return getStringTag(d->taglist, GST_TAG_KEYWORDS, index);
00779 }
00780 
00781 void TagList::setKeywords(const QString & value, TagMergeMode mode)
00782 {
00783     gst_tag_list_add_value(d->taglist, static_cast<GstTagMergeMode>(mode),
00784                            GST_TAG_KEYWORDS, QGlib::Value::create(value));
00785 }
00786 
00787 int TagList::keywordsCount() const
00788 {
00789     return gst_tag_list_get_tag_size(d->taglist, GST_TAG_KEYWORDS);
00790 }
00791 
00792 QString TagList::geoLocationName() const
00793 {
00794     return getStringTag(d->taglist, GST_TAG_GEO_LOCATION_NAME, 0);
00795 }
00796 
00797 void TagList::seGeoLocationName(const QString & value)
00798 {
00799     gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
00800                            GST_TAG_GEO_LOCATION_NAME, QGlib::Value::create(value));
00801 }
00802 
00803 double TagList::geoLocationLatitude() const
00804 {
00805     return getDoubleTag(d->taglist, GST_TAG_GEO_LOCATION_LATITUDE, 0);
00806 }
00807 
00808 void TagList::setGeoLocationLatitude(double value)
00809 {
00810     gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
00811                      GST_TAG_GEO_LOCATION_LATITUDE, value, NULL);
00812 }
00813 
00814 double TagList::geoLocationLongitude() const
00815 {
00816     return getDoubleTag(d->taglist, GST_TAG_GEO_LOCATION_LONGITUDE, 0);
00817 }
00818 
00819 void TagList::setGeoLocationLongitude(double value)
00820 {
00821     gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
00822                      GST_TAG_GEO_LOCATION_LONGITUDE, value, NULL);
00823 }
00824 
00825 double TagList::geoLocationElevation() const
00826 {
00827     return getDoubleTag(d->taglist, GST_TAG_GEO_LOCATION_ELEVATION, 0);
00828 }
00829 
00830 void TagList::setGeoLocationElevation(double value)
00831 {
00832     gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
00833                      GST_TAG_GEO_LOCATION_ELEVATION, value, NULL);
00834 }
00835 
00836 QString TagList::geoLocationCountry() const
00837 {
00838     return getStringTag(d->taglist, GST_TAG_GEO_LOCATION_COUNTRY, 0);
00839 }
00840 
00841 void TagList::setGeoLocationCountry(const QString & value)
00842 {
00843     gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
00844                            GST_TAG_GEO_LOCATION_COUNTRY, QGlib::Value::create(value));
00845 }
00846 
00847 QString TagList::geoLocationCity() const
00848 {
00849     return getStringTag(d->taglist, GST_TAG_GEO_LOCATION_CITY, 0);
00850 }
00851 
00852 void TagList::setGeoLocationCity(const QString & value)
00853 {
00854     gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
00855                            GST_TAG_GEO_LOCATION_CITY, QGlib::Value::create(value));
00856 }
00857 
00858 QString TagList::geoLocationSublocation() const
00859 {
00860     return getStringTag(d->taglist, GST_TAG_GEO_LOCATION_SUBLOCATION, 0);
00861 }
00862 
00863 void TagList::setGeoLocationSublocation(const QString & value)
00864 {
00865     gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
00866                            GST_TAG_GEO_LOCATION_SUBLOCATION, QGlib::Value::create(value));
00867 }
00868 
00869 double TagList::geoLocationMovementSpeed() const
00870 {
00871     return getDoubleTag(d->taglist, GST_TAG_GEO_LOCATION_MOVEMENT_SPEED, 0);
00872 }
00873 
00874 void TagList::setGeoLocationMovementSpeed(double value)
00875 {
00876     gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
00877                      GST_TAG_GEO_LOCATION_MOVEMENT_SPEED, value, NULL);
00878 }
00879 
00880 double TagList::geoLocationMovementDirection() const
00881 {
00882     return getDoubleTag(d->taglist, GST_TAG_GEO_LOCATION_MOVEMENT_DIRECTION, 0);
00883 }
00884 
00885 void TagList::setGeoLocationMovementDirection(double value)
00886 {
00887     gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
00888                      GST_TAG_GEO_LOCATION_MOVEMENT_DIRECTION, value, NULL);
00889 }
00890 
00891 double TagList::geoLocationCaptureDirection() const
00892 {
00893     return getDoubleTag(d->taglist, GST_TAG_GEO_LOCATION_CAPTURE_DIRECTION, 0);
00894 }
00895 
00896 void TagList::setGeoLocationCaptureDirector(double value)
00897 {
00898     gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
00899                      GST_TAG_GEO_LOCATION_CAPTURE_DIRECTION, value, NULL);
00900 }
00901 
00902 QString TagList::showName(int index) const
00903 {
00904     return getStringTag(d->taglist, GST_TAG_SHOW_NAME, index);
00905 }
00906 
00907 void TagList::setShowName(const QString & value, TagMergeMode mode)
00908 {
00909     gst_tag_list_add_value(d->taglist, static_cast<GstTagMergeMode>(mode),
00910                            GST_TAG_SHOW_NAME, QGlib::Value::create(value));
00911 }
00912 
00913 int TagList::showNameCount() const
00914 {
00915     return gst_tag_list_get_tag_size(d->taglist, GST_TAG_SHOW_NAME);
00916 }
00917 
00918 QString TagList::showSortName() const
00919 {
00920     return getStringTag(d->taglist, GST_TAG_SHOW_SORTNAME, 0);
00921 }
00922 
00923 void TagList::setShowSortName(const QString & value)
00924 {
00925     gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
00926                            GST_TAG_SHOW_SORTNAME, QGlib::Value::create(value));
00927 }
00928 
00929 quint32 TagList::showEpisodeNumber() const
00930 {
00931     return getUintTag(d->taglist, GST_TAG_SHOW_EPISODE_NUMBER, 0);
00932 }
00933 
00934 void TagList::setShowEpisodeNumber(quint32 value)
00935 {
00936     gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL, GST_TAG_SHOW_EPISODE_NUMBER, value, NULL);
00937 }
00938 
00939 quint32 TagList::showSeasonNumber() const
00940 {
00941     return getUintTag(d->taglist, GST_TAG_SHOW_SEASON_NUMBER, 0);
00942 }
00943 
00944 void TagList::setShowSeasonNumber(quint32 value)
00945 {
00946     gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL, GST_TAG_SHOW_SEASON_NUMBER, value, NULL);
00947 }
00948 
00949 QString TagList::lyrics(int index) const
00950 {
00951     return getStringTag(d->taglist, GST_TAG_LYRICS, index);
00952 }
00953 
00954 void TagList::setLyrics(const QString & value, TagMergeMode mode)
00955 {
00956     gst_tag_list_add_value(d->taglist, static_cast<GstTagMergeMode>(mode),
00957                            GST_TAG_LYRICS, QGlib::Value::create(value));
00958 }
00959 
00960 int TagList::lyricsCount() const
00961 {
00962     return gst_tag_list_get_tag_size(d->taglist, GST_TAG_LYRICS);
00963 }
00964 
00965 QString TagList::composerSortName() const
00966 {
00967     return getStringTag(d->taglist, GST_TAG_COMPOSER_SORTNAME, 0);
00968 }
00969 
00970 void TagList::setComposerSortName(const QString & value)
00971 {
00972     gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
00973                            GST_TAG_COMPOSER_SORTNAME, QGlib::Value::create(value));
00974 }
00975 
00976 QString TagList::grouping() const
00977 {
00978     return getStringTag(d->taglist, GST_TAG_GROUPING, 0);
00979 }
00980 
00981 void TagList::setGrouping(const QString & value)
00982 {
00983     gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
00984                            GST_TAG_GROUPING, QGlib::Value::create(value));
00985 }
00986 
00987 quint32 TagList::userRating() const
00988 {
00989     return getUintTag(d->taglist, GST_TAG_USER_RATING, 0);
00990 }
00991 
00992 void TagList::setUserRating(quint32 value)
00993 {
00994     gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL, GST_TAG_USER_RATING, value, NULL);
00995 }
00996 
00997 QString TagList::deviceManufacturer() const
00998 {
00999     return getStringTag(d->taglist, GST_TAG_DEVICE_MANUFACTURER, 0);
01000 }
01001 
01002 void TagList::setDeviceManufacturer(const QString & value)
01003 {
01004     gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
01005                            GST_TAG_DEVICE_MANUFACTURER, QGlib::Value::create(value));
01006 }
01007 
01008 QString TagList::deviceModel() const
01009 {
01010     return getStringTag(d->taglist, GST_TAG_DEVICE_MODEL, 0);
01011 }
01012 
01013 void TagList::setDeviceModel(const QString & value)
01014 {
01015     gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
01016                            GST_TAG_DEVICE_MODEL, QGlib::Value::create(value));
01017 }
01018 
01019 QString TagList::imageOrientation() const
01020 {
01021     return getStringTag(d->taglist, GST_TAG_IMAGE_ORIENTATION, 0);
01022 }
01023 
01024 void TagList::setImageOrientation(const QString & value)
01025 {
01026     gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
01027                            GST_TAG_IMAGE_ORIENTATION, QGlib::Value::create(value));
01028 }
01029 
01030 double TagList::geoLocationHorizontalError() const
01031 {
01032     return getDoubleTag(d->taglist, GST_TAG_GEO_LOCATION_HORIZONTAL_ERROR, 0);
01033 }
01034 
01035 void TagList::setGeoLocationHorizontalError(double value)
01036 {
01037     gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL, GST_TAG_GEO_LOCATION_HORIZONTAL_ERROR, value, NULL);
01038 }
01039 
01040 QString TagList::applicationName() const
01041 {
01042     return getStringTag(d->taglist, GST_TAG_APPLICATION_NAME, 0);
01043 }
01044 
01045 void TagList::setApplicationName(const QString & value)
01046 {
01047     gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
01048                            GST_TAG_APPLICATION_NAME, QGlib::Value::create(value));
01049 }
01050 
01051 BufferPtr TagList::applicationData() const
01052 {
01053     return getBufferTag(d->taglist, GST_TAG_APPLICATION_DATA, 0);
01054 }
01055 
01056 void TagList::setApplicationData(const BufferPtr & value)
01057 {
01058     gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
01059                            GST_TAG_APPLICATION_DATA, QGlib::Value::create(value));
01060 }
01061 
01062 QDateTime TagList::dateTime() const
01063 {
01064     return tagValue(GST_TAG_DATE_TIME).get<QDateTime>();
01065 }
01066 
01067 void TagList::setDateTime(const QDateTime & value)
01068 {
01069     gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
01070                            GST_TAG_DATE_TIME, QGlib::Value::create(value));
01071 }
01072 
01073 
01074 QDebug operator<<(QDebug debug, const TagList & taglist)
01075 {
01076     debug.nospace() << "QGst::TagList("
01077                     << QGlib::Private::stringFromGCharPtr(gst_structure_to_string(taglist)) << ")";
01078     return debug.space();
01079 }
01080 
01081 } //namespace QGst