mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
playback/player: Remove gst_player_is_playing()
The current state is now notified via the state-changed signal, and in the GTK UI it was only used to keep track of the desired state.
This commit is contained in:
parent
d0ef447da9
commit
6f88388819
1 changed files with 6 additions and 3 deletions
|
@ -32,9 +32,9 @@ typedef struct
|
||||||
GtkWidget *video_area;
|
GtkWidget *video_area;
|
||||||
GtkWidget *volume_button;
|
GtkWidget *volume_button;
|
||||||
gulong seekbar_value_changed_signal_id;
|
gulong seekbar_value_changed_signal_id;
|
||||||
|
gboolean playing;
|
||||||
} GtkPlay;
|
} GtkPlay;
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
set_title (GtkPlay * play, const gchar * title)
|
set_title (GtkPlay * play, const gchar * title)
|
||||||
{
|
{
|
||||||
|
@ -76,12 +76,13 @@ play_pause_clicked_cb (GtkButton * button, GtkPlay * play)
|
||||||
{
|
{
|
||||||
GtkWidget *image;
|
GtkWidget *image;
|
||||||
|
|
||||||
if (gst_player_is_playing (play->player)) {
|
if (play->playing) {
|
||||||
gst_player_pause (play->player);
|
gst_player_pause (play->player);
|
||||||
image =
|
image =
|
||||||
gtk_image_new_from_icon_name ("media-playback-start",
|
gtk_image_new_from_icon_name ("media-playback-start",
|
||||||
GTK_ICON_SIZE_BUTTON);
|
GTK_ICON_SIZE_BUTTON);
|
||||||
gtk_button_set_image (GTK_BUTTON (play->play_pause_button), image);
|
gtk_button_set_image (GTK_BUTTON (play->play_pause_button), image);
|
||||||
|
play->playing = FALSE;
|
||||||
} else {
|
} else {
|
||||||
gchar *title;
|
gchar *title;
|
||||||
|
|
||||||
|
@ -94,6 +95,7 @@ play_pause_clicked_cb (GtkButton * button, GtkPlay * play)
|
||||||
title = gst_player_get_uri (play->player);
|
title = gst_player_get_uri (play->player);
|
||||||
set_title (play, title);
|
set_title (play, title);
|
||||||
g_free (title);
|
g_free (title);
|
||||||
|
play->playing = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -263,7 +265,7 @@ video_dimensions_changed_cb (GstPlayer * unused, gint width, gint height,
|
||||||
static void
|
static void
|
||||||
eos_cb (GstPlayer * unused, GtkPlay * play)
|
eos_cb (GstPlayer * unused, GtkPlay * play)
|
||||||
{
|
{
|
||||||
if (gst_player_is_playing (play->player)) {
|
if (play->playing) {
|
||||||
GList *next = NULL;
|
GList *next = NULL;
|
||||||
gchar *uri;
|
gchar *uri;
|
||||||
|
|
||||||
|
@ -361,6 +363,7 @@ main (gint argc, gchar ** argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
play.player = gst_player_new ();
|
play.player = gst_player_new ();
|
||||||
|
play.playing = TRUE;
|
||||||
|
|
||||||
g_object_set (play.player, "dispatch-to-main-context", TRUE, NULL);
|
g_object_set (play.player, "dispatch-to-main-context", TRUE, NULL);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue