+2001-12-06 Arik Devens <arik@gnome.org>
+
+ * gstmediaplay.c (fullscreen_key_press_event): Added a case for
+ the q key to switch out of fullscreen.
+ (gst_media_play_init): Added signal connect for catching key
+ events.
+ (window_key_press_event): On space pause / play the media.
+
2001-12-04 Arik Devens <arik@gnome.org>
This is a minor update on a few things while i work on getting the
# FIXME FIXME
+LIBADD += $(GNOME_LIBS) $(GST_LIBS)
+CFLAGS += $(GNOME_CFLAGS) $(LIBGLADE_GNOME_CFLAGS) $(GST_CFLAGS) -DDATADIR=\""$(gladedir)/"\"
bin_PROGRAMS = gstmediaplay
gstplayprivate.h
libgstmediaplay_la_LDFLAGS = -rdynamic
-libgstmediaplay_la_CFLAGS = $(GNOME_CFLAGS) $(LIBGLADE_GNOME_CFLAGS) $(GST_CFLAGS) -DDATADIR=\""$(gladedir)/"\"
-gstmediaplay_CFLAGS = $(LIBGLADE_GNOME_CFLAGS) $(GNOME_CFLAGS) $(LIBGLADE_GNOME_CFLAGS) $(GST_CFLAGS) -DDATADIR=\""$(gladedir)/"\"
+
+gstmediaplay_CFLAGS = $(LIBGLADE_GNOME_CFLAGS)
gstmediaplay_LDADD = $(GST_LIBS) $(LIBGLADE_GNOME_LIBS) libgstmediaplay.la
static void gst_media_play_class_init (GstMediaPlayClass *klass);
static void gst_media_play_init (GstMediaPlay *play);
+static int window_key_press_event (GtkWidget *widget, GdkEventKey *event, GstMediaPlay *mplay);
+
static void gst_media_play_set_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_media_play_get_arg (GtkObject *object, GtkArg *arg, guint id);
mplay->window = glade_xml_get_widget (mplay->xml, "gstplay");
g_assert (mplay->window != NULL);
+ gtk_signal_connect (GTK_OBJECT (mplay->window), "key_press_event",
+ (GtkSignalFunc) window_key_press_event, mplay);
+
gtk_drag_dest_set (mplay->window,
GTK_DEST_DEFAULT_ALL,
target_table, 1,
mplay->last_time = 0;
}
+static int
+window_key_press_event (GtkWidget *widget,
+ GdkEventKey *event,
+ GstMediaPlay *mplay)
+{
+ switch (event->keyval) {
+ case GDK_space:
+ if (mplay->play->state == GST_PLAY_PLAYING)
+ {
+ gdk_threads_leave ();
+ gst_play_pause (mplay->play);
+ gdk_threads_enter ();
+ update_buttons (mplay, GST_PLAY_STATE(mplay->play));
+ }
+ else if (mplay->play->state == GST_PLAY_PAUSED)
+ {
+ gdk_threads_leave ();
+ gst_play_play (mplay->play);
+ gdk_threads_enter ();
+ update_buttons (mplay, GST_PLAY_STATE(mplay->play));
+ }
+ break;
+ }
+
+ return TRUE;
+}
+
GstMediaPlay *
gst_media_play_new ()
{
case GDK_Escape:
gst_media_play_set_fullscreen (mplay);
break;
+ case GDK_q:
+ gst_media_play_set_fullscreen (mplay);
+ break;
}
return TRUE;