From 83f73246f9210b98c63f14aa45a98f581a374887 Mon Sep 17 00:00:00 2001 From: "Zeeshan Ali (Khattak)" Date: Tue, 25 Nov 2008 14:44:09 +0000 Subject: [PATCH] Add some basic doc comments for all classes. svn path=/trunk/; revision=304 --- src/plugins/tracker/rygel-media-tracker.vala | 3 +++ src/plugins/tracker/rygel-tracker-container.vala | 3 +++ src/plugins/tracker/rygel-tracker-image-item.vala | 3 +++ src/plugins/tracker/rygel-tracker-item.vala | 3 +++ src/plugins/tracker/rygel-tracker-music-item.vala | 3 +++ src/plugins/tracker/rygel-tracker-video-item.vala | 3 +++ src/rygel/cstuff.vapi | 9 +++++++++ src/rygel/rygel-connection-manager.vala | 3 +++ src/rygel/rygel-content-directory.vala | 8 ++++++++ src/rygel/rygel-media-container.vala | 4 ++++ src/rygel/rygel-media-item.vala | 4 ++++ src/rygel/rygel-media-object.vala | 4 ++++ src/rygel/rygel-media-receiver-registrar.vala | 3 +++ src/rygel/rygel-media-server-factory.vala | 7 ++++++- src/rygel/rygel-media-server.vala | 3 +++ src/rygel/rygel-metadata-extractor.vala | 5 +++++ src/rygel/rygel-plugin-loader.vala | 5 +++++ src/rygel/rygel-plugin.vala | 4 ++++ src/rygel/rygel-resource-info.vala | 4 ++++ 19 files changed, 80 insertions(+), 1 deletion(-) diff --git a/src/plugins/tracker/rygel-media-tracker.vala b/src/plugins/tracker/rygel-media-tracker.vala index 2583977..d48e771 100644 --- a/src/plugins/tracker/rygel-media-tracker.vala +++ b/src/plugins/tracker/rygel-media-tracker.vala @@ -27,6 +27,9 @@ using Rygel; using GUPnP; using DBus; +/** + * Implementation of Tracker-based ContentDirectory service. + */ public class Rygel.MediaTracker : ContentDirectory { public static const int MAX_REQUESTED_COUNT = 128; diff --git a/src/plugins/tracker/rygel-tracker-container.vala b/src/plugins/tracker/rygel-tracker-container.vala index 058f9f2..1e2995e 100644 --- a/src/plugins/tracker/rygel-tracker-container.vala +++ b/src/plugins/tracker/rygel-tracker-container.vala @@ -27,6 +27,9 @@ using Rygel; using GUPnP; using DBus; +/** + * Represents Tracker category. + */ public class Rygel.TrackerContainer : MediaContainer { /* class-wide constants */ private const string TRACKER_SERVICE = "org.freedesktop.Tracker"; diff --git a/src/plugins/tracker/rygel-tracker-image-item.vala b/src/plugins/tracker/rygel-tracker-image-item.vala index e029022..b3b308b 100644 --- a/src/plugins/tracker/rygel-tracker-image-item.vala +++ b/src/plugins/tracker/rygel-tracker-image-item.vala @@ -27,6 +27,9 @@ using Rygel; using GUPnP; using DBus; +/** + * Represents Tracker image item. + */ public class Rygel.TrackerImageItem : TrackerItem { public TrackerImageItem (string id, string path, diff --git a/src/plugins/tracker/rygel-tracker-item.vala b/src/plugins/tracker/rygel-tracker-item.vala index 9b3b1b5..de94ff8 100644 --- a/src/plugins/tracker/rygel-tracker-item.vala +++ b/src/plugins/tracker/rygel-tracker-item.vala @@ -27,6 +27,9 @@ using Rygel; using GUPnP; using DBus; +/** + * Represents Tracker item. + */ public abstract class Rygel.TrackerItem : MediaItem { protected TrackerContainer parent; protected string path; diff --git a/src/plugins/tracker/rygel-tracker-music-item.vala b/src/plugins/tracker/rygel-tracker-music-item.vala index aa7e89b..1c76f70 100644 --- a/src/plugins/tracker/rygel-tracker-music-item.vala +++ b/src/plugins/tracker/rygel-tracker-music-item.vala @@ -27,6 +27,9 @@ using Rygel; using GUPnP; using DBus; +/** + * Represents Tracker music item. + */ public class Rygel.TrackerMusicItem : TrackerItem { public TrackerMusicItem (string id, string path, diff --git a/src/plugins/tracker/rygel-tracker-video-item.vala b/src/plugins/tracker/rygel-tracker-video-item.vala index 6404642..5fb4897 100644 --- a/src/plugins/tracker/rygel-tracker-video-item.vala +++ b/src/plugins/tracker/rygel-tracker-video-item.vala @@ -27,6 +27,9 @@ using Rygel; using GUPnP; using DBus; +/** + * Represents Tracker video item. + */ public class Rygel.TrackerVideoItem : TrackerItem { public TrackerVideoItem (string id, string path, diff --git a/src/rygel/cstuff.vapi b/src/rygel/cstuff.vapi index 4c2122f..b9dba33 100644 --- a/src/rygel/cstuff.vapi +++ b/src/rygel/cstuff.vapi @@ -18,7 +18,13 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/** + * Glue's our C code to Vala world. + */ namespace CStuff { + /** + * Holds constants defined by build system. + */ class BuildConfig { [CCode (cname = "DATA_DIR")] public static const string DATA_DIR; @@ -27,6 +33,9 @@ namespace CStuff { public static const string PLUGIN_DIR; } + /** + * Provides utility functions implemented in C. + */ public class Utils { [CCode (cname = "get_xml_element")] public static weak Xml.Node * get_xml_element (Xml.Node node, diff --git a/src/rygel/rygel-connection-manager.vala b/src/rygel/rygel-connection-manager.vala index f32af1c..cff6c6b 100644 --- a/src/rygel/rygel-connection-manager.vala +++ b/src/rygel/rygel-connection-manager.vala @@ -27,6 +27,9 @@ using GLib; using GUPnP; +/** + * Basic implementation of UPnP ConnectionManager service version 2. + */ public class Rygel.ConnectionManager : Service { public const string UPNP_ID = "urn:upnp-org:serviceId:ConnectionManager"; public const string UPNP_TYPE = diff --git a/src/rygel/rygel-content-directory.vala b/src/rygel/rygel-content-directory.vala index 07ab0f4..f1256be 100644 --- a/src/rygel/rygel-content-directory.vala +++ b/src/rygel/rygel-content-directory.vala @@ -26,10 +26,18 @@ using GUPnP; +/** + * Errors used by ContentDirectory and deriving classes. + */ public errordomain Rygel.ContentDirectoryError { NO_SUCH_OBJECT = 701 } +/** + * Basic implementation of UPnP ContentDirectory service version 2. Most often + * plugins will provide a child of this class. The inheriting classes should + * override add_children_metadata and add_metadata virtual methods. + */ public class Rygel.ContentDirectory: Service { public const string UPNP_ID = "urn:upnp-org:serviceId:ContentDirectory"; public const string UPNP_TYPE = diff --git a/src/rygel/rygel-media-container.vala b/src/rygel/rygel-media-container.vala index 31496ee..dd91d91 100644 --- a/src/rygel/rygel-media-container.vala +++ b/src/rygel/rygel-media-container.vala @@ -24,6 +24,10 @@ using GUPnP; +/** + * Represents a container (folder) for media items and containers. Provides + * basic serialization (to DIDLLiteWriter) implementation. + */ public class Rygel.MediaContainer : MediaObject { public uint child_count; diff --git a/src/rygel/rygel-media-item.vala b/src/rygel/rygel-media-item.vala index ea96e59..9a002cf 100644 --- a/src/rygel/rygel-media-item.vala +++ b/src/rygel/rygel-media-item.vala @@ -24,6 +24,10 @@ using GUPnP; +/** + * Represents a media (Music, Video and Image) item. Provides basic + * serialization (to DIDLLiteWriter) implementation. + */ public class Rygel.MediaItem : MediaObject { public static const string IMAGE_CLASS = "object.item.imageItem"; public static const string VIDEO_CLASS = "object.item.videoItem"; diff --git a/src/rygel/rygel-media-object.vala b/src/rygel/rygel-media-object.vala index de8e86e..11295e5 100644 --- a/src/rygel/rygel-media-object.vala +++ b/src/rygel/rygel-media-object.vala @@ -24,6 +24,10 @@ using GUPnP; +/** + * Represents a media object (container and item). Subclasses should implement + * the abstract serialize method. + */ public abstract class Rygel.MediaObject { public string id; public string parent_id; diff --git a/src/rygel/rygel-media-receiver-registrar.vala b/src/rygel/rygel-media-receiver-registrar.vala index 690935a..55b9059 100644 --- a/src/rygel/rygel-media-receiver-registrar.vala +++ b/src/rygel/rygel-media-receiver-registrar.vala @@ -24,6 +24,9 @@ using GUPnP; +/** + * Basic implementation of MS MediaReceiverRegistrar service version 1. + */ public class Rygel.MediaReceiverRegistrar: Service { public const string UPNP_ID = "urn:microsoft.com:serviceId:X_MS_MediaReceiverRegistrar"; diff --git a/src/rygel/rygel-media-server-factory.vala b/src/rygel/rygel-media-server-factory.vala index a2814bb..e8ee0e7 100644 --- a/src/rygel/rygel-media-server-factory.vala +++ b/src/rygel/rygel-media-server-factory.vala @@ -28,6 +28,10 @@ using GUPnP; using GConf; using CStuff; +/** + * Factory for MediaServer objects. Give it a plugin and it will create a + * MediaServer device for that. + */ public class Rygel.MediaServerFactory { public static const string DESC_DOC = "xml/description.xml"; public static const string XBOX_DESC_DOC = "xml/description-xbox360.xml"; @@ -209,7 +213,8 @@ public class Rygel.MediaServerFactory { this.add_services_to_desc (device_element, plugin); } - /* Fills the description doc @doc with a friendly name, and UDN from gconf. + /** + * Fills the description doc @doc with a friendly name, and UDN from gconf. * If these keys are not present in gconf, they are set with default values. */ private void set_friendly_name_and_udn (Xml.Node *device_element, diff --git a/src/rygel/rygel-media-server.vala b/src/rygel/rygel-media-server.vala index e8f2f2d..b867acc 100644 --- a/src/rygel/rygel-media-server.vala +++ b/src/rygel/rygel-media-server.vala @@ -27,6 +27,9 @@ using GUPnP; using GConf; using CStuff; +/** + * Represents a MediaServer device. + */ public class Rygel.MediaServer: RootDevice { private List services; /* Services we implement */ diff --git a/src/rygel/rygel-metadata-extractor.vala b/src/rygel/rygel-metadata-extractor.vala index f81bb23..57f39f3 100644 --- a/src/rygel/rygel-metadata-extractor.vala +++ b/src/rygel/rygel-metadata-extractor.vala @@ -34,6 +34,11 @@ private enum Gst.StreamType { ELEMENT = 5 /* stream handled by an element */ } +/** + * Metadata extractor based on Gstreamer. Just set the URI of the media on the + * uri property, it will extact the metadata for you and emit signal + * metadata_available for each key/value pair extracted. + */ public class Rygel.MetadataExtractor: GLib.Object { /* TODO: Use tagbin instead once it's ready */ diff --git a/src/rygel/rygel-plugin-loader.vala b/src/rygel/rygel-plugin-loader.vala index b1deb97..3bea07a 100644 --- a/src/rygel/rygel-plugin-loader.vala +++ b/src/rygel/rygel-plugin-loader.vala @@ -26,6 +26,11 @@ using CStuff; using GUPnP; +/** + * Responsible for plugin loading. Probes for shared library files in a specific + * directry and tries to grab a function with a specific name and signature, + * calls it and expects a Plugin instance in return. + */ public class Rygel.PluginLoader : Object { /* We need to keep the modules somewhere */ private List modules; diff --git a/src/rygel/rygel-plugin.vala b/src/rygel/rygel-plugin.vala index 09173df..2f2aacd 100644 --- a/src/rygel/rygel-plugin.vala +++ b/src/rygel/rygel-plugin.vala @@ -26,6 +26,10 @@ using Gee; using GUPnP; +/** + * Represents a Rygel plugin. Plugins are supposed to provide an object of this + * class or a subclass. + */ public class Rygel.Plugin : GUPnP.ResourceFactory { public string name; diff --git a/src/rygel/rygel-resource-info.vala b/src/rygel/rygel-resource-info.vala index 1fe23fe..6b9fe28 100644 --- a/src/rygel/rygel-resource-info.vala +++ b/src/rygel/rygel-resource-info.vala @@ -26,6 +26,10 @@ using Gee; using GUPnP; +/** + * Holds information about a particular resource (device and service) + * implementation. + */ public class Rygel.ResourceInfo { public string upnp_type; public string upnp_id; -- 2.7.4