mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
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
This commit is contained in:
parent
15a22cc4c0
commit
9af4f42b3c
24 changed files with 0 additions and 4036 deletions
11
gstplay/.gitignore
vendored
11
gstplay/.gitignore
vendored
|
@ -1,11 +0,0 @@
|
|||
Makefile
|
||||
Makefile.in
|
||||
*.o
|
||||
*.lo
|
||||
*.la
|
||||
.deps
|
||||
.libs
|
||||
*.bak
|
||||
*~
|
||||
gstmediaplay
|
||||
gstplay
|
|
@ -1 +0,0 @@
|
|||
arik devens <arik@gnome.org>
|
|
@ -1,158 +0,0 @@
|
|||
2001-12-14 Michael Meeks <michael@ximian.com>
|
||||
|
||||
* 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 <arik@gnome.org>
|
||||
|
||||
* 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 <arik@gnome.org>
|
||||
|
||||
* 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 <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
|
||||
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 <arik@gnome.org>
|
||||
|
||||
* 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 <arik@gnome.org>
|
||||
|
||||
* 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 <arik@gnome.org>
|
||||
|
||||
* 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 <arik@gnome.org>
|
||||
|
||||
* 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 <arik@gnome.org>
|
||||
|
||||
* gstmediaplay.glade: Dissabled full-screen for the moment till it
|
||||
gets fixed.
|
||||
|
||||
2001-05-20 Arik Devens <arik@gnome.org>
|
||||
|
||||
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!
|
||||
|
|
@ -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
|
|
@ -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 <arik@gnome.org>
|
|
@ -1,102 +0,0 @@
|
|||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <gnome.h>
|
||||
#include <glade/glade.h>
|
||||
#include <gst/gst.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#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();
|
||||
}
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
#include <gnome.h>
|
||||
|
||||
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);
|
||||
|
|
@ -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/
|
|
@ -1,764 +0,0 @@
|
|||
#include <config.h>
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <gnome.h>
|
||||
#ifdef USE_GLIB2
|
||||
#include <libgnomeui/libgnomeui.h>
|
||||
#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);
|
||||
}
|
|
@ -1,697 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<GTK-Interface>
|
||||
|
||||
<project>
|
||||
<name>GstMediaPlay</name>
|
||||
<program_name>gstmediaplay</program_name>
|
||||
<directory></directory>
|
||||
<source_directory>src</source_directory>
|
||||
<pixmaps_directory>pixmaps</pixmaps_directory>
|
||||
<language>C</language>
|
||||
<gnome_support>True</gnome_support>
|
||||
<gettext_support>True</gettext_support>
|
||||
<output_main_file>False</output_main_file>
|
||||
<output_support_files>False</output_support_files>
|
||||
<output_build_files>False</output_build_files>
|
||||
</project>
|
||||
|
||||
<widget>
|
||||
<class>GnomeApp</class>
|
||||
<name>gstplay</name>
|
||||
<signal>
|
||||
<name>delete_event</name>
|
||||
<handler>on_gst_media_play_delete_event</handler>
|
||||
<last_modification_time>Wed, 01 Nov 2000 00:38:57 GMT</last_modification_time>
|
||||
</signal>
|
||||
<signal>
|
||||
<name>destroy</name>
|
||||
<handler>on_gst_media_play_destroy</handler>
|
||||
<last_modification_time>Wed, 01 Nov 2000 00:39:03 GMT</last_modification_time>
|
||||
</signal>
|
||||
<title>Gstplay</title>
|
||||
<type>GTK_WINDOW_TOPLEVEL</type>
|
||||
<position>GTK_WIN_POS_CENTER</position>
|
||||
<modal>False</modal>
|
||||
<allow_shrink>True</allow_shrink>
|
||||
<allow_grow>True</allow_grow>
|
||||
<auto_shrink>True</auto_shrink>
|
||||
<wmclass_name>gstmediaplay</wmclass_name>
|
||||
<wmclass_class>GstMediaPlay</wmclass_class>
|
||||
<enable_layout_config>True</enable_layout_config>
|
||||
|
||||
<widget>
|
||||
<class>GnomeDock</class>
|
||||
<child_name>GnomeApp:dock</child_name>
|
||||
<name>dock1</name>
|
||||
<allow_floating>False</allow_floating>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>True</expand>
|
||||
<fill>True</fill>
|
||||
</child>
|
||||
|
||||
<widget>
|
||||
<class>GnomeDockItem</class>
|
||||
<name>dockitem1</name>
|
||||
<border_width>2</border_width>
|
||||
<placement>GNOME_DOCK_TOP</placement>
|
||||
<band>0</band>
|
||||
<position>0</position>
|
||||
<offset>0</offset>
|
||||
<locked>False</locked>
|
||||
<exclusive>True</exclusive>
|
||||
<never_floating>False</never_floating>
|
||||
<never_vertical>True</never_vertical>
|
||||
<never_horizontal>False</never_horizontal>
|
||||
<shadow_type>GTK_SHADOW_OUT</shadow_type>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenuBar</class>
|
||||
<name>menubar1</name>
|
||||
<shadow_type>GTK_SHADOW_NONE</shadow_type>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenuItem</class>
|
||||
<name>file1</name>
|
||||
<stock_item>GNOMEUIINFO_MENU_FILE_TREE</stock_item>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenu</class>
|
||||
<name>file1_menu</name>
|
||||
|
||||
<widget>
|
||||
<class>GtkPixmapMenuItem</class>
|
||||
<name>open1</name>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>on_open2_activate</handler>
|
||||
<last_modification_time>Thu, 27 Jul 2000 19:35:00 GMT</last_modification_time>
|
||||
</signal>
|
||||
<stock_item>GNOMEUIINFO_MENU_OPEN_ITEM</stock_item>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkPixmapMenuItem</class>
|
||||
<name>save1</name>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>on_save1_activate</handler>
|
||||
<last_modification_time>Thu, 27 Jul 2000 19:35:00 GMT</last_modification_time>
|
||||
</signal>
|
||||
<stock_item>GNOMEUIINFO_MENU_SAVE_ITEM</stock_item>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkPixmapMenuItem</class>
|
||||
<name>save_as1</name>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>on_save_as1_activate</handler>
|
||||
<last_modification_time>Thu, 27 Jul 2000 19:35:00 GMT</last_modification_time>
|
||||
</signal>
|
||||
<stock_item>GNOMEUIINFO_MENU_SAVE_AS_ITEM</stock_item>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenuItem</class>
|
||||
<name>separator1</name>
|
||||
<right_justify>False</right_justify>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkPixmapMenuItem</class>
|
||||
<name>exit_menu</name>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>on_exit_menu_activate</handler>
|
||||
<last_modification_time>Sun, 06 Aug 2000 13:41:10 GMT</last_modification_time>
|
||||
</signal>
|
||||
<stock_item>GNOMEUIINFO_MENU_EXIT_ITEM</stock_item>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenuItem</class>
|
||||
<name>view1</name>
|
||||
<stock_item>GNOMEUIINFO_MENU_VIEW_TREE</stock_item>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenu</class>
|
||||
<name>view1_menu</name>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenuItem</class>
|
||||
<name>present_movie</name>
|
||||
<label>P_resent Movie</label>
|
||||
<right_justify>False</right_justify>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenu</class>
|
||||
<name>present_movie_menu</name>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenuItem</class>
|
||||
<name>original_size</name>
|
||||
<accelerator>
|
||||
<modifiers>GDK_CONTROL_MASK</modifiers>
|
||||
<key>GDK_1</key>
|
||||
<signal>activate</signal>
|
||||
</accelerator>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>on_original_size_activate</handler>
|
||||
<last_modification_time>Sun, 06 May 2001 01:58:18 GMT</last_modification_time>
|
||||
</signal>
|
||||
<label>Original Size</label>
|
||||
<right_justify>False</right_justify>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenuItem</class>
|
||||
<name>double_size</name>
|
||||
<accelerator>
|
||||
<modifiers>GDK_CONTROL_MASK</modifiers>
|
||||
<key>GDK_2</key>
|
||||
<signal>activate</signal>
|
||||
</accelerator>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>on_double_size_activate</handler>
|
||||
<last_modification_time>Sun, 06 May 2001 01:34:06 GMT</last_modification_time>
|
||||
</signal>
|
||||
<label>Double Size</label>
|
||||
<right_justify>False</right_justify>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenuItem</class>
|
||||
<name>full_screen</name>
|
||||
<accelerator>
|
||||
<modifiers>GDK_CONTROL_MASK</modifiers>
|
||||
<key>GDK_3</key>
|
||||
<signal>activate</signal>
|
||||
</accelerator>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>on_full_screen_activate</handler>
|
||||
<last_modification_time>Sun, 06 May 2001 01:34:06 GMT</last_modification_time>
|
||||
</signal>
|
||||
<label>Full Screen</label>
|
||||
<right_justify>False</right_justify>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkCheckMenuItem</class>
|
||||
<name>extended1</name>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>on_extended1_activate</handler>
|
||||
<last_modification_time>Mon, 06 Nov 2000 21:52:57 GMT</last_modification_time>
|
||||
</signal>
|
||||
<label>_Extended</label>
|
||||
<active>False</active>
|
||||
<always_show_toggle>True</always_show_toggle>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenuItem</class>
|
||||
<name>media1</name>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>on_media2_activate</handler>
|
||||
<last_modification_time>Thu, 27 Jul 2000 19:37:03 GMT</last_modification_time>
|
||||
</signal>
|
||||
<label>_Media...</label>
|
||||
<right_justify>False</right_justify>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenuItem</class>
|
||||
<name>settings1</name>
|
||||
<stock_item>GNOMEUIINFO_MENU_SETTINGS_TREE</stock_item>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenu</class>
|
||||
<name>settings1_menu</name>
|
||||
|
||||
<widget>
|
||||
<class>GtkPixmapMenuItem</class>
|
||||
<name>preferences1</name>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>on_preferences1_activate</handler>
|
||||
<last_modification_time>Thu, 27 Jul 2000 19:35:00 GMT</last_modification_time>
|
||||
</signal>
|
||||
<stock_item>GNOMEUIINFO_MENU_PREFERENCES_ITEM</stock_item>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenuItem</class>
|
||||
<name>play1</name>
|
||||
<label>_Play</label>
|
||||
<right_justify>False</right_justify>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenu</class>
|
||||
<name>play1_menu</name>
|
||||
|
||||
<widget>
|
||||
<class>GtkPixmapMenuItem</class>
|
||||
<name>play1</name>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>on_toggle_play_toggled</handler>
|
||||
<last_modification_time>Sun, 06 Aug 2000 13:29:59 GMT</last_modification_time>
|
||||
</signal>
|
||||
<label>_Play</label>
|
||||
<right_justify>False</right_justify>
|
||||
<icon>play.xpm</icon>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkPixmapMenuItem</class>
|
||||
<name>pause1</name>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>on_toggle_pause_toggled</handler>
|
||||
<last_modification_time>Sun, 06 Aug 2000 13:30:13 GMT</last_modification_time>
|
||||
</signal>
|
||||
<label>P_ause</label>
|
||||
<right_justify>False</right_justify>
|
||||
<icon>pause.xpm</icon>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkPixmapMenuItem</class>
|
||||
<name>stop1</name>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>on_toggle_stop_toggled</handler>
|
||||
<last_modification_time>Sun, 06 Aug 2000 13:30:25 GMT</last_modification_time>
|
||||
</signal>
|
||||
<label>_Stop</label>
|
||||
<right_justify>False</right_justify>
|
||||
<icon>stop.xpm</icon>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenuItem</class>
|
||||
<name>help1</name>
|
||||
<stock_item>GNOMEUIINFO_MENU_HELP_TREE</stock_item>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenu</class>
|
||||
<name>help1_menu</name>
|
||||
|
||||
<widget>
|
||||
<class>GtkPixmapMenuItem</class>
|
||||
<name>about1</name>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>on_about_activate</handler>
|
||||
<last_modification_time>Sun, 06 Aug 2000 11:54:17 GMT</last_modification_time>
|
||||
</signal>
|
||||
<stock_item>GNOMEUIINFO_MENU_ABOUT_ITEM</stock_item>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GnomeDockItem</class>
|
||||
<name>dockitem3</name>
|
||||
<border_width>1</border_width>
|
||||
<placement>GNOME_DOCK_BOTTOM</placement>
|
||||
<band>0</band>
|
||||
<position>0</position>
|
||||
<offset>0</offset>
|
||||
<locked>True</locked>
|
||||
<exclusive>True</exclusive>
|
||||
<never_floating>True</never_floating>
|
||||
<never_vertical>True</never_vertical>
|
||||
<never_horizontal>True</never_horizontal>
|
||||
<shadow_type>GTK_SHADOW_NONE</shadow_type>
|
||||
|
||||
<widget>
|
||||
<class>GtkHScale</class>
|
||||
<name>slider</name>
|
||||
<can_focus>True</can_focus>
|
||||
<draw_value>False</draw_value>
|
||||
<value_pos>GTK_POS_LEFT</value_pos>
|
||||
<digits>1</digits>
|
||||
<policy>GTK_UPDATE_CONTINUOUS</policy>
|
||||
<value>0</value>
|
||||
<lower>0</lower>
|
||||
<upper>110</upper>
|
||||
<step>1</step>
|
||||
<page>10</page>
|
||||
<page_size>10</page_size>
|
||||
</widget>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GnomeDockItem</class>
|
||||
<name>dockitem2</name>
|
||||
<placement>GNOME_DOCK_BOTTOM</placement>
|
||||
<band>1</band>
|
||||
<position>0</position>
|
||||
<offset>0</offset>
|
||||
<locked>False</locked>
|
||||
<exclusive>True</exclusive>
|
||||
<never_floating>False</never_floating>
|
||||
<never_vertical>False</never_vertical>
|
||||
<never_horizontal>False</never_horizontal>
|
||||
<shadow_type>GTK_SHADOW_OUT</shadow_type>
|
||||
|
||||
<widget>
|
||||
<class>GtkToolbar</class>
|
||||
<name>toolbar1</name>
|
||||
<border_width>3</border_width>
|
||||
<orientation>GTK_ORIENTATION_HORIZONTAL</orientation>
|
||||
<type>GTK_TOOLBAR_ICONS</type>
|
||||
<space_size>0</space_size>
|
||||
<space_style>GTK_TOOLBAR_SPACE_LINE</space_style>
|
||||
<relief>GTK_RELIEF_NONE</relief>
|
||||
<tooltips>True</tooltips>
|
||||
|
||||
<widget>
|
||||
<class>GtkToggleButton</class>
|
||||
<child_name>Toolbar:button</child_name>
|
||||
<name>toggle_play</name>
|
||||
<tooltip>Play</tooltip>
|
||||
<signal>
|
||||
<name>toggled</name>
|
||||
<handler>on_toggle_play_toggled</handler>
|
||||
<last_modification_time>Sun, 06 Aug 2000 13:17:46 GMT</last_modification_time>
|
||||
</signal>
|
||||
<label>Play</label>
|
||||
<icon>play.xpm</icon>
|
||||
<active>False</active>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkToggleButton</class>
|
||||
<child_name>Toolbar:button</child_name>
|
||||
<name>toggle_pause</name>
|
||||
<tooltip>Pause</tooltip>
|
||||
<signal>
|
||||
<name>toggled</name>
|
||||
<handler>on_toggle_pause_toggled</handler>
|
||||
<last_modification_time>Sun, 06 Aug 2000 13:17:57 GMT</last_modification_time>
|
||||
</signal>
|
||||
<label>Pause</label>
|
||||
<icon>pause.xpm</icon>
|
||||
<active>False</active>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkToggleButton</class>
|
||||
<child_name>Toolbar:button</child_name>
|
||||
<name>toggle_stop</name>
|
||||
<tooltip>Stop</tooltip>
|
||||
<signal>
|
||||
<name>toggled</name>
|
||||
<handler>on_toggle_stop_toggled</handler>
|
||||
<last_modification_time>Sun, 06 Aug 2000 13:18:07 GMT</last_modification_time>
|
||||
</signal>
|
||||
<label>Stop</label>
|
||||
<icon>stop.xpm</icon>
|
||||
<active>False</active>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkButton</class>
|
||||
<child_name>Toolbar:button</child_name>
|
||||
<name>button1</name>
|
||||
<label>button1</label>
|
||||
<icon>play.xpm</icon>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GnomeDockItem</class>
|
||||
<name>dockitem4</name>
|
||||
<placement>GNOME_DOCK_BOTTOM</placement>
|
||||
<band>2</band>
|
||||
<position>0</position>
|
||||
<offset>0</offset>
|
||||
<locked>True</locked>
|
||||
<exclusive>True</exclusive>
|
||||
<never_floating>False</never_floating>
|
||||
<never_vertical>False</never_vertical>
|
||||
<never_horizontal>False</never_horizontal>
|
||||
<shadow_type>GTK_SHADOW_OUT</shadow_type>
|
||||
|
||||
<widget>
|
||||
<class>Custom</class>
|
||||
<name>status_area</name>
|
||||
<creation_function>gst_status_area_new</creation_function>
|
||||
<int1>0</int1>
|
||||
<int2>0</int2>
|
||||
<last_modification_time>Wed, 08 Nov 2000 19:56:51 GMT</last_modification_time>
|
||||
</widget>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>Placeholder</class>
|
||||
<child_name>GnomeDock:contents</child_name>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GnomeAbout</class>
|
||||
<name>about</name>
|
||||
<modal>True</modal>
|
||||
<wmclass_name>about</wmclass_name>
|
||||
<wmclass_class>GstMediaPlay</wmclass_class>
|
||||
<copyright>(C) 1999-2001 Erik Walthinsen, Arik Devens</copyright>
|
||||
<authors>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>
|
||||
</authors>
|
||||
<comments>A generic media player for the gstreamer streaming media framework.</comments>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkFileSelection</class>
|
||||
<name>fileselection1</name>
|
||||
<border_width>10</border_width>
|
||||
<title>Select File</title>
|
||||
<type>GTK_WINDOW_TOPLEVEL</type>
|
||||
<position>GTK_WIN_POS_NONE</position>
|
||||
<modal>True</modal>
|
||||
<allow_shrink>False</allow_shrink>
|
||||
<allow_grow>True</allow_grow>
|
||||
<auto_shrink>False</auto_shrink>
|
||||
<wmclass_name>filesel</wmclass_name>
|
||||
<wmclass_class>GstMediaPlay</wmclass_class>
|
||||
<show_file_op_buttons>True</show_file_op_buttons>
|
||||
|
||||
<widget>
|
||||
<class>GtkButton</class>
|
||||
<child_name>FileSel:ok_button</child_name>
|
||||
<name>ok_button1</name>
|
||||
<can_default>True</can_default>
|
||||
<can_focus>True</can_focus>
|
||||
<signal>
|
||||
<name>clicked</name>
|
||||
<handler>on_ok_button1_clicked</handler>
|
||||
<data>fileselection1</data>
|
||||
<last_modification_time>Sun, 06 Aug 2000 15:56:49 GMT</last_modification_time>
|
||||
</signal>
|
||||
<signal>
|
||||
<name>clicked</name>
|
||||
<handler>gtk_widget_hide</handler>
|
||||
<object>fileselection1</object>
|
||||
<last_modification_time>Sun, 06 Aug 2000 15:55:52 GMT</last_modification_time>
|
||||
</signal>
|
||||
<stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
|
||||
<relief>GTK_RELIEF_NORMAL</relief>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkButton</class>
|
||||
<child_name>FileSel:cancel_button</child_name>
|
||||
<name>cancel_button1</name>
|
||||
<can_default>True</can_default>
|
||||
<can_focus>True</can_focus>
|
||||
<signal>
|
||||
<name>clicked</name>
|
||||
<handler>gtk_widget_hide</handler>
|
||||
<object>fileselection1</object>
|
||||
<last_modification_time>Sun, 06 Aug 2000 15:53:48 GMT</last_modification_time>
|
||||
</signal>
|
||||
<stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
|
||||
<relief>GTK_RELIEF_NORMAL</relief>
|
||||
</widget>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkWindow</class>
|
||||
<name>preferences</name>
|
||||
<title>GstMediaPlayer Preferences</title>
|
||||
<type>GTK_WINDOW_TOPLEVEL</type>
|
||||
<position>GTK_WIN_POS_NONE</position>
|
||||
<modal>False</modal>
|
||||
<allow_shrink>False</allow_shrink>
|
||||
<allow_grow>True</allow_grow>
|
||||
<auto_shrink>False</auto_shrink>
|
||||
|
||||
<widget>
|
||||
<class>GtkNotebook</class>
|
||||
<name>notebook1</name>
|
||||
<can_focus>True</can_focus>
|
||||
<show_tabs>True</show_tabs>
|
||||
<show_border>True</show_border>
|
||||
<tab_pos>GTK_POS_TOP</tab_pos>
|
||||
<scrollable>False</scrollable>
|
||||
<tab_hborder>2</tab_hborder>
|
||||
<tab_vborder>2</tab_vborder>
|
||||
<popup_enable>False</popup_enable>
|
||||
|
||||
<widget>
|
||||
<class>GtkFrame</class>
|
||||
<name>frame1</name>
|
||||
<label>Full Screen</label>
|
||||
<label_xalign>0</label_xalign>
|
||||
<shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
|
||||
|
||||
<widget>
|
||||
<class>GtkVBox</class>
|
||||
<name>vbox1</name>
|
||||
<homogeneous>False</homogeneous>
|
||||
<spacing>0</spacing>
|
||||
|
||||
<widget>
|
||||
<class>GtkCheckButton</class>
|
||||
<name>checkbutton1</name>
|
||||
<can_focus>True</can_focus>
|
||||
<label>Show file menu</label>
|
||||
<active>False</active>
|
||||
<draw_indicator>True</draw_indicator>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>False</expand>
|
||||
<fill>False</fill>
|
||||
</child>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkCheckButton</class>
|
||||
<name>checkbutton2</name>
|
||||
<can_focus>True</can_focus>
|
||||
<label>Show player controls</label>
|
||||
<active>False</active>
|
||||
<draw_indicator>True</draw_indicator>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>False</expand>
|
||||
<fill>False</fill>
|
||||
</child>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkCheckButton</class>
|
||||
<name>checkbutton3</name>
|
||||
<can_focus>True</can_focus>
|
||||
<label>Show status area</label>
|
||||
<active>False</active>
|
||||
<draw_indicator>True</draw_indicator>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>False</expand>
|
||||
<fill>False</fill>
|
||||
</child>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkLabel</class>
|
||||
<child_name>Notebook:tab</child_name>
|
||||
<name>label1</name>
|
||||
<label>Viewers</label>
|
||||
<justify>GTK_JUSTIFY_CENTER</justify>
|
||||
<wrap>False</wrap>
|
||||
<xalign>0.5</xalign>
|
||||
<yalign>0.5</yalign>
|
||||
<xpad>0</xpad>
|
||||
<ypad>0</ypad>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkWindow</class>
|
||||
<name>playlist_window</name>
|
||||
<title>playlist</title>
|
||||
<type>GTK_WINDOW_TOPLEVEL</type>
|
||||
<position>GTK_WIN_POS_NONE</position>
|
||||
<modal>False</modal>
|
||||
<allow_shrink>False</allow_shrink>
|
||||
<allow_grow>True</allow_grow>
|
||||
<auto_shrink>False</auto_shrink>
|
||||
|
||||
<widget>
|
||||
<class>GtkScrolledWindow</class>
|
||||
<name>scrolledwindow1</name>
|
||||
<hscrollbar_policy>GTK_POLICY_AUTOMATIC</hscrollbar_policy>
|
||||
<vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy>
|
||||
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
|
||||
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
|
||||
|
||||
<widget>
|
||||
<class>GtkCList</class>
|
||||
<name>playlist_clist</name>
|
||||
<can_focus>True</can_focus>
|
||||
<columns>2</columns>
|
||||
<column_widths>273,80</column_widths>
|
||||
<selection_mode>GTK_SELECTION_SINGLE</selection_mode>
|
||||
<show_titles>True</show_titles>
|
||||
<shadow_type>GTK_SHADOW_IN</shadow_type>
|
||||
|
||||
<widget>
|
||||
<class>GtkLabel</class>
|
||||
<child_name>CList:title</child_name>
|
||||
<name>track_name</name>
|
||||
<label>track name</label>
|
||||
<justify>GTK_JUSTIFY_CENTER</justify>
|
||||
<wrap>False</wrap>
|
||||
<xalign>0.5</xalign>
|
||||
<yalign>0.5</yalign>
|
||||
<xpad>0</xpad>
|
||||
<ypad>0</ypad>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkLabel</class>
|
||||
<child_name>CList:title</child_name>
|
||||
<name>track_lengthe</name>
|
||||
<label>track length</label>
|
||||
<justify>GTK_JUSTIFY_CENTER</justify>
|
||||
<wrap>False</wrap>
|
||||
<xalign>0.5</xalign>
|
||||
<yalign>0.5</yalign>
|
||||
<xpad>0</xpad>
|
||||
<ypad>0</ypad>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
|
||||
</GTK-Interface>
|
|
@ -1,709 +0,0 @@
|
|||
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
|
||||
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd" >
|
||||
|
||||
<glade-interface>
|
||||
<requires lib="gnome" />
|
||||
<requires lib="bonobo" />
|
||||
|
||||
<widget class="GnomeApp" id="gstplay">
|
||||
<property name="title" translatable="yes">Gstplay</property>
|
||||
<property name="type">GTK_WINDOW_TOPLEVEL</property>
|
||||
<property name="modal">no</property>
|
||||
<property name="allow_shrink">yes</property>
|
||||
<property name="allow_grow">yes</property>
|
||||
<property name="wmclass_name">gstmediaplay</property>
|
||||
<property name="wmclass_class">GstMediaPlay</property>
|
||||
<property name="enable_layout_config">yes</property>
|
||||
<property name="visible">no</property>
|
||||
<property name="window-position">GTK_WIN_POS_CENTER</property>
|
||||
|
||||
<signal name="delete_event" handler="on_gst_media_play_delete_event" />
|
||||
<signal name="destroy" handler="on_gst_media_play_destroy" />
|
||||
|
||||
<child internal-child="dock">
|
||||
<widget class="BonoboDock" id="dock1">
|
||||
<property name="allow_floating">no</property>
|
||||
<property name="visible">yes</property>
|
||||
|
||||
<child>
|
||||
<widget class="BonoboDockItem" id="dockitem1">
|
||||
<property name="border_width">2</property>
|
||||
<property name="shadow_type">GTK_SHADOW_OUT</property>
|
||||
<property name="visible">yes</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenuBar" id="menubar1">
|
||||
<property name="visible">yes</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenuItem" id="file1">
|
||||
<property name="stock_item">GNOMEUIINFO_MENU_FILE_TREE</property>
|
||||
<property name="visible">yes</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenu" id="file1_menu">
|
||||
<property name="visible">yes</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="open1">
|
||||
<property name="stock_item">GNOMEUIINFO_MENU_OPEN_ITEM</property>
|
||||
<property name="visible">yes</property>
|
||||
|
||||
<signal name="activate" handler="on_open2_activate" />
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="save1">
|
||||
<property name="stock_item">GNOMEUIINFO_MENU_SAVE_ITEM</property>
|
||||
<property name="visible">yes</property>
|
||||
|
||||
<signal name="activate" handler="on_save1_activate" />
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="save_as1">
|
||||
<property name="stock_item">GNOMEUIINFO_MENU_SAVE_AS_ITEM</property>
|
||||
<property name="visible">yes</property>
|
||||
|
||||
<signal name="activate" handler="on_save_as1_activate" />
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenuItem" id="separator1">
|
||||
<property name="visible">yes</property>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="exit_menu">
|
||||
<property name="stock_item">GNOMEUIINFO_MENU_EXIT_ITEM</property>
|
||||
<property name="visible">yes</property>
|
||||
|
||||
<signal name="activate" handler="on_exit_menu_activate" />
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenuItem" id="view1">
|
||||
<property name="stock_item">GNOMEUIINFO_MENU_VIEW_TREE</property>
|
||||
<property name="visible">yes</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenu" id="view1_menu">
|
||||
<property name="visible">yes</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenuItem" id="present_movie">
|
||||
<property name="visible">yes</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenu" id="present_movie_menu">
|
||||
<property name="visible">yes</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenuItem" id="original_size">
|
||||
<property name="visible">yes</property>
|
||||
|
||||
<signal name="activate" handler="on_original_size_activate" />
|
||||
|
||||
<accelerator key="1" modifiers="GDK_CONTROL_MASK" signal="activate" />
|
||||
|
||||
<child>
|
||||
<widget class="GtkAccelLabel" id="convertwidget2">
|
||||
<property name="label" translatable="yes">Original Size</property>
|
||||
<property name="xalign">0.0</property>
|
||||
<property name="accel-widget">original_size</property>
|
||||
<property name="use-underline">yes</property>
|
||||
<property name="visible">yes</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenuItem" id="double_size">
|
||||
<property name="visible">yes</property>
|
||||
|
||||
<signal name="activate" handler="on_double_size_activate" />
|
||||
|
||||
<accelerator key="2" modifiers="GDK_CONTROL_MASK" signal="activate" />
|
||||
|
||||
<child>
|
||||
<widget class="GtkAccelLabel" id="convertwidget3">
|
||||
<property name="label" translatable="yes">Double Size</property>
|
||||
<property name="xalign">0.0</property>
|
||||
<property name="accel-widget">double_size</property>
|
||||
<property name="use-underline">yes</property>
|
||||
<property name="visible">yes</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenuItem" id="full_screen">
|
||||
<property name="visible">yes</property>
|
||||
|
||||
<signal name="activate" handler="on_full_screen_activate" />
|
||||
|
||||
<accelerator key="3" modifiers="GDK_CONTROL_MASK" signal="activate" />
|
||||
|
||||
<child>
|
||||
<widget class="GtkAccelLabel" id="convertwidget4">
|
||||
<property name="label" translatable="yes">Full Screen</property>
|
||||
<property name="xalign">0.0</property>
|
||||
<property name="accel-widget">full_screen</property>
|
||||
<property name="use-underline">yes</property>
|
||||
<property name="visible">yes</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkAccelLabel" id="convertwidget1">
|
||||
<property name="label" translatable="yes">P_resent Movie</property>
|
||||
<property name="xalign">0.0</property>
|
||||
<property name="accel-widget">present_movie</property>
|
||||
<property name="use-underline">yes</property>
|
||||
<property name="visible">yes</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkCheckMenuItem" id="extended1">
|
||||
<property name="active">no</property>
|
||||
<property name="always_show_toggle">yes</property>
|
||||
<property name="visible">yes</property>
|
||||
|
||||
<signal name="activate" handler="on_extended1_activate" />
|
||||
|
||||
<child>
|
||||
<widget class="GtkAccelLabel" id="convertwidget5">
|
||||
<property name="label" translatable="yes">_Extended</property>
|
||||
<property name="xalign">0.0</property>
|
||||
<property name="accel-widget">extended1</property>
|
||||
<property name="use-underline">yes</property>
|
||||
<property name="visible">yes</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenuItem" id="media1">
|
||||
<property name="visible">yes</property>
|
||||
|
||||
<signal name="activate" handler="on_media2_activate" />
|
||||
|
||||
<child>
|
||||
<widget class="GtkAccelLabel" id="convertwidget6">
|
||||
<property name="label" translatable="yes">_Media...</property>
|
||||
<property name="xalign">0.0</property>
|
||||
<property name="accel-widget">media1</property>
|
||||
<property name="use-underline">yes</property>
|
||||
<property name="visible">yes</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenuItem" id="settings1">
|
||||
<property name="stock_item">GNOMEUIINFO_MENU_SETTINGS_TREE</property>
|
||||
<property name="visible">yes</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenu" id="settings1_menu">
|
||||
<property name="visible">yes</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="preferences1">
|
||||
<property name="stock_item">GNOMEUIINFO_MENU_PREFERENCES_ITEM</property>
|
||||
<property name="visible">yes</property>
|
||||
|
||||
<signal name="activate" handler="on_preferences1_activate" />
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenuItem" id="play1">
|
||||
<property name="visible">yes</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenu" id="play1_menu">
|
||||
<property name="visible">yes</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="play1">
|
||||
<property name="icon">play.xpm</property>
|
||||
<property name="visible">yes</property>
|
||||
|
||||
<signal name="activate" handler="on_toggle_play_toggled" />
|
||||
|
||||
<child>
|
||||
<widget class="GtkAccelLabel" id="convertwidget8">
|
||||
<property name="label" translatable="yes">_Play</property>
|
||||
<property name="xalign">0.0</property>
|
||||
<property name="accel-widget">play1</property>
|
||||
<property name="use-underline">yes</property>
|
||||
<property name="visible">yes</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="pause1">
|
||||
<property name="icon">pause.xpm</property>
|
||||
<property name="visible">yes</property>
|
||||
|
||||
<signal name="activate" handler="on_toggle_pause_toggled" />
|
||||
|
||||
<child>
|
||||
<widget class="GtkAccelLabel" id="convertwidget9">
|
||||
<property name="label" translatable="yes">P_ause</property>
|
||||
<property name="xalign">0.0</property>
|
||||
<property name="accel-widget">pause1</property>
|
||||
<property name="use-underline">yes</property>
|
||||
<property name="visible">yes</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="stop1">
|
||||
<property name="icon">stop.xpm</property>
|
||||
<property name="visible">yes</property>
|
||||
|
||||
<signal name="activate" handler="on_toggle_stop_toggled" />
|
||||
|
||||
<child>
|
||||
<widget class="GtkAccelLabel" id="convertwidget10">
|
||||
<property name="label" translatable="yes">_Stop</property>
|
||||
<property name="xalign">0.0</property>
|
||||
<property name="accel-widget">stop1</property>
|
||||
<property name="use-underline">yes</property>
|
||||
<property name="visible">yes</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkAccelLabel" id="convertwidget7">
|
||||
<property name="label" translatable="yes">_Play</property>
|
||||
<property name="xalign">0.0</property>
|
||||
<property name="accel-widget">play1</property>
|
||||
<property name="use-underline">yes</property>
|
||||
<property name="visible">yes</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenuItem" id="help1">
|
||||
<property name="stock_item">GNOMEUIINFO_MENU_HELP_TREE</property>
|
||||
<property name="visible">yes</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenu" id="help1_menu">
|
||||
<property name="visible">yes</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="about1">
|
||||
<property name="stock_item">GNOMEUIINFO_MENU_ABOUT_ITEM</property>
|
||||
<property name="visible">yes</property>
|
||||
|
||||
<signal name="activate" handler="on_about_activate" />
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="placement">BONOBO_DOCK_TOP</property>
|
||||
<property name="band">0</property>
|
||||
<property name="position">0</property>
|
||||
<property name="offset">0</property>
|
||||
<property name="behavior">BONOBO_DOCK_ITEM_BEH_EXCLUSIVE|BONOBO_DOCK_ITEM_BEH_NEVER_VERTICAL</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="BonoboDockItem" id="dockitem3">
|
||||
<property name="border_width">1</property>
|
||||
<property name="shadow_type">GTK_SHADOW_NONE</property>
|
||||
<property name="visible">yes</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkHScale" id="slider">
|
||||
<property name="can_focus">yes</property>
|
||||
<property name="draw_value">no</property>
|
||||
<property name="value_pos">GTK_POS_LEFT</property>
|
||||
<property name="digits">1</property>
|
||||
<property name="visible">yes</property>
|
||||
<property name="adjustment">0 0 110 1 10 10</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="placement">BONOBO_DOCK_BOTTOM</property>
|
||||
<property name="band">0</property>
|
||||
<property name="position">0</property>
|
||||
<property name="offset">0</property>
|
||||
<property name="behavior">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</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="BonoboDockItem" id="dockitem2">
|
||||
<property name="shadow_type">GTK_SHADOW_OUT</property>
|
||||
<property name="visible">yes</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkToolbar" id="toolbar1">
|
||||
<property name="border_width">3</property>
|
||||
<property name="orientation">GTK_ORIENTATION_HORIZONTAL</property>
|
||||
<property name="toolbar-style">GTK_TOOLBAR_ICONS</property>
|
||||
<property name="visible">yes</property>
|
||||
|
||||
<child>
|
||||
<widget class="toggle" id="toggle_play">
|
||||
<property name="tooltip" translatable="yes">Play</property>
|
||||
<property name="label" translatable="yes">Play</property>
|
||||
<property name="icon">play.xpm</property>
|
||||
<property name="active">no</property>
|
||||
<property name="visible">yes</property>
|
||||
|
||||
<signal name="toggled" handler="on_toggle_play_toggled" />
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="toggle" id="toggle_pause">
|
||||
<property name="tooltip" translatable="yes">Pause</property>
|
||||
<property name="label" translatable="yes">Pause</property>
|
||||
<property name="icon">pause.xpm</property>
|
||||
<property name="active">no</property>
|
||||
<property name="visible">yes</property>
|
||||
|
||||
<signal name="toggled" handler="on_toggle_pause_toggled" />
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="toggle" id="toggle_stop">
|
||||
<property name="tooltip" translatable="yes">Stop</property>
|
||||
<property name="label" translatable="yes">Stop</property>
|
||||
<property name="icon">stop.xpm</property>
|
||||
<property name="active">no</property>
|
||||
<property name="visible">yes</property>
|
||||
|
||||
<signal name="toggled" handler="on_toggle_stop_toggled" />
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="placement">BONOBO_DOCK_BOTTOM</property>
|
||||
<property name="band">1</property>
|
||||
<property name="position">0</property>
|
||||
<property name="offset">0</property>
|
||||
<property name="behavior">BONOBO_DOCK_ITEM_BEH_EXCLUSIVE</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="BonoboDockItem" id="dockitem4">
|
||||
<property name="shadow_type">GTK_SHADOW_OUT</property>
|
||||
<property name="visible">yes</property>
|
||||
|
||||
<child>
|
||||
<widget class="Custom" id="status_area">
|
||||
<property name="creation_function">gst_status_area_new</property>
|
||||
<property name="int1">0</property>
|
||||
<property name="int2">0</property>
|
||||
<property name="last_modification_time">Wed, 08 Nov 2000 19:56:51 GMT</property>
|
||||
<property name="visible">yes</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="placement">BONOBO_DOCK_BOTTOM</property>
|
||||
<property name="band">2</property>
|
||||
<property name="position">0</property>
|
||||
<property name="offset">0</property>
|
||||
<property name="behavior">BONOBO_DOCK_ITEM_BEH_LOCKED|BONOBO_DOCK_ITEM_BEH_EXCLUSIVE</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="Placeholder" id="None">
|
||||
<property name="visible">yes</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">yes</property>
|
||||
<property name="fill">yes</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<widget class="GnomeAbout" id="about">
|
||||
<property name="modal">yes</property>
|
||||
<property name="wmclass_name">about</property>
|
||||
<property name="wmclass_class">GstMediaPlay</property>
|
||||
<property name="copyright" translatable="yes">(C) 1999-2001 Erik Walthinsen, Arik Devens</property>
|
||||
<property name="authors">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>
|
||||
</property>
|
||||
<property name="comments" translatable="yes">A generic media player for the gstreamer streaming media framework.</property>
|
||||
<property name="visible">no</property>
|
||||
</widget>
|
||||
<widget class="GtkFileSelection" id="fileselection1">
|
||||
<property name="border_width">10</property>
|
||||
<property name="title" translatable="yes">Select File</property>
|
||||
<property name="type">GTK_WINDOW_TOPLEVEL</property>
|
||||
<property name="modal">yes</property>
|
||||
<property name="allow_shrink">no</property>
|
||||
<property name="allow_grow">yes</property>
|
||||
<property name="wmclass_name">filesel</property>
|
||||
<property name="wmclass_class">GstMediaPlay</property>
|
||||
<property name="visible">no</property>
|
||||
<property name="show-fileops">yes</property>
|
||||
<property name="window-position">GTK_WIN_POS_NONE</property>
|
||||
|
||||
<child internal-child="ok_button">
|
||||
<widget class="GtkButton" id="ok_button1">
|
||||
<property name="can_default">yes</property>
|
||||
<property name="can_focus">yes</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="visible">yes</property>
|
||||
<property name="label" translatable="yes">gtk-ok</property>
|
||||
<property name="use_stock">yes</property>
|
||||
<property name="use_underline">yes</property>
|
||||
|
||||
<signal name="clicked" handler="on_ok_button1_clicked" />
|
||||
<signal name="clicked" handler="gtk_widget_hide" object="fileselection1" />
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child internal-child="cancel_button">
|
||||
<widget class="GtkButton" id="cancel_button1">
|
||||
<property name="can_default">yes</property>
|
||||
<property name="can_focus">yes</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="visible">yes</property>
|
||||
<property name="label" translatable="yes">gtk-cancel</property>
|
||||
<property name="use_stock">yes</property>
|
||||
<property name="use_underline">yes</property>
|
||||
|
||||
<signal name="clicked" handler="gtk_widget_hide" object="fileselection1" />
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<widget class="GtkWindow" id="preferences">
|
||||
<property name="title" translatable="yes">GstMediaPlayer Preferences</property>
|
||||
<property name="type">GTK_WINDOW_TOPLEVEL</property>
|
||||
<property name="modal">no</property>
|
||||
<property name="allow_shrink">no</property>
|
||||
<property name="allow_grow">yes</property>
|
||||
<property name="visible">no</property>
|
||||
<property name="window-position">GTK_WIN_POS_NONE</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkNotebook" id="notebook1">
|
||||
<property name="can_focus">yes</property>
|
||||
<property name="show_tabs">yes</property>
|
||||
<property name="show_border">yes</property>
|
||||
<property name="tab_pos">GTK_POS_TOP</property>
|
||||
<property name="scrollable">no</property>
|
||||
<property name="tab_hborder">2</property>
|
||||
<property name="tab_vborder">2</property>
|
||||
<property name="enable-popup">no</property>
|
||||
<property name="visible">yes</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkFrame" id="frame1">
|
||||
<property name="label" translatable="yes">Full Screen</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<property name="shadow">GTK_SHADOW_ETCHED_IN</property>
|
||||
<property name="visible">yes</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkVBox" id="vbox1">
|
||||
<property name="homogeneous">no</property>
|
||||
<property name="spacing">0</property>
|
||||
<property name="visible">yes</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="checkbutton1">
|
||||
<property name="can_focus">yes</property>
|
||||
<property name="label" translatable="yes">Show file menu</property>
|
||||
<property name="active">no</property>
|
||||
<property name="draw_indicator">yes</property>
|
||||
<property name="visible">yes</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">no</property>
|
||||
<property name="fill">no</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="checkbutton2">
|
||||
<property name="can_focus">yes</property>
|
||||
<property name="label" translatable="yes">Show player controls</property>
|
||||
<property name="active">no</property>
|
||||
<property name="draw_indicator">yes</property>
|
||||
<property name="visible">yes</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">no</property>
|
||||
<property name="fill">no</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="checkbutton3">
|
||||
<property name="can_focus">yes</property>
|
||||
<property name="label" translatable="yes">Show status area</property>
|
||||
<property name="active">no</property>
|
||||
<property name="draw_indicator">yes</property>
|
||||
<property name="visible">yes</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">no</property>
|
||||
<property name="fill">no</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label1">
|
||||
<property name="label" translatable="yes">Viewers</property>
|
||||
<property name="justify">GTK_JUSTIFY_CENTER</property>
|
||||
<property name="wrap">no</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="visible">yes</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="type">tab</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<widget class="GtkWindow" id="playlist_window">
|
||||
<property name="title" translatable="yes">playlist</property>
|
||||
<property name="type">GTK_WINDOW_TOPLEVEL</property>
|
||||
<property name="modal">no</property>
|
||||
<property name="allow_shrink">no</property>
|
||||
<property name="allow_grow">yes</property>
|
||||
<property name="visible">no</property>
|
||||
<property name="window-position">GTK_WIN_POS_NONE</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkScrolledWindow" id="scrolledwindow1">
|
||||
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
|
||||
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
|
||||
<property name="visible">yes</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkCList" id="playlist_clist">
|
||||
<property name="can_focus">yes</property>
|
||||
<property name="column_widths">273,80</property>
|
||||
<property name="selection_mode">GTK_SELECTION_SINGLE</property>
|
||||
<property name="show_titles">yes</property>
|
||||
<property name="shadow_type">GTK_SHADOW_IN</property>
|
||||
<property name="n_columns">2</property>
|
||||
<property name="visible">yes</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="track_name">
|
||||
<property name="label" translatable="yes">track name</property>
|
||||
<property name="justify">GTK_JUSTIFY_CENTER</property>
|
||||
<property name="wrap">no</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="visible">yes</property>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="track_lengthe">
|
||||
<property name="label" translatable="yes">track length</property>
|
||||
<property name="justify">GTK_JUSTIFY_CENTER</property>
|
||||
<property name="wrap">no</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="visible">yes</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child internal-child="hscrollbar">
|
||||
<widget class="GtkHScrollbar" id="convertwidget11">
|
||||
<property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
|
||||
<property name="visible">yes</property>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child internal-child="vscrollbar">
|
||||
<widget class="GtkVScrollbar" id="convertwidget12">
|
||||
<property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
|
||||
<property name="visible">yes</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</glade-interface>
|
|
@ -1,65 +0,0 @@
|
|||
#ifndef __GST_MEDIA_PLAY_H__
|
||||
#define __GST_MEDIA_PLAY_H__
|
||||
|
||||
#include <glade/glade.h>
|
||||
#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__ */
|
|
@ -1,777 +0,0 @@
|
|||
#include <config.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <gtk/gtkobject.h>
|
||||
#include <gtk/gtksignal.h>
|
||||
#include <gtk/gtksocket.h>
|
||||
#include <gtk/gtkmain.h>
|
||||
|
||||
#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;
|
||||
}
|
||||
}
|
|
@ -1,96 +0,0 @@
|
|||
#ifndef __GSTPLAY_H__
|
||||
#define __GSTPLAY_H__
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#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 <gst/gst.h>
|
||||
#include <gtk/gtkhbox.h>
|
||||
|
||||
#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__ */
|
|
@ -1 +0,0 @@
|
|||
#error Bogus header
|
|
@ -1,298 +0,0 @@
|
|||
#include <config.h>
|
||||
#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;
|
||||
}
|
||||
}
|
|
@ -1,46 +0,0 @@
|
|||
#ifndef __GST_STATUS_AREA_H__
|
||||
#define __GST_STATUS_AREA_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#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__ */
|
|
@ -1,52 +0,0 @@
|
|||
#include <config.h>
|
||||
#include <gnome.h>
|
||||
#ifdef USE_GLIB2
|
||||
#include <libgnomeui/libgnomeui.h>
|
||||
#include <libgnomeui/gnome-ui-init.h>
|
||||
#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;
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
/* XPM */
|
||||
static char * pause_xpm[] = {
|
||||
"13 15 5 1",
|
||||
" c None",
|
||||
". c #949594",
|
||||
"+ c #000000",
|
||||
"@ c #8E8E8E",
|
||||
"# c #FFFFFF",
|
||||
"...... ......",
|
||||
".+++@# .+++@#",
|
||||
".+++@# .+++@#",
|
||||
".+++@# .+++@#",
|
||||
".+++@# .+++@#",
|
||||
".+++@# .+++@#",
|
||||
".+++@# .+++@#",
|
||||
".+++@# .+++@#",
|
||||
".+++@# .+++@#",
|
||||
".+++@# .+++@#",
|
||||
".+++@# .+++@#",
|
||||
".+++@# .+++@#",
|
||||
".+++@# .+++@#",
|
||||
".+@@@# .+@@@#",
|
||||
".##### .#####"};
|
|
@ -1,23 +0,0 @@
|
|||
/* XPM */
|
||||
static char * pause_xpm[] = {
|
||||
"13 15 5 1",
|
||||
" c None",
|
||||
". c #949594",
|
||||
"+ c #000000",
|
||||
"@ c #8E8E8E",
|
||||
"# c #FFFFFF",
|
||||
"...... ......",
|
||||
".+++@# .+++@#",
|
||||
".+++@# .+++@#",
|
||||
".+++@# .+++@#",
|
||||
".+++@# .+++@#",
|
||||
".+++@# .+++@#",
|
||||
".+++@# .+++@#",
|
||||
".+++@# .+++@#",
|
||||
".+++@# .+++@#",
|
||||
".+++@# .+++@#",
|
||||
".+++@# .+++@#",
|
||||
".+++@# .+++@#",
|
||||
".+++@# .+++@#",
|
||||
".+@@@# .+@@@#",
|
||||
".##### .#####"};
|
|
@ -1,23 +0,0 @@
|
|||
/* XPM */
|
||||
static char * play_back_xpm[] = {
|
||||
"13 15 5 1",
|
||||
" c None",
|
||||
". c #949594",
|
||||
"+ c #000000",
|
||||
"@ c #8E8E8E",
|
||||
"# c #FFFFFF",
|
||||
"...... ",
|
||||
".+++++. ",
|
||||
".++++++. ",
|
||||
".+++++++. ",
|
||||
".++++++++. ",
|
||||
".+++++++++. ",
|
||||
".++++++++++. ",
|
||||
".++++++++++@#",
|
||||
".+++++++++@# ",
|
||||
".++++++++@# ",
|
||||
".+++++++@# ",
|
||||
".++++++@# ",
|
||||
".+++++@# ",
|
||||
".+@@@@# ",
|
||||
".##### "};
|
|
@ -1,23 +0,0 @@
|
|||
/* XPM */
|
||||
static char * stop_back_xpm[] = {
|
||||
"13 15 5 1",
|
||||
" c None",
|
||||
". c #949594",
|
||||
"+ c #000000",
|
||||
"@ c #8E8E8E",
|
||||
"# c #FFFFFF",
|
||||
".............",
|
||||
".++++++++++@#",
|
||||
".++++++++++@#",
|
||||
".++++++++++@#",
|
||||
".++++++++++@#",
|
||||
".++++++++++@#",
|
||||
".++++++++++@#",
|
||||
".++++++++++@#",
|
||||
".++++++++++@#",
|
||||
".++++++++++@#",
|
||||
".++++++++++@#",
|
||||
".++++++++++@#",
|
||||
".++++++++++@#",
|
||||
".+@@@@@@@@@@#",
|
||||
".############"};
|
|
@ -1,23 +0,0 @@
|
|||
/* XPM */
|
||||
static char * play_back_xpm[] = {
|
||||
"13 15 5 1",
|
||||
" c None",
|
||||
". c #949594",
|
||||
"+ c #000000",
|
||||
"@ c #8E8E8E",
|
||||
"# c #FFFFFF",
|
||||
"...... ",
|
||||
".+++++. ",
|
||||
".++++++. ",
|
||||
".+++++++. ",
|
||||
".++++++++. ",
|
||||
".+++++++++. ",
|
||||
".++++++++++. ",
|
||||
".++++++++++@#",
|
||||
".+++++++++@# ",
|
||||
".++++++++@# ",
|
||||
".+++++++@# ",
|
||||
".++++++@# ",
|
||||
".+++++@# ",
|
||||
".+@@@@# ",
|
||||
".##### "};
|
|
@ -1,23 +0,0 @@
|
|||
/* XPM */
|
||||
static char * stop_back_xpm[] = {
|
||||
"13 15 5 1",
|
||||
" c None",
|
||||
". c #949594",
|
||||
"+ c #000000",
|
||||
"@ c #8E8E8E",
|
||||
"# c #FFFFFF",
|
||||
".............",
|
||||
".++++++++++@#",
|
||||
".++++++++++@#",
|
||||
".++++++++++@#",
|
||||
".++++++++++@#",
|
||||
".++++++++++@#",
|
||||
".++++++++++@#",
|
||||
".++++++++++@#",
|
||||
".++++++++++@#",
|
||||
".++++++++++@#",
|
||||
".++++++++++@#",
|
||||
".++++++++++@#",
|
||||
".++++++++++@#",
|
||||
".+@@@@@@@@@@#",
|
||||
".############"};
|
Loading…
Reference in a new issue