From 9af4f42b3caca02f3a6099279d9c178656d6596e Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Mon, 7 Jan 2002 21:49:11 +0000 Subject: [PATCH] old gst-player source is now in the gst-oldplayer module Original commit message from CVS: old gst-player source is now in the gst-oldplayer module --- gstplay/.gitignore | 11 - gstplay/AUTHORS | 1 - gstplay/ChangeLog | 158 --------- gstplay/Makefile.am | 41 --- gstplay/PLEASE_READ_THIS | 6 - gstplay/callbacks.c | 102 ------ gstplay/callbacks.h | 35 -- gstplay/gstmediaplay.1 | 39 --- gstplay/gstmediaplay.c | 764 ------------------------------------------- gstplay/gstmediaplay.glade | 697 --------------------------------------- gstplay/gstmediaplay.glade2 | 709 ---------------------------------------- gstplay/gstmediaplay.h | 65 ---- gstplay/gstplay.c | 777 -------------------------------------------- gstplay/gstplay.h | 96 ------ gstplay/gstplayprivate.h | 1 - gstplay/gststatusarea.c | 298 ----------------- gstplay/gststatusarea.h | 46 --- gstplay/main.c | 52 --- gstplay/pause.xpm | 23 -- gstplay/pixmaps/pause.xpm | 23 -- gstplay/pixmaps/play.xpm | 23 -- gstplay/pixmaps/stop.xpm | 23 -- gstplay/play.xpm | 23 -- gstplay/stop.xpm | 23 -- 24 files changed, 4036 deletions(-) delete mode 100644 gstplay/.gitignore delete mode 100644 gstplay/AUTHORS delete mode 100644 gstplay/ChangeLog delete mode 100644 gstplay/Makefile.am delete mode 100644 gstplay/PLEASE_READ_THIS delete mode 100644 gstplay/callbacks.c delete mode 100644 gstplay/callbacks.h delete mode 100644 gstplay/gstmediaplay.1 delete mode 100644 gstplay/gstmediaplay.c delete mode 100644 gstplay/gstmediaplay.glade delete mode 100644 gstplay/gstmediaplay.glade2 delete mode 100644 gstplay/gstmediaplay.h delete mode 100644 gstplay/gstplay.c delete mode 100644 gstplay/gstplay.h delete mode 100644 gstplay/gstplayprivate.h delete mode 100644 gstplay/gststatusarea.c delete mode 100644 gstplay/gststatusarea.h delete mode 100644 gstplay/main.c delete mode 100644 gstplay/pause.xpm delete mode 100644 gstplay/pixmaps/pause.xpm delete mode 100644 gstplay/pixmaps/play.xpm delete mode 100644 gstplay/pixmaps/stop.xpm delete mode 100644 gstplay/play.xpm delete mode 100644 gstplay/stop.xpm diff --git a/gstplay/.gitignore b/gstplay/.gitignore deleted file mode 100644 index 460a665..0000000 --- a/gstplay/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -Makefile -Makefile.in -*.o -*.lo -*.la -.deps -.libs -*.bak -*~ -gstmediaplay -gstplay diff --git a/gstplay/AUTHORS b/gstplay/AUTHORS deleted file mode 100644 index bf70321..0000000 --- a/gstplay/AUTHORS +++ /dev/null @@ -1 +0,0 @@ -arik devens diff --git a/gstplay/ChangeLog b/gstplay/ChangeLog deleted file mode 100644 index 64bfa96..0000000 --- a/gstplay/ChangeLog +++ /dev/null @@ -1,158 +0,0 @@ -2001-12-14 Michael Meeks - - * gstplay.c (gst_play_set_uri): remove bogus - priv->offset_element set. - - * gstplayprivate.h: kill, move into - - * gstplay.c: here & lots of cleanup. - - * gstplay.h: use an opaque typedef for GstPlayPrivate, - lots of ugly casts die. - - * main.c (main): use gtk_main; gst_main no longer hits - the GUI mainloop. - - * gstmediaplay.c (gst_media_play_init): show the toplevel - -2001-12-06 Arik Devens - - * gstmediaplay.c (window_key_press_event): Added a case for - alt+return setting fullscreen to simulate the behavior of windows - media player. - -2001-12-06 Arik Devens - - * gstmediaplay.c (window_key_press_event): Added a case for the m - key to switch in and out of fullscreen. - -2001-12-06 Arik Devens - - * 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 - - This is a minor update on a few things while i work on getting the - new gstplay into cvs. Enjoy :-) - - * gstmediaplay.c (on_load_file_selected): As below, commented out - the addto_playlist line to get rid of GtkCList warnings. - (gst_media_play_set_fullscreen): Added setting and unsetting of - the GdkCursor on fullscreen to hide the cursor while playing - video. - - * main.c (main): Commented out adding to the playlist for now to - get rid of the GtkCList warning. - -2001-08-15 Arik Devens - - * gstmediaplay.c (gst_media_play_set_fullscreen): Added a hacky - check to determine if we are even playing a video. workaround till - the new libgstplay gets here and makes all of this hackishness - unnecessary and foolish. ;-) - -2001-08-15 Arik Devens - - * main.c (main): Disabled the showing of the playlist till it - works. ;-) - - * gstmediaplay.c (gst_media_play_play_item): New function to play - an item when selected in the playlist. - (gst_media_play_show_playlist): New function to show the - playlist. This is temporary till i do an interface overhaul on the - player. - (gst_media_play_addto_playlist): New function to add files to the - playlist. - - * main.c (main): Added stuff for playlist and for handling - multiple files from the console. - - * gstmediaplay.h: Added new items to the GstMediaPlay struct for - playlist stuff and for the fullscreen keypress connection. - - * gstmediaplay.c (fullscreen_key_press_event): New function to - handle keypress stuff so that we leave fullscreen when the user - hits the escape key. - (gst_media_play_set_fullscreen): Added a signal connect/disconnect - for keypress handling. - (gst_media_play_set_original_size): Added checking to see if we - are still in fullscreen mode and if we are leaving it before - sizing to original size. - (gst_media_play_set_double_size): Ditto except for double size. - -2001-08-12 Arik Devens - - * gstmediaplay.c (gst_media_play_set_fullscreen): Added the hiding - and reshowing of the status area when entering and leaving - fullscreen. - -2001-06-12 Arik Devens - - * gstmediaplay.glade: Added a basic preferences dialog, not hooked - up yet. - - * callbacks.c (on_preferences1_activate): Added loading the new - preferences dialog. - - * Makefile.am: Removed full-screen.[c,h] from the build. - - * full-screen.h: Removed this file, no longer needed. - - * full-screen.c: Removed this file, no longer needed. - - * gstplay.c (gst_play_get_video_widget): New function to return - the actual video_widget. - (gst_play_get_source_width): New function to get the width of the - source media. - (gst_play_get_source_height): New function to get the height of - the source media. - (gst_play_set_uri): Added check to make sure the file we are - trying to play actually exists. i wonder if this fails with - gnomevfs? - - * callbacks.c (on_original_size_activate): Use the new function. - (on_double_size_activate): Use the new function. - (on_full_screen_activate): Use the new function. - - * gstmediaplay.h (gst_media_play_set_fullscreen): Added function - prototypes for the new functions. - - * gstmediaplay.c (gst_media_play_start_uri): Added a check for the - return value of set_uri so that we don't crash on not being able - to load a file. - (gst_media_play_set_original_size): New function to size the - video_widget to its default size. - (gst_media_play_set_fullscreen): New function to do - full-screen. Still a hack but at least this one works. - (gst_media_play_set_double_size): New function to size the - video_widget to double its default size. - -2001-06-06 Arik Devens - - * gstmediaplay.glade: Dissabled full-screen for the moment till it - gets fixed. - -2001-05-20 Arik Devens - - General code cleanup and moving bits around as well. - - * gstplay.c (gst_play_have_size): Added saving of the source_width - and source_height so that changing the size is possible. - (gst_play_set_display_size): New function to change the displayed - size. - - * callbacks.c (on_original_size_activate): Added a new function to - restore the size of the media to it's default. - (on_double_size_activate): Added a new function to double the size - of the media. - (on_full_screen_activate): Added a new function to (theoretically) - do full-screen action baby! - - * full-screen.h: New file for full-screen action baby! - - * full-screen.c: New file for full-screen action baby! - diff --git a/gstplay/Makefile.am b/gstplay/Makefile.am deleted file mode 100644 index 99b051a..0000000 --- a/gstplay/Makefile.am +++ /dev/null @@ -1,41 +0,0 @@ -## Process this file with automake to produce Makefile.in - -# FIXME FIXME - - -bin_PROGRAMS = gstmediaplay - -lib_LTLIBRARIES = libgstmediaplay.la - -man_MANS = gstmediaplay.1 - -gladedir = $(datadir)/gstmediaplay -glade_DATA = gstmediaplay.glade play.xpm stop.xpm pause.xpm - -EXTRA_DIST = $(glade_DATA) $(man_MANS) - -libgstmediaplay_la_SOURCES = \ - gstplay.c \ - gstmediaplay.c \ - gststatusarea.c \ - callbacks.c - -gstmediaplay_SOURCES = \ - main.c - -libgstmediaplayincludedir = $(includedir)/gstplay -libgstmediaplayinclude_HEADERS = \ - gstplay.h - -noinst_HEADERS = \ - gstmediaplay.h \ - gststatusarea.h \ - callbacks.h - -libgstmediaplay_la_CFLAGS = $(GST_CFLAGS) $(GNOME_CFLAGS) \ - -DDATADIR=\""$(gladedir)/"\" $(LIBGLADE_CFLAGS) -libgstmediaplay_la_LIBADD = $(GST_LIBS) $(GNOME_LIBS) $(LIBGLADE_LIBS) -libgstmediaplay_la_LDFLAGS = -rdynamic - -gstmediaplay_CFLAGS = $(GST_CFLAGS) $(LIBGLADE_CFLAGS) $(GNOME_CFLAGS) -gstmediaplay_LDADD = $(GST_LIBS) $(LIBGLADE_LIBS) $(GNOME_LIBS) libgstmediaplay.la diff --git a/gstplay/PLEASE_READ_THIS b/gstplay/PLEASE_READ_THIS deleted file mode 100644 index d232540..0000000 --- a/gstplay/PLEASE_READ_THIS +++ /dev/null @@ -1,6 +0,0 @@ -um... whoever is changing stuff, please, please, please add what you changed to the ChangeLog... - -also, this is gonna go away real soon, if you really want to help please send patches for the new module gstplay. - -thanks, -arik diff --git a/gstplay/callbacks.c b/gstplay/callbacks.c deleted file mode 100644 index e9d8f6a..0000000 --- a/gstplay/callbacks.c +++ /dev/null @@ -1,102 +0,0 @@ -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include -#include "gstmediaplay.h" -#include "gstplay.h" -#include "callbacks.h" - -GtkFileSelection *open_file_selection; - -void -on_save1_activate (GtkMenuItem *menuitem, gpointer user_data) -{ - printf ("file1 activate\n"); -} - -void -on_save_as1_activate (GtkMenuItem *menuitem, gpointer user_data) -{ - printf ("file1 activate\n"); -} - -void -on_media2_activate (GtkMenuItem *menuitem, gpointer user_data) -{ - printf ("file1 activate\n"); -} - -void -on_original_size_activate (GtkMenuItem *menuitem, gpointer user_data) -{ - GstMediaPlay *mplay; - - mplay = GST_MEDIA_PLAY (user_data); - - gst_media_play_set_original_size (mplay); -} - -void -on_double_size_activate (GtkMenuItem *menuitem, gpointer user_data) -{ - GstMediaPlay *mplay; - - mplay = GST_MEDIA_PLAY (user_data); - - gst_media_play_set_double_size (mplay); -} - -void -on_full_screen_activate (GtkMenuItem *menuitem, gpointer user_data) -{ - GstMediaPlay *mplay; - - mplay = GST_MEDIA_PLAY (user_data); - - gst_media_play_set_fullscreen (mplay); -} - -void -on_preferences1_activate (GtkMenuItem *menuitem, gpointer user_data) -{ - GladeXML *xml; - struct stat statbuf; - - if (stat (DATADIR"gstmediaplay.glade", &statbuf) == 0) - xml = gst_glade_xml_new (DATADIR"gstmediaplay.glade", "preferences"); - else - xml = gst_glade_xml_new ("gstmediaplay.glade", "preferences"); - - glade_xml_signal_autoconnect (xml); - - gtk_widget_show (glade_xml_get_widget (xml, "preferences")); -} - -void -on_about_activate (GtkWidget *widget, gpointer data) -{ - GladeXML *xml; - struct stat statbuf; - - if (stat (DATADIR"gstmediaplay.glade", &statbuf) == 0) { - xml = gst_glade_xml_new (DATADIR"gstmediaplay.glade", "about"); - } - else - xml = gst_glade_xml_new ("gstmediaplay.glade", "about"); - - glade_xml_signal_autoconnect (xml); - - gtk_widget_show (glade_xml_get_widget (xml, "about")); -} - -void -on_gstplay_destroy (GtkWidget *widget, gpointer data) -{ - gtk_main_quit(); -} - diff --git a/gstplay/callbacks.h b/gstplay/callbacks.h deleted file mode 100644 index 6fcbc24..0000000 --- a/gstplay/callbacks.h +++ /dev/null @@ -1,35 +0,0 @@ -#include - -void -on_file1_activate (GtkMenuItem *menuitem, - gpointer user_data); -void -on_open1_activate (GtkMenuItem *menuitem, - gpointer user_data); -void -on_close1_activate (GtkMenuItem *menuitem, - gpointer user_data); -void -on_media1_activate (GtkMenuItem *menuitem, - gpointer user_data); -void -on_play2_activate (GtkMenuItem *menuitem, - gpointer user_data); -void -on_pause1_activate (GtkMenuItem *menuitem, - gpointer user_data); -void -on_stop1_activate (GtkMenuItem *menuitem, - gpointer user_data); - -void -on_about1_activate (GtkMenuItem *menuitem, - gpointer user_data); -void -on_hscale1_value_changed (GtkAdjustment *adj, - gpointer user_data); -void -on_drawingarea1_configure_event (GtkWidget *widget, - GdkEventConfigure *event, - gpointer user_data); - diff --git a/gstplay/gstmediaplay.1 b/gstplay/gstmediaplay.1 deleted file mode 100644 index b88c097..0000000 --- a/gstplay/gstmediaplay.1 +++ /dev/null @@ -1,39 +0,0 @@ -.TH GStreamer 1 "March 2001" -.SH NAME -gstmediaplay - a GStreamer media player -.SH SYNOPSIS -.B gstmediaplay [OPTION...] [FILE] -.SH DESCRIPTION -.PP -\fIgstmediaplay\fP is a media player based on the \fIGStreamer\fP -framework. -. -.SH OPTIONS -.l -\fIgstmediaplay\fP accepts the following options: -.TP 8 -.B FILE -File to play on startup -.TP 8 -.B \-\-help -Print help synopsis and available FLAGS -.TP 8 -.B \-\-gst\-info\-mask=FLAGS -\fIGStreamer\fP info flags to set (list with \-\-help) -.TP 8 -.B \-\-gst\-debug\-mask=FLAGS -\fIGStreamer\fP debugging flags to set (list with \-\-help) -.TP 8 -.B \-\-gst\-plugin\-spew -\fIGStreamer\fP info flags to set -Enable printout of errors while loading \fIGStreamer\fP plugins -.TP 8 -.B \-\-gst\-plugin\-path=PATH -Add directories separated with ':' to the plugin search path -.SH SEE ALSO -.BR gstreamer\-register (1), -.BR gstreamer\-inspect (1), -.BR gstreamer\-launch (1), -.BR gsteditor (1) -.SH AUTHOR -The GStreamer team at http://gstreamer.net/ diff --git a/gstplay/gstmediaplay.c b/gstplay/gstmediaplay.c deleted file mode 100644 index d2dab66..0000000 --- a/gstplay/gstmediaplay.c +++ /dev/null @@ -1,764 +0,0 @@ -#include - -#include -#include - -#include -#ifdef USE_GLIB2 -#include -#endif -#include "gstmediaplay.h" -#include "callbacks.h" - -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); - -static void gst_media_play_frame_displayed (GstPlay *play, GstMediaPlay *mplay); -static void gst_media_play_state_changed (GstPlay *play, GstPlayState state, GstMediaPlay *mplay); -static void gst_media_play_slider_changed (GtkAdjustment *adj, GstMediaPlay *mplay); - -static void update_buttons (GstMediaPlay *mplay, GstPlayState state); -static void update_slider (GstMediaPlay *mplay, GtkAdjustment *adjustment, gfloat value); - -gboolean fullscreen_active = FALSE; - -/* signals and args */ -enum { - LAST_SIGNAL -}; - -enum { - ARG_0, -}; - -static void -target_drag_data_received (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - GtkSelectionData *data, - guint info, - guint time, - GstMediaPlay *play) -{ - g_print ("Got: %s\n", data->data); - gdk_threads_leave (); - gst_media_play_start_uri (play, g_strchomp (data->data)); - gdk_threads_enter (); - -} - -static GtkTargetEntry target_table[] = { - { "text/plain", 0, 0 } -}; - -static GtkObject *parent_class = NULL; -/* static guint gst_media_play_signals[LAST_SIGNAL] = { 0 }; */ - -GtkType -gst_media_play_get_type (void) -{ - static GtkType play_type = 0; - - if (!play_type) { - static const GtkTypeInfo play_info = { - "GstMediaPlay", - sizeof (GstMediaPlay), - sizeof (GstMediaPlayClass), - (GtkClassInitFunc) gst_media_play_class_init, - (GtkObjectInitFunc) gst_media_play_init, - NULL, - NULL, - (GtkClassInitFunc) NULL, - }; - play_type = gtk_type_unique (gtk_object_get_type(), &play_info); - } - return play_type; -} - -static void -gst_media_play_class_init (GstMediaPlayClass *klass) -{ - GtkObjectClass *object_class; - - parent_class = gtk_type_class (gtk_object_get_type ()); - - object_class = (GtkObjectClass*) klass; - - object_class->set_arg = gst_media_play_set_arg; - object_class->get_arg = gst_media_play_get_arg; -} - -typedef struct { - GstMediaPlay *play; - GModule *symbols; -} connect_struct; - -/* we need more control here so... */ -static void -gst_media_play_connect_func (const gchar *handler_name, - GtkObject *object, - const gchar *signal_name, - const gchar *signal_data, - GtkObject *connect_object, - gboolean after, - gpointer user_data) -{ - GtkSignalFunc func; - connect_struct *data = (connect_struct *) user_data; - - if (!g_module_symbol (data->symbols, handler_name, (gpointer *)&func)) - g_warning ("gsteditorproperty: could not find signal handler '%s'.", handler_name); - else { - if (after) - gtk_signal_connect_after (object, signal_name, func, (gpointer) data->play); - else - gtk_signal_connect (object, signal_name, func, (gpointer) data->play); - } -} - - -static void -gst_media_play_init (GstMediaPlay *mplay) -{ - GModule *symbols; - connect_struct data; - struct stat statbuf; - - - /* load the interface */ - if (stat (DATADIR"gstmediaplay.glade", &statbuf) == 0) { - mplay->xml = gst_glade_xml_new (DATADIR"gstmediaplay.glade", "gstplay"); - } - else { - mplay->xml = gst_glade_xml_new ("gstmediaplay.glade", "gstplay"); - } - g_assert (mplay->xml != NULL); - - mplay->slider = glade_xml_get_widget (mplay->xml, "slider"); - g_assert (mplay->slider != NULL); - { -#ifndef USE_GLIB2 - GtkArg arg; - GtkRange *range; - - arg.name = "adjustment"; - gtk_object_getv (GTK_OBJECT (mplay->slider), 1, &arg); - - range = GTK_RANGE (GTK_VALUE_POINTER (arg)); - mplay->adjustment = gtk_range_get_adjustment (range); -#else - mplay->adjustment = gtk_range_get_adjustment (GTK_RANGE (mplay->slider)); -#endif - - gtk_signal_connect (GTK_OBJECT (mplay->adjustment), "value_changed", - GTK_SIGNAL_FUNC (gst_media_play_slider_changed), mplay); - } - - mplay->play_button = glade_xml_get_widget (mplay->xml, "toggle_play"); - g_assert (mplay->play_button != NULL); - mplay->pause_button = glade_xml_get_widget (mplay->xml, "toggle_pause"); - g_assert (mplay->pause_button != NULL); - mplay->stop_button = glade_xml_get_widget (mplay->xml, "toggle_stop"); - g_assert (mplay->stop_button != NULL); - - 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, - GDK_ACTION_COPY); - gtk_signal_connect (GTK_OBJECT (mplay->window), "drag_data_received", - GTK_SIGNAL_FUNC (target_drag_data_received), - mplay); - - mplay->play = gst_play_new(); - - gtk_signal_connect (GTK_OBJECT (mplay->play), "frame_displayed", - GTK_SIGNAL_FUNC (gst_media_play_frame_displayed), - mplay); - - gtk_signal_connect (GTK_OBJECT (mplay->play), "audio_played", - GTK_SIGNAL_FUNC (gst_media_play_frame_displayed), - mplay); - - gtk_signal_connect (GTK_OBJECT (mplay->play), "playing_state_changed", - GTK_SIGNAL_FUNC (gst_media_play_state_changed), - mplay); - -#ifdef USE_GLIB2 - bonobo_dock_set_client_area (BONOBO_DOCK (glade_xml_get_widget(mplay->xml, "dock1")), - GTK_WIDGET (mplay->play)); -#else - gnome_dock_set_client_area (GNOME_DOCK (glade_xml_get_widget(mplay->xml, "dock1")), - GTK_WIDGET (mplay->play)); -#endif - - gtk_widget_show (GTK_WIDGET (mplay->play)); - - gtk_widget_show (GTK_WIDGET (glade_xml_get_widget (mplay->xml, "gstplay"))); - - mplay->status = (GstStatusArea *) glade_xml_get_widget (mplay->xml, "status_area"); - gst_status_area_set_state (mplay->status, GST_STATUS_AREA_STATE_INIT); - gst_status_area_set_playtime (mplay->status, "00:00 / 00:00"); - - symbols = g_module_open (NULL, 0); - - data.play = mplay; - data.symbols = symbols; - - glade_xml_signal_autoconnect_full (mplay->xml, gst_media_play_connect_func, &data); - - mplay->last_time = 0; -} - -static int -window_key_press_event (GtkWidget *widget, - GdkEventKey *event, - GstMediaPlay *mplay) -{ - guint state; - - state = event->state; - - 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; - case GDK_m: - gst_media_play_set_fullscreen (mplay); - break; - case GDK_Return: - if (state & GDK_MOD1_MASK) - gst_media_play_set_fullscreen (mplay); - break; - } - - return TRUE; -} - -GstMediaPlay * -gst_media_play_new () -{ - return GST_MEDIA_PLAY (gtk_type_new (GST_TYPE_MEDIA_PLAY)); -} - -static void -gst_media_play_play_item (GtkCList *clist, - gint row, - gint column, - GdkEventButton *event, - GstMediaPlay *mplay) -{ - gchar *text; - - gtk_clist_get_text (clist, row, column, &text); - - gdk_threads_leave (); - gst_media_play_start_uri (mplay, text); - gdk_threads_enter (); -} - -void -gst_media_play_show_playlist (GstMediaPlay *mplay) -{ - struct stat statbuf; - - /* load the interface */ - if (stat (DATADIR"gstmediaplay.glade", &statbuf) == 0) { - mplay->playlist_xml = gst_glade_xml_new (DATADIR"gstmediaplay.glade", "playlist_window"); - } - else { - mplay->playlist_xml = gst_glade_xml_new ("gstmediaplay.glade", - "playlist_window"); - } - g_assert (mplay->playlist_xml != NULL); - - mplay->playlist_window = glade_xml_get_widget (mplay->playlist_xml, "playlist_window"); - mplay->playlist_clist = glade_xml_get_widget (mplay->playlist_xml, "playlist_clist"); - - gtk_signal_connect (GTK_OBJECT (mplay->playlist_clist), "select_row", - GTK_SIGNAL_FUNC (gst_media_play_play_item), mplay); - - gtk_window_set_default_size (GTK_WINDOW (mplay->playlist_window), 215, 280); - - gtk_widget_show (mplay->playlist_window); -} - -void -gst_media_play_addto_playlist (GstMediaPlay *mplay, char *uri) -{ - gchar *text[2]; - - text[0] = uri; - - gtk_clist_append (GTK_CLIST (mplay->playlist_clist), text); -} - -static void -gst_media_play_update_status_area (GstMediaPlay *mplay, - gulong current_time, - gulong total_time) -{ - gchar time[14]; - - sprintf (time, "%02lu:%02lu / %02lu:%02lu", - current_time / 60, current_time % 60, - total_time / 60, total_time % 60); - - gst_status_area_set_playtime (mplay->status, time); -} - -void -gst_media_play_start_uri (GstMediaPlay *mplay, - const guchar *uri) -{ - GstPlayReturn ret; - - g_return_if_fail (mplay != NULL); - g_return_if_fail (GST_IS_MEDIA_PLAY (mplay)); - - if (uri != NULL) { - ret = gst_play_set_uri (mplay->play, uri); - - if (ret == GST_PLAY_CANNOT_PLAY) { - printf ("*** Cannot load file: %s ***\n", uri); - } else { - if (!gst_play_media_can_seek (mplay->play)) { - gtk_widget_set_sensitive (mplay->slider, FALSE); - } - - gtk_window_set_title (GTK_WINDOW (mplay->window), - g_strconcat ( "Gstplay - ", uri, NULL)); - - gst_play_play (mplay->play); - } - } -} - -typedef struct { - GtkWidget *selection; - GstMediaPlay *play; -} file_select; - -static void -on_load_file_selected (GtkWidget *button, - file_select *data) -{ - GtkWidget *selector = data->selection; - const gchar *file_name; - GstMediaPlay *play = data->play; - - 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 (); - - /* gst_media_play_addto_playlist (play, file_name); */ - - 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, - guint id) -{ - GstMediaPlay *play; - play = GST_MEDIA_PLAY (object); - - switch (id) { - default: - g_warning ("GstMediaPlay: unknown arg!"); - break; - } -} - -static void -gst_media_play_get_arg (GtkObject *object, - GtkArg *arg, - guint id) -{ - GstMediaPlay *play; - - play = GST_MEDIA_PLAY (object); - - switch (id) { - default: - arg->type = GTK_TYPE_INVALID; - break; - } -} - -static void -gst_media_play_state_changed (GstPlay *play, - GstPlayState state, - GstMediaPlay *mplay) -{ - GstStatusAreaState area_state; - - g_return_if_fail (GST_IS_PLAY (play)); - g_return_if_fail (GST_IS_MEDIA_PLAY (mplay)); - - - gdk_threads_enter (); - update_buttons (mplay, state); - - switch (state) { - case GST_PLAY_STOPPED: - area_state = GST_STATUS_AREA_STATE_STOPPED; - break; - case GST_PLAY_PLAYING: - area_state = GST_STATUS_AREA_STATE_PLAYING; - break; - case GST_PLAY_PAUSED: - area_state = GST_STATUS_AREA_STATE_PAUSED; - break; - default: - area_state = GST_STATUS_AREA_STATE_INIT; - } - gst_status_area_set_state (mplay->status, area_state); - gdk_threads_leave (); -} - -void -on_gst_media_play_destroy (GtkWidget *widget, GstMediaPlay *mplay) -{ - gst_main_quit (); -} - -void -on_exit_menu_activate (GtkWidget *widget, GstMediaPlay *mplay) -{ - gdk_threads_leave (); - gst_play_stop (mplay->play); - gdk_threads_enter (); - gst_main_quit (); -} - -gint -on_gst_media_play_delete_event (GtkWidget *widget, - GdkEvent *event, - GstMediaPlay *mplay) -{ - gdk_threads_leave (); - gst_play_stop (mplay->play); - gdk_threads_enter (); - return FALSE; -} - -void -on_extended1_activate (GtkCheckMenuItem *item, GstMediaPlay *mplay) -{ - gdk_threads_leave (); - gst_status_area_show_extended (mplay->status, item->active); - gdk_threads_enter (); -} - -void -gst_media_play_set_original_size (GstMediaPlay *mplay) -{ - GstPlay *play; - GtkWidget *video_widget; - gint width, height; - - play = mplay->play; - - if (fullscreen_active) - gst_media_play_set_fullscreen (mplay); - - video_widget = gst_play_get_video_widget (play); - width = gst_play_get_source_width (play); - height = gst_play_get_source_height (play); - - gtk_widget_set_usize (video_widget, width, height); -} - -void -gst_media_play_set_double_size (GstMediaPlay *mplay) -{ - GstPlay *play; - GtkWidget *video_widget; - gint width, height; - - play = mplay->play; - - if (fullscreen_active) - gst_media_play_set_fullscreen (mplay); - - video_widget = gst_play_get_video_widget (play); - width = gst_play_get_source_width (play); - height = gst_play_get_source_height (play); - - gtk_widget_set_usize (video_widget, width * 1.5, height * 1.5); -} - -static int -fullscreen_key_press_event (GtkWidget *widget, - GdkEventKey *event, - GstMediaPlay *mplay) -{ - switch (event->keyval) { - case GDK_Escape: - gst_media_play_set_fullscreen (mplay); - break; - case GDK_q: - gst_media_play_set_fullscreen (mplay); - break; - } - - return TRUE; -} - -void -gst_media_play_set_fullscreen (GstMediaPlay *mplay) -{ - GdkWindow *gdk_window; - gint client_x, client_y, root_x, root_y; - gint width, height, source_width, source_height; - GstPlay *play; - GtkWidget *video_widget; - GdkCursor* cursor; - GdkPixmap *source; - GdkPixmap *mask; - GdkColor fg = {0, 0, 0, 0}; - GdkColor bg = {0, 0, 0, 0}; - static unsigned char cursor_bits[] = { - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; - static unsigned char cursormask_bits[] = { - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; - - gdk_window = mplay->window->window; - play = mplay->play; - - video_widget = gst_play_get_video_widget (play); - source_width = gst_play_get_source_width (play); - source_height = gst_play_get_source_height (play); - - if (source_width || source_height) - { - if (!fullscreen_active) { - gtk_widget_hide (glade_xml_get_widget (mplay->xml, "dockitem1")); - gtk_widget_hide (glade_xml_get_widget (mplay->xml, "dockitem2")); - gtk_widget_hide (glade_xml_get_widget (mplay->xml, "dockitem3")); - gtk_widget_hide (glade_xml_get_widget (mplay->xml, "dockitem4")); - gtk_widget_hide (GTK_WIDGET (mplay->status)); - - gdk_window_get_origin (gdk_window, &root_x, &root_y); - gdk_window_get_geometry (gdk_window, &client_x, &client_y, - &width, &height, NULL); - gdk_window_move (gdk_window, -client_x, -client_y); - gtk_widget_set_usize (video_widget, gdk_screen_width () + 1, - gdk_screen_height () + 1); - - source = gdk_bitmap_create_from_data (NULL, cursor_bits, - 16, 16); - mask = gdk_bitmap_create_from_data (NULL, cursormask_bits, - 16, 16); - cursor = gdk_cursor_new_from_pixmap (source, mask, &fg, &bg, 8, 8); - gdk_pixmap_unref (source); - gdk_pixmap_unref (mask); - - gdk_window_set_cursor (mplay->window->window, cursor); - - mplay->x = root_x - client_x; - mplay->y = root_y - client_y; - mplay->width = width; - mplay->height = height; - - fullscreen_active = TRUE; - - mplay->fullscreen_connection_id = gtk_signal_connect (GTK_OBJECT (mplay->window), "key_press_event", - (GtkSignalFunc) fullscreen_key_press_event, mplay); - } else { - gtk_widget_show (glade_xml_get_widget (mplay->xml, "dockitem1")); - gtk_widget_show (glade_xml_get_widget (mplay->xml, "dockitem2")); - gtk_widget_show (glade_xml_get_widget (mplay->xml, "dockitem3")); - gtk_widget_show (glade_xml_get_widget (mplay->xml, "dockitem4")); - gtk_widget_show (GTK_WIDGET (mplay->status)); - gtk_widget_queue_resize (glade_xml_get_widget (mplay->xml, "dock1")); - - gdk_window_move (gdk_window, mplay->x, mplay->y); - gtk_widget_set_usize (video_widget, source_width, - source_height); - - gdk_window_set_cursor (mplay->window->window, NULL); - - gtk_signal_disconnect (GTK_OBJECT (mplay->window), mplay->fullscreen_connection_id); - - fullscreen_active = FALSE; - } - } -} - -static void -gst_media_play_frame_displayed (GstPlay *play, GstMediaPlay *mplay) -{ - gulong current_time; - gulong total_time; - gulong size, current_offset; - - g_return_if_fail (GST_IS_PLAY (play)); - g_return_if_fail (GST_IS_MEDIA_PLAY (mplay)); - - current_time = gst_play_get_media_current_time (play); - total_time = gst_play_get_media_total_time (play); - size = gst_play_get_media_size (play); - current_offset = gst_play_get_media_offset (play); - - /* g_print ("%lu %lu %lu %lu\n", current_time, total_time, size, current_offset); */ - - if (current_time != mplay->last_time) { - gdk_threads_enter (); - gst_media_play_update_status_area (mplay, current_time, total_time); - update_slider (mplay, mplay->adjustment, current_offset*100.0/size); - mplay->last_time = current_time; - gdk_threads_leave (); - } -} - -static void -gst_media_play_slider_changed (GtkAdjustment *adj, GstMediaPlay *mplay) -{ - gulong size; - - g_return_if_fail (GST_IS_MEDIA_PLAY (mplay)); - - size = gst_play_get_media_size (mplay->play); - - gst_play_media_seek (mplay->play, (int)(adj->value*size/100.0)); -} - -void -on_toggle_play_toggled (GtkToggleButton *togglebutton, GstMediaPlay *play) -{ - gdk_threads_leave (); - gst_play_play (play->play); - gdk_threads_enter (); - update_buttons (play, GST_PLAY_STATE(play->play)); -} - -void -on_toggle_pause_toggled (GtkToggleButton *togglebutton, GstMediaPlay *play) -{ - gdk_threads_leave (); - gst_play_pause (play->play); - gdk_threads_enter (); - update_buttons (play, GST_PLAY_STATE(play->play)); -} - -void -on_toggle_stop_toggled (GtkToggleButton *togglebutton, GstMediaPlay *play) -{ - gdk_threads_leave (); - gst_play_stop (play->play); - gdk_threads_enter (); - update_buttons (play, GST_PLAY_STATE(play->play)); -} - -static void -update_buttons (GstMediaPlay *mplay, GstPlayState state) -{ - gtk_signal_handler_block_by_func (GTK_OBJECT (mplay->play_button), - GTK_SIGNAL_FUNC (on_toggle_play_toggled), - mplay); - gtk_signal_handler_block_by_func (GTK_OBJECT (mplay->pause_button), - GTK_SIGNAL_FUNC (on_toggle_pause_toggled), - mplay); - gtk_signal_handler_block_by_func (GTK_OBJECT (mplay->stop_button), - GTK_SIGNAL_FUNC (on_toggle_stop_toggled), - mplay); - - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (mplay->play_button), FALSE); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (mplay->pause_button), FALSE); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (mplay->stop_button), FALSE); - - if (state == GST_PLAY_PLAYING) { - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (mplay->play_button), TRUE); - } - else if (state == GST_PLAY_PAUSED) { - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (mplay->pause_button), TRUE); - } - else if (state == GST_PLAY_STOPPED) { - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (mplay->stop_button), TRUE); - } - - gtk_signal_handler_unblock_by_func (GTK_OBJECT (mplay->play_button), - GTK_SIGNAL_FUNC (on_toggle_play_toggled), - mplay); - gtk_signal_handler_unblock_by_func (GTK_OBJECT (mplay->pause_button), - GTK_SIGNAL_FUNC (on_toggle_pause_toggled), - mplay); - gtk_signal_handler_unblock_by_func (GTK_OBJECT (mplay->stop_button), - GTK_SIGNAL_FUNC (on_toggle_stop_toggled), - mplay); -} - -static void -update_slider (GstMediaPlay *mplay, - GtkAdjustment *adjustment, - gfloat value) -{ - gtk_signal_handler_block_by_func (GTK_OBJECT (adjustment), - GTK_SIGNAL_FUNC (gst_media_play_slider_changed), - mplay); - gtk_adjustment_set_value (adjustment, value); - gtk_signal_handler_unblock_by_func (GTK_OBJECT (adjustment), - GTK_SIGNAL_FUNC (gst_media_play_slider_changed), - mplay); -} diff --git a/gstplay/gstmediaplay.glade b/gstplay/gstmediaplay.glade deleted file mode 100644 index a4c9063..0000000 --- a/gstplay/gstmediaplay.glade +++ /dev/null @@ -1,697 +0,0 @@ - - - - - GstMediaPlay - gstmediaplay - - src - pixmaps - C - True - True - False - False - False - - - - GnomeApp - gstplay - - delete_event - on_gst_media_play_delete_event - Wed, 01 Nov 2000 00:38:57 GMT - - - destroy - on_gst_media_play_destroy - Wed, 01 Nov 2000 00:39:03 GMT - - Gstplay - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_CENTER - False - True - True - True - gstmediaplay - GstMediaPlay - True - - - GnomeDock - GnomeApp:dock - dock1 - False - - 0 - True - True - - - - GnomeDockItem - dockitem1 - 2 - GNOME_DOCK_TOP - 0 - 0 - 0 - False - True - False - True - False - GTK_SHADOW_OUT - - - GtkMenuBar - menubar1 - GTK_SHADOW_NONE - - - GtkMenuItem - file1 - GNOMEUIINFO_MENU_FILE_TREE - - - GtkMenu - file1_menu - - - GtkPixmapMenuItem - open1 - - activate - on_open2_activate - Thu, 27 Jul 2000 19:35:00 GMT - - GNOMEUIINFO_MENU_OPEN_ITEM - - - - GtkPixmapMenuItem - save1 - - activate - on_save1_activate - Thu, 27 Jul 2000 19:35:00 GMT - - GNOMEUIINFO_MENU_SAVE_ITEM - - - - GtkPixmapMenuItem - save_as1 - - activate - on_save_as1_activate - Thu, 27 Jul 2000 19:35:00 GMT - - GNOMEUIINFO_MENU_SAVE_AS_ITEM - - - - GtkMenuItem - separator1 - False - - - - GtkPixmapMenuItem - exit_menu - - activate - on_exit_menu_activate - Sun, 06 Aug 2000 13:41:10 GMT - - GNOMEUIINFO_MENU_EXIT_ITEM - - - - - - GtkMenuItem - view1 - GNOMEUIINFO_MENU_VIEW_TREE - - - GtkMenu - view1_menu - - - GtkMenuItem - present_movie - - False - - - GtkMenu - present_movie_menu - - - GtkMenuItem - original_size - - GDK_CONTROL_MASK - GDK_1 - activate - - - activate - on_original_size_activate - Sun, 06 May 2001 01:58:18 GMT - - - False - - - - GtkMenuItem - double_size - - GDK_CONTROL_MASK - GDK_2 - activate - - - activate - on_double_size_activate - Sun, 06 May 2001 01:34:06 GMT - - - False - - - - GtkMenuItem - full_screen - - GDK_CONTROL_MASK - GDK_3 - activate - - - activate - on_full_screen_activate - Sun, 06 May 2001 01:34:06 GMT - - - False - - - - - - GtkCheckMenuItem - extended1 - - activate - on_extended1_activate - Mon, 06 Nov 2000 21:52:57 GMT - - - False - True - - - - GtkMenuItem - media1 - - activate - on_media2_activate - Thu, 27 Jul 2000 19:37:03 GMT - - - False - - - - - - GtkMenuItem - settings1 - GNOMEUIINFO_MENU_SETTINGS_TREE - - - GtkMenu - settings1_menu - - - GtkPixmapMenuItem - preferences1 - - activate - on_preferences1_activate - Thu, 27 Jul 2000 19:35:00 GMT - - GNOMEUIINFO_MENU_PREFERENCES_ITEM - - - - - - GtkMenuItem - play1 - - False - - - GtkMenu - play1_menu - - - GtkPixmapMenuItem - play1 - - activate - on_toggle_play_toggled - Sun, 06 Aug 2000 13:29:59 GMT - - - False - play.xpm - - - - GtkPixmapMenuItem - pause1 - - activate - on_toggle_pause_toggled - Sun, 06 Aug 2000 13:30:13 GMT - - - False - pause.xpm - - - - GtkPixmapMenuItem - stop1 - - activate - on_toggle_stop_toggled - Sun, 06 Aug 2000 13:30:25 GMT - - - False - stop.xpm - - - - - - GtkMenuItem - help1 - GNOMEUIINFO_MENU_HELP_TREE - - - GtkMenu - help1_menu - - - GtkPixmapMenuItem - about1 - - activate - on_about_activate - Sun, 06 Aug 2000 11:54:17 GMT - - GNOMEUIINFO_MENU_ABOUT_ITEM - - - - - - - - GnomeDockItem - dockitem3 - 1 - GNOME_DOCK_BOTTOM - 0 - 0 - 0 - True - True - True - True - True - GTK_SHADOW_NONE - - - GtkHScale - slider - True - False - GTK_POS_LEFT - 1 - GTK_UPDATE_CONTINUOUS - 0 - 0 - 110 - 1 - 10 - 10 - - - - - GnomeDockItem - dockitem2 - GNOME_DOCK_BOTTOM - 1 - 0 - 0 - False - True - False - False - False - GTK_SHADOW_OUT - - - GtkToolbar - toolbar1 - 3 - GTK_ORIENTATION_HORIZONTAL - GTK_TOOLBAR_ICONS - 0 - GTK_TOOLBAR_SPACE_LINE - GTK_RELIEF_NONE - True - - - GtkToggleButton - Toolbar:button - toggle_play - Play - - toggled - on_toggle_play_toggled - Sun, 06 Aug 2000 13:17:46 GMT - - - play.xpm - False - - - - GtkToggleButton - Toolbar:button - toggle_pause - Pause - - toggled - on_toggle_pause_toggled - Sun, 06 Aug 2000 13:17:57 GMT - - - pause.xpm - False - - - - GtkToggleButton - Toolbar:button - toggle_stop - Stop - - toggled - on_toggle_stop_toggled - Sun, 06 Aug 2000 13:18:07 GMT - - - stop.xpm - False - - - - GtkButton - Toolbar:button - button1 - - play.xpm - - - - - - GnomeDockItem - dockitem4 - GNOME_DOCK_BOTTOM - 2 - 0 - 0 - True - True - False - False - False - GTK_SHADOW_OUT - - - Custom - status_area - gst_status_area_new - 0 - 0 - Wed, 08 Nov 2000 19:56:51 GMT - - - - - Placeholder - GnomeDock:contents - - - - - - GnomeAbout - about - True - about - GstMediaPlay - (C) 1999-2001 Erik Walthinsen, Arik Devens - Erik Walthinsen <omega@cse.ogi.edu> -Wim Taymans <wim.taymans@tvd.be> -Richard Boulton <richard@tartarus.org> -Chris Emerson (PPC port) -Ronald Bultje <rbultje@ronald.bitfreak.net> -Arik Devens <arik@gnome.org> - - A generic media player for the gstreamer streaming media framework. - - - - GtkFileSelection - fileselection1 - 10 - Select File - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - True - False - True - False - filesel - GstMediaPlay - True - - - GtkButton - FileSel:ok_button - ok_button1 - True - True - - clicked - on_ok_button1_clicked - fileselection1 - Sun, 06 Aug 2000 15:56:49 GMT - - - clicked - gtk_widget_hide - fileselection1 - Sun, 06 Aug 2000 15:55:52 GMT - - GNOME_STOCK_BUTTON_OK - GTK_RELIEF_NORMAL - - - - GtkButton - FileSel:cancel_button - cancel_button1 - True - True - - clicked - gtk_widget_hide - fileselection1 - Sun, 06 Aug 2000 15:53:48 GMT - - GNOME_STOCK_BUTTON_CANCEL - GTK_RELIEF_NORMAL - - - - - GtkWindow - preferences - GstMediaPlayer Preferences - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - False - True - False - - - GtkNotebook - notebook1 - True - True - True - GTK_POS_TOP - False - 2 - 2 - False - - - GtkFrame - frame1 - - 0 - GTK_SHADOW_ETCHED_IN - - - GtkVBox - vbox1 - False - 0 - - - GtkCheckButton - checkbutton1 - True - - False - True - - 0 - False - False - - - - - GtkCheckButton - checkbutton2 - True - - False - True - - 0 - False - False - - - - - GtkCheckButton - checkbutton3 - True - - False - True - - 0 - False - False - - - - - - - GtkLabel - Notebook:tab - label1 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - - - GtkWindow - playlist_window - playlist - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - False - True - False - - - GtkScrolledWindow - scrolledwindow1 - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_UPDATE_CONTINUOUS - GTK_UPDATE_CONTINUOUS - - - GtkCList - playlist_clist - True - 2 - 273,80 - GTK_SELECTION_SINGLE - True - GTK_SHADOW_IN - - - GtkLabel - CList:title - track_name - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - GtkLabel - CList:title - track_lengthe - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - - - diff --git a/gstplay/gstmediaplay.glade2 b/gstplay/gstmediaplay.glade2 deleted file mode 100644 index 3e2bfb8..0000000 --- a/gstplay/gstmediaplay.glade2 +++ /dev/null @@ -1,709 +0,0 @@ - - - - - - - - - Gstplay - GTK_WINDOW_TOPLEVEL - no - yes - yes - gstmediaplay - GstMediaPlay - yes - no - GTK_WIN_POS_CENTER - - - - - - - no - yes - - - - 2 - GTK_SHADOW_OUT - yes - - - - yes - - - - GNOMEUIINFO_MENU_FILE_TREE - yes - - - - yes - - - - GNOMEUIINFO_MENU_OPEN_ITEM - yes - - - - - - - - GNOMEUIINFO_MENU_SAVE_ITEM - yes - - - - - - - - GNOMEUIINFO_MENU_SAVE_AS_ITEM - yes - - - - - - - - yes - - - - - - GNOMEUIINFO_MENU_EXIT_ITEM - yes - - - - - - - - - - - - GNOMEUIINFO_MENU_VIEW_TREE - yes - - - - yes - - - - yes - - - - yes - - - - yes - - - - - - - - Original Size - 0.0 - original_size - yes - yes - - - - - - - - yes - - - - - - - - Double Size - 0.0 - double_size - yes - yes - - - - - - - - yes - - - - - - - - Full Screen - 0.0 - full_screen - yes - yes - - - - - - - - - - P_resent Movie - 0.0 - present_movie - yes - yes - - - - - - - - no - yes - yes - - - - - - _Extended - 0.0 - extended1 - yes - yes - - - - - - - - yes - - - - - - _Media... - 0.0 - media1 - yes - yes - - - - - - - - - - - - GNOMEUIINFO_MENU_SETTINGS_TREE - yes - - - - yes - - - - GNOMEUIINFO_MENU_PREFERENCES_ITEM - yes - - - - - - - - - - - - yes - - - - yes - - - - play.xpm - yes - - - - - - _Play - 0.0 - play1 - yes - yes - - - - - - - - pause.xpm - yes - - - - - - P_ause - 0.0 - pause1 - yes - yes - - - - - - - - stop.xpm - yes - - - - - - _Stop - 0.0 - stop1 - yes - yes - - - - - - - - - - _Play - 0.0 - play1 - yes - yes - - - - - - - - GNOMEUIINFO_MENU_HELP_TREE - yes - - - - yes - - - - GNOMEUIINFO_MENU_ABOUT_ITEM - yes - - - - - - - - - - - - - BONOBO_DOCK_TOP - 0 - 0 - 0 - BONOBO_DOCK_ITEM_BEH_EXCLUSIVE|BONOBO_DOCK_ITEM_BEH_NEVER_VERTICAL - - - - - - 1 - GTK_SHADOW_NONE - yes - - - - yes - no - GTK_POS_LEFT - 1 - yes - 0 0 110 1 10 10 - - - - - BONOBO_DOCK_BOTTOM - 0 - 0 - 0 - BONOBO_DOCK_ITEM_BEH_LOCKED|BONOBO_DOCK_ITEM_BEH_EXCLUSIVE|BONOBO_DOCK_ITEM_BEH_NEVER_FLOATING|BONOBO_DOCK_ITEM_BEH_NEVER_VERTICAL|BONOBO_DOCK_ITEM_BEH_NEVER_HORIZONTAL - - - - - - GTK_SHADOW_OUT - yes - - - - 3 - GTK_ORIENTATION_HORIZONTAL - GTK_TOOLBAR_ICONS - yes - - - - Play - Play - play.xpm - no - yes - - - - - - - - Pause - Pause - pause.xpm - no - yes - - - - - - - - Stop - Stop - stop.xpm - no - yes - - - - - - - - - BONOBO_DOCK_BOTTOM - 1 - 0 - 0 - BONOBO_DOCK_ITEM_BEH_EXCLUSIVE - - - - - - GTK_SHADOW_OUT - yes - - - - gst_status_area_new - 0 - 0 - Wed, 08 Nov 2000 19:56:51 GMT - yes - - - - - BONOBO_DOCK_BOTTOM - 2 - 0 - 0 - BONOBO_DOCK_ITEM_BEH_LOCKED|BONOBO_DOCK_ITEM_BEH_EXCLUSIVE - - - - - - yes - - - - - 0 - yes - yes - - - - - yes - about - GstMediaPlay - (C) 1999-2001 Erik Walthinsen, Arik Devens - Erik Walthinsen <omega@cse.ogi.edu> -Wim Taymans <wim.taymans@tvd.be> -Richard Boulton <richard@tartarus.org> -Chris Emerson (PPC port) -Ronald Bultje <rbultje@ronald.bitfreak.net> -Arik Devens <arik@gnome.org> - - A generic media player for the gstreamer streaming media framework. - no - - - 10 - Select File - GTK_WINDOW_TOPLEVEL - yes - no - yes - filesel - GstMediaPlay - no - yes - GTK_WIN_POS_NONE - - - - yes - yes - GTK_RELIEF_NORMAL - yes - gtk-ok - yes - yes - - - - - - - - - yes - yes - GTK_RELIEF_NORMAL - yes - gtk-cancel - yes - yes - - - - - - - GstMediaPlayer Preferences - GTK_WINDOW_TOPLEVEL - no - no - yes - no - GTK_WIN_POS_NONE - - - - yes - yes - yes - GTK_POS_TOP - no - 2 - 2 - no - yes - - - - Full Screen - 0 - GTK_SHADOW_ETCHED_IN - yes - - - - no - 0 - yes - - - - yes - Show file menu - no - yes - yes - - - 0 - no - no - - - - - - yes - Show player controls - no - yes - yes - - - 0 - no - no - - - - - - yes - Show status area - no - yes - yes - - - 0 - no - no - - - - - - - - - - Viewers - GTK_JUSTIFY_CENTER - no - 0.5 - 0.5 - 0 - 0 - yes - - - tab - - - - - - - playlist - GTK_WINDOW_TOPLEVEL - no - no - yes - no - GTK_WIN_POS_NONE - - - - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - yes - - - - yes - 273,80 - GTK_SELECTION_SINGLE - yes - GTK_SHADOW_IN - 2 - yes - - - - track name - GTK_JUSTIFY_CENTER - no - 0.5 - 0.5 - 0 - 0 - yes - - - - - - track length - GTK_JUSTIFY_CENTER - no - 0.5 - 0.5 - 0 - 0 - yes - - - - - - - - GTK_UPDATE_CONTINUOUS - yes - - - - - - GTK_UPDATE_CONTINUOUS - yes - - - - - - diff --git a/gstplay/gstmediaplay.h b/gstplay/gstmediaplay.h deleted file mode 100644 index ee5b45a..0000000 --- a/gstplay/gstmediaplay.h +++ /dev/null @@ -1,65 +0,0 @@ -#ifndef __GST_MEDIA_PLAY_H__ -#define __GST_MEDIA_PLAY_H__ - -#include -#include "gstplay.h" -#include "gststatusarea.h" - -#define GST_TYPE_MEDIA_PLAY (gst_media_play_get_type()) -#define GST_MEDIA_PLAY(obj) (GTK_CHECK_CAST ((obj), GST_TYPE_MEDIA_PLAY, GstMediaPlay)) -#define GST_MEDIA_PLAY_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GST_TYPE_MEDIA_PLAY, GstMediaPlayClass)) -#define GST_IS_MEDIA_PLAY(obj) (GTK_CHECK_TYPE ((obj), GST_TYPE_MEDIA_PLAY)) -#define GST_IS_MEDIA_PLAY_CLASS(obj) (GTK_CHECK_CLASS_TYPE ((klass), GST_TYPE_MEDIA_PLAY)) - -typedef struct _GstMediaPlay GstMediaPlay; -typedef struct _GstMediaPlayClass GstMediaPlayClass; - -struct _GstMediaPlay { - GtkObject parent; - - GladeXML *xml; - GladeXML *playlist_xml; - GstPlay *play; - - GtkWidget *play_button; - GtkWidget *pause_button; - GtkWidget *stop_button; - GtkWidget *window; - - GstStatusArea *status; - - /* the slider */ - GtkAdjustment *adjustment; - GtkWidget *slider; - - /* the playlist */ - GtkWidget *playlist_window; - GtkWidget *playlist_clist; - - guint fullscreen_connection_id; - - gulong last_time; - - gint x, y, width, height; -}; - -struct _GstMediaPlayClass { - GtkObjectClass parent_class; -}; - - -GtkType gst_media_play_get_type (void); - -/* setup the player */ -GstMediaPlay* gst_media_play_new (void); - -void gst_media_play_start_uri (GstMediaPlay *play, const guchar *uri); - -void gst_media_play_show_playlist (GstMediaPlay *mplay); -void gst_media_play_addto_playlist (GstMediaPlay *mplay, char *uri); - -void gst_media_play_set_original_size (GstMediaPlay *mplay); -void gst_media_play_set_double_size (GstMediaPlay *mplay); -void gst_media_play_set_fullscreen (GstMediaPlay *mplay); - -#endif /* __GST_MEDIA_PLAY_H__ */ diff --git a/gstplay/gstplay.c b/gstplay/gstplay.c deleted file mode 100644 index de32595..0000000 --- a/gstplay/gstplay.c +++ /dev/null @@ -1,777 +0,0 @@ -#include - -#include -#include -#include -#include -#include - -#include "gstplay.h" - -static void gst_play_class_init (GstPlayClass *klass); -static void gst_play_init (GstPlay *play); - -static void gst_play_set_arg (GtkObject *object, GtkArg *arg, guint id); -static void gst_play_get_arg (GtkObject *object, GtkArg *arg, guint id); - -static void gst_play_realize (GtkWidget *play); - -static void gst_play_frame_displayed (GstElement *element, GstPlay *play); -static void gst_play_have_size (GstElement *element, guint width, guint height, GstPlay *play); -static void gst_play_audio_handoff (GstElement *element, GstPlay *play); - -/* signals and args */ -enum { - SIGNAL_STATE_CHANGED, - SIGNAL_FRAME_DISPLAYED, - SIGNAL_AUDIO_PLAYED, - LAST_SIGNAL -}; - -enum { - ARG_0, - ARG_URI, - ARG_MUTE, - ARG_STATE, - ARG_MEDIA_SIZE, - ARG_MEDIA_OFFSET, - ARG_MEDIA_TOTAL_TIME, - ARG_MEDIA_CURRENT_TIME, -}; - -static GtkObject *parent_class = NULL; -static guint gst_play_signals[LAST_SIGNAL] = {0}; - -struct _GstPlayPrivate { - GstElement *pipeline; - GstElement *video_element, *audio_element; - GstElement *video_show; - GtkWidget *video_widget; - GstElement *src; - GstElement *cache; - GstElement *typefind; - - guchar *uri; - gboolean muted; - gboolean can_seek; - - GstElement *offset_element; - GstElement *bit_rate_element; - GstElement *media_time_element; - GstElement *current_time_element; - - guint source_width; - guint source_height; -}; - -GtkType -gst_play_get_type (void) -{ - static GtkType play_type = 0; - - if (!play_type) { - static const GtkTypeInfo play_info = { - "GstPlay", - sizeof (GstPlay), - sizeof (GstPlayClass), - (GtkClassInitFunc) gst_play_class_init, - (GtkObjectInitFunc) gst_play_init, - NULL, - NULL, - (GtkClassInitFunc)NULL, - }; - play_type = gtk_type_unique (gtk_hbox_get_type (), &play_info); - } - return play_type; -} - -static void -gst_play_class_init (GstPlayClass *klass) -{ - GtkObjectClass *object_class; - GtkWidgetClass *widget_class; - - parent_class = gtk_type_class (gtk_hbox_get_type ()); - - object_class = (GtkObjectClass*)klass; - widget_class = (GtkWidgetClass*)klass; - - gst_play_signals[SIGNAL_STATE_CHANGED] = - gtk_signal_new ("playing_state_changed", GTK_RUN_FIRST, - G_TYPE_FROM_CLASS (object_class), - GTK_SIGNAL_OFFSET (GstPlayClass, state_changed), - gtk_marshal_NONE__INT, GTK_TYPE_NONE, 1, - GTK_TYPE_INT); - - gst_play_signals[SIGNAL_FRAME_DISPLAYED] = - gtk_signal_new ("frame_displayed",GTK_RUN_FIRST, G_TYPE_FROM_CLASS (object_class), - GTK_SIGNAL_OFFSET (GstPlayClass, frame_displayed), - gtk_marshal_NONE__NONE, GTK_TYPE_NONE, 0); - - gst_play_signals[SIGNAL_AUDIO_PLAYED] = - gtk_signal_new ("audio_played",GTK_RUN_FIRST, G_TYPE_FROM_CLASS (object_class), - GTK_SIGNAL_OFFSET (GstPlayClass, audio_played), - gtk_marshal_NONE__NONE, GTK_TYPE_NONE, 0); - -#ifndef USE_GLIB2 - gtk_object_class_add_signals (object_class, gst_play_signals, LAST_SIGNAL); -#endif - - gtk_object_add_arg_type ("GstPlay::uri", GTK_TYPE_STRING, - GTK_ARG_READABLE, ARG_URI); - gtk_object_add_arg_type ("GstPlay::mute", GTK_TYPE_BOOL, - GTK_ARG_READWRITE, ARG_MUTE); - gtk_object_add_arg_type ("GstPlay::state", GTK_TYPE_INT, - GTK_ARG_READABLE, ARG_STATE); -#ifdef USE_GLIB2 - gtk_object_add_arg_type ("GstPlay::media_size", GTK_TYPE_UINT, - GTK_ARG_READABLE, ARG_MEDIA_SIZE); - gtk_object_add_arg_type ("GstPlay::media_offset", GTK_TYPE_UINT, - GTK_ARG_READABLE, ARG_MEDIA_OFFSET); - gtk_object_add_arg_type ("GstPlay::media_total_time", GTK_TYPE_UINT, - GTK_ARG_READABLE, ARG_MEDIA_TOTAL_TIME); - gtk_object_add_arg_type ("GstPlay::media_current_time", GTK_TYPE_UINT, - GTK_ARG_READABLE, ARG_MEDIA_CURRENT_TIME); -#else - gtk_object_add_arg_type ("GstPlay::media_size", GTK_TYPE_ULONG, - GTK_ARG_READABLE, ARG_MEDIA_SIZE); - gtk_object_add_arg_type ("GstPlay::media_offset", GTK_TYPE_ULONG, - GTK_ARG_READABLE, ARG_MEDIA_OFFSET); - gtk_object_add_arg_type ("GstPlay::media_total_time", GTK_TYPE_ULONG, - GTK_ARG_READABLE, ARG_MEDIA_TOTAL_TIME); - gtk_object_add_arg_type ("GstPlay::media_current_time", GTK_TYPE_ULONG, - GTK_ARG_READABLE, ARG_MEDIA_CURRENT_TIME); -#endif - - object_class->set_arg = gst_play_set_arg; - object_class->get_arg = gst_play_get_arg; - - widget_class->realize = gst_play_realize; - -} - -static void -gst_play_init (GstPlay *play) -{ - GstPlayPrivate *priv = g_new0 (GstPlayPrivate, 1); - GstElement *colorspace; - - play->priv = priv; - - /* create a new bin to hold the elements */ - priv->pipeline = gst_pipeline_new ("main_pipeline"); - g_assert (priv->pipeline != NULL); - - priv->audio_element = gst_elementfactory_make ("osssink", "play_audio"); - g_return_if_fail (priv->audio_element != NULL); - g_signal_connect (G_OBJECT (priv->audio_element), "handoff", - G_CALLBACK (gst_play_audio_handoff), play); - - priv->video_element = gst_elementfactory_make ("bin", "video_bin"); - - priv->video_show = gst_elementfactory_make ("xvideosink", "show"); - g_object_set (G_OBJECT (priv->video_show), "toplevel", FALSE, NULL); - g_return_if_fail (priv->video_show != NULL); - /* gtk_object_set (GTK_OBJECT (priv->video_element), "xv_enabled", FALSE, NULL); */ - g_signal_connect (G_OBJECT (priv->video_show), "frame_displayed", - G_CALLBACK (gst_play_frame_displayed), play); - g_signal_connect (G_OBJECT (priv->video_show), "have_size", - G_CALLBACK (gst_play_have_size), play); - - gst_bin_add (GST_BIN (priv->video_element), priv->video_show); - - colorspace = gst_elementfactory_make ("colorspace", "colorspace"); - if (colorspace == NULL) { - g_warning ("could not create the 'colorspace' element, doing without"); - gst_element_add_ghost_pad (priv->video_element, - gst_element_get_pad (priv->video_show, "sink"), - "sink"); - } - else { - //GST_FLAG_SET (priv->video_element, GST_ELEMENT_THREAD_SUGGESTED); - gst_bin_add (GST_BIN (priv->video_element), colorspace); - gst_element_connect (colorspace, "src", priv->video_show, "sink"); - gst_element_add_ghost_pad (priv->video_element, - gst_element_get_pad (colorspace, "sink"), - "sink"); - } - - play->state = GST_PLAY_STOPPED; - play->flags = 0; - - priv->src = NULL; - priv->muted = FALSE; - priv->can_seek = TRUE; - priv->uri = NULL; - priv->offset_element = NULL; - priv->bit_rate_element = NULL; - priv->media_time_element = NULL; - priv->current_time_element = NULL; - - priv->source_width = 0; - priv->source_height = 0; -} - -GstPlay * -gst_play_new () -{ - return GST_PLAY (gtk_type_new (GST_TYPE_PLAY)); -} - -static gboolean -gst_play_idle_func (gpointer data) -{ - gboolean busy; - - busy = gst_bin_iterate (GST_BIN (data)); - - return busy; -} - -static void -gst_play_eos (GstElement *element, - GstPlay *play) -{ - GST_DEBUG(0, "gstplay: eos reached\n"); - gst_play_stop (play); -} - -static void -gst_play_have_size (GstElement *element, guint width, guint height, - GstPlay *play) -{ - play->priv->source_width = width; - play->priv->source_height = height; - - gtk_widget_set_usize (play->priv->video_widget, width, height); -} - -static void -gst_play_frame_displayed (GstElement *element, GstPlay *play) -{ - static int stolen = FALSE; - - gdk_threads_enter (); - if (!stolen) { - gtk_widget_realize (play->priv->video_widget); - gtk_socket_steal (GTK_SOCKET (play->priv->video_widget), - gst_util_get_int_arg ( - G_OBJECT (play->priv->video_show), "xid")); - gtk_widget_show (play->priv->video_widget); - stolen = TRUE; - } - gdk_threads_leave (); - - gtk_signal_emit (GTK_OBJECT (play), gst_play_signals[SIGNAL_FRAME_DISPLAYED], - NULL); -} - -static void -gst_play_audio_handoff (GstElement *element, GstPlay *play) -{ - gtk_signal_emit (GTK_OBJECT (play), gst_play_signals[SIGNAL_AUDIO_PLAYED], - NULL); -} - -#ifdef USE_GLIB2 -static void -gst_play_object_introspect (GstObject *object, const gchar *property, GstElement **target) -{ - GParamSpec *pspec; - GstElement *element; - - if (!GST_IS_ELEMENT (object) && !GST_IS_BIN (object)) - return; - - element = GST_ELEMENT (object); - - pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (element), property); - - if (pspec) { - *target = element; - GST_DEBUG(0, "gstplay: using element \"%s\" for %s property\n", - gst_element_get_name(element), property); - } -} -#else -static void -gst_play_object_introspect (GstObject *object, const gchar *property, GstElement **target) -{ - gchar *info; - GtkArgInfo *arg; - GstElement *element; - - if (!GST_IS_ELEMENT (object) && !GST_IS_BIN (object)) - return; - - element = GST_ELEMENT (object); - - info = gtk_object_arg_get_info (GTK_OBJECT_TYPE (element), property, &arg); - - if (info) { - g_free(info); - } - else { - *target = element; - GST_DEBUG(0, "gstplay: using element \"%s\" for %s property\n", - gst_element_get_name(element), property); - } -} -#endif - -/* Dumb introspection of the interface... - * this will change with glib 1.4 - * */ -static void -gst_play_object_added (GstAutoplug* autoplug, GstObject *object, GstPlay *play) -{ - g_return_if_fail (play != NULL); - - if (GST_FLAG_IS_SET (object, GST_ELEMENT_NO_SEEK)) - play->priv->can_seek = FALSE; - - /* first come first serve here... */ - if (!play->priv->offset_element) - gst_play_object_introspect (object, "offset", - &play->priv->offset_element); - if (!play->priv->bit_rate_element) - gst_play_object_introspect (object, "bit_rate", - &play->priv->bit_rate_element); - if (!play->priv->media_time_element) - gst_play_object_introspect (object, "media_time", - &play->priv->media_time_element); - if (!play->priv->current_time_element) - gst_play_object_introspect (object, "current_time", - &play->priv->current_time_element); - -} - -static void -gst_play_cache_empty (GstElement *element, GstPlay *play) -{ - GstPlayPrivate *priv = play->priv; - GstElement *new_element; - - gst_element_set_state (priv->pipeline, GST_STATE_PAUSED); - - new_element = gst_bin_get_by_name (GST_BIN (priv->pipeline), "new_element"); - - gst_element_disconnect (priv->src, "src", priv->cache, "sink"); - gst_element_disconnect (priv->cache, "src", new_element, "sink"); - gst_bin_remove (GST_BIN (priv->pipeline), priv->cache); - gst_element_connect (priv->src, "src", new_element, "sink"); - - gst_element_set_state (priv->pipeline, GST_STATE_PLAYING); -} - -static void -gst_play_have_type (GstElement *sink, GstCaps *caps, GstPlay *play) -{ - GstElement *new_element; - GstAutoplug *autoplug; - GstPlayPrivate *priv = play->priv; - - GST_DEBUG (0,"GstPipeline: play have type\n"); - - gst_element_set_state (priv->pipeline, GST_STATE_PAUSED); - - gst_element_disconnect (priv->cache, "src", priv->typefind, "sink"); - gst_bin_remove (GST_BIN (priv->pipeline), priv->typefind); - - autoplug = gst_autoplugfactory_make ("staticrender"); - g_assert (autoplug != NULL); - - g_signal_connect (G_OBJECT (autoplug), "new_object", - G_CALLBACK (gst_play_object_added), play); - - new_element = gst_autoplug_to_renderers (autoplug, - caps, - priv->video_element, - priv->audio_element, - NULL); - - if (!new_element) { - /* FIXME, signal a suitable error */ - return; - } - - gst_element_set_name (new_element, "new_element"); - - gst_bin_add (GST_BIN (priv->pipeline), new_element); - - g_object_set (G_OBJECT (priv->cache), "reset", TRUE, NULL); - - gst_element_connect (priv->cache, "src", new_element, "sink"); - - g_signal_connect (G_OBJECT (priv->pipeline), "eos", G_CALLBACK (gst_play_eos), play); - - gst_element_set_state (priv->pipeline, GST_STATE_PLAYING); -} - -#if 0 -static gboolean -connect_pads (GstElement *new_element, GstElement *target, gboolean add) -{ - GList *pads = gst_element_get_pad_list (new_element); - GstPad *targetpad = gst_element_get_pad (target, "sink"); - - while (pads) { - GstPad *pad = GST_PAD (pads->data); - - if (gst_pad_check_compatibility (pad, targetpad)) { - if (add) { - gst_bin_add (GST_BIN (gst_element_get_parent ( - GST_ELEMENT (gst_pad_get_real_parent (pad)))), - target); - } - gst_pad_connect (pad, targetpad); - return TRUE; - } - pads = g_list_next (pads); - } - return FALSE; -} -#endif - -GstPlayReturn -gst_play_set_uri (GstPlay *play, const guchar *uri) -{ - gchar *uriloc; - GstPlayPrivate *priv; - - g_return_val_if_fail (play != NULL, GST_PLAY_ERROR); - g_return_val_if_fail (GST_IS_PLAY (play), GST_PLAY_ERROR); - g_return_val_if_fail (uri != NULL, GST_PLAY_ERROR); - - priv = (GstPlayPrivate *)play->priv; - - if (priv->uri) - g_free (priv->uri); - - /* see if it looks like an URI */ - if ((uriloc = strstr (uri, ":/"))) { - priv->src = gst_elementfactory_make ("gnomevfssrc", "srcelement"); - - if (!priv->src) { - if (strstr (uri, "file:/")) - uri += strlen ("file:/"); - else - return GST_PLAY_CANNOT_PLAY; - } - } - - if (!priv->src) - priv->src = gst_elementfactory_make ("filesrc", "srcelement"); - - priv->uri = g_strdup (uri); - - /* priv->src = gst_elementfactory_make ("dvdsrc", "disk_src"); */ - - g_return_val_if_fail (priv->src != NULL, GST_PLAY_CANNOT_PLAY); - - g_object_set (G_OBJECT (priv->src), "location", priv->uri, NULL); - - priv->cache = gst_elementfactory_make ("autoplugcache", "cache"); - g_return_val_if_fail (priv->cache != NULL, GST_PLAY_CANNOT_PLAY); - - g_signal_connect (G_OBJECT (priv->cache), "cache_empty", - G_CALLBACK (gst_play_cache_empty), play); - - priv->typefind = gst_elementfactory_make ("typefind", "typefind"); - g_return_val_if_fail (priv->typefind != NULL, GST_PLAY_CANNOT_PLAY); - g_signal_connect (G_OBJECT (priv->typefind), "have_type", - G_CALLBACK (gst_play_have_type), play); - - - gst_bin_add (GST_BIN (priv->pipeline), priv->src); - gst_bin_add (GST_BIN (priv->pipeline), priv->cache); - gst_bin_add (GST_BIN (priv->pipeline), priv->typefind); - - gst_element_connect (priv->src, "src", priv->cache, "sink"); - gst_element_connect (priv->cache, "src", priv->typefind, "sink"); - - return GST_PLAY_OK; -} - -static void -gst_play_realize (GtkWidget *widget) -{ - GstPlay *play = GST_PLAY (widget); - - g_return_if_fail (play != NULL); - - /* g_print ("realize\n"); */ - - play->priv->video_widget = gtk_socket_new (); - - gtk_container_add (GTK_CONTAINER (widget), play->priv->video_widget); - - if (GTK_WIDGET_CLASS (parent_class)->realize) - GTK_WIDGET_CLASS (parent_class)->realize (widget); - - /* gtk_socket_steal (GTK_SOCKET (priv->video_widget), */ - /* gst_util_get_int_arg (GTK_OBJECT(priv->video_element), "xid")); */ - - /* gtk_widget_realize (priv->video_widget); */ - /* gtk_socket_steal (GTK_SOCKET (priv->video_widget), */ - /* gst_util_get_int_arg (GTK_OBJECT(priv->video_element), "xid")); */ -} - -void -gst_play_play (GstPlay *play) -{ - GstPlayPrivate *priv = play->priv; - - g_return_if_fail (play != NULL); - g_return_if_fail (GST_IS_PLAY (play)); - - if (play->state == GST_PLAY_PLAYING) - return; - - if (play->state == GST_PLAY_STOPPED) - gst_element_set_state (GST_ELEMENT (priv->pipeline),GST_STATE_READY); - gst_element_set_state (GST_ELEMENT (priv->pipeline),GST_STATE_PLAYING); - - play->state = GST_PLAY_PLAYING; - gtk_idle_add (gst_play_idle_func, priv->pipeline); - - gtk_signal_emit (GTK_OBJECT (play), gst_play_signals[SIGNAL_STATE_CHANGED], - play->state); -} - -void -gst_play_pause (GstPlay *play) -{ - GstPlayPrivate *priv = play->priv; - - g_return_if_fail (play != NULL); - g_return_if_fail (GST_IS_PLAY (play)); - - if (play->state != GST_PLAY_PLAYING) - return; - - gst_element_set_state (GST_ELEMENT (priv->pipeline), GST_STATE_PAUSED); - - play->state = GST_PLAY_PAUSED; - g_idle_remove_by_data (priv->pipeline); - - gtk_signal_emit (GTK_OBJECT (play), gst_play_signals[SIGNAL_STATE_CHANGED], - play->state); -} - -void -gst_play_stop (GstPlay *play) -{ - GstPlayPrivate *priv = play->priv; - - g_return_if_fail (play != NULL); - g_return_if_fail (GST_IS_PLAY (play)); - - if (play->state == GST_PLAY_STOPPED) - return; - - /* FIXME until state changes are handled properly */ - gst_element_set_state (GST_ELEMENT (priv->pipeline), GST_STATE_READY); - g_object_set (G_OBJECT (priv->src), "offset", 0, NULL); - /* gst_element_set_state (GST_ELEMENT (priv->pipeline),GST_STATE_NULL); */ - - play->state = GST_PLAY_STOPPED; - g_idle_remove_by_data (priv->pipeline); - - gtk_signal_emit (GTK_OBJECT (play), gst_play_signals[SIGNAL_STATE_CHANGED], - play->state); -} - -GtkWidget * -gst_play_get_video_widget (GstPlay *play) -{ - g_return_val_if_fail (GST_IS_PLAY (play), 0); - - return play->priv->video_widget; -} - -gint -gst_play_get_source_width (GstPlay *play) -{ - g_return_val_if_fail (GST_IS_PLAY (play), 0); - - return play->priv->source_width; -} - -gint -gst_play_get_source_height (GstPlay *play) -{ - g_return_val_if_fail (GST_IS_PLAY (play), 0); - - return play->priv->source_height; -} - -gulong -gst_play_get_media_size (GstPlay *play) -{ - g_return_val_if_fail (GST_IS_PLAY (play), 0); - - if (gst_util_has_arg (G_OBJECT (play->priv->src), - "filesize", G_TYPE_INT64)) - return gst_util_get_int64_arg ( - G_OBJECT (play->priv->src), "filesize"); - else - return 0; -} - -gulong -gst_play_get_media_offset (GstPlay *play) -{ - g_return_val_if_fail (GST_IS_PLAY (play), 0); - - if (play->priv->offset_element) - return gst_util_get_long_arg ( - G_OBJECT (play->priv->offset_element), "offset"); - else - return 0; -} - -gulong -gst_play_get_media_total_time (GstPlay *play) -{ - gulong total_time, bit_rate; - - g_return_val_if_fail (play != NULL, 0); - g_return_val_if_fail (GST_IS_PLAY (play), 0); - - if (play->priv->media_time_element) - return gst_util_get_long_arg ( - G_OBJECT (play->priv->media_time_element), "media_time"); - - if (!play->priv->bit_rate_element) - return 0; - - bit_rate = gst_util_get_long_arg ( - G_OBJECT (play->priv->bit_rate_element), "bit_rate"); - - if (bit_rate) - total_time = (gst_play_get_media_size (play) * 8) / bit_rate; - else - total_time = 0; - - return total_time; -} - -gulong -gst_play_get_media_current_time (GstPlay *play) -{ - gulong current_time, bit_rate; - - g_return_val_if_fail (GST_IS_PLAY (play), 0); - - if (play->priv->current_time_element) { - return gst_util_get_long_arg ( - G_OBJECT (play->priv->current_time_element), - "current_time"); - } - - if (!play->priv->bit_rate_element) - return 0; - - bit_rate = gst_util_get_long_arg ( - G_OBJECT (play->priv->bit_rate_element), "bit_rate"); - - if (bit_rate) - current_time = (gst_play_get_media_offset (play) * 8) / bit_rate; - else - current_time = 0; - - return current_time; -} - -gboolean -gst_play_media_can_seek (GstPlay *play) -{ - g_return_val_if_fail (GST_IS_PLAY (play), FALSE); - - return play->priv->can_seek; -} - -void -gst_play_media_seek (GstPlay *play, gulong offset) -{ - g_return_if_fail (GST_IS_PLAY (play)); - - if (play->priv->offset_element) - g_object_set (G_OBJECT (play->priv->src), - "offset", offset, NULL); -} - -GstElement* -gst_play_get_pipeline (GstPlay *play) -{ - g_return_val_if_fail (GST_IS_PLAY (play), NULL); - - return GST_ELEMENT (play->priv->pipeline); -} - -static void -gst_play_set_arg (GtkObject *object, GtkArg *arg, guint id) -{ - GstPlay *play; - - g_return_if_fail (object != NULL); - g_return_if_fail (arg != NULL); - - play = GST_PLAY (object); - - switch (id) { - case ARG_MUTE: - break; - default: - g_warning ("GstPlay: unknown arg!"); - break; - } -} - -static void -gst_play_get_arg (GtkObject *object, GtkArg *arg, guint id) -{ - GstPlay *play; - GstPlayPrivate *priv; - - g_return_if_fail (object != NULL); - g_return_if_fail (arg != NULL); - - play = GST_PLAY (object); - priv = play->priv; - - switch (id) { - case ARG_URI: - GTK_VALUE_STRING (*arg) = priv->uri; - break; - case ARG_MUTE: - GTK_VALUE_BOOL (*arg) = priv->muted; - break; - case ARG_STATE: - GTK_VALUE_INT (*arg) = play->state; - break; -#ifdef USE_GLIB2 - case ARG_MEDIA_SIZE: - GTK_VALUE_UINT (*arg) = gst_play_get_media_size(play); - break; - case ARG_MEDIA_OFFSET: - GTK_VALUE_UINT (*arg) = gst_play_get_media_offset(play); - break; -#else - case ARG_MEDIA_SIZE: - GTK_VALUE_LONG (*arg) = gst_play_get_media_size(play); - break; - case ARG_MEDIA_OFFSET: - GTK_VALUE_LONG (*arg) = gst_play_get_media_offset(play); - break; -#endif - case ARG_MEDIA_TOTAL_TIME: - break; - case ARG_MEDIA_CURRENT_TIME: - break; - default: - arg->type = GTK_TYPE_INVALID; - break; - } -} diff --git a/gstplay/gstplay.h b/gstplay/gstplay.h deleted file mode 100644 index 567e64b..0000000 --- a/gstplay/gstplay.h +++ /dev/null @@ -1,96 +0,0 @@ -#ifndef __GSTPLAY_H__ -#define __GSTPLAY_H__ - -#include - -#ifdef USE_GLIB2 -#define gst_glade_xml_new(path,misc) (glade_xml_new (path "2", (misc), NULL)) -#else -#define gst_glade_xml_new(path,misc) (glade_xml_new (path, (misc))) -#endif - -#include -#include - -#define GST_TYPE_PLAY (gst_play_get_type ()) -#define GST_PLAY(obj) (GTK_CHECK_CAST ((obj), GST_TYPE_PLAY, GstPlay)) -#define GST_PLAY_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GST_TYPE_PLAY, GstPlayClass)) -#define GST_IS_PLAY(obj) (GTK_CHECK_TYPE ((obj), GST_TYPE_PLAY)) -#define GST_IS_PLAY_CLASS(obj) (GTK_CHECK_CLASS_TYPE ((klass), GST_TYPE_PLAY)) - -typedef struct _GstPlay GstPlay; -typedef struct _GstPlayClass GstPlayClass; - -typedef enum { - GST_PLAY_STOPPED, - GST_PLAY_PLAYING, - GST_PLAY_PAUSED, -} GstPlayState; - -typedef enum { - GST_PLAY_OK, - GST_PLAY_UNKNOWN_MEDIA, - GST_PLAY_CANNOT_PLAY, - GST_PLAY_ERROR, -} GstPlayReturn; - -typedef enum { - GST_PLAY_TYPE_AUDIO = (1 << 0), - GST_PLAY_TYPE_VIDEO = (1 << 1), -} GstPlayMediaTypeFlags; - -typedef struct _GstPlayPrivate GstPlayPrivate; - -struct _GstPlay { - GtkHBox parent; - - GstPlayState state; - GstPlayMediaTypeFlags flags; - GstPlayPrivate *priv; -}; - -#define GST_PLAY_STATE(play) ((play)->state) -#define GST_PLAY_MEDIA_TYPE(play) ((play)->flags) -#define GST_PLAY_IS_AUDIO_TYPE(play) ((play)->flags & GST_PLAY_TYPE_AUDIO) -#define GST_PLAY_IS_VIDEO_TYPE(play) ((play)->flags & GST_PLAY_TYPE_VIDEO) - -struct _GstPlayClass { - GtkHBoxClass parent_class; - - void (*state_changed) (GstPlay *play, GstPlayState state); - void (*frame_displayed) (GstPlay *play); - void (*audio_played) (GstPlay *play); -}; - - -GtkType gst_play_get_type (void); - -/* setup the player */ -GstPlay* gst_play_new (void); -GstPlayReturn gst_play_set_uri (GstPlay *play, const guchar *uri); - -/* control the player */ -void gst_play_play (GstPlay *play); -void gst_play_pause (GstPlay *play); -void gst_play_stop (GstPlay *play); - -void gst_play_mute (GstPlay *play, gboolean mute); - -/* information about the media stream */ -gulong gst_play_get_media_size (GstPlay *play); -gulong gst_play_get_media_offset (GstPlay *play); -gboolean gst_play_media_can_seek (GstPlay *play); -void gst_play_media_seek (GstPlay *play, gulong offset); - -gulong gst_play_get_media_total_time (GstPlay *play); -gulong gst_play_get_media_current_time (GstPlay *play); - -/* set display stuff */ -GtkWidget * gst_play_get_video_widget (GstPlay *play); -gint gst_play_get_source_width (GstPlay *play); -gint gst_play_get_source_height (GstPlay *play); - -/* the autoplugged pipeline */ -GstElement* gst_play_get_pipeline (GstPlay *play); - -#endif /* __GSTPLAY_H__ */ diff --git a/gstplay/gstplayprivate.h b/gstplay/gstplayprivate.h deleted file mode 100644 index 4ce7837..0000000 --- a/gstplay/gstplayprivate.h +++ /dev/null @@ -1 +0,0 @@ -#error Bogus header diff --git a/gstplay/gststatusarea.c b/gstplay/gststatusarea.c deleted file mode 100644 index af07484..0000000 --- a/gstplay/gststatusarea.c +++ /dev/null @@ -1,298 +0,0 @@ -#include -#include "gststatusarea.h" - -static void gst_status_area_class_init (GstStatusAreaClass *klass); -static void gst_status_area_init (GstStatusArea *status_area); - -static void gst_status_area_set_arg (GtkObject *object, GtkArg *arg, guint id); -static void gst_status_area_get_arg (GtkObject *object, GtkArg *arg, guint id); - -static void gst_status_area_realize (GtkWidget *status_area); -static gint gst_status_area_expose (GtkWidget *widget, GdkEventExpose *event); - -#define DEFAULT_HEIGHT 20 -#define DEFAULT_EXPANDED_HEIGHT 100 - -/* signals and args */ -enum { - LAST_SIGNAL -}; - -enum { - ARG_0, -}; - -static GtkDrawingArea *parent_class = NULL; -/* static guint gst_status_area_signals[LAST_SIGNAL] = { 0 }; */ - -GtkType -gst_status_area_get_type (void) -{ - static GtkType status_area_type = 0; - - if (!status_area_type) { - static const GtkTypeInfo status_area_info = { - "GstStatusArea", - sizeof(GstStatusArea), - sizeof(GstStatusAreaClass), - (GtkClassInitFunc)gst_status_area_class_init, - (GtkObjectInitFunc)gst_status_area_init, - NULL, - NULL, - (GtkClassInitFunc)NULL, - }; - status_area_type = gtk_type_unique (gtk_widget_get_type (),&status_area_info); - } - return status_area_type; -} - -static void -gst_status_area_class_init (GstStatusAreaClass *klass) -{ - GtkObjectClass *object_class; - GtkWidgetClass *widget_class; - - parent_class = gtk_type_class (gtk_widget_get_type ()); - - object_class = (GtkObjectClass*)klass; - widget_class = (GtkWidgetClass*)klass; - - object_class->set_arg = gst_status_area_set_arg; - object_class->get_arg = gst_status_area_get_arg; - - widget_class->realize = gst_status_area_realize; - widget_class->expose_event = gst_status_area_expose; -} - -static void -gst_status_area_init (GstStatusArea *status_area) -{ - GTK_WIDGET(status_area)->requisition.height = DEFAULT_HEIGHT; - - status_area->state = GST_STATUS_AREA_STATE_INIT; - status_area->expanded = FALSE; -} - -GstStatusArea * -gst_status_area_new (void) -{ - return GST_STATUS_AREA (gtk_type_new (GST_TYPE_STATUS_AREA)); -} - -static void -gst_status_area_realize (GtkWidget *widget) -{ - GdkWindowAttr attributes; - gint attributes_mask; - GstStatusArea *status_area; - - g_return_if_fail (widget != NULL); - g_return_if_fail(GST_IS_STATUS_AREA(widget)); - - GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED); - status_area = GST_STATUS_AREA(widget); - - attributes.x = widget->allocation.x; - attributes.y = widget->allocation.y; - attributes.width = widget->allocation.width; - attributes.height = widget->allocation.height; - attributes.wclass = GDK_INPUT_OUTPUT; - attributes.window_type = GDK_WINDOW_CHILD; - attributes.event_mask = gtk_widget_get_events (widget) - | GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK; - - attributes.visual = gtk_widget_get_visual (widget); - attributes.colormap = gtk_widget_get_colormap (widget); - - attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP; - widget->window = gdk_window_new (widget->parent->window, &attributes, attributes_mask); - - widget->style = gtk_style_attach (widget->style, widget->window); -} - -static gint -gst_status_area_expose(GtkWidget *widget, GdkEventExpose *event) -{ - GstStatusArea *status_area; - guchar *statustext; - - g_return_val_if_fail (GST_IS_STATUS_AREA (widget), FALSE); - g_return_val_if_fail (event != NULL, FALSE); - - status_area = GST_STATUS_AREA (widget); - -#ifndef USE_GLIB2 - if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_MAPPED (widget)) { - gdk_draw_rectangle (widget->window, - widget->style->black_gc, - TRUE, - 0, 0, - widget->allocation.width, - widget->allocation.height); - - if (status_area->expanded) { - gint width; - - gdk_draw_line (widget->window, - widget->style->dark_gc[0], - 0, widget->allocation.height - 20, - widget->allocation.width, widget->allocation.height - 20); - - width = gdk_string_width (widget->style->font, "Show:"); - - gdk_draw_string (widget->window, - widget->style->font, - widget->style->white_gc, - 80-width, 15, - "Show:"); - - width = gdk_string_width (widget->style->font, "Clip:"); - - gdk_draw_string (widget->window, - widget->style->font, - widget->style->white_gc, - 80-width, 40, - "Clip:"); - - width = gdk_string_width (widget->style->font, "Author:"); - - gdk_draw_string (widget->window, - widget->style->font, - widget->style->white_gc, - 80-width, 55, - "Author:"); - - width = gdk_string_width (widget->style->font, "Copyright:"); - - gdk_draw_string (widget->window, - widget->style->font, - widget->style->white_gc, - 80-width, 70, - "Copyright:"); - - gdk_draw_line (widget->window, - widget->style->dark_gc[0], - 0, widget->allocation.height - 80, - widget->allocation.width, widget->allocation.height - 80); - - - - - } - - switch (status_area->state) { - case GST_STATUS_AREA_STATE_INIT: - statustext = "Initializing"; - break; - case GST_STATUS_AREA_STATE_PLAYING: - statustext = "Playing"; - break; - case GST_STATUS_AREA_STATE_PAUSED: - statustext = "Paused"; - break; - case GST_STATUS_AREA_STATE_STOPPED: - statustext = "Stopped"; - break; - default: - statustext = ""; - break; - } - - gdk_draw_string (widget->window, - widget->style->font, - widget->style->white_gc, - 8, widget->allocation.height-5, - statustext); - - if (status_area->playtime) { - gint width = gdk_string_width (widget->style->font, status_area->playtime); - - gdk_draw_string (widget->window, - widget->style->font, - widget->style->white_gc, - widget->allocation.width-width-20, - widget->allocation.height-5, - status_area->playtime); - } - } -#else -#warning this needs pangoizing. -#endif - - return FALSE; -} - -void -gst_status_area_set_state (GstStatusArea *area, GstStatusAreaState state) -{ - g_return_if_fail(area != NULL); - g_return_if_fail(GST_IS_STATUS_AREA(area)); - - area->state = state; - - if (GTK_WIDGET_VISIBLE(area)) - gtk_widget_queue_draw(GTK_WIDGET(area)); -} - -void -gst_status_area_set_playtime (GstStatusArea *area, const guchar *time) -{ - g_return_if_fail(area != NULL); - g_return_if_fail(GST_IS_STATUS_AREA(area)); - g_return_if_fail(time != NULL); - - if (area->playtime) g_free (area->playtime); - - area->playtime = g_strdup (time); - - if (GTK_WIDGET_VISIBLE(area)) - gtk_widget_queue_draw(GTK_WIDGET(area)); -} - -void -gst_status_area_set_streamtype (GstStatusArea *area, const guchar *type) -{ -} - -void -gst_status_area_show_extended (GstStatusArea *area, gboolean show) -{ - area->expanded = show; - - if (show) { - GTK_WIDGET(area)->requisition.height = DEFAULT_EXPANDED_HEIGHT; - } - else { - GTK_WIDGET(area)->requisition.height = DEFAULT_HEIGHT; - } - gtk_widget_queue_resize (GTK_WIDGET (area)); -} - -static void -gst_status_area_set_arg(GtkObject *object, GtkArg *arg, guint id) -{ - GstStatusArea *status_area; - - status_area = GST_STATUS_AREA(object); - - switch (id) { - default: - g_warning("GstStatusArea: unknown arg!"); - break; - } -} - -static void -gst_status_area_get_arg(GtkObject *object, GtkArg *arg, guint id) -{ - GstStatusArea *status_area; - - status_area = GST_STATUS_AREA(object); - - switch (id) { - default: - arg->type = GTK_TYPE_INVALID; - break; - } -} diff --git a/gstplay/gststatusarea.h b/gstplay/gststatusarea.h deleted file mode 100644 index 11a0da2..0000000 --- a/gstplay/gststatusarea.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef __GST_STATUS_AREA_H__ -#define __GST_STATUS_AREA_H__ - -#include -#include - -#define GST_TYPE_STATUS_AREA (gst_status_area_get_type ()) -#define GST_STATUS_AREA(obj) (GTK_CHECK_CAST ((obj), GST_TYPE_STATUS_AREA, GstStatusArea)) -#define GST_STATUS_AREA_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GST_TYPE_STATUS_AREA, GstStatusAreaClass)) -#define GST_IS_STATUS_AREA(obj) (GTK_CHECK_TYPE ((obj), GST_TYPE_STATUS_AREA)) -#define GST_IS_STATUS_AREA_CLASS(obj) (GTK_CHECK_CLASS_TYPE ((klass), GST_TYPE_STATUS_AREA)) - -typedef struct _GstStatusArea GstStatusArea; -typedef struct _GstStatusAreaClass GstStatusAreaClass; - -typedef enum { - GST_STATUS_AREA_STATE_INIT, - GST_STATUS_AREA_STATE_PLAYING, - GST_STATUS_AREA_STATE_PAUSED, - GST_STATUS_AREA_STATE_STOPPED, -} GstStatusAreaState; - -struct _GstStatusArea { - GtkWidget parent; - - GstStatusAreaState state; - guchar *playtime; - gboolean expanded; -}; - -struct _GstStatusAreaClass { - GtkWidgetClass parent_class; -}; - - -GtkType gst_status_area_get_type (void); - -GstStatusArea* gst_status_area_new (void); - -void gst_status_area_set_state (GstStatusArea *area, GstStatusAreaState state); -void gst_status_area_set_playtime (GstStatusArea *area, const guchar *time); -void gst_status_area_set_streamtype (GstStatusArea *area, const guchar *type); - -void gst_status_area_show_extended (GstStatusArea *area, gboolean show); - -#endif /* __GST_STATUS_AREA_H__ */ diff --git a/gstplay/main.c b/gstplay/main.c deleted file mode 100644 index 5981eca..0000000 --- a/gstplay/main.c +++ /dev/null @@ -1,52 +0,0 @@ -#include -#include -#ifdef USE_GLIB2 -#include -#include -#endif -#include "gstmediaplay.h" - -int -main (int argc, char *argv[]) -{ - GstMediaPlay *play; - - gst_init (&argc,&argv); - -#ifdef USE_GLIB2 - gnome_program_init ("gstmediaplay", "0.3", - LIBGNOMEUI_MODULE, - argc, argv, NULL); -#else - gnome_init ("gstreamer", VERSION, argc, argv); - glade_init(); - glade_gnome_init(); -#endif - - play = gst_media_play_new (); - - if (argc > 1) { - int i; - - gst_media_play_show_playlist (play); - gst_media_play_start_uri (play, argv [1]); - - for (i = 1; i < argc; i++) - gst_media_play_addto_playlist (play, argv [i]); - } - -#ifndef GST_DISABLE_LOADSAVE - xmlSaveFile ("gstmediaplay.gst", gst_xml_write ( - gst_play_get_pipeline (play->play))); -#endif - - gdk_threads_enter(); -#ifdef USE_GLIB2 - gtk_main (); -#else - gst_main(); -#endif - gdk_threads_leave(); - - return 0; -} diff --git a/gstplay/pause.xpm b/gstplay/pause.xpm deleted file mode 100644 index 2283f24..0000000 --- a/gstplay/pause.xpm +++ /dev/null @@ -1,23 +0,0 @@ -/* XPM */ -static char * pause_xpm[] = { -"13 15 5 1", -" c None", -". c #949594", -"+ c #000000", -"@ c #8E8E8E", -"# c #FFFFFF", -"...... ......", -".+++@# .+++@#", -".+++@# .+++@#", -".+++@# .+++@#", -".+++@# .+++@#", -".+++@# .+++@#", -".+++@# .+++@#", -".+++@# .+++@#", -".+++@# .+++@#", -".+++@# .+++@#", -".+++@# .+++@#", -".+++@# .+++@#", -".+++@# .+++@#", -".+@@@# .+@@@#", -".##### .#####"}; diff --git a/gstplay/pixmaps/pause.xpm b/gstplay/pixmaps/pause.xpm deleted file mode 100644 index 2283f24..0000000 --- a/gstplay/pixmaps/pause.xpm +++ /dev/null @@ -1,23 +0,0 @@ -/* XPM */ -static char * pause_xpm[] = { -"13 15 5 1", -" c None", -". c #949594", -"+ c #000000", -"@ c #8E8E8E", -"# c #FFFFFF", -"...... ......", -".+++@# .+++@#", -".+++@# .+++@#", -".+++@# .+++@#", -".+++@# .+++@#", -".+++@# .+++@#", -".+++@# .+++@#", -".+++@# .+++@#", -".+++@# .+++@#", -".+++@# .+++@#", -".+++@# .+++@#", -".+++@# .+++@#", -".+++@# .+++@#", -".+@@@# .+@@@#", -".##### .#####"}; diff --git a/gstplay/pixmaps/play.xpm b/gstplay/pixmaps/play.xpm deleted file mode 100644 index 5b7db49..0000000 --- a/gstplay/pixmaps/play.xpm +++ /dev/null @@ -1,23 +0,0 @@ -/* XPM */ -static char * play_back_xpm[] = { -"13 15 5 1", -" c None", -". c #949594", -"+ c #000000", -"@ c #8E8E8E", -"# c #FFFFFF", -"...... ", -".+++++. ", -".++++++. ", -".+++++++. ", -".++++++++. ", -".+++++++++. ", -".++++++++++. ", -".++++++++++@#", -".+++++++++@# ", -".++++++++@# ", -".+++++++@# ", -".++++++@# ", -".+++++@# ", -".+@@@@# ", -".##### "}; diff --git a/gstplay/pixmaps/stop.xpm b/gstplay/pixmaps/stop.xpm deleted file mode 100644 index 2d159d0..0000000 --- a/gstplay/pixmaps/stop.xpm +++ /dev/null @@ -1,23 +0,0 @@ -/* XPM */ -static char * stop_back_xpm[] = { -"13 15 5 1", -" c None", -". c #949594", -"+ c #000000", -"@ c #8E8E8E", -"# c #FFFFFF", -".............", -".++++++++++@#", -".++++++++++@#", -".++++++++++@#", -".++++++++++@#", -".++++++++++@#", -".++++++++++@#", -".++++++++++@#", -".++++++++++@#", -".++++++++++@#", -".++++++++++@#", -".++++++++++@#", -".++++++++++@#", -".+@@@@@@@@@@#", -".############"}; diff --git a/gstplay/play.xpm b/gstplay/play.xpm deleted file mode 100644 index 5b7db49..0000000 --- a/gstplay/play.xpm +++ /dev/null @@ -1,23 +0,0 @@ -/* XPM */ -static char * play_back_xpm[] = { -"13 15 5 1", -" c None", -". c #949594", -"+ c #000000", -"@ c #8E8E8E", -"# c #FFFFFF", -"...... ", -".+++++. ", -".++++++. ", -".+++++++. ", -".++++++++. ", -".+++++++++. ", -".++++++++++. ", -".++++++++++@#", -".+++++++++@# ", -".++++++++@# ", -".+++++++@# ", -".++++++@# ", -".+++++@# ", -".+@@@@# ", -".##### "}; diff --git a/gstplay/stop.xpm b/gstplay/stop.xpm deleted file mode 100644 index 2d159d0..0000000 --- a/gstplay/stop.xpm +++ /dev/null @@ -1,23 +0,0 @@ -/* XPM */ -static char * stop_back_xpm[] = { -"13 15 5 1", -" c None", -". c #949594", -"+ c #000000", -"@ c #8E8E8E", -"# c #FFFFFF", -".............", -".++++++++++@#", -".++++++++++@#", -".++++++++++@#", -".++++++++++@#", -".++++++++++@#", -".++++++++++@#", -".++++++++++@#", -".++++++++++@#", -".++++++++++@#", -".++++++++++@#", -".++++++++++@#", -".++++++++++@#", -".+@@@@@@@@@@#", -".############"}; -- 2.7.4