![]() |
![]() |
![]() |
Totem Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties | Signals |
#include <totem.h> typedef Totem; TotemObject; enum TotemRemoteCommand; enum TotemRemoteSetting; #define TOTEM_GSETTINGS_SCHEMA void totem_object_show_error (TotemObject *totem
,const char *title
,const char *reason
); void totem_object_exit (TotemObject *totem
); void totem_object_play (TotemObject *totem
); void totem_object_play_pause (TotemObject *totem
); void totem_object_stop (TotemObject *totem
); void totem_object_seek_next (TotemObject *totem
); void totem_object_seek_previous (TotemObject *totem
); gboolean totem_object_remote_get_setting (TotemObject *totem
,TotemRemoteSetting setting
); void totem_object_remote_set_setting (TotemObject *totem
,TotemRemoteSetting setting
,gboolean value
); void totem_object_seek_time (TotemObject *totem
,gint64 msec
,gboolean accurate
); void totem_object_seek_relative (TotemObject *totem
,gint64 offset
,gboolean accurate
); void totem_object_set_volume (TotemObject *totem
,double volume
); void totem_object_remote_command (TotemObject *totem
,TotemRemoteCommand cmd
,const char *url
); gboolean totem_object_is_playing (TotemObject *totem
); gboolean totem_object_is_paused (TotemObject *totem
); gboolean totem_object_is_seekable (TotemObject *totem
); GtkWindow * totem_object_get_main_window (TotemObject *totem
); GtkUIManager * totem_object_get_ui_manager (TotemObject *totem
); char * totem_object_get_current_mrl (TotemObject *totem
); GtkWidget * totem_object_get_video_widget (TotemObject *totem
); void totem_object_set_current_subtitle (TotemObject *totem
,const char *subtitle_uri
); guint totem_object_get_playlist_length (TotemObject *totem
); int totem_object_get_playlist_pos (TotemObject *totem
); char * totem_object_get_title_at_playlist_pos (TotemObject *totem
,guint playlist_index
); double totem_object_get_volume (TotemObject *totem
); void totem_object_add_sidebar_page (TotemObject *totem
,const char *page_id
,const char *title
,GtkWidget *main_widget
); void totem_object_remove_sidebar_page (TotemObject *totem
,const char *page_id
); const gchar * const * totem_object_get_supported_content_types (void
); const gchar * const * totem_object_get_supported_uri_schemes (void
);
"current-content-type" gchar* : Read "current-display-name" gchar* : Read "current-mrl" gchar* : Read "current-time" gint64 : Read "fullscreen" gboolean : Read "playing" gboolean : Read "seekable" gboolean : Read "stream-length" gint64 : Read
"file-closed" :Run Last
"file-has-played" :Run Last
"file-opened" :Run Last
"get-text-subtitle" :Run Last
"get-user-agent" :Run Last
"metadata-updated" :Run Last
TotemObject is the core object of Totem; a singleton which controls all Totem's main functions.
typedef struct _TotemObject Totem;
The Totem object is a handy synonym for TotemObject, and the two can be used interchangably.
typedef struct _TotemObject TotemObject;
All the fields in the TotemObject structure are private and should never be accessed directly.
typedef enum { TOTEM_REMOTE_COMMAND_UNKNOWN = 0, TOTEM_REMOTE_COMMAND_PLAY, TOTEM_REMOTE_COMMAND_PAUSE, TOTEM_REMOTE_COMMAND_STOP, TOTEM_REMOTE_COMMAND_PLAYPAUSE, TOTEM_REMOTE_COMMAND_NEXT, TOTEM_REMOTE_COMMAND_PREVIOUS, TOTEM_REMOTE_COMMAND_SEEK_FORWARD, TOTEM_REMOTE_COMMAND_SEEK_BACKWARD, TOTEM_REMOTE_COMMAND_VOLUME_UP, TOTEM_REMOTE_COMMAND_VOLUME_DOWN, TOTEM_REMOTE_COMMAND_FULLSCREEN, TOTEM_REMOTE_COMMAND_QUIT, TOTEM_REMOTE_COMMAND_ENQUEUE, TOTEM_REMOTE_COMMAND_REPLACE, TOTEM_REMOTE_COMMAND_SHOW, TOTEM_REMOTE_COMMAND_UP, TOTEM_REMOTE_COMMAND_DOWN, TOTEM_REMOTE_COMMAND_LEFT, TOTEM_REMOTE_COMMAND_RIGHT, TOTEM_REMOTE_COMMAND_SELECT, TOTEM_REMOTE_COMMAND_DVD_MENU, TOTEM_REMOTE_COMMAND_ZOOM_UP, TOTEM_REMOTE_COMMAND_ZOOM_DOWN, TOTEM_REMOTE_COMMAND_EJECT, TOTEM_REMOTE_COMMAND_PLAY_DVD, TOTEM_REMOTE_COMMAND_MUTE, TOTEM_REMOTE_COMMAND_TOGGLE_ASPECT } TotemRemoteCommand;
Represents a command which can be sent to a running Totem 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 Totem | |
enqueue a new playlist item | |
replace an item in the playlist | |
show the Totem instance | |
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 |
typedef enum { TOTEM_REMOTE_SETTING_REPEAT } TotemRemoteSetting;
Represents a boolean setting or preference on a remote Totem instance.
#define TOTEM_GSETTINGS_SCHEMA "org.gnome.totem"
The GSettings schema under which all Totem settings are stored.
void totem_object_show_error (TotemObject *totem
,const char *title
,const char *reason
);
Displays a non-blocking error dialog with the
given title
and reason
.
|
a TotemObject |
|
the error dialog title |
|
the error dialog text |
void totem_object_exit (TotemObject *totem
);
Closes Totem.
|
a TotemObject |
void totem_object_play (TotemObject *totem
);
Plays the current stream. If Totem is already playing, it continues to play. If the stream cannot be played, and error dialog is displayed.
|
a TotemObject |
void totem_object_play_pause (TotemObject *totem
);
Gets the current MRL from the playlist and attempts to play it. If the stream is already playing, playback is paused.
|
a TotemObject |
void totem_object_stop (TotemObject *totem
);
Stops the current stream.
|
a TotemObject |
void totem_object_seek_next (TotemObject *totem
);
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.
|
a TotemObject |
void totem_object_seek_previous (TotemObject *totem
);
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.
|
a TotemObject |
gboolean totem_object_remote_get_setting (TotemObject *totem
,TotemRemoteSetting setting
);
Returns the value of setting
for this instance of Totem.
|
a TotemObject |
|
a TotemRemoteSetting |
Returns : |
TRUE if the setting is enabled, FALSE otherwise |
void totem_object_remote_set_setting (TotemObject *totem
,TotemRemoteSetting setting
,gboolean value
);
Sets setting
to value
on this instance of Totem.
|
a TotemObject |
|
a TotemRemoteSetting |
|
the new value for the setting |
void totem_object_seek_time (TotemObject *totem
,gint64 msec
,gboolean accurate
);
Seeks to an absolute time in the stream, or displays an error dialog if that's not possible.
|
a TotemObject |
|
the time to seek to |
|
whether to use accurate seek, an accurate seek might be slower for some formats (see GStreamer docs) |
void totem_object_seek_relative (TotemObject *totem
,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.
|
a TotemObject |
|
the time offset to seek to |
|
whether to use accurate seek, an accurate seek might be slower for some formats (see GStreamer docs) |
void totem_object_set_volume (TotemObject *totem
,double volume
);
Sets the volume, with 1.0
being the maximum, and 0.0
being the minimum level.
|
a TotemObject |
|
the new absolute volume value |
void totem_object_remote_command (TotemObject *totem
,TotemRemoteCommand cmd
,const char *url
);
Executes the specified cmd
on this instance of Totem. If cmd
is an operation requiring an MRL, url
is required; it can be NULL
otherwise.
If Totem's fullscreened and the operation is executed correctly, the controls will appear as if the user had moved the mouse.
|
a TotemObject |
|
a TotemRemoteCommand |
|
an MRL to play, or NULL
|
gboolean totem_object_is_playing (TotemObject *totem
);
Returns TRUE
if Totem is playing a stream.
|
a TotemObject |
Returns : |
TRUE if Totem is playing a stream |
gboolean totem_object_is_paused (TotemObject *totem
);
Returns TRUE
if playback is paused.
|
a TotemObject |
Returns : |
TRUE if playback is paused, FALSE otherwise |
gboolean totem_object_is_seekable (TotemObject *totem
);
Returns TRUE
if the current stream is seekable.
|
a TotemObject |
Returns : |
TRUE if the current stream is seekable |
GtkWindow * totem_object_get_main_window (TotemObject *totem
);
Gets Totem's main window and increments its reference count.
|
a TotemObject |
Returns : |
Totem's main window. [transfer full] |
GtkUIManager * totem_object_get_ui_manager (TotemObject *totem
);
Gets Totem's UI manager, but does not change its reference count.
|
a TotemObject |
Returns : |
Totem's UI manager. [transfer none] |
char * totem_object_get_current_mrl (TotemObject *totem
);
Get the MRL of the current stream, or NULL
if nothing's playing.
Free with g_free()
.
|
a TotemObject |
Returns : |
a newly-allocated string containing the MRL of the current stream |
GtkWidget * totem_object_get_video_widget (TotemObject *totem
);
Gets Totem's video widget and increments its reference count.
|
a TotemObject |
Returns : |
Totem's video widget. [transfer full] |
void totem_object_set_current_subtitle (TotemObject *totem
,const char *subtitle_uri
);
Add the subtitle_uri
subtitle file to the playlist, setting it as the subtitle for the current
playlist entry.
|
a TotemObject |
|
the URI of the subtitle file to add |
guint totem_object_get_playlist_length (TotemObject *totem
);
Returns the length of the current playlist.
|
a TotemObject |
Returns : |
the playlist length |
int totem_object_get_playlist_pos (TotemObject *totem
);
Returns the 0
-based index of the current entry in the playlist. If
there is no current entry in the playlist, -1
is returned.
|
a TotemObject |
Returns : |
the index of the current playlist entry, or -1
|
char * totem_object_get_title_at_playlist_pos (TotemObject *totem
,guint playlist_index
);
Gets the title of the playlist entry at index
.
|
a TotemObject |
|
the 0 -based entry index |
Returns : |
the entry title at index , or NULL ; free with g_free()
|
double totem_object_get_volume (TotemObject *totem
);
Gets the current volume level, as a value between 0.0
and 1.0
.
|
a TotemObject |
Returns : |
the volume level |
void totem_object_add_sidebar_page (TotemObject *totem
,const char *page_id
,const char *title
,GtkWidget *main_widget
);
Adds a sidebar page to Totem'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.
|
a TotemObject |
|
a string used to identify the page |
|
the page's title |
|
the main widget for the page |
void totem_object_remove_sidebar_page (TotemObject *totem
,const char *page_id
);
Removes the page identified by page_id
from Totem's sidebar.
If page_id
doesn't exist in the sidebar, this function does
nothing.
|
a TotemObject |
|
a string used to identify the page |
const gchar * const * totem_object_get_supported_content_types
(void
);
Get the full list of file content types which Totem supports playing.
Returns : |
a NULL -terminated array of the content types Totem supports. [array zero-terminated=1][transfer none]
|
Since 3.1.5
"current-content-type"
property"current-content-type" gchar* : Read
The content-type of the current stream.
Default value: NULL
"current-display-name"
property"current-display-name" gchar* : Read
The display name of the current stream.
Default value: NULL
"current-mrl"
property"current-mrl" gchar* : Read
The MRL of the current stream.
Default value: NULL
"current-time"
property"current-time" gint64 : Read
The player's position (time) in the current stream, in milliseconds.
Default value: 0
"fullscreen"
property"fullscreen" gboolean : Read
If TRUE
, Totem is in fullscreen mode.
Default value: FALSE
"playing"
property"playing" gboolean : Read
If TRUE
, Totem is playing an audio or video file.
Default value: FALSE
"seekable"
property"seekable" gboolean : Read
If TRUE
, the current stream is seekable.
Default value: FALSE
"stream-length"
property"stream-length" gint64 : Read
The length of the current stream, in milliseconds.
Default value: 0
"file-closed"
signalvoid user_function (TotemObject *totem,
gpointer user_data) : Run Last
The "file-closed" signal is emitted when Totem closes a stream.
|
the TotemObject which received the signal |
|
user data set when the signal handler was connected. |
"file-has-played"
signalvoid user_function (TotemObject *totem,
gchar *mrl,
gpointer user_data) : Run Last
The "file-has-played" signal is emitted when a new stream has started playing in Totem.
|
the TotemObject which received the signal |
|
the MRL of the opened stream |
|
user data set when the signal handler was connected. |
"file-opened"
signalvoid user_function (TotemObject *totem,
gchar *mrl,
gpointer user_data) : Run Last
The "file-opened" signal is emitted when a new stream is opened by Totem.
|
the TotemObject which received the signal |
|
the MRL of the opened stream |
|
user data set when the signal handler was connected. |
"get-text-subtitle"
signalgchar* user_function (TotemObject *totem,
gchar *mrl,
gpointer user_data) : Run Last
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.
|
the TotemObject which received the signal |
|
the MRL of the opened stream |
|
user data set when the signal handler was connected. |
Returns : |
allocated string representing the URI of the subtitle to use for mrl
|
"get-user-agent"
signalgchar* user_function (TotemObject *totem,
gchar *mrl,
gpointer user_data) : Run Last
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.
|
the TotemObject which received the signal |
|
the MRL of the opened stream |
|
user data set when the signal handler was connected. |
Returns : |
allocated string representing the user-agent to use for mrl
|
"metadata-updated"
signalvoid user_function (TotemObject *totem,
gchar *artist,
gchar *title,
gchar *album,
guint track_number,
gpointer user_data) : Run Last
The "metadata-updated" signal is emitted when the metadata of a stream is updated, typically when it's being loaded.
|
the TotemObject which received the signal |
|
the name of the artist, or NULL
|
|
the stream title, or NULL
|
|
the name of the stream's album, or NULL
|
|
the stream's track number |
|
user data set when the signal handler was connected. |