mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 00:36:51 +00:00
implement the stop button
This commit is contained in:
parent
c94b446766
commit
081dc24869
2 changed files with 18 additions and 2 deletions
|
@ -93,6 +93,7 @@ void window_destroy_cb (GtkObject * window, App * app);
|
|||
void quit_item_activate_cb (GtkMenuItem * item, App * app);
|
||||
void delete_activate_cb (GtkAction * item, App * app);
|
||||
void play_activate_cb (GtkAction * item, App * app);
|
||||
void stop_activate_cb (GtkAction * item, App * app);
|
||||
void add_file_activate_cb (GtkAction * item, App * app);
|
||||
void add_text_activate_cb (GtkAction * item, App * app);
|
||||
void add_test_activate_cb (GtkAction * item, App * app);
|
||||
|
@ -719,7 +720,7 @@ static void selection_foreach (GtkTreeModel * model, GtkTreePath * path,
|
|||
GtkTreeIter * iter, gpointer user);
|
||||
|
||||
static void
|
||||
app_toggle_playback (App * app)
|
||||
app_toggle_playpause (App * app)
|
||||
{
|
||||
if (app->state != GST_STATE_PLAYING) {
|
||||
gst_element_set_state (GST_ELEMENT (app->pipeline), GST_STATE_PLAYING);
|
||||
|
@ -728,6 +729,14 @@ app_toggle_playback (App * app)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
app_stop_playback (App * app)
|
||||
{
|
||||
if ((app->state != GST_STATE_NULL) && (app->state != GST_STATE_READY)) {
|
||||
gst_element_set_state (GST_ELEMENT (app->pipeline), GST_STATE_READY);
|
||||
}
|
||||
}
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GList *objects;
|
||||
|
@ -987,7 +996,13 @@ add_transition_activate_cb (GtkAction * item, App * app)
|
|||
void
|
||||
play_activate_cb (GtkAction * item, App * app)
|
||||
{
|
||||
app_toggle_playback (app);
|
||||
app_toggle_playpause (app);
|
||||
}
|
||||
|
||||
void
|
||||
stop_activate_cb (GtkAction * item, App * app)
|
||||
{
|
||||
app_stop_playback (app);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -859,5 +859,6 @@
|
|||
<property name="label">Stop</property>
|
||||
<property name="short_label">Stop</property>
|
||||
<property name="stock_id">gtk-media-stop</property>
|
||||
<signal name="activate" handler="stop_activate_cb"/>
|
||||
</object>
|
||||
</interface>
|
||||
|
|
Loading…
Reference in a new issue