From 40fc4c1412e3a9066fc6cb1d4ea262d1f51fd2a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sat, 18 Apr 2009 16:43:15 +0200 Subject: [PATCH] Put tags into the Tag class instead of a new Tags class Also remove the void ctor of the Tag class, it's not meant to be instantiated --- gstreamer-sharp/Gstreamer.metadata | 2 ++ gstreamer-sharp/Makefile.am | 6 ++-- gstreamer-sharp/Tag.custom | 54 ++++++++++++++++++++++++++++ gstreamer-sharp/Tags.cs | 58 ------------------------------ parser/gst-generate-tags.cs | 19 ++++++---- source/Makefile.am | 3 +- 6 files changed, 73 insertions(+), 69 deletions(-) create mode 100644 gstreamer-sharp/Tag.custom delete mode 100644 gstreamer-sharp/Tags.cs diff --git a/gstreamer-sharp/Gstreamer.metadata b/gstreamer-sharp/Gstreamer.metadata index 76d251fcea..150db35402 100644 --- a/gstreamer-sharp/Gstreamer.metadata +++ b/gstreamer-sharp/Gstreamer.metadata @@ -448,6 +448,8 @@ 1 + 1 + TagFlags ref diff --git a/gstreamer-sharp/Makefile.am b/gstreamer-sharp/Makefile.am index 966a737f8c..21b178543d 100644 --- a/gstreamer-sharp/Makefile.am +++ b/gstreamer-sharp/Makefile.am @@ -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 index 0000000000..7520323dac --- /dev/null +++ b/gstreamer-sharp/Tag.custom @@ -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 index 4e1e3cbad1..0000000000 --- a/gstreamer-sharp/Tags.cs +++ /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"; - } -} diff --git a/parser/gst-generate-tags.cs b/parser/gst-generate-tags.cs index 2591f93c2c..7b9a2a3579 100644 --- a/parser/gst-generate-tags.cs +++ b/parser/gst-generate-tags.cs @@ -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= --namespace= --class="); + if (args.Length != 3 && args.Length != 4) { + Console.WriteLine ("usage: gst-generate-tags --header= --namespace= --class= [--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; } diff --git a/source/Makefile.am b/source/Makefile.am index 50fee98208..9944dbb672 100644 --- a/source/Makefile.am +++ b/source/Makefile.am @@ -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