## XplayerObject XplayerObject — main Xplayer object |

## Stability Level

Unstable, unless otherwise indicated

## Functions

void | xplayer_object_plugins_init ()
void | xplayer_object_plugins_shutdown ()
void | xplayer_file_opened ()
void | xplayer_file_closed ()
void | xplayer_metadata_updated ()
void | xplayer_object_action_error ()
void | xplayer_object_action_exit ()
void | xplayer_object_add_to_playlist_and_play ()
void | xplayer_object_action_play ()
void | xplayer_object_action_play_pause ()
void | xplayer_action_pause ()
void | xplayer_object_action_stop ()
void | xplayer_action_fullscreen ()
void | xplayer_object_action_fullscreen_toggle ()
void | xplayer_object_action_next ()
void | xplayer_object_action_previous ()
void | xplayer_action_next_angle ()
gboolean | xplayer_object_action_remote_get_setting ()
void | xplayer_object_action_remote_set_setting ()
void | xplayer_object_action_seek_time ()
void | xplayer_action_seek_relative ()
void | xplayer_object_action_volume ()
void | xplayer_action_volume_relative ()
void | xplayer_action_volume_toggle_mute ()
void | xplayer_action_toggle_aspect_ratio ()
int | xplayer_action_get_aspect_ratio ()
void | xplayer_action_set_aspect_ratio ()
void | xplayer_action_toggle_controls ()
void | xplayer_action_set_scale_ratio ()
void | xplayer_action_set_playlist_index ()
void | xplayer_object_action_remote ()
gboolean | xplayer_is_fullscreen ()
gboolean | xplayer_object_is_playing ()
gboolean | xplayer_object_is_paused ()
gboolean | xplayer_object_is_seekable ()
GtkWindow * | xplayer_object_get_main_window ()
GtkUIManager * | xplayer_object_get_ui_manager ()
char * | xplayer_object_get_current_mrl ()
GtkWidget * | xplayer_object_get_video_widget ()
gint64 | xplayer_get_current_time ()
void | xplayer_object_set_current_subtitle ()
guint | xplayer_object_get_playlist_length ()
int | xplayer_object_get_playlist_pos ()
char * | xplayer_object_get_title_at_playlist_pos ()
char * | xplayer_get_short_title ()
double | xplayer_object_get_volume ()
char * | xplayer_object_get_version ()
void | xplayer_object_add_sidebar_page ()
void | xplayer_object_remove_sidebar_page ()
const gchar * const * | xplayer_object_get_supported_content_types ()
const gchar * const * | xplayer_object_get_supported_uri_schemes ()

## Properties

gchar * | current-content-type | Read
gchar * | current-display-name | Read
gchar * | current-mrl | Read
gint64 | current-time | Read
gboolean | fullscreen | Read
gboolean | playing | Read
gboolean | remember-position | Read / Write
gboolean | seekable | Read
gint64 | stream-length | Read

## Signals

void | file-closed | Run Last
void | file-has-played | Run Last
void | file-opened | Run Last
gchar* | get-text-subtitle | Run Last
gchar* | get-user-agent | Run Last
void | metadata-updated | Run Last

## Types and Values

typedef | Xplayer
| XplayerObject
enum | XplayerRemoteCommand
enum | XplayerRemoteSetting
#define | XPLAYER_GSETTINGS_SCHEMA

## Object Hierarchy

        GObject
        ╰── GApplication
            ╰── GtkApplication
                ╰── XplayerObject

## Implemented Interfaces

XplayerObject implements GActionGroup and GActionMap.

## Includes

    #include <xplayer.h>

## Description

XplayerObject is the core object of Xplayer; a singleton which controls all Xplayer's main functions.

## Functions

### xplayer_object_plugins_init ()

    void
    xplayer_object_plugins_init (XplayerObject *xplayer);

Initialises the plugin engine and activates all the enabled plugins.

#### Parameters

xplayer | a XplayerObject |

### xplayer_object_plugins_shutdown ()

    void
    xplayer_object_plugins_shutdown (XplayerObject *xplayer);

Shuts down the plugin engine and deactivates all the plugins.

#### Parameters

xplayer | a XplayerObject |

### xplayer_file_opened ()

    void
    xplayer_file_opened (XplayerObject *xplayer,
                         const char *mrl);

Emits the “file-opened” signal on `xplayer` , with the specified `mrl` .

#### Parameters

xplayer | a XplayerObject |
mrl | the MRL opened |

### xplayer_file_closed ()

    void
    xplayer_file_closed (XplayerObject *xplayer);

Emits the “file-closed” signal on `xplayer` .

#### Parameters

xplayer | a XplayerObject |

### xplayer_metadata_updated ()

    void
    xplayer_metadata_updated (XplayerObject *xplayer,
                              const char *artist,
                              const char *title,
                              const char *album,
                              guint track_num);

Emits the “metadata-updated” signal on `xplayer` , with the specified stream data.

#### Parameters

xplayer | a XplayerObject |
artist | the stream's artist, or `NULL` |
title | the stream's title, or `NULL` |
album | the stream's album, or `NULL` |
track_num | the track number of the stream |

### xplayer_object_action_error ()

    void
    xplayer_object_action_error (XplayerObject *xplayer,
                                 const char *title,
                                 const char *reason);

Displays a non-blocking error dialog with the given `title` and `reason` .

#### Parameters

xplayer | a XplayerObject |
title | the error dialog title |
reason | the error dialog text |

### xplayer_object_action_exit ()

    void
    xplayer_object_action_exit (XplayerObject *xplayer);

Closes Xplayer.

#### Parameters

xplayer | a XplayerObject |

### xplayer_object_add_to_playlist_and_play ()

    void
    xplayer_object_add_to_playlist_and_play
                                   (XplayerObject *xplayer,
                                    const char *uri,
                                    const char *display_name);

Add `uri` to the playlist and play it immediately.

#### Parameters

xplayer | a XplayerObject |
uri | the URI to add to the playlist |
display_name | the display name of the URI |

### xplayer_object_action_play ()

    void
    xplayer_object_action_play (XplayerObject *xplayer);

Plays the current stream. If Xplayer is already playing, it continues to play. If the stream cannot be played, and error dialog is displayed.

#### Parameters

xplayer | a XplayerObject |

### xplayer_object_action_play_pause ()

    void
    xplayer_object_action_play_pause (XplayerObject *xplayer);

Gets the current MRL from the playlist and attempts to play it. If the stream is already playing, playback is paused.

#### Parameters

xplayer | a XplayerObject |

### xplayer_action_pause ()

    void
    xplayer_action_pause (XplayerObject *xplayer);

Pauses the current stream. If Xplayer is already paused, it continues to be paused.

#### Parameters

xplayer | a XplayerObject |

### xplayer_object_action_stop ()

    void
    xplayer_object_action_stop (XplayerObject *xplayer);

Stops the current stream.

#### Parameters

xplayer | a XplayerObject |

### xplayer_action_fullscreen ()

    void
    xplayer_action_fullscreen (XplayerObject *xplayer,
                               gboolean state);

Sets Xplayer's fullscreen state according to `state` .

#### Parameters

xplayer | a XplayerObject |
state | `TRUE` if Xplayer should be fullscreened |

### xplayer_object_action_fullscreen_toggle ()

    void
    xplayer_object_action_fullscreen_toggle
                                   (XplayerObject *xplayer);

Toggles Xplayer's fullscreen state; if Xplayer is fullscreened, calling this makes it unfullscreened and vice-versa.

#### Parameters

xplayer | a XplayerObject |

### xplayer_object_action_next ()

    void
    xplayer_object_action_next (XplayerObject *xplayer);

If a DVD is being played, goes to the next chapter. If a normal stream is being played, plays the next entry in the playlist.

#### Parameters

xplayer | a XplayerObject |

### xplayer_object_action_previous ()

    void
    xplayer_object_action_previous (XplayerObject *xplayer);

If a DVD is being played, goes to the previous chapter. If a normal stream is being played, goes to the start of the stream if possible. If seeking is not possible, plays the previous entry in the playlist.

#### Parameters

xplayer | a XplayerObject |

### xplayer_action_next_angle ()

    void
    xplayer_action_next_angle (XplayerObject *xplayer);

Switches to the next angle, if watching a DVD. If not watching a DVD, this is a no-op.

#### Parameters

xplayer | a XplayerObject |

### xplayer_object_action_remote_get_setting ()

    gboolean
    xplayer_object_action_remote_get_setting
                                   (XplayerObject *xplayer,
                                    XplayerRemoteSetting setting);

Returns the value of `setting` for this instance of Xplayer.

#### Parameters

xplayer | a XplayerObject |
setting | a XplayerRemoteSetting |

#### Returns

`TRUE` if the setting is enabled, `FALSE` otherwise

### xplayer_object_action_remote_set_setting ()

    void
    xplayer_object_action_remote_set_setting
                                   (XplayerObject *xplayer,
                                    XplayerRemoteSetting setting,
                                    gboolean value);

Sets `setting` to `value` on this instance of Xplayer.

#### Parameters

xplayer | a XplayerObject |
setting | a XplayerRemoteSetting |
value | the new value for the setting |

### xplayer_object_action_seek_time ()

    void
    xplayer_object_action_seek_time (XplayerObject *xplayer,
                                     gint64 msec,
                                     gboolean accurate);

Seeks to an absolute time in the stream, or displays an error dialog if that's not possible.

#### Parameters

xplayer | a XplayerObject |
msec | the time to seek to |
accurate | whether to use accurate seek, an accurate seek might be slower for some formats (see GStreamer docs) |

### xplayer_action_seek_relative ()

    void
    xplayer_action_seek_relative (XplayerObject *xplayer,
                                  gint64 offset,
                                  gboolean accurate);

Seeks to an `offset` from the current position in the stream, or displays an error dialog if that's not possible.

#### Parameters

xplayer | a XplayerObject |
offset | the time offset to seek to |
accurate | whether to use accurate seek, an accurate seek might be slower for some formats (see GStreamer docs) |

### xplayer_object_action_volume ()

    void
    xplayer_object_action_volume (XplayerObject *xplayer,
                                  double volume);

Sets the volume, with `1.0` being the maximum, and `0.0` being the minimum level.

#### Parameters

xplayer | a XplayerObject |
volume | the new absolute volume value |

### xplayer_action_volume_relative ()

    void
    xplayer_action_volume_relative (XplayerObject *xplayer,
                                    double off_pct);

Sets the volume relative to its current level, with `1.0` being the maximum, and `0.0` being the minimum level.

#### Parameters

xplayer | a XplayerObject |
off_pct | the value by which to increase or decrease the volume |

### xplayer_action_volume_toggle_mute ()

    void
    xplayer_action_volume_toggle_mute (XplayerObject *xplayer);

Toggles the mute status.

#### Parameters

xplayer | a XplayerObject |

### xplayer_action_toggle_aspect_ratio ()

    void
    xplayer_action_toggle_aspect_ratio (XplayerObject *xplayer);

Toggles the aspect ratio selected in the menu to the next one in the list.

#### Parameters

xplayer | a XplayerObject |

### xplayer_action_get_aspect_ratio ()

    int
    xplayer_action_get_aspect_ratio (XplayerObject *xplayer);

Gets the current aspect ratio as defined in BvwAspectRatio.

#### Parameters

xplayer | a XplayerObject |

#### Returns

the current aspect ratio

### xplayer_action_set_aspect_ratio ()

    void
    xplayer_action_set_aspect_ratio (XplayerObject *xplayer,
                                     int ratio);

Sets the aspect ratio selected in the menu to `ratio` , as defined in BvwAspectRatio.

#### Parameters

xplayer | a XplayerObject |
ratio | the aspect ratio to use |

### xplayer_action_toggle_controls ()

    void
    xplayer_action_toggle_controls (XplayerObject *xplayer);

If Xplayer's not fullscreened, this toggles the state of the "Show Controls" menu entry, and consequently shows or hides the controls in the UI.

#### Parameters

xplayer | a XplayerObject |

### xplayer_action_set_scale_ratio ()

    void
    xplayer_action_set_scale_ratio (XplayerObject *xplayer,
                                    gfloat ratio);

Sets the video scale ratio, as a float where, for example, 1.0 is 1:1 and 2.0 is 2:1.

#### Parameters

xplayer | a XplayerObject |
ratio | the scale ratio to use |

### xplayer_action_set_playlist_index ()

    void
    xplayer_action_set_playlist_index (XplayerObject *xplayer,
                                       guint index);

Sets the `0`-based playlist index to `index` , causing Xplayer to load and start playing that playlist entry.

If `index` is higher than the current length of the playlist, this has the effect of restarting the current playlist entry.

#### Parameters

xplayer | a XplayerObject |
index | the new playlist index |

### xplayer_object_action_remote ()

    void
    xplayer_object_action_remote (XplayerObject *xplayer,
                                  XplayerRemoteCommand cmd,
                                  const char *url);

Executes the specified `cmd` on this instance of Xplayer. If `cmd` is an operation requiring an MRL, `url` is required; it can be `NULL` otherwise.

If Xplayer's fullscreened and the operation is executed correctly, the controls will appear as if the user had moved the mouse.

#### Parameters

xplayer | a XplayerObject |
cmd | a XplayerRemoteCommand |
url | an MRL to play, or `NULL` |

### xplayer_is_fullscreen ()

    gboolean
    xplayer_is_fullscreen (XplayerObject *xplayer);

Returns `TRUE` if Xplayer is fullscreened.

#### Parameters

xplayer | a XplayerObject |

#### Returns

`TRUE` if Xplayer is fullscreened

### xplayer_object_is_playing ()

    gboolean
    xplayer_object_is_playing (XplayerObject *xplayer);

Returns `TRUE` if Xplayer is playing a stream.

#### Parameters

xplayer | a XplayerObject |

#### Returns

`TRUE` if Xplayer is playing a stream

### xplayer_object_is_paused ()

    gboolean
    xplayer_object_is_paused (XplayerObject *xplayer);

Returns `TRUE` if playback is paused.

#### Parameters

xplayer | a XplayerObject |

#### Returns

`TRUE` if playback is paused, `FALSE` otherwise

### xplayer_object_is_seekable ()

    gboolean
    xplayer_object_is_seekable (XplayerObject *xplayer);

Returns `TRUE` if the current stream is seekable.

#### Parameters

xplayer | a XplayerObject |

#### Returns

`TRUE` if the current stream is seekable

### xplayer_object_get_main_window ()

    GtkWindow *
    xplayer_object_get_main_window (XplayerObject *xplayer);

Gets Xplayer's main window and increments its reference count.

#### Parameters

xplayer | a XplayerObject |

#### Returns

Xplayer's main window.

[transfer full]

### xplayer_object_get_ui_manager ()

    GtkUIManager *
    xplayer_object_get_ui_manager (XplayerObject *xplayer);

Gets Xplayer's UI manager, but does not change its reference count.

#### Parameters

xplayer | a XplayerObject |

#### Returns

Xplayer's UI manager.

[transfer none]

### xplayer_object_get_current_mrl ()

    char *
    xplayer_object_get_current_mrl (XplayerObject *xplayer);

Get the MRL of the current stream, or `NULL` if nothing's playing. Free with `g_free()`.

#### Parameters

xplayer | a XplayerObject |

#### Returns

a newly-allocated string containing the MRL of the current stream

### xplayer_object_get_video_widget ()

    GtkWidget *
    xplayer_object_get_video_widget (XplayerObject *xplayer);

Gets Xplayer's video widget and increments its reference count.

#### Parameters

xplayer | a XplayerObject |

#### Returns

Xplayer's video widget.

[transfer full]

### xplayer_get_current_time ()

    gint64
    xplayer_get_current_time (XplayerObject *xplayer);

Gets the current position's time in the stream as a gint64.

#### Parameters

xplayer | a XplayerObject |

#### Returns

the current position in the stream

### xplayer_object_set_current_subtitle ()

    void
    xplayer_object_set_current_subtitle (XplayerObject *xplayer,
                                         const char *subtitle_uri);

Add the `subtitle_uri` subtitle file to the playlist, setting it as the subtitle for the current playlist entry.

#### Parameters

xplayer | a XplayerObject |
subtitle_uri | the URI of the subtitle file to add |

### xplayer_object_get_playlist_length ()

    guint
    xplayer_object_get_playlist_length (XplayerObject *xplayer);

Returns the length of the current playlist.

#### Parameters

xplayer | a XplayerObject |

#### Returns

the playlist length

### xplayer_object_get_playlist_pos ()

    int
    xplayer_object_get_playlist_pos (XplayerObject *xplayer);

Returns the `0`-based index of the current entry in the playlist. If there is no current entry in the playlist, `-1` is returned.

#### Parameters

xplayer | a XplayerObject |

#### Returns

the index of the current playlist entry, or `-1`

### xplayer_object_get_title_at_playlist_pos ()

    char *
    xplayer_object_get_title_at_playlist_pos
                                   (XplayerObject *xplayer,
                                    guint playlist_index);

Gets the title of the playlist entry at `index` .

#### Parameters

xplayer | a XplayerObject |
playlist_index | the `0`-based entry index |

#### Returns

the entry title at `index` , or `NULL`; free with `g_free()`

### xplayer_get_short_title ()

    char *
    xplayer_get_short_title (XplayerObject *xplayer);

Gets the title of the current entry in the playlist.

#### Parameters

xplayer | a XplayerObject |

#### Returns

the current entry's title, or `NULL`; free with `g_free()`

### xplayer_object_get_volume ()

    double
    xplayer_object_get_volume (XplayerObject *xplayer);

Gets the current volume level, as a value between `0.0` and `1.0`.

#### Parameters

xplayer | a XplayerObject |

#### Returns

the volume level

### xplayer_object_get_version ()

    char *
    xplayer_object_get_version (void);

Gets the application name and version (e.g. "Xplayer 2.28.0").

#### Returns

a newly-allocated string of the name and version of the application

### xplayer_object_add_sidebar_page ()

    void
    xplayer_object_add_sidebar_page (XplayerObject *xplayer,
                                     const char *page_id,
                                     const char *title,
                                     GtkWidget *main_widget);

Adds a sidebar page to Xplayer's sidebar with the given `page_id` . `main_widget` is added into the page and shown automatically, while `title` is displayed as the page's title in the tab bar.

#### Parameters

xplayer | a XplayerObject |
page_id | a string used to identify the page |
title | the page's title |
main_widget | the main widget for the page |

### xplayer_object_remove_sidebar_page ()

    void
    xplayer_object_remove_sidebar_page (XplayerObject *xplayer,
                                        const char *page_id);

Removes the page identified by `page_id` from Xplayer's sidebar. If `page_id` doesn't exist in the sidebar, this function does nothing.

#### Parameters

xplayer | a XplayerObject |
page_id | a string used to identify the page |

### xplayer_object_get_supported_content_types ()

    const gchar * const *
    xplayer_object_get_supported_content_types
                                   (void);

Get the full list of file content types which Xplayer supports playing.

#### Returns

a `NULL`-terminated array of the content types Xplayer supports.

[array zero-terminated=1][transfer none]

Since: 3.1.5

### xplayer_object_get_supported_uri_schemes ()

    const gchar * const *
    xplayer_object_get_supported_uri_schemes
                                   (void);

Get the full list of URI schemes which Xplayer supports accessing.

#### Returns

a `NULL`-terminated array of the URI schemes Xplayer supports.

[array zero-terminated=1][transfer none]

Since: 3.1.5

## Types and Values

### Xplayer

    typedef struct _XplayerObject Xplayer;

The Xplayer object is a handy synonym for XplayerObject, and the two can be used interchangably.

### XplayerObject

    typedef struct _XplayerObject XplayerObject;

All the fields in the XplayerObject structure are private and should never be accessed directly.

### enum XplayerRemoteCommand

Represents a command which can be sent to a running Xplayer instance remotely.

#### Members

XPLAYER_REMOTE_COMMAND_UNKNOWN | unknown command |
XPLAYER_REMOTE_COMMAND_PLAY | play the current stream |
XPLAYER_REMOTE_COMMAND_PAUSE | pause the current stream |
XPLAYER_REMOTE_COMMAND_STOP | stop playing the current stream |
XPLAYER_REMOTE_COMMAND_PLAYPAUSE | toggle play/pause on the current stream |
XPLAYER_REMOTE_COMMAND_NEXT | play the next playlist item |
XPLAYER_REMOTE_COMMAND_PREVIOUS | play the previous playlist item |
XPLAYER_REMOTE_COMMAND_SEEK_FORWARD | seek forwards in the current stream |
XPLAYER_REMOTE_COMMAND_SEEK_BACKWARD | seek backwards in the current stream |
XPLAYER_REMOTE_COMMAND_VOLUME_UP | increase the volume |
XPLAYER_REMOTE_COMMAND_VOLUME_DOWN | decrease the volume |
XPLAYER_REMOTE_COMMAND_FULLSCREEN | toggle fullscreen mode |
XPLAYER_REMOTE_COMMAND_QUIT | quit the instance of Xplayer |
XPLAYER_REMOTE_COMMAND_ENQUEUE | enqueue a new playlist item |
XPLAYER_REMOTE_COMMAND_REPLACE | replace an item in the playlist |
XPLAYER_REMOTE_COMMAND_SHOW | show the Xplayer instance |
XPLAYER_REMOTE_COMMAND_TOGGLE_CONTROLS | toggle the control visibility |
XPLAYER_REMOTE_COMMAND_UP | go up (DVD controls) |
XPLAYER_REMOTE_COMMAND_DOWN | go down (DVD controls) |
XPLAYER_REMOTE_COMMAND_LEFT | go left (DVD controls) |
XPLAYER_REMOTE_COMMAND_RIGHT | go right (DVD controls) |
XPLAYER_REMOTE_COMMAND_SELECT | select the current item (DVD controls) |
XPLAYER_REMOTE_COMMAND_DVD_MENU | go to the DVD menu |
XPLAYER_REMOTE_COMMAND_ZOOM_UP | increase the zoom level |
XPLAYER_REMOTE_COMMAND_ZOOM_DOWN | decrease the zoom level |
XPLAYER_REMOTE_COMMAND_EJECT | eject the current disc |
XPLAYER_REMOTE_COMMAND_PLAY_DVD | play a DVD in a drive |
XPLAYER_REMOTE_COMMAND_MUTE | toggle mute |
XPLAYER_REMOTE_COMMAND_TOGGLE_ASPECT | toggle the aspect ratio |

### enum XplayerRemoteSetting

Represents a boolean setting or preference on a remote Xplayer instance.

#### Members

XPLAYER_REMOTE_SETTING_SHUFFLE | whether shuffle is enabled |
XPLAYER_REMOTE_SETTING_REPEAT | whether repeat is enabled |

### XPLAYER_GSETTINGS_SCHEMA

    #define XPLAYER_GSETTINGS_SCHEMA "org.x.player"

The GSettings schema under which all Xplayer settings are stored.

## Property Details

### The `“current-content-type”` property

      “current-content-type”     gchar *

The content-type of the current stream.

Flags: Read

Default value: NULL

### The `“current-display-name”` property

      “current-display-name”     gchar *

The display name of the current stream.

Flags: Read

Default value: NULL

### The `“current-mrl”` property

      “current-mrl”              gchar *

The MRL of the current stream.

Flags: Read

Default value: NULL

### The `“current-time”` property

      “current-time”             gint64

The player's position (time) in the current stream, in milliseconds.

Flags: Read

Default value: 0

### The `“fullscreen”` property

      “fullscreen”               gboolean

If `TRUE`, Xplayer is in fullscreen mode.

Flags: Read

Default value: FALSE

### The `“playing”` property

      “playing”                  gboolean

If `TRUE`, Xplayer is playing an audio or video file.

Flags: Read

Default value: FALSE

### The `“remember-position”` property

      “remember-position”        gboolean

If `TRUE`, Xplayer will remember the position it was at last time a given file was opened.

Flags: Read / Write

Default value: FALSE

### The `“seekable”` property

      “seekable”                 gboolean

If `TRUE`, the current stream is seekable.

Flags: Read

Default value: FALSE

### The `“stream-length”` property

      “stream-length”            gint64

The length of the current stream, in milliseconds.

Flags: Read

Default value: 0

## Signal Details

### The `“file-closed”` signal

    void
    user_function (XplayerObject *xplayer,
                   gpointer       user_data)

The “file-closed” signal is emitted when Xplayer closes a stream.

#### Parameters

xplayer | the XplayerObject which received the signal |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

### The `“file-has-played”` signal

    void
    user_function (XplayerObject *xplayer,
                   gchar         *mrl,
                   gpointer       user_data)

The “file-has-played” signal is emitted when a new stream has started playing in Xplayer.

#### Parameters

xplayer | the XplayerObject which received the signal |
mrl | the MRL of the opened stream |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

### The `“file-opened”` signal

    void
    user_function (XplayerObject *xplayer,
                   gchar         *mrl,
                   gpointer       user_data)

The “file-opened” signal is emitted when a new stream is opened by Xplayer.

#### Parameters

xplayer | the XplayerObject which received the signal |
mrl | the MRL of the opened stream |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

### The `“get-text-subtitle”` signal

    gchar*
    user_function (XplayerObject *xplayer,
                   gchar         *mrl,
                   gpointer       user_data)

The “get-text-subtitle” signal is emitted before opening a stream, so that plugins have the opportunity to detect or download text subtitles for the stream if necessary.

#### Parameters

xplayer | the XplayerObject which received the signal |
mrl | the MRL of the opened stream |
user_data | user data set when the signal handler was connected. |

#### Returns

allocated string representing the URI of the subtitle to use for `mrl`

Flags: Run Last

### The `“get-user-agent”` signal

    gchar*
    user_function (XplayerObject *xplayer,
                   gchar         *mrl,
                   gpointer       user_data)

The “get-user-agent” signal is emitted before opening a stream, so that plugins have the opportunity to return the user-agent to be set.

#### Parameters

xplayer | the XplayerObject which received the signal |
mrl | the MRL of the opened stream |
user_data | user data set when the signal handler was connected. |

#### Returns

allocated string representing the user-agent to use for `mrl`

Flags: Run Last

### The `“metadata-updated”` signal

    void
    user_function (XplayerObject *xplayer,
                   gchar         *artist,
                   gchar         *title,
                   gchar         *album,
                   guint          track_number,
                   gpointer       user_data)

The “metadata-updated” signal is emitted when the metadata of a stream is updated, typically when it's being loaded.

#### Parameters

xplayer | the XplayerObject which received the signal |
artist | the name of the artist, or `NULL` |
title | the stream title, or `NULL` |
album | the name of the stream's album, or `NULL` |
track_number | the stream's track number |
user_data | user data set when the signal handler was connected. |

Flags: Run Last