Top |
This high level class represents a multimedia item. It has methods to set and get properties like author, title, description, and so on.
GrlMedia *
grl_media_audio_new (void
);
Creates a new media audio object.
Since: 0.1.4
GrlMedia *
grl_media_image_new (void
);
Creates a new media image object.
Since: 0.1.4
GrlMedia *
grl_media_video_new (void
);
Creates a new media video object.
Since: 0.1.4
GrlMedia *
grl_media_container_new (void
);
Creates a new media container object.
Since: 0.3.0
gboolean
grl_media_is_audio (GrlMedia *media
);
Check if media
is an audio
Since: 0.3.0
gboolean
grl_media_is_image (GrlMedia *media
);
Check if media
is an image
Since: 0.3.0
gboolean
grl_media_is_video (GrlMedia *media
);
Check if media
is a video
Since: 0.3.0
gboolean
grl_media_is_container (GrlMedia *media
);
Check if media
is a container
Since: 0.3.0
void grl_media_add_artist (GrlMedia *media
,const gchar *artist
);
Adds a new artist to media
.
Since: 0.3.0
void grl_media_add_author (GrlMedia *media
,const gchar *author
);
Adds a new author to media
.
Since: 0.1.10
void grl_media_add_director (GrlMedia *media
,const gchar *director
);
Adds the director of the media
Since: 0.3.0
void grl_media_add_external_player (GrlMedia *media
,const gchar *player
);
Adds a new external player to media
.
Since: 0.1.10
void grl_media_add_external_url (GrlMedia *media
,const gchar *url
);
Adds a new external url to media
.
Since: 0.1.10
void grl_media_add_genre (GrlMedia *media
,const gchar *genre
);
Adds a new genre to media
.
Since: 0.3.0
void grl_media_add_keyword (GrlMedia *media
,const gchar *keyword
);
Adds the keyword describing the media
.
Since: 0.2.3
void grl_media_add_lyrics (GrlMedia *media
,const gchar *lyrics
);
Adds a new lyrics to media
.
Since: 0.3.0
void grl_media_add_mb_artist_id (GrlMedia *media
,const gchar *mb_artist_id
);
Adds a new MusicBrainz artist id to media
.
Since: 0.3.0
void grl_media_add_performer (GrlMedia *media
,const gchar *performer
);
Adds the actor performing in the movie.
Since: 0.3.0
void grl_media_add_producer (GrlMedia *media
,const gchar *producer
);
Adds the producer of the media.
Since: 0.3.0
void grl_media_add_region_data (GrlMedia *media
,const gchar *region
,const GDateTime *publication_date
,const gchar *certificate
);
Adds regional publication and certification information for region
.
media |
a GrlMedia |
|
region |
the region's ISO-3166-1 code |
|
publication_date |
the publication date |
|
certificate |
the age certification |
Since: 0.2.3
void grl_media_add_thumbnail (GrlMedia *media
,const gchar *thumbnail
);
Adds a new thumbnail to media
.
Since: 0.1.10
void grl_media_add_thumbnail_binary (GrlMedia *media
,const guint8 *thumbnail
,gsize size
);
Adds a new thumbnail to media
.
media |
a GrlMedia |
|
thumbnail |
a buffer containing the thumbnail for |
|
size |
size of buffer |
Since: 0.1.10
void grl_media_add_url_data (GrlMedia *media
,const gchar *url
,const gchar *mime
,gint bitrate
,gfloat framerate
,gint width
,gint height
);
Sets all the keys related with the URL of a media resource and adds it to
media
(useful for resources with more than one URL).
media |
a GrlMedia |
|
url |
a media's URL |
|
mime |
th |
|
bitrate |
the |
|
framerate |
media framerate, or -1 to ignore |
|
width |
media width, or -1 to ignore |
|
height |
media height, or -1 to ignore |
Since: 0.3.0
const gchar * grl_media_get_artist_nth (GrlMedia *media
,guint index
);
Since: 0.3.0
const gchar * grl_media_get_author_nth (GrlMedia *media
,guint index
);
Since: 0.1.10
const gchar *
grl_media_get_camera_model (GrlMedia *media
);
Since: 0.3.0
const gchar *
grl_media_get_certificate (GrlMedia *media
);
Returns the media's first age certificate.
This should usually be the media's most relevant
age certificate. Use grl_media_get_region_data_nth()
to
get other age certificates.
Since: 0.1.6
gint
grl_media_get_childcount (GrlMedia *media
);
Number of children of this container.
Since: 0.3.0
GDateTime *
grl_media_get_creation_date (GrlMedia *media
);
Since: 0.2.0
const gchar *
grl_media_get_description (GrlMedia *media
);
Since: 0.1.4
const gchar * grl_media_get_director_nth (GrlMedia *media
,guint index
);
Since: 0.3.0
const gchar *
grl_media_get_episode_title (GrlMedia *media
);
Since: 0.3.0
const gchar *
grl_media_get_flash_used (GrlMedia *media
);
whether the flash was used.
See http://library.gnome.org/devel/ontology/unstable/nmm-classes.htmlnmm-Flash
Since: 0.3.0
const gchar * grl_media_get_genre_nth (GrlMedia *media
,guint index
);
Since: 0.3.0
const gchar *
grl_media_get_external_url (GrlMedia *media
);
Since: 0.1.6
const gchar * grl_media_get_external_url_nth (GrlMedia *media
,guint index
);
Since: 0.1.10
const gchar * grl_media_get_keyword_nth (GrlMedia *media
,guint index
);
Since: 0.2.3
const gchar *
grl_media_get_mb_album_id (GrlMedia *media
);
Since: 0.3.0
const gchar *
grl_media_get_mb_artist_id (GrlMedia *media
);
Since: 0.3.0
const gchar * grl_media_get_mb_artist_id_nth (GrlMedia *media
,guint index
);
Since: 0.3.0
const gchar *
grl_media_get_mb_recording_id (GrlMedia *media
);
Since: 0.3.0
const gchar *
grl_media_get_mb_track_id (GrlMedia *media
);
Since: 0.3.0
GDateTime *
grl_media_get_modification_date (GrlMedia *media
);
Since: 0.2.0
const gchar *
grl_media_get_original_title (GrlMedia *media
);
Since: 0.3.0
const gchar * grl_media_get_performer_nth (GrlMedia *media
,guint index
);
Since: 0.3.0
const gchar * grl_media_get_producer_nth (GrlMedia *media
,guint index
);
Since: 0.3.0
const gchar * grl_media_get_player_nth (GrlMedia *media
,guint index
);
Since: 0.1.10
GDateTime *
grl_media_get_publication_date (GrlMedia *media
);
Since: 0.2.0
const gchar *
grl_media_get_region (GrlMedia *media
);
the ISO-3166-1 of the region where the media was
published (owned by media
).
[transfer none]
Since: 0.2.3
const gchar * grl_media_get_region_data (GrlMedia *media
,const GDateTime **publication_date
,const gchar **certificate
);
Returns the media's age certificate and publication date for the first region.
This should usually be the media's most relevant region.
Use grl_media_get_region_data_nth()
to get the age certificate and
publication date for other regions.
media |
the media object |
|
publication_date |
the publication date, or |
[out][transfer none] |
certificate |
the age certification, or |
[out][transfer none] |
the ISO-3166-1 of the region where the media was
published (owned by media
).
[transfer none]
Since: 0.2.3
const gchar * grl_media_get_region_data_nth (GrlMedia *media
,guint index
,const GDateTime **publication_date
,const gchar **certificate
);
Returns the media's age certificate and publication date for one region.
Use grl_data_length()
with GRL_METADATA_KEY_REGION to discover
how many regions are available. For instance:
1 2 3 4 5 6 7 8 9 10 |
guint count = grl_data_length (GRL_DATA (media), GRL_METADATA_KEY_REGION); guint i; for (i = 0; i < count; ++i) { const GDateTime* publication_date = NULL; const gchar* certificate = NULL; const gchar* region = grl_media_get_region_data_nth (media, i, &publication_date, &certificate); ... } |
media |
the media object |
|
index |
element to retrieve |
|
publication_date |
the publication date, or |
[out][transfer none] |
certificate |
the age certification, or |
[out][transfer none] |
the ISO-3166-1 of the region where the media was
published (owned by media
).
[transfer none]
Since: 0.2.3
const guint8 * grl_media_get_thumbnail_binary (GrlMedia *media
,gsize *size
);
Since: 0.1.9
const guint8 * grl_media_get_thumbnail_binary_nth (GrlMedia *media
,gsize *size
,guint index
);
media |
the media object |
|
size |
pointer to store the thumbnail buffer size |
|
index |
element to retrieve |
Since: 0.1.10
const gchar * grl_media_get_thumbnail_nth (GrlMedia *media
,guint index
);
Since: 0.1.10
const gchar * grl_media_get_url_data (GrlMedia *media
,gchar **mime
,gint *bitrate
,gfloat *framerate
,gint *width
,gint *height
);
media |
the media object |
|
mime |
the mime-type, or |
[out][transfer none] |
bitrate |
the url bitrate, or |
[out] |
framerate |
the url framerate, or |
|
width |
the url width, or |
|
height |
the url height, or |
Since: 0.3.0
const gchar * grl_media_get_url_data_nth (GrlMedia *media
,guint index
,gchar **mime
,gint *bitrate
,gfloat *framerate
,gint *width
,gint *height
);
media |
the media object |
|
index |
element to retrieve |
|
mime |
the mime-type, or |
[out][transfer none] |
bitrate |
the url bitrate, or |
[out] |
framerate |
the url framerate, or |
|
width |
the url width, or |
|
height |
the url height, or |
Since: 0.3.0
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.
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).
Since: 0.1.6
void grl_media_set_album (GrlMedia *media
,const gchar *album
);
Set the album of the media
Since: 0.3.0
void grl_media_set_artist (GrlMedia *media
,const gchar *artist
);
Set the artist of the media
Since: 0.3.0
void grl_media_set_author (GrlMedia *media
,const gchar *author
);
Set the media's author
Since: 0.1.4
void grl_media_set_bitrate (GrlMedia *media
,gint bitrate
);
Set the bitrate of the media
Since: 0.3.0
void grl_media_set_camera_model (GrlMedia *media
,const gchar *camera_model
);
Set the camera_model of the media
Since: 0.3.0
void grl_media_set_certificate (GrlMedia *media
,const gchar *certificate
);
Set the media's first age certification.
This should usually be the media's most relevant
age certificate. Use grl_media_set_region_data()
to
set other age certificates.
Since: 0.1.6
void grl_media_set_childcount (GrlMedia *media
,gint childcount
);
Sets the number of children of this container. Use GRL_METADATA_KEY_CHILDCOUNT_UNKNOWN if it is unknown.
Since: 0.3.0
void grl_media_set_creation_date (GrlMedia *media
,const GDateTime *creation_date
);
Set the creation_date of the media
Since: 0.2.0
void grl_media_set_description (GrlMedia *media
,const gchar *description
);
Set the media's description
Since: 0.1.4
void grl_media_set_director (GrlMedia *media
,const gchar *director
);
Sets the director of the media.
Since: 0.3.0
void grl_media_set_duration (GrlMedia *media
,gint duration
);
Set the media's duration
Since: 0.1.4
void grl_media_set_episode (GrlMedia *media
,gint episode
);
Sets the episode number of the media
Since: 0.3.0
void grl_media_set_episode_title (GrlMedia *media
,const gchar *episode_title
);
Sets the title of an media
Since: 0.3.0
void grl_media_set_exposure_time (GrlMedia *media
,gfloat exposure_time
);
Set the exposure_time of the media
Since: 0.3.0
void grl_media_set_external_player (GrlMedia *media
,const gchar *player
);
Set the location of a player for the media (usually a flash player)
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
Since: 0.1.6
void grl_media_set_favourite (GrlMedia *media
,gboolean favourite
);
Set if the media is favourite or not
Since: 0.2.3
void grl_media_set_flash_used (GrlMedia *media
,const gchar *flash_used
);
Set the flash_used of the media See http://library.gnome.org/devel/ontology/unstable/nmm-classes.htmlnmm-Flash
Since: 0.3.0
void grl_media_set_framerate (GrlMedia *media
,gfloat framerate
);
Set the framerate of the media
Since: 0.3.0
void grl_media_set_genre (GrlMedia *media
,const gchar *genre
);
Set the genre of the media
Since: 0.3.0
void grl_media_set_height (GrlMedia *media
,gint height
);
Set the height of the media
Since: 0.3.0
void grl_media_set_id (GrlMedia *media
,const gchar *id
);
Set the media identifier
Since: 0.1.4
void grl_media_set_iso_speed (GrlMedia *media
,gfloat iso_speed
);
Set the iso_speed of the media
Since: 0.3.0
void grl_media_set_keyword (GrlMedia *media
,const gchar *keyword
);
Sets the keyword describing the media
.
Since: 0.2.3
void grl_media_set_last_played (GrlMedia *media
,const GDateTime *last_played
);
Set the media last played date
Since: 0.3.0
void grl_media_set_last_position (GrlMedia *media
,gint last_position
);
Set the media last played position
Since: 0.1.4
void grl_media_set_license (GrlMedia *media
,const gchar *license
);
Set the media license
Since: 0.1.6
void grl_media_set_lyrics (GrlMedia *media
,const gchar *lyrics
);
Set the lyrics of the media
Since: 0.3.0
void grl_media_set_mb_album_id (GrlMedia *media
,const gchar *mb_album_id
);
Set the MusicBrainz album identifier of the media
Since: 0.3.0
void grl_media_set_mb_artist_id (GrlMedia *media
,const gchar *mb_artist_id
);
Set the MusicBrainz artist identifier of the media
Since: 0.3.0
void grl_media_set_mb_recording_id (GrlMedia *media
,const gchar *mb_recording_id
);
Set the MusicBrainz recording identifier of the media
Since: 0.3.0
void grl_media_set_mb_track_id (GrlMedia *media
,const gchar *mb_track_id
);
Set the MusicBrainz track identifier of the media
Since: 0.3.0
void grl_media_set_mime (GrlMedia *media
,const gchar *mime
);
Set the media's mime-type
Since: 0.1.4
void grl_media_set_modification_date (GrlMedia *media
,const GDateTime *modification_date
);
Set the modification date of the media
Since: 0.2.0
void grl_media_set_original_title (GrlMedia *media
,const gchar *original_title
);
Sets the original, untranslated title of the media.
Since: 0.3.0
void grl_media_set_orientation (GrlMedia *media
,gint orientation
);
Set the orientation of the media
Since: 0.3.0
void grl_media_set_performer (GrlMedia *media
,const gchar *performer
);
Sets the actor performing in the movie.
Since: 0.3.0
void grl_media_set_producer (GrlMedia *media
,const gchar *producer
);
Sets the producer of the media.
Since: 0.3.0
void grl_media_set_play_count (GrlMedia *media
,gint play_count
);
Set the media play count
Since: 0.1.4
void grl_media_set_publication_date (GrlMedia *media
,const GDateTime *date
);
Set the publication date of media
.
Since: 0.2.0
void grl_media_set_rating (GrlMedia *media
,gfloat rating
,gfloat max
);
This method receives a rating and its scale and normalizes it on a scale from 0...5 to match the usual five-star rating.
Since: 0.1.5
void grl_media_set_region (GrlMedia *media
,const gchar *region
);
Sets the region
where media
was published.
Since: 0.2.3
void grl_media_set_region_data (GrlMedia *media
,const gchar *region
,const GDateTime *publication_date
,const gchar *certificate
);
Sets regional publication and certification information for region
.
media |
a GrlMedia |
|
region |
the region's ISO-3166-1 code |
|
publication_date |
the publication date |
|
certificate |
the age certification |
Since: 0.2.3
void grl_media_set_season (GrlMedia *media
,gint season
);
Sets the season number of the media
Since: 0.3.0
void grl_media_set_show (GrlMedia *media
,const gchar *show
);
Sets the show title of the media
Since: 0.3.0
void grl_media_set_site (GrlMedia *media
,const gchar *site
);
Set the media's site. A site is a website about the media such as a studio's promotional website for a movie.
Since: 0.1.4
void grl_media_set_source (GrlMedia *media
,const gchar *source
);
Set the media's source
Since: 0.1.4
void grl_media_set_studio (GrlMedia *media
,const gchar *studio
);
Set the media studio
Since: 0.1.6
void grl_media_set_thumbnail (GrlMedia *media
,const gchar *thumbnail
);
Set the media's thumbnail URL
Since: 0.1.4
void grl_media_set_thumbnail_binary (GrlMedia *media
,const guint8 *thumbnail
,gsize size
);
Set the media's binary thumbnail
Since: 0.1.9
void grl_media_set_title (GrlMedia *media
,const gchar *title
);
Set the media's title
Since: 0.1.4
void grl_media_set_track_number (GrlMedia *media
,gint track_number
);
Set the track number of the media
Since: 0.3.0
void grl_media_set_url (GrlMedia *media
,const gchar *url
);
Set the media's URL
Since: 0.1.4
void grl_media_set_url_data (GrlMedia *media
,const gchar *url
,const gchar *mime
,gint bitrate
,gfloat framerate
,gint width
,gint height
);
Sets all the keys related with the URL of a media resource in one go.
media |
a GrlMedia |
|
url |
the media's URL |
|
mime |
the |
|
bitrate |
the |
|
framerate |
media framerate, or -1 to ignore |
|
width |
media width, or -1 to ignore |
|
height |
media height, or -1 to ignore |
Since: 0.3.0
void grl_media_set_size (GrlMedia *media
,gint64 size
);
Set the size of the media
Since: 0.2.10
void grl_media_set_width (GrlMedia *media
,gint width
);
Set the width of the media
Since: 0.3.0
GrlMedia *
grl_media_unserialize (const gchar *serial
);
Unserializes a GrlMedia.
Since: 0.1.6
“media-type”
property“media-type” GrlMediaType
Type of media.
Flags: Read / Write / Construct
Default value: GRL_MEDIA_TYPE_UNKNOWN