![]() |
![]() |
![]() |
Grilo Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#include <grilo.h> enum GrlMediaSerializeType; struct GrlMediaClass; void grl_media_set_id (GrlMedia *media
,const gchar *id
); void grl_media_set_url (GrlMedia *media
,const gchar *url
); void grl_media_set_author (GrlMedia *media
,const gchar *author
); void grl_media_set_title (GrlMedia *media
,const gchar *title
); void grl_media_set_description (GrlMedia *media
,const gchar *description
); void grl_media_set_source (GrlMedia *media
,const gchar *source
); void grl_media_set_thumbnail (GrlMedia *media
,const gchar *thumbnail
); void grl_media_set_site (GrlMedia *media
,const gchar *site
); void grl_media_set_duration (GrlMedia *media
,gint duration
); void grl_media_set_date (GrlMedia *media
,const gchar *date
); void grl_media_set_mime (GrlMedia *media
,const gchar *mime
); void grl_media_set_play_count (GrlMedia *media
,gint play_count
); void grl_media_set_last_played (GrlMedia *media
,const gchar *last_played
); void grl_media_set_last_position (GrlMedia *media
,gint last_position
); void grl_media_set_external_player (GrlMedia *media
,const gchar *player
); void grl_media_set_external_url (GrlMedia *media
,const gchar *url
); void grl_media_set_studio (GrlMedia *media
,const gchar *studio
); void grl_media_set_certificate (GrlMedia *media
,const gchar *certificate
); void grl_media_set_license (GrlMedia *media
,const gchar *license
); void grl_media_set_rating (GrlMedia *media
,gfloat rating
,gfloat max
); const gchar * grl_media_get_id (GrlMedia *media
); const gchar * grl_media_get_url (GrlMedia *media
); const gchar * grl_media_get_author (GrlMedia *media
); const gchar * grl_media_get_title (GrlMedia *media
); const gchar * grl_media_get_description (GrlMedia *media
); const gchar * grl_media_get_source (GrlMedia *media
); const gchar * grl_media_get_thumbnail (GrlMedia *media
); const gchar * grl_media_get_site (GrlMedia *media
); gint grl_media_get_duration (GrlMedia *media
); const gchar * grl_media_get_date (GrlMedia *media
); const gchar * grl_media_get_mime (GrlMedia *media
); gfloat grl_media_get_rating (GrlMedia *media
); gint grl_media_get_play_count (GrlMedia *media
); gint grl_media_get_last_position (GrlMedia *media
); const gchar * grl_media_get_last_played (GrlMedia *media
); const gchar * grl_media_get_player (GrlMedia *media
); const gchar * grl_media_get_external_url (GrlMedia *media
); const gchar * grl_media_get_studio (GrlMedia *media
); const gchar * grl_media_get_certificate (GrlMedia *media
); const gchar * grl_media_get_license (GrlMedia *media
); GrlMedia * grl_media_new (void
); gchar * grl_media_serialize (GrlMedia *media
); gchar * grl_media_serialize_extended (GrlMedia *media
,GrlMediaSerializeType serial_type
,...
); GrlMedia * grl_media_unserialize (const gchar *serial
);
This high level class represents a multimedia item. It has methods to set and get properties like author, title, description, and so on.
typedef enum { GRL_MEDIA_SERIALIZE_BASIC, GRL_MEDIA_SERIALIZE_PARTIAL, GRL_MEDIA_SERIALIZE_FULL } GrlMediaSerializeType;
GrlMedia serialize type
struct GrlMediaClass { GrlDataClass parent_class; };
Grilo Media Class
GrlDataClass |
the parent class structure |
void grl_media_set_id (GrlMedia *media
,const gchar *id
);
Set the media identifier
|
the media |
|
the identifier of the media |
Since 0.1.4
void grl_media_set_url (GrlMedia *media
,const gchar *url
);
Set the media's URL
|
the media |
|
the media's URL |
Since 0.1.4
void grl_media_set_author (GrlMedia *media
,const gchar *author
);
Set the media's author
|
the media |
|
the media's author |
Since 0.1.4
void grl_media_set_title (GrlMedia *media
,const gchar *title
);
Set the media's title
|
the media |
|
the title |
Since 0.1.4
void grl_media_set_description (GrlMedia *media
,const gchar *description
);
Set the media's description
|
the media |
|
the description |
Since 0.1.4
void grl_media_set_source (GrlMedia *media
,const gchar *source
);
Set the media's source
|
the media |
|
the source |
Since 0.1.4
void grl_media_set_thumbnail (GrlMedia *media
,const gchar *thumbnail
);
Set the media's thumbnail URL
|
the media |
|
the thumbnail URL |
Since 0.1.4
void grl_media_set_site (GrlMedia *media
,const gchar *site
);
Set the media's site
|
the media |
|
the site |
Since 0.1.4
void grl_media_set_duration (GrlMedia *media
,gint duration
);
Set the media's duration
|
the media |
|
the duration |
Since 0.1.4
void grl_media_set_date (GrlMedia *media
,const gchar *date
);
Set the media's date (TBD)
|
the media |
|
the date |
void grl_media_set_mime (GrlMedia *media
,const gchar *mime
);
Set the media's mime-type
|
the media |
|
the mime type |
Since 0.1.4
void grl_media_set_play_count (GrlMedia *media
,gint play_count
);
Set the media play count
|
the media |
|
the play count |
Since 0.1.4
void grl_media_set_last_played (GrlMedia *media
,const gchar *last_played
);
Set the media last played date
|
the media |
|
date when the media was last played |
Since 0.1.4
void grl_media_set_last_position (GrlMedia *media
,gint last_position
);
Set the media last played position
|
the media |
|
second at which the media playback was interrupted |
Since 0.1.4
void grl_media_set_external_player (GrlMedia *media
,const gchar *player
);
Set the location of a player for the media (usually a flash player)
|
the media |
|
location of an external player for this media |
Since 0.1.6
void grl_media_set_external_url (GrlMedia *media
,const gchar *url
);
Set an external location where users can play the media
|
the media |
|
external location where this media can be played. |
Since 0.1.6
void grl_media_set_studio (GrlMedia *media
,const gchar *studio
);
Set the media studio
|
the media |
|
The studio the media is from |
Since 0.1.6
void grl_media_set_certificate (GrlMedia *media
,const gchar *certificate
);
Set the media certificate
|
the media |
|
The rating certificate of the media |
Since 0.1.6
void grl_media_set_license (GrlMedia *media
,const gchar *license
);
Set the media license
|
the media |
|
The license of the media |
Since 0.1.6
void grl_media_set_rating (GrlMedia *media
,gfloat rating
,gfloat max
);
This method receives a rating and its scale and normalizes it
|
a media |
|
a rating value |
|
maximum rating value |
Since 0.1.5
const gchar * grl_media_get_id (GrlMedia *media
);
|
the media object |
Returns : |
the media's identifier |
Since 0.1.4
const gchar * grl_media_get_url (GrlMedia *media
);
|
the media object |
Returns : |
the media's URL |
Since 0.1.4
const gchar * grl_media_get_author (GrlMedia *media
);
|
the media object |
Returns : |
the media's author |
Since 0.1.4
const gchar * grl_media_get_title (GrlMedia *media
);
|
the media object |
Returns : |
the media's title |
Since 0.1.4
const gchar * grl_media_get_description (GrlMedia *media
);
|
the media object |
Returns : |
the media's description |
Since 0.1.4
const gchar * grl_media_get_source (GrlMedia *media
);
|
the media object source |
Returns : |
the media's source |
Since 0.1.4
const gchar * grl_media_get_thumbnail (GrlMedia *media
);
|
the media object |
Returns : |
the media's thumbnail URL |
Since 0.1.4
const gchar * grl_media_get_site (GrlMedia *media
);
|
the media object |
Returns : |
the media's site |
Since 0.1.4
gint grl_media_get_duration (GrlMedia *media
);
|
the media object |
Returns : |
the media's duration |
Since 0.1.4
const gchar * grl_media_get_date (GrlMedia *media
);
|
the media object |
Returns : |
the media's date (TBD) |
Since 0.1.4
const gchar * grl_media_get_mime (GrlMedia *media
);
|
the media object |
Returns : |
the media's mime-type |
Since 0.1.4
gfloat grl_media_get_rating (GrlMedia *media
);
|
the media object |
Returns : |
the media's rating |
Since 0.1.5
gint grl_media_get_play_count (GrlMedia *media
);
|
the media object |
Returns : |
the media's play count |
Since 0.1.4
gint grl_media_get_last_position (GrlMedia *media
);
|
the media object |
Returns : |
the media's last_played position (in seconds) |
Since 0.1.4
const gchar * grl_media_get_last_played (GrlMedia *media
);
|
the media object |
Returns : |
the media's last played time |
Since 0.1.4
const gchar * grl_media_get_player (GrlMedia *media
);
|
the media object |
Returns : |
URL of an external player object for this media |
Since 0.1.6
const gchar * grl_media_get_external_url (GrlMedia *media
);
|
the media object |
Returns : |
URL of an external location where the user play the media. |
Since 0.1.6
const gchar * grl_media_get_studio (GrlMedia *media
);
|
the media object |
Returns : |
the studio the media is from |
Since 0.1.6
const gchar * grl_media_get_certificate (GrlMedia *media
);
|
the media object |
Returns : |
the media's certificate |
Since 0.1.6
const gchar * grl_media_get_license (GrlMedia *media
);
|
the media object |
Returns : |
the license the media is under |
Since 0.1.6
GrlMedia * grl_media_new (void
);
Creates a new data media object.
Returns : |
a newly-allocated data media. |
Since 0.1.4
gchar * grl_media_serialize (GrlMedia *media
);
Serializes a GrlMedia into a string. It does a basic serialization.
See grl_media_serialize_extended()
to get more serialization approaches.
|
a GrlMedia |
Returns : |
serialized media |
Since 0.1.6
gchar * grl_media_serialize_extended (GrlMedia *media
,GrlMediaSerializeType serial_type
,...
);
Serializes a GrlMedia into a string.
See grl_media_unserialize()
to recover back the GrlMedia from the string.
If serialization type is GRL_MEDIA_SERIALIZE_PARTIAL
then it requires a
GList
with the properties to consider in serialization (id and source are
always considered).
|
a GrlMedia |
|
type of serialization |
|
media keys to serialize |
Returns : |
serialized media |
Since 0.1.6