[sushi] media-bin: add a way to access the tag list
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sushi] media-bin: add a way to access the tag list
- Date: Wed, 19 Jun 2019 21:33:54 +0000 (UTC)
commit bd6145f54a5d9321997e89106b579b082d9ff62c
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Wed Jun 19 14:24:39 2019 -0700
media-bin: add a way to access the tag list
Add a signal for when tags are updated, together with getters for
video and audio tags.
src/libsushi/sushi-media-bin.c | 32 ++++++++++++++++++++++++++++++++
src/libsushi/sushi-media-bin.h | 3 +++
2 files changed, 35 insertions(+)
---
diff --git a/src/libsushi/sushi-media-bin.c b/src/libsushi/sushi-media-bin.c
index 35dd52c..b5e00da 100644
--- a/src/libsushi/sushi-media-bin.c
+++ b/src/libsushi/sushi-media-bin.c
@@ -168,6 +168,7 @@ enum
{
ERROR,
SIZE_CHANGE,
+ TAGS_CHANGE,
LAST_SIGNAL
};
@@ -1213,6 +1214,17 @@ sushi_media_bin_class_init (SushiMediaBinClass *klass)
0, NULL, NULL, NULL,
G_TYPE_NONE, 0);
+ /**
+ * SushiMediaBin::tags-change:
+ * @self: the #SushiMediaBin which received the signal.
+ */
+ sushi_media_bin_signals[TAGS_CHANGE] =
+ g_signal_new ("tags-change",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ 0, NULL, NULL, NULL,
+ G_TYPE_NONE, 0);
+
/* Action signals for key bindings */
SMB_DEFINE_ACTION_SIGNAL (object_class, "toggle", sushi_media_bin_action_toggle, 1, G_TYPE_STRING);
SMB_DEFINE_ACTION_SIGNAL (object_class, "seek", sushi_media_bin_action_seek, 1, G_TYPE_INT);
@@ -2115,6 +2127,26 @@ SMB_DEFINE_SETTER_FULL (gdouble, volume, VOLUME,
gtk_adjustment_set_value (priv->volume_adjustment, volume),
)
+/**
+ * sushi_media_bin_get_audio_tags:
+ * @self: a #SushiMediaBin
+ *
+ * Returns a #GstTagList with the audio tags for the played media
+ */
+SMB_DEFINE_GETTER_FULL (GstTagList *, audio_tags, NULL,
+ return (SMB_PRIVATE (self)->audio_tags);
+)
+
+/**
+ * sushi_media_bin_get_video_tags:
+ * @self: a #SushiMediaBin
+ *
+ * Returns a #GstTagList with the video tags for the played media
+ */
+SMB_DEFINE_GETTER_FULL (GstTagList *, video_tags, NULL,
+ return (SMB_PRIVATE (self)->video_tags);
+)
+
/**
* sushi_media_bin_play:
* @self: a #SushiMediaBin
diff --git a/src/libsushi/sushi-media-bin.h b/src/libsushi/sushi-media-bin.h
index ca15533..900675d 100644
--- a/src/libsushi/sushi-media-bin.h
+++ b/src/libsushi/sushi-media-bin.h
@@ -26,6 +26,7 @@
#pragma once
+#include <gst/gst.h>
#include <gtk/gtk.h>
G_BEGIN_DECLS
@@ -63,6 +64,8 @@ const gchar *sushi_media_bin_get_description (SushiMediaBin *self);
void sushi_media_bin_set_description (SushiMediaBin *self,
const gchar *description);
+GstTagList *sushi_media_bin_get_audio_tags (SushiMediaBin *self);
+GstTagList *sushi_media_bin_get_video_tags (SushiMediaBin *self);
void sushi_media_bin_play (SushiMediaBin *self);
void sushi_media_bin_pause (SushiMediaBin *self);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]