AC_DEFINE(HAVE_VORBIS),
HAVE_VORBIS=no, )
+dnl Check for libvorbis
+AC_MSG_CHECKING(libjpeg library)
+AC_CHECK_LIB(jpeg, jpeg_set_defaults,
+HAVE_LIBJPEG=yes
+AC_DEFINE(HAVE_LIBJPEG),
+HAVE_LIBJPEG=no, )
+
dnl Check for cdparanoia
AC_MSG_CHECKING(CDparanoia library)
AM_CONDITIONAL(HAVE_XAUDIO, test "x$HAVE_XAUDIO" = "xyes")
AM_CONDITIONAL(HAVE_CSSAUTH, test "x$HAVE_CSSAUTH" = "xyes")
AM_CONDITIONAL(HAVE_VORBIS, test "x$HAVE_VORBIS" = "xyes")
+AM_CONDITIONAL(HAVE_LIBJPEG, test "x$HAVE_LIBJPEG" = "xyes")
AM_CONDITIONAL(HAVE_NASM, test "x$HAVE_NASM" = "xyes")
AM_CONDITIONAL(HAVE_LIBGLADE_GNOME, test "x$HAVE_LIBGLADE_GNOME" = "xyes")
AM_CONDITIONAL(HAVE_LIBXV, test "x$HAVE_LIBXV" = "xyes")
}
-void
-on_open2_activate (GtkMenuItem *menuitem,
- gpointer user_data)
-{
- GladeXML *xml;
- xml = glade_xml_new(DATADIR "gstmediaplay.glade", "fileselection1");
- /* connect the signals in the interface */
- glade_xml_signal_autoconnect(xml);
- open_file_selection = GTK_FILE_SELECTION(glade_xml_get_widget(xml, "fileselection1"));
-}
-
void on_about_activate(GtkWidget *widget, gpointer data)
{
GladeXML *xml;
gint y,
GtkSelectionData *data,
guint info,
- guint time)
+ guint time,
+ GstMediaPlay *play)
{
if (strstr (data->data, "file:")) {
- g_print ("Got: %s\n",data->data);
+ g_print ("Got: %s\n",&data->data[5]);
+ gdk_threads_leave ();
+ gst_media_play_start_uri (play, g_strchomp(&data->data[5]));
+ gdk_threads_enter ();
}
}
GDK_ACTION_COPY);
gtk_signal_connect (GTK_OBJECT (mplay->window), "drag_data_received",
GTK_SIGNAL_FUNC (target_drag_data_received),
- NULL);
+ mplay);
mplay->play = gst_play_new();
}
}
+typedef struct {
+ GtkWidget *selection;
+ GstMediaPlay *play;
+} file_select;
+
+static void
+on_load_file_selected (GtkWidget *button,
+ file_select *data)
+{
+ GtkWidget *selector = data->selection;
+ GstMediaPlay *play = data->play;
+
+ gchar *file_name = gtk_file_selection_get_filename (GTK_FILE_SELECTION(selector));
+ gdk_threads_leave();
+ gst_media_play_start_uri (play, file_name);
+ gdk_threads_enter();
+
+ g_free (data);
+}
+
+void
+on_open2_activate (GtkWidget *widget,
+ GstMediaPlay *play)
+{
+ GtkWidget *file_selector;
+ file_select *file_data = g_new0 (file_select, 1);
+
+ file_selector = gtk_file_selection_new("Please select a file to load.");
+
+ file_data->selection = file_selector;
+ file_data->play = play;
+
+ gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION(file_selector)->ok_button),
+ "clicked", GTK_SIGNAL_FUNC (on_load_file_selected),
+ file_data);
+
+ /* Ensure that the dialog box is destroyed when the user clicks a button. */
+ gtk_signal_connect_object (GTK_OBJECT (GTK_FILE_SELECTION(file_selector)->ok_button),
+ "clicked", GTK_SIGNAL_FUNC (gtk_widget_destroy),
+ (gpointer) file_selector);
+ gtk_signal_connect_object (GTK_OBJECT (GTK_FILE_SELECTION(file_selector)->cancel_button),
+ "clicked", GTK_SIGNAL_FUNC (gtk_widget_destroy),
+ (gpointer) file_selector);
+
+ /* Display that dialog */
+ gtk_widget_show (file_selector);
+}
+
+
static void
gst_media_play_set_arg (GtkObject *object,
GtkArg *arg,