[easytag/wip/gmodule-mp4v2: 4/5] WIP Support copyright tag for MP4 tags



commit aa5863e7fc074a56c03af73c41426c057d26d51a
Author: David King <amigadave amigadave com>
Date:   Wed Jun 5 21:03:49 2013 +0100

    WIP Support copyright tag for MP4 tags

 src/easytag.c         |    4 ++--
 src/mp4_tag.c         |   17 +++++++++++++++++
 src/mp4_tag_private.h |    3 +++
 3 files changed, 22 insertions(+), 2 deletions(-)
---
diff --git a/src/easytag.c b/src/easytag.c
index 13b8f33..1126ea3 100644
--- a/src/easytag.c
+++ b/src/easytag.c
@@ -4011,8 +4011,8 @@ void Tag_Area_Display_Controls (ET_File *ETFile)
             gtk_widget_show (GTK_WIDGET (ComposerEntry));
             gtk_widget_hide(GTK_WIDGET(OrigArtistLabel));
             gtk_widget_hide(GTK_WIDGET(OrigArtistEntry));
-            gtk_widget_hide(GTK_WIDGET(CopyrightLabel));
-            gtk_widget_hide(GTK_WIDGET(CopyrightEntry));
+            gtk_widget_show (GTK_WIDGET (CopyrightLabel));
+            gtk_widget_show (GTK_WIDGET (CopyrightEntry));
             gtk_widget_hide(GTK_WIDGET(URLLabel));
             gtk_widget_hide(GTK_WIDGET(URLEntry));
             gtk_widget_show (GTK_WIDGET (EncodedByLabel));
diff --git a/src/mp4_tag.c b/src/mp4_tag.c
index ed43d3d..2ffd65f 100644
--- a/src/mp4_tag.c
+++ b/src/mp4_tag.c
@@ -123,6 +123,7 @@ et_mp4_tag_load_symbols (EtMP4Tag *tag)
         { "MP4TagsSetGenre", (gpointer *)&priv->mp4v2_tags_set_genre },
         { "MP4TagsSetComments", (gpointer *)&priv->mp4v2_tags_set_comments },
         { "MP4TagsSetComposer", (gpointer *)&priv->mp4v2_tags_set_composer },
+        { "MP4TagsSetCopyright", (gpointer *)&priv->mp4v2_tags_set_copyright },
         { "MP4TagsSetEncodedBy", (gpointer *)&priv->mp4v2_tags_set_encoded_by },
         { "MP4TagsAddArtwork", (gpointer *)&priv->mp4v2_tags_add_artwork },
         { "MP4TagsSetArtwork", (gpointer *)&priv->mp4v2_tags_set_artwork },
@@ -330,6 +331,12 @@ Mp4tag_Read_File_Tag (EtMP4Tag *tag, gchar *filename, File_Tag *FileTag)
     if (mp4tags->composer)
         FileTag->composer = g_strdup(mp4tags->composer);
 
+    /* Copyright. */
+    if (mp4tags->copyright)
+    {
+        FileTag->copyright = g_strdup (mp4tags->copyright);
+    }
+
     /*****************
      * Encoding Tool *
      *****************/
@@ -562,6 +569,16 @@ Mp4tag_Write_File_Tag (EtMP4Tag *tag, ET_File *ETFile)
         priv->mp4v2_tags_set_composer (mp4tags, "");
     }
 
+    /* Copyright. */
+    if (FileTag->copyright && g_utf8_strlen (FileTag->copyright, -1) > 0)
+    {
+        priv->mp4v2_tags_set_copyright (mp4tags, FileTag->copyright);
+    }
+    else
+    {
+        priv->mp4v2_tags_set_copyright (mp4tags, "");
+    }
+
     /*****************
      * Encoding Tool *
      *****************/
diff --git a/src/mp4_tag_private.h b/src/mp4_tag_private.h
index 11a7373..8300dd9 100644
--- a/src/mp4_tag_private.h
+++ b/src/mp4_tag_private.h
@@ -175,6 +175,8 @@ typedef gboolean (*_mp4v2_tags_set_comments) (const MP4Tags *tags,
                                               const gchar *comments);
 typedef gboolean (*_mp4v2_tags_set_composer) (const MP4Tags *tags,
                                               const gchar *composer);
+typedef gboolean (*_mp4v2_tags_set_copyright) (const MP4Tags *tags,
+                                               const gchar *copyright);
 typedef gboolean (*_mp4v2_tags_set_encoded_by) (const MP4Tags *tags,
                                                 const gchar *encoded_by);
 typedef gboolean (*_mp4v2_tags_add_artwork) (const MP4Tags *tags,
@@ -234,6 +236,7 @@ struct _EtMP4TagPrivate
     _mp4v2_tags_set_genre mp4v2_tags_set_genre;
     _mp4v2_tags_set_comments mp4v2_tags_set_comments;
     _mp4v2_tags_set_composer mp4v2_tags_set_composer;
+    _mp4v2_tags_set_copyright mp4v2_tags_set_copyright;
     _mp4v2_tags_set_encoded_by mp4v2_tags_set_encoded_by;
     _mp4v2_tags_add_artwork mp4v2_tags_add_artwork;
     _mp4v2_tags_remove_artwork mp4v2_tags_remove_artwork;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]