this.add_resource (resource_info);
- var icon_info = new IconInfo ("image/png", // Mimetype
- 48, // width
- 48, // height
- 24, // depth
- ICON); // Icon Path
+ var icon_info = new IconInfo ("image/png");
+
+ icon_info.path = ICON;
+ icon_info.width = 48;
+ icon_info.height = 48;
+ icon_info.depth = 24;
this.add_icon (icon_info);
}
* Holds information about an icon.
*/
public class Rygel.IconInfo {
- public string mimetype;
- public uint width;
- public uint height;
- public uint depth;
+ public string mime_type;
public string path;
- public IconInfo (string mimetype,
- uint width,
- uint height,
- uint depth,
- string path) {
- this.mimetype = mimetype;
- this.width = width;
- this.height = height;
- this.depth = depth;
+ public long size = -1; // Size in bytes
+ public int width = -1; // Width in pixels
+ public int height = -1; // Height in pixels
+ public int depth = -1; // depth of pixels in bytes
+
+ public IconInfo (string mime_type) {
+ this.mime_type = mime_type;
this.path = path;
}
}
string height = icon_info.height.to_string ();
string depth = icon_info.depth.to_string ();
- icon_node->new_child (null, "mimetype", icon_info.mimetype);
+ icon_node->new_child (null, "mimetype", icon_info.mime_type);
icon_node->new_child (null, "width", width);
icon_node->new_child (null, "height", height);
icon_node->new_child (null, "depth", depth);
using GUPnP;
-private errordomain Rygel.ThumbnailError {
- BAD_URI
-}
-
/**
* Represents a picture or video thumbnail.
*/
-public class Rygel.Thumbnail : GLib.Object {
+public class Rygel.Thumbnail : Rygel.IconInfo {
public string uri;
- public string mime_type;
public string dlna_profile;
- public long size = -1; // Size in bytes
- public int width = -1; // Width in pixels
- public int height = -1; // Height in pixels
- public int color_depth = -1; // depth of pixels in bytes
-
public Thumbnail (string mime_type = "image/jpeg",
string dlna_profile = "JPEG_TN") {
- this.mime_type = mime_type;
+ base (mime_type);
+
this.dlna_profile = dlna_profile;
}
res.width = this.width;
res.height = this.height;
- res.color_depth = this.color_depth;
+ res.color_depth = this.depth;
/* Protocol info */
res.protocol_info = this.get_protocol_info (protocol);