## PtMediaInfo

PtMediaInfo — Provides metadata for the current track

## Functions

gchar * | pt_media_info_get_album ()
GStrv | pt_media_info_get_artist ()
gchar * | pt_media_info_get_title ()
gchar * | pt_media_info_dump_caps ()
gchar * | pt_media_info_dump_tags ()

## Signals

void | media-info-changed | Run Last

## Object Hierarchy

        GObject
        ╰── PtMediaInfo

## Includes

    #include <parlatype/parlatype.h>

## Description

A read-only object that is owned by PtPlayer and provides metadata for the currently playing track, like title or artist.

Call `pt_player_get_media_info()` to obtain the object and query the current track’s metadata.

Whenever metadata changes, a signal “media-info-changed” is emitted.

## Functions

### pt_media_info_get_album ()

    gchar *
    pt_media_info_get_album (PtMediaInfo *self);

Gets the album’s name.

#### Parameters

self | a PtMediaInfo |

#### Returns

the album’s name or NULL.

[transfer none][nullable]

Since: 4.3

### pt_media_info_get_artist ()

    GStrv
    pt_media_info_get_artist (PtMediaInfo *self);

Gets the track’s artists.

#### Parameters

self | a PtMediaInfo |

#### Returns

the tracks’s artists as a NULL-terminated array or NULL.

[transfer none][nullable]

Since: 4.3

### pt_media_info_get_title ()

    gchar *
    pt_media_info_get_title (PtMediaInfo *self);

Gets the track’s title.

#### Parameters

self | a PtMediaInfo |

#### Returns

the track’s title or NULL.

[transfer none][nullable]

Since: 4.3

### pt_media_info_dump_caps ()

    gchar *
    pt_media_info_dump_caps (PtMediaInfo *self);

Returns a string with all available GstCaps in the current track, even those without a getter method in PtMediaInfo. This is meant for debug purposes.

#### Parameters

self | a PtMediaInfo |

#### Returns

multiline string with all caps or NULL. After use free with `g_free()`.

[transfer full]

Since: 4.3

### pt_media_info_dump_tags ()

    gchar *
    pt_media_info_dump_tags (PtMediaInfo *self);

Returns a string with all available GstTags in the current track, even those without a getter method in PtMediaInfo. This is meant for debug purposes.

#### Parameters

self | a PtMediaInfo |

#### Returns

multiline string with all tags or NULL. After use free with `g_free()`.

[transfer full]

Since: 4.3

## Signal Details

### The `“media-info-changed”` signal

    void
    user_function (PtMediaInfo *self,
                   gpointer     user_data)

Emitted when the player has updated the metadata of the current stream. This will typically happen just after opening a stream.

Call pt_media_info_get_<artist|title|etc.>() to query the updated metadata.

#### Parameters

self | the player emitting the signal |
user_data | user data set when the signal handler was connected. |

Flags: Run Last