Top | ![]() |
![]() |
![]() |
![]() |
char * | current-content-type | Read |
char * | current-display-name | Read |
char * | 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 |
void | file-closed | Run Last |
void | file-has-played | Run Last |
void | file-opened | Run Last |
char* | get-text-subtitle | Run Last |
char* | get-user-agent | Run Last |
void | metadata-updated | Run Last |
typedef | Xplayer |
XplayerObject | |
enum | XplayerRemoteCommand |
enum | XplayerRemoteSetting |
#define | XPLAYER_GSETTINGS_SCHEMA |
#define | xplayer_action_pause |
XplayerObject is the core object of Xplayer; a singleton which controls all Xplayer's main functions.
void
xplayer_object_plugins_init (XplayerObject *xplayer
);
Initialises the plugin engine and activates all the enabled plugins.
void
xplayer_object_plugins_shutdown (XplayerObject *xplayer
);
Shuts down the plugin engine and deactivates all the plugins.
void xplayer_file_opened (XplayerObject *xplayer
,const char *mrl
);
Emits the “file-opened” signal on xplayer
, with the
specified mrl
.
void
xplayer_file_closed (XplayerObject *xplayer
);
Emits the “file-closed” signal on xplayer
.
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.
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
.
void
xplayer_object_action_exit (XplayerObject *xplayer
);
Closes Xplayer.
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.
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.
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.
void
xplayer_object_action_stop (XplayerObject *xplayer
);
Stops the current stream.
void xplayer_action_fullscreen (XplayerObject *xplayer
,gboolean state
);
Sets Xplayer's fullscreen state according to state
.
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.
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.
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.
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.
gboolean xplayer_object_action_remote_get_setting (XplayerObject *xplayer
,XplayerRemoteSetting setting
);
Returns the value of setting
for this instance of Xplayer.
void xplayer_object_action_remote_set_setting (XplayerObject *xplayer
,XplayerRemoteSetting setting
,gboolean value
);
Sets setting
to value
on this instance of Xplayer.
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.
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.
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.
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.
void
xplayer_action_volume_toggle_mute (XplayerObject *xplayer
);
Toggles the mute status.
void
xplayer_action_toggle_aspect_ratio (XplayerObject *xplayer
);
Toggles the aspect ratio selected in the menu to the next one in the list.
int
xplayer_action_get_aspect_ratio (XplayerObject *xplayer
);
Gets the current aspect ratio as defined in BvwAspectRatio.
void xplayer_action_set_aspect_ratio (XplayerObject *xplayer
,int ratio
);
Sets the aspect ratio selected in the menu to ratio
,
as defined in BvwAspectRatio.
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.
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.
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.
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.
gboolean
xplayer_is_fullscreen (XplayerObject *xplayer
);
Returns TRUE
if Xplayer is fullscreened.
gboolean
xplayer_object_is_playing (XplayerObject *xplayer
);
Returns TRUE
if Xplayer is playing a stream.
gboolean
xplayer_object_is_paused (XplayerObject *xplayer
);
Returns TRUE
if playback is paused.
gboolean
xplayer_object_is_seekable (XplayerObject *xplayer
);
Returns TRUE
if the current stream is seekable.
GtkWindow *
xplayer_object_get_main_window (XplayerObject *xplayer
);
Gets Xplayer's main window and increments its reference count.
GtkUIManager *
xplayer_object_get_ui_manager (XplayerObject *xplayer
);
Gets Xplayer's UI manager, but does not change its reference count.
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()
.
GtkWidget *
xplayer_object_get_video_widget (XplayerObject *xplayer
);
Gets Xplayer's video widget and increments its reference count.
gint64
xplayer_get_current_time (XplayerObject *xplayer
);
Gets the current position's time in the stream as a gint64.
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.
guint
xplayer_object_get_playlist_length (XplayerObject *xplayer
);
Returns the length of the current playlist.
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.
char * xplayer_object_get_title_at_playlist_pos (XplayerObject *xplayer
,guint playlist_index
);
Gets the title of the playlist entry at index
.
char *
xplayer_get_short_title (XplayerObject *xplayer
);
Gets the title of the current entry in the playlist.
double
xplayer_object_get_volume (XplayerObject *xplayer
);
Gets the current volume level, as a value between 0.0
and 1.0
.
char *
xplayer_object_get_version (void
);
Gets the application name and version (e.g. "Xplayer 2.28.0").
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.
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.
const gchar * const *
xplayer_object_get_supported_content_types
(void
);
Get the full list of file content types which Xplayer supports playing.
a NULL
-terminated array of the content types Xplayer supports.
[array zero-terminated=1][transfer none]
Since: 3.1.5
const gchar * const *
xplayer_object_get_supported_uri_schemes
(void
);
Get the full list of URI schemes which Xplayer supports accessing.
a NULL
-terminated array of the URI schemes Xplayer supports.
[array zero-terminated=1][transfer none]
Since: 3.1.5
typedef struct _XplayerObject Xplayer;
The Xplayer object is a handy synonym for XplayerObject, and the two can be used interchangably.
typedef struct _XplayerObject XplayerObject;
All the fields in the XplayerObject structure are private and should never be accessed directly.
Represents a command which can be sent to a running Xplayer instance remotely.
unknown command |
||
play the current stream |
||
pause the current stream |
||
stop playing the current stream |
||
toggle play/pause on the current stream |
||
play the next playlist item |
||
play the previous playlist item |
||
seek forwards in the current stream |
||
seek backwards in the current stream |
||
increase the volume |
||
decrease the volume |
||
toggle fullscreen mode |
||
quit the instance of Xplayer |
||
enqueue a new playlist item |
||
replace an item in the playlist |
||
show the Xplayer instance |
||
toggle the control visibility |
||
go up (DVD controls) |
||
go down (DVD controls) |
||
go left (DVD controls) |
||
go right (DVD controls) |
||
select the current item (DVD controls) |
||
go to the DVD menu |
||
increase the zoom level |
||
decrease the zoom level |
||
eject the current disc |
||
play a DVD in a drive |
||
toggle mute |
||
toggle the aspect ratio |
#define XPLAYER_GSETTINGS_SCHEMA "org.x.player"
The GSettings schema under which all Xplayer settings are stored.
“current-content-type”
property “current-content-type” char *
The content-type of the current stream.
Owner: XplayerObject
Flags: Read
Default value: NULL
“current-display-name”
property “current-display-name” char *
The display name of the current stream.
Owner: XplayerObject
Flags: Read
Default value: NULL
“current-mrl”
property “current-mrl” char *
The MRL of the current stream.
Owner: XplayerObject
Flags: Read
Default value: NULL
“current-time”
property “current-time” gint64
The player's position (time) in the current stream, in milliseconds.
Owner: XplayerObject
Flags: Read
Default value: 0
“fullscreen”
property “fullscreen” gboolean
If TRUE
, Xplayer is in fullscreen mode.
Owner: XplayerObject
Flags: Read
Default value: FALSE
“playing”
property “playing” gboolean
If TRUE
, Xplayer is playing an audio or video file.
Owner: XplayerObject
Flags: Read
Default value: FALSE
“remember-position”
property “remember-position” gboolean
If TRUE
, Xplayer will remember the position it was at last time a given file was opened.
Owner: XplayerObject
Flags: Read / Write
Default value: FALSE
“seekable”
property “seekable” gboolean
If TRUE
, the current stream is seekable.
Owner: XplayerObject
Flags: Read
Default value: FALSE
“file-closed”
signalvoid user_function (XplayerObject *xplayer, gpointer user_data)
The “file-closed” signal is emitted when Xplayer closes a stream.
xplayer |
the XplayerObject which received the signal |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“file-has-played”
signalvoid user_function (XplayerObject *xplayer, char *mrl, gpointer user_data)
The “file-has-played” signal is emitted when a new stream has started playing in Xplayer.
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
“file-opened”
signalvoid user_function (XplayerObject *xplayer, char *mrl, gpointer user_data)
The “file-opened” signal is emitted when a new stream is opened by Xplayer.
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
“get-text-subtitle”
signalchar* user_function (XplayerObject *xplayer, char *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.
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
“get-user-agent”
signalchar* user_function (XplayerObject *xplayer, char *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.
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
“metadata-updated”
signalvoid user_function (XplayerObject *xplayer, char *artist, char *title, char *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.
xplayer |
the XplayerObject which received the signal |
|
artist |
the name of the artist, or |
|
title |
the stream title, or |
|
album |
the name of the stream's album, or |
|
track_number |
the stream's track number |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last