QtGStreamer  1.2.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
taglist.cpp
1 /*
2  Copyright (C) 2010 Collabora Multimedia.
3  @author Mauricio Piacentini <mauricio.piacentini@collabora.co.uk>
4  Copyright (C) 2011 Collabora Ltd.
5  @author George Kiagiadakis <george.kiagiadakis@collabora.co.uk>
6 
7  This library is free software; you can redistribute it and/or modify
8  it under the terms of the GNU Lesser General Public License as published
9  by the Free Software Foundation; either version 2.1 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU Lesser General Public License for more details.
16 
17  You should have received a copy of the GNU Lesser General Public License
18  along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20 #include "taglist.h"
21 #include "sample.h"
22 #include "../QGlib/string_p.h"
23 #include <gst/gst.h>
24 #include <QtCore/QDebug>
25 #include <QtCore/QDate>
26 
27 namespace QGst {
28 
29 QString getStringTag(GstTagList * list, const gchar * tag, int index)
30 {
31  gchar * value;
32  if (gst_tag_list_get_string_index(list, tag, index, &value)) {
33  return QGlib::Private::stringFromGCharPtr(value);
34  }
35  return QString::null;
36 }
37 
38 quint32 getUintTag(GstTagList * list, const gchar * tag, int index)
39 {
40  guint value = 0;
41  gst_tag_list_get_uint_index(list, tag, index, &value);
42  return value;
43 }
44 
45 double getDoubleTag(GstTagList * list, const gchar * tag, int index)
46 {
47  double value = 0;
48  gst_tag_list_get_double_index(list, tag, index, &value);
49  return value;
50 }
51 
52 SamplePtr getSampleTag(GstTagList * list, const gchar * tag, int index)
53 {
54  GstSample *s = NULL;
55  gst_tag_list_get_sample_index(list, tag, index, &s);
56  //Buffer is already refd()
57  return SamplePtr::wrap(s, false);
58 }
59 
60 #ifndef DOXYGEN_RUN
61 
62 struct QTGSTREAMER_NO_EXPORT TagList::Data : public QSharedData
63 {
64  Data();
65  Data(const GstTagList *tl);
66  Data(const Data & other);
67  ~Data();
68 
69  GstTagList *taglist;
70 };
71 
72 TagList::Data::Data()
73  : QSharedData()
74 {
75  taglist = gst_tag_list_new_empty();
76 }
77 
78 TagList::Data::Data(const GstTagList *tl)
79  : QSharedData()
80 {
81  if (tl && GST_IS_TAG_LIST(tl)) {
82  taglist = gst_tag_list_copy(tl);
83  } else {
84  taglist = gst_tag_list_new_empty();
85  }
86 }
87 
88 TagList::Data::Data(const TagList::Data & other)
89  : QSharedData(other)
90 {
91  taglist = gst_tag_list_copy(other.taglist);
92 }
93 
94 TagList::Data::~Data()
95 {
96  gst_tag_list_unref(taglist);
97 }
98 
99 #endif //DOXYGEN_RUN
100 
101 TagList::TagList()
102  : d(new Data)
103 {
104 }
105 
106 TagList::TagList(const GstTagList *taglist)
107  : d(new Data(taglist))
108 {
109 }
110 
111 TagList::~TagList()
112 {
113 }
114 
115 TagList::TagList(const TagList & other)
116  : d(other.d)
117 {
118 }
119 
120 TagList & TagList::operator=(const TagList & other)
121 {
122  d = other.d;
123  return *this;
124 }
125 
126 bool TagList::isEmpty() const
127 {
128  return gst_tag_list_is_empty(d->taglist);
129 }
130 
131 void TagList::insert(const TagList & other, TagMergeMode mode)
132 {
133  gst_tag_list_insert(d->taglist, other.d->taglist, static_cast<GstTagMergeMode>(mode));
134 }
135 
136 //static
137 TagList TagList::merge(const TagList & firstList, const TagList & secondList, TagMergeMode mode)
138 {
139  GstTagList *taglist = gst_tag_list_merge(firstList, secondList,
140  static_cast<GstTagMergeMode>(mode));
141 
142  //avoid copying the merged taglist by freeing the new one and assigning this one to d->taglist
143  TagList tl;
144  gst_tag_list_unref(tl.d->taglist);
145  tl.d->taglist = taglist;
146  return tl;
147 }
148 
149 QGlib::Value TagList::tagValue(const char *tag, int index) const
150 {
151  return QGlib::Value(gst_tag_list_get_value_index(d->taglist, tag, index));
152 }
153 
154 void TagList::setTagValue(const char *tag, const QGlib::Value & value, TagMergeMode mode)
155 {
156  gst_tag_list_add_value(d->taglist, static_cast<GstTagMergeMode>(mode), tag, value);
157 }
158 
159 int TagList::tagValueCount(const char *tag) const
160 {
161  return gst_tag_list_get_tag_size(d->taglist, tag);
162 }
163 
164 void TagList::clear()
165 {
166  gst_tag_list_unref(d->taglist);
167  d->taglist = gst_tag_list_new_empty();
168 }
169 
170 void TagList::removeTag(const char *tag)
171 {
172  gst_tag_list_remove_tag(d->taglist, tag);
173 }
174 
175 TagList::operator GstTagList*()
176 {
177  return d->taglist;
178 }
179 
180 TagList::operator const GstTagList*() const
181 {
182  return d->taglist;
183 }
184 
185 QString TagList::title(int index) const
186 {
187  return getStringTag(d->taglist, GST_TAG_TITLE, index);
188 }
189 
190 void TagList::setTitle(const QString & value, TagMergeMode mode)
191 {
192  gst_tag_list_add_value(d->taglist, static_cast<GstTagMergeMode>(mode),
193  GST_TAG_TITLE, QGlib::Value::create(value));
194 }
195 
196 int TagList::titleCount() const
197 {
198  return gst_tag_list_get_tag_size(d->taglist, GST_TAG_TITLE);
199 }
200 
201 QString TagList::titleSortName() const
202 {
203  return getStringTag(d->taglist, GST_TAG_TITLE_SORTNAME, 0);
204 }
205 
206 void TagList::setTitleSortName(const QString & value)
207 {
208  gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
209  GST_TAG_TITLE_SORTNAME, QGlib::Value::create(value));
210 }
211 
212 QString TagList::artist(int index) const
213 {
214  return getStringTag(d->taglist, GST_TAG_ARTIST, index);
215 }
216 
217 void TagList::setArtist(const QString & value, TagMergeMode mode)
218 {
219  gst_tag_list_add_value(d->taglist, static_cast<GstTagMergeMode>(mode),
220  GST_TAG_ARTIST, QGlib::Value::create(value));
221 }
222 
223 int TagList::artistCount() const
224 {
225  return gst_tag_list_get_tag_size(d->taglist, GST_TAG_ARTIST);
226 }
227 
228 QString TagList::artistSortName() const
229 {
230  return getStringTag(d->taglist, GST_TAG_ARTIST_SORTNAME, 0);
231 }
232 
233 void TagList::setArtistSortName(const QString & value)
234 {
235  gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
236  GST_TAG_ARTIST_SORTNAME, QGlib::Value::create(value));
237 }
238 
239 QString TagList::composer(int index) const
240 {
241  return getStringTag(d->taglist, GST_TAG_COMPOSER, index);
242 }
243 
244 void TagList::setComposer(const QString & value, TagMergeMode mode)
245 {
246  gst_tag_list_add_value(d->taglist, static_cast<GstTagMergeMode>(mode),
247  GST_TAG_COMPOSER, QGlib::Value::create(value));
248 }
249 
250 int TagList::composerCount() const
251 {
252  return gst_tag_list_get_tag_size(d->taglist, GST_TAG_COMPOSER);
253 }
254 
255 QDate TagList::date() const
256 {
257  GDate * value;
258  if (gst_tag_list_get_date(d->taglist, GST_TAG_DATE, &value)) {
259  QDate ret = QDate::fromJulianDay(g_date_get_julian(value));
260  g_date_free(value);
261  return ret;
262  }
263  return QDate();
264 }
265 
266 void TagList::setDate(const QDate & value)
267 {
268  GDate * date = g_date_new_julian(value.toJulianDay());
269  gst_tag_list_add (d->taglist, GST_TAG_MERGE_REPLACE_ALL, GST_TAG_DATE, date, NULL);
270 }
271 
272 QString TagList::genre(int index) const
273 {
274  return getStringTag(d->taglist, GST_TAG_GENRE, index);
275 }
276 
277 void TagList::setGenre(const QString & value, TagMergeMode mode)
278 {
279  gst_tag_list_add_value(d->taglist, static_cast<GstTagMergeMode>(mode),
280  GST_TAG_GENRE, QGlib::Value::create(value));
281 }
282 
283 int TagList::genreCount() const
284 {
285  return gst_tag_list_get_tag_size(d->taglist, GST_TAG_GENRE);
286 }
287 
288 QString TagList::comment(int index) const
289 {
290  return getStringTag(d->taglist, GST_TAG_COMMENT, index);
291 }
292 
293 void TagList::setComment(const QString & value, TagMergeMode mode)
294 {
295  gst_tag_list_add_value(d->taglist, static_cast<GstTagMergeMode>(mode),
296  GST_TAG_COMMENT, QGlib::Value::create(value));
297 }
298 
299 int TagList::commentCount() const
300 {
301  return gst_tag_list_get_tag_size(d->taglist, GST_TAG_COMMENT);
302 }
303 
304 QString TagList::extendedComment(int index) const
305 {
306  return getStringTag(d->taglist, GST_TAG_EXTENDED_COMMENT, index);
307 }
308 
309 void TagList::setExtendedComment(const QString & value, TagMergeMode mode)
310 {
311  gst_tag_list_add_value(d->taglist, static_cast<GstTagMergeMode>(mode),
312  GST_TAG_EXTENDED_COMMENT, QGlib::Value::create(value));
313 }
314 
315 int TagList::extendedCommentCount() const
316 {
317  return gst_tag_list_get_tag_size(d->taglist, GST_TAG_EXTENDED_COMMENT);
318 }
319 
320 quint32 TagList::trackNumber() const
321 {
322  return getUintTag(d->taglist, GST_TAG_TRACK_NUMBER, 0);
323 }
324 
325 void TagList::setTrackNumber(quint32 value)
326 {
327  gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL, GST_TAG_TRACK_NUMBER, value, NULL);
328 }
329 
330 quint32 TagList::trackCount() const
331 {
332  return getUintTag(d->taglist, GST_TAG_TRACK_COUNT, 0);
333 }
334 
335 void TagList::setTrackCount(quint32 value)
336 {
337  gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL, GST_TAG_TRACK_COUNT, value, NULL);
338 }
339 
340 quint32 TagList::albumVolumeNumber() const
341 {
342  return getUintTag(d->taglist, GST_TAG_ALBUM_VOLUME_NUMBER, 0);
343 }
344 
345 void TagList::setAlbumVolumeNumber(quint32 value)
346 {
347  gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL, GST_TAG_ALBUM_VOLUME_NUMBER, value, NULL);
348 }
349 
350 quint32 TagList::albumVolumeCount() const
351 {
352  return getUintTag(d->taglist, GST_TAG_ALBUM_VOLUME_COUNT, 0);
353 }
354 
355 void TagList::setAlbumVolumeCount(quint32 value)
356 {
357  gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL, GST_TAG_ALBUM_VOLUME_COUNT, value, NULL);
358 }
359 
360 QString TagList::location(int index) const
361 {
362  return getStringTag(d->taglist, GST_TAG_LOCATION, index);
363 }
364 
365 void TagList::setLocation(const QString & value, TagMergeMode mode)
366 {
367  gst_tag_list_add_value(d->taglist, static_cast<GstTagMergeMode>(mode),
368  GST_TAG_LOCATION, QGlib::Value::create(value));
369 }
370 
371 int TagList::locationCount() const
372 {
373  return gst_tag_list_get_tag_size(d->taglist, GST_TAG_LOCATION);
374 }
375 
376 QString TagList::homepage(int index) const
377 {
378  return getStringTag(d->taglist, GST_TAG_HOMEPAGE, index);
379 }
380 
381 void TagList::setHomepage(const QString & value, TagMergeMode mode)
382 {
383  gst_tag_list_add_value(d->taglist, static_cast<GstTagMergeMode>(mode),
384  GST_TAG_HOMEPAGE, QGlib::Value::create(value));
385 }
386 
387 int TagList::homepageCount() const
388 {
389  return gst_tag_list_get_tag_size(d->taglist, GST_TAG_HOMEPAGE);
390 }
391 
392 QString TagList::description(int index) const
393 {
394  return getStringTag(d->taglist, GST_TAG_DESCRIPTION, index);
395 }
396 
397 void TagList::setDescription(const QString & value, TagMergeMode mode)
398 {
399  gst_tag_list_add_value(d->taglist, static_cast<GstTagMergeMode>(mode),
400  GST_TAG_DESCRIPTION, QGlib::Value::create(value));
401 }
402 
403 int TagList::descriptionCount() const
404 {
405  return gst_tag_list_get_tag_size(d->taglist, GST_TAG_DESCRIPTION);
406 }
407 
408 QString TagList::version() const
409 {
410  return getStringTag(d->taglist, GST_TAG_VERSION, 0);
411 }
412 
413 void TagList::setVersion(const QString & value)
414 {
415  gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
416  GST_TAG_VERSION, QGlib::Value::create(value));
417 }
418 
419 QString TagList::isrc() const
420 {
421  return getStringTag(d->taglist, GST_TAG_ISRC, 0);
422 }
423 
424 void TagList::setIsrc(const QString & value)
425 {
426  gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
427  GST_TAG_ISRC, QGlib::Value::create(value));
428 }
429 
430 QString TagList::organization(int index) const
431 {
432  return getStringTag(d->taglist, GST_TAG_ORGANIZATION, index);
433 }
434 
435 void TagList::setOrganization(const QString & value, TagMergeMode mode)
436 {
437  gst_tag_list_add_value(d->taglist, static_cast<GstTagMergeMode>(mode),
438  GST_TAG_ORGANIZATION, QGlib::Value::create(value));
439 }
440 
441 int TagList::organizationCount() const
442 {
443  return gst_tag_list_get_tag_size(d->taglist, GST_TAG_ORGANIZATION);
444 }
445 
446 QString TagList::copyright() const
447 {
448  return getStringTag(d->taglist, GST_TAG_COPYRIGHT, 0);
449 }
450 
451 void TagList::setCopyright(const QString & value)
452 {
453  gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
454  GST_TAG_COPYRIGHT, QGlib::Value::create(value));
455 }
456 
457 QString TagList::copyrightUri() const
458 {
459  return getStringTag(d->taglist, GST_TAG_COPYRIGHT_URI, 0);
460 }
461 
462 void TagList::setCopyrightUri(const QString & value)
463 {
464  gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
465  GST_TAG_COPYRIGHT_URI, QGlib::Value::create(value));
466 }
467 
468 QString TagList::contact(int index) const
469 {
470  return getStringTag(d->taglist, GST_TAG_CONTACT, index);
471 }
472 
473 void TagList::setContact(const QString & value, TagMergeMode mode)
474 {
475  gst_tag_list_add_value(d->taglist, static_cast<GstTagMergeMode>(mode),
476  GST_TAG_CONTACT, QGlib::Value::create(value));
477 }
478 
479 int TagList::contactCount() const
480 {
481  return gst_tag_list_get_tag_size(d->taglist, GST_TAG_CONTACT);
482 }
483 
484 QString TagList::license() const
485 {
486  return getStringTag(d->taglist, GST_TAG_LICENSE, 0);
487 }
488 
489 void TagList::setLicense(const QString & value)
490 {
491  gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
492  GST_TAG_LICENSE, QGlib::Value::create(value));
493 }
494 
495 QString TagList::licenseUri() const
496 {
497  return getStringTag(d->taglist, GST_TAG_LICENSE_URI, 0);
498 }
499 
500 void TagList::setLicenseUri(const QString & value)
501 {
502  gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
503  GST_TAG_LICENSE_URI, QGlib::Value::create(value));
504 }
505 
506 QString TagList::performer(int index) const
507 {
508  return getStringTag(d->taglist, GST_TAG_PERFORMER, index);
509 }
510 
511 void TagList::setPerformer(const QString & value, TagMergeMode mode)
512 {
513  gst_tag_list_add_value(d->taglist, static_cast<GstTagMergeMode>(mode),
514  GST_TAG_PERFORMER, QGlib::Value::create(value));
515 }
516 
517 int TagList::performerCount() const
518 {
519  return gst_tag_list_get_tag_size(d->taglist, GST_TAG_PERFORMER);
520 }
521 
522 quint64 TagList::duration() const
523 {
524  guint64 value = 0;
525  gst_tag_list_get_uint64_index(d->taglist, GST_TAG_DURATION, 0, &value);
526  return value;
527 }
528 
529 void TagList::setDuration(quint64 value)
530 {
531  gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL, GST_TAG_DURATION, value, NULL);
532 }
533 
534 QString TagList::codec() const
535 {
536  return getStringTag(d->taglist, GST_TAG_CODEC, 0);
537 }
538 
539 void TagList::setCodec(const QString & value)
540 {
541  gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
542  GST_TAG_CODEC, QGlib::Value::create(value));
543 }
544 
545 QString TagList::videoCodec() const
546 {
547  return getStringTag(d->taglist, GST_TAG_VIDEO_CODEC, 0);
548 }
549 
550 void TagList::setVideoCodec(const QString & value)
551 {
552  gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
553  GST_TAG_VIDEO_CODEC, QGlib::Value::create(value));
554 }
555 
556 QString TagList::audioCodec() const
557 {
558  return getStringTag(d->taglist, GST_TAG_AUDIO_CODEC, 0);
559 }
560 
561 void TagList::setAudioCodec(const QString & value)
562 {
563  gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
564  GST_TAG_AUDIO_CODEC, QGlib::Value::create(value));
565 }
566 
567 QString TagList::subtitleCodec() const
568 {
569  return getStringTag(d->taglist, GST_TAG_SUBTITLE_CODEC, 0);
570 }
571 
572 void TagList::setSubtitleCodec(const QString & value)
573 {
574  gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
575  GST_TAG_SUBTITLE_CODEC, QGlib::Value::create(value));
576 }
577 
578 QString TagList::containerFormat() const
579 {
580  return getStringTag(d->taglist, GST_TAG_CONTAINER_FORMAT, 0);
581 }
582 
583 void TagList::setContainerFormat(const QString & value)
584 {
585  gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
586  GST_TAG_CONTAINER_FORMAT, QGlib::Value::create(value));
587 }
588 
589 quint32 TagList::bitrate() const
590 {
591  return getUintTag(d->taglist, GST_TAG_BITRATE, 0);
592 }
593 
594 void TagList::setBitrate(quint32 value)
595 {
596  gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL, GST_TAG_BITRATE, value, NULL);
597 }
598 
599 quint32 TagList::nominalBitrate() const
600 {
601  return getUintTag(d->taglist, GST_TAG_NOMINAL_BITRATE, 0);
602 }
603 
604 void TagList::setNominalBitrate(quint32 value)
605 {
606  gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL, GST_TAG_NOMINAL_BITRATE, value, NULL);
607 }
608 
609 quint32 TagList::minimumBitrate() const
610 {
611  return getUintTag(d->taglist, GST_TAG_MINIMUM_BITRATE, 0);
612 }
613 
614 void TagList::setMinimumBitrate(quint32 value)
615 {
616  gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL, GST_TAG_MINIMUM_BITRATE, value, NULL);
617 }
618 
619 quint32 TagList::maximumBitrate() const
620 {
621  return getUintTag(d->taglist, GST_TAG_MAXIMUM_BITRATE, 0);
622 }
623 
624 void TagList::setMaximumBitrate(quint32 value)
625 {
626  gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL, GST_TAG_MAXIMUM_BITRATE, value, NULL);
627 }
628 
629 quint32 TagList::serial() const
630 {
631  return getUintTag(d->taglist, GST_TAG_SERIAL, 0);
632 }
633 
634 void TagList::setSerial(quint32 value)
635 {
636  gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL, GST_TAG_SERIAL, value, NULL);
637 }
638 
639 QString TagList::encoder() const
640 {
641  return getStringTag(d->taglist, GST_TAG_ENCODER, 0);
642 }
643 
644 void TagList::setEncoder(const QString & value)
645 {
646  gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
647  GST_TAG_ENCODER, QGlib::Value::create(value));
648 }
649 
650 quint32 TagList::encoderVersion() const
651 {
652  return getUintTag(d->taglist, GST_TAG_ENCODER_VERSION, 0);
653 }
654 
655 void TagList::setEncoderVersion(quint32 value)
656 {
657  gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL, GST_TAG_ENCODER_VERSION, value, NULL);
658 }
659 
660 double TagList::trackGain() const
661 {
662  return getDoubleTag(d->taglist, GST_TAG_TRACK_GAIN, 0);
663 }
664 
665 void TagList::setTrackGain(double value)
666 {
667  gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL, GST_TAG_TRACK_GAIN, value, NULL);
668 }
669 
670 double TagList::trackPeak() const
671 {
672  return getDoubleTag(d->taglist, GST_TAG_TRACK_PEAK, 0);
673 }
674 
675 void TagList::setTrackPeak(double value)
676 {
677  gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL, GST_TAG_TRACK_PEAK, value, NULL);
678 }
679 
680 double TagList::albumGain() const
681 {
682  return getDoubleTag(d->taglist, GST_TAG_ALBUM_GAIN, 0);
683 }
684 
685 void TagList::setAlbumGain(double value)
686 {
687  gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL, GST_TAG_ALBUM_GAIN, value, NULL);
688 }
689 
690 double TagList::albumPeak() const
691 {
692  return getDoubleTag(d->taglist, GST_TAG_ALBUM_PEAK, 0);
693 }
694 
695 void TagList::setAlbumPeak(double value)
696 {
697  gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL, GST_TAG_ALBUM_PEAK, value, NULL);
698 }
699 
700 double TagList::referenceLevel() const
701 {
702  return getDoubleTag(d->taglist, GST_TAG_REFERENCE_LEVEL, 0);
703 }
704 
705 void TagList::setReferenceLevel(double value)
706 {
707  gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL, GST_TAG_REFERENCE_LEVEL, value, NULL);
708 }
709 
710 QString TagList::languageCode() const
711 {
712  return getStringTag(d->taglist, GST_TAG_LANGUAGE_CODE, 0);
713 }
714 
715 void TagList::setLanguageCode(const QString & value)
716 {
717  gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
718  GST_TAG_LANGUAGE_CODE, QGlib::Value::create(value));
719 }
720 
721 SamplePtr TagList::image(int index) const
722 {
723  return getSampleTag(d->taglist, GST_TAG_IMAGE, index);
724 }
725 
726 void TagList::setImage(const SamplePtr & value, TagMergeMode mode)
727 {
728  gst_tag_list_add_value(d->taglist, static_cast<GstTagMergeMode>(mode),
729  GST_TAG_IMAGE, QGlib::Value::create(value));
730 }
731 
732 int TagList::imageCount() const
733 {
734  return gst_tag_list_get_tag_size(d->taglist, GST_TAG_IMAGE);
735 }
736 
737 SamplePtr TagList::previewImage() const
738 {
739  return getSampleTag(d->taglist, GST_TAG_PREVIEW_IMAGE, 0);
740 }
741 
742 void TagList::setPreviewImage(const SamplePtr & value)
743 {
744  gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
745  GST_TAG_PREVIEW_IMAGE, QGlib::Value::create(value));
746 }
747 
748 SamplePtr TagList::attachment(int index) const
749 {
750  return getSampleTag(d->taglist, GST_TAG_ATTACHMENT, index);
751 }
752 
753 void TagList::setAttachment(const SamplePtr & value, TagMergeMode mode)
754 {
755  gst_tag_list_add_value(d->taglist, static_cast<GstTagMergeMode>(mode),
756  GST_TAG_ATTACHMENT, QGlib::Value::create(value));
757 }
758 
759 int TagList::attachmentCount() const
760 {
761  return gst_tag_list_get_tag_size(d->taglist, GST_TAG_ATTACHMENT);
762 }
763 
764 double TagList::beatsPerMinute() const
765 {
766  return getDoubleTag(d->taglist, GST_TAG_BEATS_PER_MINUTE, 0);
767 }
768 
769 void TagList::setBeatsPerMinute(double value)
770 {
771  gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL, GST_TAG_BEATS_PER_MINUTE, value, NULL);
772 }
773 
774 QString TagList::keywords(int index) const
775 {
776  return getStringTag(d->taglist, GST_TAG_KEYWORDS, index);
777 }
778 
779 void TagList::setKeywords(const QString & value, TagMergeMode mode)
780 {
781  gst_tag_list_add_value(d->taglist, static_cast<GstTagMergeMode>(mode),
782  GST_TAG_KEYWORDS, QGlib::Value::create(value));
783 }
784 
785 int TagList::keywordsCount() const
786 {
787  return gst_tag_list_get_tag_size(d->taglist, GST_TAG_KEYWORDS);
788 }
789 
790 QString TagList::geoLocationName() const
791 {
792  return getStringTag(d->taglist, GST_TAG_GEO_LOCATION_NAME, 0);
793 }
794 
795 void TagList::seGeoLocationName(const QString & value)
796 {
797  gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
798  GST_TAG_GEO_LOCATION_NAME, QGlib::Value::create(value));
799 }
800 
801 double TagList::geoLocationLatitude() const
802 {
803  return getDoubleTag(d->taglist, GST_TAG_GEO_LOCATION_LATITUDE, 0);
804 }
805 
806 void TagList::setGeoLocationLatitude(double value)
807 {
808  gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
809  GST_TAG_GEO_LOCATION_LATITUDE, value, NULL);
810 }
811 
812 double TagList::geoLocationLongitude() const
813 {
814  return getDoubleTag(d->taglist, GST_TAG_GEO_LOCATION_LONGITUDE, 0);
815 }
816 
817 void TagList::setGeoLocationLongitude(double value)
818 {
819  gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
820  GST_TAG_GEO_LOCATION_LONGITUDE, value, NULL);
821 }
822 
823 double TagList::geoLocationElevation() const
824 {
825  return getDoubleTag(d->taglist, GST_TAG_GEO_LOCATION_ELEVATION, 0);
826 }
827 
828 void TagList::setGeoLocationElevation(double value)
829 {
830  gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
831  GST_TAG_GEO_LOCATION_ELEVATION, value, NULL);
832 }
833 
834 QString TagList::geoLocationCountry() const
835 {
836  return getStringTag(d->taglist, GST_TAG_GEO_LOCATION_COUNTRY, 0);
837 }
838 
839 void TagList::setGeoLocationCountry(const QString & value)
840 {
841  gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
842  GST_TAG_GEO_LOCATION_COUNTRY, QGlib::Value::create(value));
843 }
844 
845 QString TagList::geoLocationCity() const
846 {
847  return getStringTag(d->taglist, GST_TAG_GEO_LOCATION_CITY, 0);
848 }
849 
850 void TagList::setGeoLocationCity(const QString & value)
851 {
852  gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
853  GST_TAG_GEO_LOCATION_CITY, QGlib::Value::create(value));
854 }
855 
856 QString TagList::geoLocationSublocation() const
857 {
858  return getStringTag(d->taglist, GST_TAG_GEO_LOCATION_SUBLOCATION, 0);
859 }
860 
861 void TagList::setGeoLocationSublocation(const QString & value)
862 {
863  gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
864  GST_TAG_GEO_LOCATION_SUBLOCATION, QGlib::Value::create(value));
865 }
866 
867 double TagList::geoLocationMovementSpeed() const
868 {
869  return getDoubleTag(d->taglist, GST_TAG_GEO_LOCATION_MOVEMENT_SPEED, 0);
870 }
871 
872 void TagList::setGeoLocationMovementSpeed(double value)
873 {
874  gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
875  GST_TAG_GEO_LOCATION_MOVEMENT_SPEED, value, NULL);
876 }
877 
878 double TagList::geoLocationMovementDirection() const
879 {
880  return getDoubleTag(d->taglist, GST_TAG_GEO_LOCATION_MOVEMENT_DIRECTION, 0);
881 }
882 
883 void TagList::setGeoLocationMovementDirection(double value)
884 {
885  gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
886  GST_TAG_GEO_LOCATION_MOVEMENT_DIRECTION, value, NULL);
887 }
888 
889 double TagList::geoLocationCaptureDirection() const
890 {
891  return getDoubleTag(d->taglist, GST_TAG_GEO_LOCATION_CAPTURE_DIRECTION, 0);
892 }
893 
894 void TagList::setGeoLocationCaptureDirector(double value)
895 {
896  gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
897  GST_TAG_GEO_LOCATION_CAPTURE_DIRECTION, value, NULL);
898 }
899 
900 QString TagList::showName(int index) const
901 {
902  return getStringTag(d->taglist, GST_TAG_SHOW_NAME, index);
903 }
904 
905 void TagList::setShowName(const QString & value, TagMergeMode mode)
906 {
907  gst_tag_list_add_value(d->taglist, static_cast<GstTagMergeMode>(mode),
908  GST_TAG_SHOW_NAME, QGlib::Value::create(value));
909 }
910 
911 int TagList::showNameCount() const
912 {
913  return gst_tag_list_get_tag_size(d->taglist, GST_TAG_SHOW_NAME);
914 }
915 
916 QString TagList::showSortName() const
917 {
918  return getStringTag(d->taglist, GST_TAG_SHOW_SORTNAME, 0);
919 }
920 
921 void TagList::setShowSortName(const QString & value)
922 {
923  gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
924  GST_TAG_SHOW_SORTNAME, QGlib::Value::create(value));
925 }
926 
927 quint32 TagList::showEpisodeNumber() const
928 {
929  return getUintTag(d->taglist, GST_TAG_SHOW_EPISODE_NUMBER, 0);
930 }
931 
932 void TagList::setShowEpisodeNumber(quint32 value)
933 {
934  gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL, GST_TAG_SHOW_EPISODE_NUMBER, value, NULL);
935 }
936 
937 quint32 TagList::showSeasonNumber() const
938 {
939  return getUintTag(d->taglist, GST_TAG_SHOW_SEASON_NUMBER, 0);
940 }
941 
942 void TagList::setShowSeasonNumber(quint32 value)
943 {
944  gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL, GST_TAG_SHOW_SEASON_NUMBER, value, NULL);
945 }
946 
947 QString TagList::lyrics(int index) const
948 {
949  return getStringTag(d->taglist, GST_TAG_LYRICS, index);
950 }
951 
952 void TagList::setLyrics(const QString & value, TagMergeMode mode)
953 {
954  gst_tag_list_add_value(d->taglist, static_cast<GstTagMergeMode>(mode),
955  GST_TAG_LYRICS, QGlib::Value::create(value));
956 }
957 
958 int TagList::lyricsCount() const
959 {
960  return gst_tag_list_get_tag_size(d->taglist, GST_TAG_LYRICS);
961 }
962 
963 QString TagList::composerSortName() const
964 {
965  return getStringTag(d->taglist, GST_TAG_COMPOSER_SORTNAME, 0);
966 }
967 
968 void TagList::setComposerSortName(const QString & value)
969 {
970  gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
971  GST_TAG_COMPOSER_SORTNAME, QGlib::Value::create(value));
972 }
973 
974 QString TagList::grouping() const
975 {
976  return getStringTag(d->taglist, GST_TAG_GROUPING, 0);
977 }
978 
979 void TagList::setGrouping(const QString & value)
980 {
981  gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
982  GST_TAG_GROUPING, QGlib::Value::create(value));
983 }
984 
985 quint32 TagList::userRating() const
986 {
987  return getUintTag(d->taglist, GST_TAG_USER_RATING, 0);
988 }
989 
990 void TagList::setUserRating(quint32 value)
991 {
992  gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL, GST_TAG_USER_RATING, value, NULL);
993 }
994 
995 QString TagList::deviceManufacturer() const
996 {
997  return getStringTag(d->taglist, GST_TAG_DEVICE_MANUFACTURER, 0);
998 }
999 
1000 void TagList::setDeviceManufacturer(const QString & value)
1001 {
1002  gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
1003  GST_TAG_DEVICE_MANUFACTURER, QGlib::Value::create(value));
1004 }
1005 
1006 QString TagList::deviceModel() const
1007 {
1008  return getStringTag(d->taglist, GST_TAG_DEVICE_MODEL, 0);
1009 }
1010 
1011 void TagList::setDeviceModel(const QString & value)
1012 {
1013  gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
1014  GST_TAG_DEVICE_MODEL, QGlib::Value::create(value));
1015 }
1016 
1017 QString TagList::imageOrientation() const
1018 {
1019  return getStringTag(d->taglist, GST_TAG_IMAGE_ORIENTATION, 0);
1020 }
1021 
1022 void TagList::setImageOrientation(const QString & value)
1023 {
1024  gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
1025  GST_TAG_IMAGE_ORIENTATION, QGlib::Value::create(value));
1026 }
1027 
1028 double TagList::geoLocationHorizontalError() const
1029 {
1030  return getDoubleTag(d->taglist, GST_TAG_GEO_LOCATION_HORIZONTAL_ERROR, 0);
1031 }
1032 
1033 void TagList::setGeoLocationHorizontalError(double value)
1034 {
1035  gst_tag_list_add(d->taglist, GST_TAG_MERGE_REPLACE_ALL, GST_TAG_GEO_LOCATION_HORIZONTAL_ERROR, value, NULL);
1036 }
1037 
1038 QString TagList::applicationName() const
1039 {
1040  return getStringTag(d->taglist, GST_TAG_APPLICATION_NAME, 0);
1041 }
1042 
1043 void TagList::setApplicationName(const QString & value)
1044 {
1045  gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
1046  GST_TAG_APPLICATION_NAME, QGlib::Value::create(value));
1047 }
1048 
1049 SamplePtr TagList::applicationData() const
1050 {
1051  return getSampleTag(d->taglist, GST_TAG_APPLICATION_DATA, 0);
1052 }
1053 
1054 void TagList::setApplicationData(const SamplePtr & value)
1055 {
1056  gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
1057  GST_TAG_APPLICATION_DATA, QGlib::Value::create(value));
1058 }
1059 
1060 QDateTime TagList::dateTime() const
1061 {
1062  return tagValue(GST_TAG_DATE_TIME).get<QDateTime>();
1063 }
1064 
1065 void TagList::setDateTime(const QDateTime & value)
1066 {
1067  gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
1068  GST_TAG_DATE_TIME, QGlib::Value::create(value));
1069 }
1070 
1071 
1072 QDebug operator<<(QDebug debug, const TagList & taglist)
1073 {
1074  debug.nospace() << "QGst::TagList("
1075  << QGlib::Private::stringFromGCharPtr(gst_tag_list_to_string(taglist)) << ")";
1076  return debug.space();
1077 }
1078 
1079 } //namespace QGst
static RefPointer< T > wrap(typename T::CType *nativePtr, bool increaseRef=true)
Definition: refpointer.h:326
static Value create(const T &data)
Definition: value.h:293
Wrapper class for GValue.
Definition: value.h:74
T get(bool *ok=NULL) const
Definition: value.h:308
Wrapper class for GstTagList.
Definition: taglist.h:70