Put tags into the Tag class instead of a new Tags class
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Sat, 18 Apr 2009 14:43:15 +0000 (16:43 +0200)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Sat, 18 Apr 2009 14:43:15 +0000 (16:43 +0200)
Also remove the void ctor of the Tag class, it's not meant to be instantiated

gstreamer-sharp/Gstreamer.metadata
gstreamer-sharp/Makefile.am
gstreamer-sharp/Tag.custom [new file with mode: 0644]
gstreamer-sharp/Tags.cs [deleted file]
parser/gst-generate-tags.cs
source/Makefile.am

index 76d251f..150db35 100644 (file)
 
   <attr path="/api/namespace/object[@name='Task']/field[@name='Func']" name="hidden">1</attr>
 
+  <attr path="/api/namespace/class[@name='Tag']" name="disable_void_ctor">1</attr>
+
   <attr path="/api/namespace/enum[@name='TagFlag']" name="name">TagFlags</attr>
 
   <attr path="/api/namespace/boxed[@name='TagList']/method[@name='CopyValue']/*/*[@name='dest']" name="pass_as">ref</attr>
index 966a737..21b1785 100644 (file)
@@ -42,7 +42,6 @@ sources = \
        Application.cs \
        Version.cs \
        AssemblyInfo.cs \
-       Tags.cs \
        GError.cs \
        Value.cs \
        plugins-base/PlayBin.cs \
@@ -66,9 +65,8 @@ customs =                     \
        PadTemplate.custom      \
        MiniObject.custom       \
        Registry.custom         \
-       Structure.custom
-
-               
+       Structure.custom        \
+       Tag.custom
 
 build_customs = $(addprefix $(srcdir)/, $(customs))
 
diff --git a/gstreamer-sharp/Tag.custom b/gstreamer-sharp/Tag.custom
new file mode 100644 (file)
index 0000000..7520323
--- /dev/null
@@ -0,0 +1,54 @@
+                public const string Title = "title";
+                public const string TitleSortname = "title-sortname";
+                public const string Artist = "artist";
+                public const string ArtistSortname = "musicbrainz-sortname";
+                public const string Album = "album";
+                public const string AlbumSortname = "album-sortname";
+                public const string Composer = "composer";
+                public const string Date = "date";
+                public const string Genre = "genre";
+                public const string Comment = "comment";
+                public const string ExtendedComment = "extended-comment";
+                public const string TrackNumber = "track-number";
+                public const string TrackCount = "track-count";
+                public const string AlbumVolumeNumber = "album-disc-number";
+                public const string AlbumVolumeCount = "album-disc-count";
+                public const string Location = "location";
+                public const string Homepage = "homepage";
+                public const string Description = "description";
+                public const string Version = "version";
+                public const string Isrc = "isrc";
+                public const string Organization = "organization";
+                public const string Copyright = "copyright";
+                public const string CopyrightUri = "copyright-uri";
+                public const string Contact = "contact";
+                public const string License = "license";
+                public const string LicenseUri = "license-uri";
+                public const string Performer = "performer";
+                public const string Duration = "duration";
+                public const string Codec = "codec";
+                public const string VideoCodec = "video-codec";
+                public const string AudioCodec = "audio-codec";
+                public const string SubtitleCodec = "subtitle-codec";
+                public const string Bitrate = "bitrate";
+                public const string NominalBitrate = "nominal-bitrate";
+                public const string MinimumBitrate = "minimum-bitrate";
+                public const string MaximumBitrate = "maximum-bitrate";
+                public const string Serial = "serial";
+                public const string Encoder = "encoder";
+                public const string EncoderVersion = "encoder-version";
+                public const string TrackGain = "replaygain-track-gain";
+                public const string TrackPeak = "replaygain-track-peak";
+                public const string AlbumGain = "replaygain-album-gain";
+                public const string AlbumPeak = "replaygain-album-peak";
+                public const string ReferenceLevel = "replaygain-reference-level";
+                public const string LanguageCode = "language-code";
+                public const string Image = "image";
+                public const string PreviewImage = "preview-image";
+                public const string Attachment = "attachment";
+                public const string BeatsPerMinute = "beats-per-minute";
+                public const string Keywords = "keywords";
+                public const string GeoLocationName = "geo-location-name";
+                public const string GeoLocationLatitude = "geo-location-latitude";
+                public const string GeoLocationLongitude = "geo-location-longitude";
+                public const string GeoLocationElevation = "geo-location-elevation";
diff --git a/gstreamer-sharp/Tags.cs b/gstreamer-sharp/Tags.cs
deleted file mode 100644 (file)
index 4e1e3cb..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-namespace Gst {
-  public static class Tags {
-    public const string Title = "title";
-    public const string TitleSortname = "title-sortname";
-    public const string Artist = "artist";
-    public const string ArtistSortname = "musicbrainz-sortname";
-    public const string Album = "album";
-    public const string AlbumSortname = "album-sortname";
-    public const string Composer = "composer";
-    public const string Date = "date";
-    public const string Genre = "genre";
-    public const string Comment = "comment";
-    public const string ExtendedComment = "extended-comment";
-    public const string TrackNumber = "track-number";
-    public const string TrackCount = "track-count";
-    public const string AlbumVolumeNumber = "album-disc-number";
-    public const string AlbumVolumeCount = "album-disc-count";
-    public const string Location = "location";
-    public const string Homepage = "homepage";
-    public const string Description = "description";
-    public const string Version = "version";
-    public const string Isrc = "isrc";
-    public const string Organization = "organization";
-    public const string Copyright = "copyright";
-    public const string CopyrightUri = "copyright-uri";
-    public const string Contact = "contact";
-    public const string License = "license";
-    public const string LicenseUri = "license-uri";
-    public const string Performer = "performer";
-    public const string Duration = "duration";
-    public const string Codec = "codec";
-    public const string VideoCodec = "video-codec";
-    public const string AudioCodec = "audio-codec";
-    public const string SubtitleCodec = "subtitle-codec";
-    public const string Bitrate = "bitrate";
-    public const string NominalBitrate = "nominal-bitrate";
-    public const string MinimumBitrate = "minimum-bitrate";
-    public const string MaximumBitrate = "maximum-bitrate";
-    public const string Serial = "serial";
-    public const string Encoder = "encoder";
-    public const string EncoderVersion = "encoder-version";
-    public const string TrackGain = "replaygain-track-gain";
-    public const string TrackPeak = "replaygain-track-peak";
-    public const string AlbumGain = "replaygain-album-gain";
-    public const string AlbumPeak = "replaygain-album-peak";
-    public const string ReferenceLevel = "replaygain-reference-level";
-    public const string LanguageCode = "language-code";
-    public const string Image = "image";
-    public const string PreviewImage = "preview-image";
-    public const string Attachment = "attachment";
-    public const string BeatsPerMinute = "beats-per-minute";
-    public const string Keywords = "keywords";
-    public const string GeoLocationName = "geo-location-name";
-    public const string GeoLocationLatitude = "geo-location-latitude";
-    public const string GeoLocationLongitude = "geo-location-longitude";
-    public const string GeoLocationElevation = "geo-location-elevation";
-  }
-}
index 2591f93..7b9a2a3 100644 (file)
@@ -3,14 +3,15 @@ using System.IO;
 
 public class GenerateTags {
   public static int Main (string[] args) {
-    if (args.Length != 3) {
-      Console.WriteLine ("usage: gst-generate-tags --header=<filename> --namespace=<namespace> --class=<name>");
+    if (args.Length != 3 && args.Length != 4) {
+      Console.WriteLine ("usage: gst-generate-tags --header=<filename> --namespace=<namespace> --class=<name> [--only-body]");
       return 1;
     }
 
     StreamReader header = null;
     string ns = "Gst";
     string cls = "Tags";
+    bool only_body = false;
 
     foreach (string arg in args) {
 
@@ -29,14 +30,18 @@ public class GenerateTags {
         ns = arg.Substring (12);
       } else if (arg.StartsWith ("--class=")) {
         cls = arg.Substring (8);
+      } else if (arg.StartsWith ("--only-body")) {
+        only_body = true;
       } else {
         Console.WriteLine ("Invalid argument '" + arg + "'");
         return 3;
       }
     }
 
-    Console.WriteLine ("namespace " + ns + " {");
-    Console.WriteLine ("\tpublic static class " + cls + " {");
+    if (!only_body) {
+      Console.WriteLine ("namespace " + ns + " {");
+      Console.WriteLine ("\tpublic static class " + cls + " {");
+    }
 
     string line;
     while ( (line = header.ReadLine ()) != null) {
@@ -77,8 +82,10 @@ public class GenerateTags {
 
     }
 
-    Console.WriteLine ("\t}");
-    Console.WriteLine ("}");
+    if (!only_body) {
+      Console.WriteLine ("\t}");
+      Console.WriteLine ("}");
+    }
 
     return 0;
   }
index 50fee98..9944dbb 100644 (file)
@@ -6,5 +6,6 @@ api:
                --header=../../gstreamer/gst/gsttaglist.h \
                --namespace=Gst \
                --class=Tags \
-               > $(top_srcdir)/gstreamer-sharp/Tags.cs
+               --only-body \
+               > $(top_srcdir)/gstreamer-sharp/Tag.custom