Grl.Media¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/c |
Type of media |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class Grl.Media(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod audio_new()¶
- Returns:
a newly-allocated media audio.
- Return type:
Creates a new media audio object.
New in version 0.1.4.
- classmethod container_new()¶
- Returns:
a newly-allocated media container.
- Return type:
Creates a new media container object.
New in version 0.3.0.
- classmethod image_new()¶
- Returns:
a newly-allocated media image.
- Return type:
Creates a new media image object.
New in version 0.1.4.
- classmethod new()¶
- Returns:
a newly-allocated data media.
- Return type:
Creates a new data media object.
- classmethod unserialize(serial)¶
-
Unserializes a
Grl.Media
.New in version 0.1.6.
- classmethod video_new()¶
- Returns:
a newly-allocated media video.
- Return type:
Creates a new media video object.
New in version 0.1.4.
- add_artist(artist)¶
- Parameters:
artist (
str
) – an audio’s artist
Adds a new artist to self.
New in version 0.3.0.
- add_author(author)¶
- Parameters:
author (
str
) – an author for self
Adds a new author to self.
New in version 0.1.10.
- add_director(director)¶
- Parameters:
director (
str
) – director of the movie
Adds the director of the media
New in version 0.3.0.
- add_external_player(player)¶
- Parameters:
player (
str
) – an external player for self
Adds a new external player to self.
New in version 0.1.10.
- add_external_url(url)¶
- Parameters:
url (
str
) – an external url for self
Adds a new external url to self.
New in version 0.1.10.
- add_genre(genre)¶
- Parameters:
genre (
str
) – an audio’s genre
Adds a new genre to self.
New in version 0.3.0.
- add_keyword(keyword)¶
- Parameters:
keyword (
str
) – a keyword describing the media
Adds the keyword describing the self.
New in version 0.2.3.
- add_lyrics(lyrics)¶
- Parameters:
lyrics (
str
) – an audio’s lyrics
Adds a new lyrics to self.
New in version 0.3.0.
- add_mb_artist_id(mb_artist_id)¶
- Parameters:
mb_artist_id (
str
) – a MusicBrainz artist identifier
Adds a new MusicBrainz artist id to self.
New in version 0.3.0.
- add_performer(performer)¶
- Parameters:
performer (
str
) – an actor performing in the movie
Adds the actor performing in the movie.
New in version 0.3.0.
- add_producer(producer)¶
- Parameters:
producer (
str
) – producer of the movie
Adds the producer of the media.
New in version 0.3.0.
- add_region_data(region, publication_date, certificate)¶
- Parameters:
region (
str
) – the region’s ISO-3166-1 codepublication_date (
GLib.DateTime
) – the publication datecertificate (
str
) – the age certification
Adds regional publication and certification information for region.
New in version 0.2.3.
- add_thumbnail(thumbnail)¶
- Parameters:
thumbnail (
str
) – a thumbnail for self
Adds a new thumbnail to self.
New in version 0.1.10.
- add_thumbnail_binary(thumbnail, size)¶
- Parameters:
Adds a new thumbnail to self.
New in version 0.1.10.
- add_url_data(url, mime, bitrate, framerate, width, height)¶
- Parameters:
Sets all the keys related with the URL of a media resource and adds it to self (useful for resources with more than one URL).
New in version 0.3.0.
- get_album_artist()¶
- Returns:
the main artist of the album of the media
- Return type:
New in version 0.3.1.
- get_album_disc_number()¶
- Returns:
the disc number of the media for multi-disc album sets.
- Return type:
New in version 0.3.1.
- get_artist_nth(index)¶
- Parameters:
index (
int
) – element to retrieve, starting at 0- Returns:
the n-th artist of the media
- Return type:
New in version 0.3.0.
- get_author_nth(index)¶
-
New in version 0.1.10.
- get_camera_model()¶
- Returns:
model of camera used to take picture
- Return type:
New in version 0.3.0.
- get_certificate()¶
- Returns:
the media’s age certification
- Return type:
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.New in version 0.1.6.
- get_childcount()¶
- Returns:
number of children, or
Grl.METADATA_KEY_CHILDCOUNT_UNKNOWN
if unknown.- Return type:
Number of children of this container.
New in version 0.3.0.
- get_composer_nth(index)¶
- Parameters:
index (
int
) – element to retrieve, starting at 0- Returns:
the n-th composer of the media
- Return type:
New in version 0.3.1.
- get_creation_date()¶
- Returns:
date when media was created (owned by self).
- Return type:
New in version 0.2.0.
- get_director()¶
- Returns:
the director of the movie (owned by self).
- Return type:
New in version 0.3.0.
- get_director_nth(index)¶
- Parameters:
index (
int
) – element to retrieve- Returns:
the director of the movie (owned by self).
- Return type:
New in version 0.3.0.
- get_external_url()¶
- Returns:
URL of an external location where the user play the media.
- Return type:
New in version 0.1.6.
- get_external_url_nth(index)¶
- Parameters:
index (
int
) – element to retrieve- Returns:
the n-th media’s external location where the user can play it.
- Return type:
New in version 0.1.10.
- get_favourite()¶
- Returns:
whether the media is favourite or not
- Return type:
New in version 0.2.3.
- get_flash_used()¶
- Returns:
whether the flash was used.
See http://library.gnome.org/devel/ontology/unstable/nmm-classes.html#nmm-Flash
- Return type:
New in version 0.3.0.
- get_genre_nth(index)¶
- Parameters:
index (
int
) – element to retrieve, starting at 0- Returns:
the n-th genre of the media
- Return type:
New in version 0.3.0.
- get_keyword()¶
- Returns:
the keyword describing the self (owned by self).
- Return type:
New in version 0.2.3.
- get_keyword_nth(index)¶
- Parameters:
index (
int
) – element to retrieve- Returns:
the keyword describing the self (owned by self).
- Return type:
New in version 0.2.3.
- get_last_played()¶
- Returns:
the media’s last played time
- Return type:
New in version 0.3.0.
- get_last_position()¶
- Returns:
the media’s last_played position (in seconds)
- Return type:
New in version 0.1.4.
- get_lyrics_nth(index)¶
- Parameters:
index (
int
) – element to retrieve, starting at 0- Returns:
the n-th lyrics of the media
- Return type:
New in version 0.3.0.
- get_mb_album_id()¶
- Returns:
the MusicBrainz album identifier
- Return type:
New in version 0.3.0.
Deprecated since version 0.3.8: in favor of more specific metadata-keys
Grl.METADATA_KEY_MB_RELEASE_ID
andGrl.METADATA_KEY_MB_RELEASE_GROUP_ID
- get_mb_artist_id()¶
- Returns:
the MusicBrainz artist identifier
- Return type:
New in version 0.3.0.
- get_mb_artist_id_nth(index)¶
- Parameters:
index (
int
) – element to retrieve, starting at 0- Returns:
the n-th MusicBrainz artist identifier of the media
- Return type:
New in version 0.3.0.
- get_mb_recording_id()¶
- Returns:
the MusicBrainz recording identifier
- Return type:
New in version 0.3.0.
- get_mb_release_group_id()¶
- Returns:
the MusicBrainz release group identifier of the media
- Return type:
New in version 0.3.8.
- get_mb_release_id()¶
- Returns:
the MusicBrainz release identifier of the media
- Return type:
New in version 0.3.8.
- get_media_type()¶
- Returns:
media type
- Return type:
Gets the “media-type” property.
New in version 0.3.0.
- get_modification_date()¶
- Returns:
date when the media was last modified (owned by self).
- Return type:
New in version 0.2.0.
- get_orientation()¶
- Returns:
degrees clockwise orientation of the picture
- Return type:
New in version 0.3.0.
- get_original_title()¶
- Returns:
the original, untranslated title of the movie (owned by self).
- Return type:
New in version 0.3.0.
- get_performer()¶
- Returns:
the actor performing in the movie (owned by self).
- Return type:
New in version 0.3.0.
- get_performer_nth(index)¶
- Parameters:
index (
int
) – element to retrieve- Returns:
the actor performing in the movie (owned by medi).
- Return type:
New in version 0.3.0.
- get_player()¶
- Returns:
URL of an external player object for this media
- Return type:
New in version 0.1.6.
- get_player_nth(index)¶
- Parameters:
index (
int
) – element to retrieve- Returns:
the n-th media’s external player object.
- Return type:
New in version 0.1.10.
- get_producer()¶
- Returns:
the producer of the movie (owned by self).
- Return type:
New in version 0.3.0.
- get_producer_nth(index)¶
- Parameters:
index (
int
) – element to retrieve- Returns:
the producer of the movie (owned by self).
- Return type:
New in version 0.3.0.
- get_publication_date()¶
- Returns:
the publication date of self (owned by self).
- Return type:
New in version 0.2.0.
- get_region()¶
- Returns:
the ISO-3166-1 of the region where the media was published (owned by self).
- Return type:
New in version 0.2.3.
- get_region_data()¶
- Returns:
the ISO-3166-1 of the region where the media was published (owned by self).
- Return type:
(
str
, publication_date:GLib.DateTime
, certificate:str
)
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.New in version 0.2.3.
- get_region_data_nth(index)¶
- Parameters:
index (
int
) – element to retrieve- Returns:
the ISO-3166-1 of the region where the media was published (owned by self).
- Return type:
(
str
, publication_date:GLib.DateTime
, certificate:str
)
Returns the media’s age certificate and publication date for one region. Use
Grl.Data.length
() withGrl.METADATA_KEY_REGION
to discover how many regions are available. For instance: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); ... }
New in version 0.2.3.
- get_size()¶
- Returns:
the media’s size, in bytes or -1 if unknown.
- Return type:
New in version 0.2.10.
- get_start_time()¶
- Returns:
the start time of the logical media resource inside the file containing it, in seconds.
- Return type:
New in version 0.1.19.
- get_thumbnail_binary(size)¶
- Parameters:
size (
int
) – pointer to storing the thumbnail buffer size- Returns:
the media’s thumbnail data and set size to the thumbnail buffer size
- Return type:
New in version 0.1.9.
- get_thumbnail_binary_nth(size, index)¶
- Parameters:
- Returns:
the n-th media’s thumbnail binary and sets size to the thumbnail buffer size.
- Return type:
New in version 0.1.10.
- get_thumbnail_nth(index)¶
-
New in version 0.1.10.
- get_url_data(framerate, width, height)¶
- Parameters:
- Returns:
the media’s URL and its related properties.
- Return type:
New in version 0.3.0.
- get_url_data_nth(index, framerate, width, height)¶
- Parameters:
- Returns:
the n-th media’s URL and its related properties.
- Return type:
New in version 0.3.0.
- is_audio()¶
-
Check if self is an audio
New in version 0.3.0.
- is_container()¶
-
Check if self is a container
New in version 0.3.0.
- is_image()¶
-
Check if self is an image
New in version 0.3.0.
- is_video()¶
-
Check if self is a video
New in version 0.3.0.
- serialize()¶
- Returns:
serialized media
- Return type:
Serializes a
Grl.Media
into a string. It does a basic serialization.See grl_media_serialize_extended() to get more serialization approaches.
New in version 0.1.6.
- set_album(album)¶
- Parameters:
album (
str
) – the audio’s album
Set the album of the media
New in version 0.3.0.
- set_album_artist(album_artist)¶
- Parameters:
album_artist (
str
) – the audio’s album main artist
Set the main artist of the album of the media
New in version 0.3.1.
- set_album_disc_number(disc_number)¶
- Parameters:
disc_number (
int
) – the disc number within an album
Set the disc number of the media for multi-disc album sets.
New in version 0.3.1.
- set_artist(artist)¶
- Parameters:
artist (
str
) – the audio’s artist
Set the artist of the media
New in version 0.3.0.
- set_author(author)¶
- Parameters:
author (
str
) – the media’s author
Set the media’s author
New in version 0.1.4.
- set_bitrate(bitrate)¶
- Parameters:
bitrate (
int
) – the audio’s bitrate
Set the bitrate of the media
New in version 0.3.0.
- set_camera_model(camera_model)¶
- Parameters:
camera_model (
str
) – model of camera used to take picture
Set the camera_model of the media
New in version 0.3.0.
- set_certificate(certificate)¶
- Parameters:
certificate (
str
) – The age certificate of the media
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.New in version 0.1.6.
- set_childcount(childcount)¶
- Parameters:
childcount (
int
) – number of children
Sets the number of children of this container. Use
Grl.METADATA_KEY_CHILDCOUNT_UNKNOWN
if it is unknown.New in version 0.3.0.
- set_composer(composer)¶
- Parameters:
composer (
str
) – the audio’s composer
Set the composer of the media
New in version 0.3.1.
- set_creation_date(creation_date)¶
- Parameters:
creation_date (
GLib.DateTime
) – date when media was created
Set the creation_date of the media
New in version 0.2.0.
- set_description(description)¶
- Parameters:
description (
str
) – the description
Set the media’s description
New in version 0.1.4.
- set_director(director)¶
- Parameters:
director (
str
) – director of the movie
Sets the director of the media.
New in version 0.3.0.
- set_duration(duration)¶
- Parameters:
duration (
int
) – the duration in seconds
Set the media’s duration
New in version 0.1.4.
- set_episode(episode)¶
- Parameters:
episode (
int
) – the video’s episode
Sets the episode number of the media
New in version 0.3.0.
- set_episode_title(episode_title)¶
- Parameters:
episode_title (
str
) – the title of the episode
Sets the title of an media
New in version 0.3.0.
- set_exposure_time(exposure_time)¶
- Parameters:
exposure_time (
float
) – picture’s exposure time
Set the exposure_time of the media
New in version 0.3.0.
- set_external_player(player)¶
- Parameters:
player (
str
) – location of an external player for this media
Set the location of a player for the media (usually a flash player)
New in version 0.1.6.
- set_external_url(url)¶
- Parameters:
url (
str
) – external location where this media can be played.
Set an external location where users can play the media
New in version 0.1.6.
- set_favourite(favourite)¶
- Parameters:
favourite (
bool
) – whether the item is favourite or not
Set if the media is favourite or not
New in version 0.2.3.
- set_flash_used(flash_used)¶
- Parameters:
flash_used (
str
) – whether the flash was used
Set the flash_used of the media See http://library.gnome.org/devel/ontology/unstable/nmm-classes.html#nmm-Flash
New in version 0.3.0.
- set_framerate(framerate)¶
- Parameters:
framerate (
float
) – the video’s framerate
Set the framerate of the media
New in version 0.3.0.
- set_genre(genre)¶
- Parameters:
genre (
str
) – the audio’s genre
Set the genre of the media
New in version 0.3.0.
- set_height(height)¶
- Parameters:
height (
int
) – the video’s height
Set the height of the media
New in version 0.3.0.
- set_id(id)¶
- Parameters:
id (
str
) – the identifier of the media
Set the media identifier
New in version 0.1.4.
- set_iso_speed(iso_speed)¶
- Parameters:
iso_speed (
float
) – picture’s iso speed
Set the iso_speed of the media
New in version 0.3.0.
- set_keyword(keyword)¶
- Parameters:
keyword (
str
) – a keyword describing the media
Sets the keyword describing the self.
New in version 0.2.3.
- set_last_played(last_played)¶
- Parameters:
last_played (
GLib.DateTime
) – date when the media was last played
Set the media last played date
New in version 0.3.0.
- set_last_position(last_position)¶
- Parameters:
last_position (
int
) – second at which the media playback was interrupted
Set the media last played position
New in version 0.1.4.
- set_license(license)¶
- Parameters:
license (
str
) – The license of the media
Set the media license
New in version 0.1.6.
- set_lyrics(lyrics)¶
- Parameters:
lyrics (
str
) – the audio’s lyrics
Set the lyrics of the media
New in version 0.3.0.
- set_mb_album_id(mb_album_id)¶
- Parameters:
mb_album_id (
str
) – the MusicBrainz album identifier
Set the MusicBrainz album identifier of the media
New in version 0.3.0.
Deprecated since version 0.3.8: in favor of more specific metadata-keys
Grl.METADATA_KEY_MB_RELEASE_ID
andGrl.METADATA_KEY_MB_RELEASE_GROUP_ID
- set_mb_artist_id(mb_artist_id)¶
- Parameters:
mb_artist_id (
str
) – the MusicBrainz artist identifier
Set the MusicBrainz artist identifier of the media
New in version 0.3.0.
- set_mb_recording_id(mb_recording_id)¶
- Parameters:
mb_recording_id (
str
) – the MusicBrainz recording identifier
Set the MusicBrainz recording identifier of the media
New in version 0.3.0.
- set_mb_release_group_id(mb_release_group_id)¶
- Parameters:
mb_release_group_id (
str
) – Album group release identifier in MusicBrainz
Set the MusicBrainz Release Group identifier of the media
New in version 0.3.8.
- set_mb_release_id(mb_release_id)¶
- Parameters:
mb_release_id (
str
) – Album release identifier in MusicBrainz
Set the MusicBrainz release identifier of the media
New in version 0.3.8.
- set_mb_track_id(mb_track_id)¶
- Parameters:
mb_track_id (
str
) – the MusicBrainz track identifier
Set the MusicBrainz track identifier of the media
New in version 0.3.0.
- set_mime(mime)¶
- Parameters:
mime (
str
) – the mime type
Set the media’s mime-type
New in version 0.1.4.
- set_modification_date(modification_date)¶
- Parameters:
modification_date (
GLib.DateTime
) – date when the media was last modified
Set the modification date of the media
New in version 0.2.0.
- set_orientation(orientation)¶
- Parameters:
orientation (
int
) – degrees clockwise orientation of the picture
Set the orientation of the media
New in version 0.3.0.
- set_original_title(original_title)¶
- Parameters:
original_title (
str
) – original, untranslated title of the movie
Sets the original, untranslated title of the media.
New in version 0.3.0.
- set_performer(performer)¶
- Parameters:
performer (
str
) – an actor performing in the movie
Sets the actor performing in the movie.
New in version 0.3.0.
- set_play_count(play_count)¶
- Parameters:
play_count (
int
) – the play count
Set the media play count
New in version 0.1.4.
- set_producer(producer)¶
- Parameters:
producer (
str
) – producer of the movie
Sets the producer of the media.
New in version 0.3.0.
- set_publication_date(date)¶
- Parameters:
date (
GLib.DateTime
) – the date
Set the publication date of self.
New in version 0.2.0.
- set_rating(rating, 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.
New in version 0.1.5.
- set_region(region)¶
- Parameters:
region (
str
) – the region’s ISO-3166-1 code
Sets the region where self was published.
New in version 0.2.3.
- set_region_data(region, publication_date, certificate)¶
- Parameters:
region (
str
) – the region’s ISO-3166-1 codepublication_date (
GLib.DateTime
) – the publication datecertificate (
str
) – the age certification
Sets regional publication and certification information for region.
New in version 0.2.3.
- set_season(season)¶
- Parameters:
season (
int
) – the video’s season
Sets the season number of the media
New in version 0.3.0.
- set_show(show)¶
- Parameters:
show (
str
) – the video’s show name
Sets the show title of the media
New in version 0.3.0.
- set_site(site)¶
- Parameters:
site (
str
) – the site
Set the media’s site. A site is a website about the media such as a studio’s promotional website for a movie.
New in version 0.1.4.
- set_size(size)¶
- Parameters:
size (
int
) – the size in bytes
Set the size of the media
New in version 0.2.10.
- set_source(source)¶
- Parameters:
source (
str
) – the source
Set the media’s source
New in version 0.1.4.
- set_studio(studio)¶
- Parameters:
studio (
str
) – The studio the media is from
Set the media studio
New in version 0.1.6.
- set_thumbnail(thumbnail)¶
- Parameters:
thumbnail (
str
) – the thumbnail URL
Set the media’s thumbnail URL
New in version 0.1.4.
- set_thumbnail_binary(thumbnail, size)¶
-
Set the media’s binary thumbnail
New in version 0.1.9.
- set_track_number(track_number)¶
- Parameters:
track_number (
int
) – the audio’s track number
Set the track number of the media
New in version 0.3.0.
- set_url_data(url, mime, bitrate, framerate, width, height)¶
- Parameters:
Sets all the keys related with the URL of a media resource in one go.
New in version 0.3.0.
Property Details¶
- Grl.Media.props.media_type¶
- Name:
media-type
- Type:
- Default Value:
- Flags:
Type of media