2000-06-25 21:38:00 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include <config.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <gnome.h>
|
2000-08-14 10:16:23 +00:00
|
|
|
#include <glade/glade.h>
|
2000-06-25 21:38:00 +00:00
|
|
|
#include <gst/gst.h>
|
|
|
|
|
2000-07-05 10:21:08 +00:00
|
|
|
#include "gstplay.h"
|
2000-06-25 21:38:00 +00:00
|
|
|
#include "callbacks.h"
|
|
|
|
#include "interface.h"
|
|
|
|
|
|
|
|
extern GstElement *src;
|
2000-07-05 10:21:08 +00:00
|
|
|
extern gboolean picture_shown;
|
|
|
|
extern GstPlayState state;
|
|
|
|
extern guchar statusline[];
|
|
|
|
extern guchar *statustext;
|
2000-08-14 10:16:23 +00:00
|
|
|
extern GtkFileSelection *open_file_selection;
|
2000-06-25 21:38:00 +00:00
|
|
|
|
|
|
|
void
|
2000-08-14 10:16:23 +00:00
|
|
|
on_save1_activate (GtkMenuItem *menuitem,
|
2000-06-25 21:38:00 +00:00
|
|
|
gpointer user_data)
|
|
|
|
{
|
2000-08-14 10:16:23 +00:00
|
|
|
printf("file1 activate\n");
|
2000-06-25 21:38:00 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2000-08-14 10:16:23 +00:00
|
|
|
on_save_as1_activate (GtkMenuItem *menuitem,
|
2000-06-25 21:38:00 +00:00
|
|
|
gpointer user_data)
|
|
|
|
{
|
2000-08-14 10:16:23 +00:00
|
|
|
printf("file1 activate\n");
|
2000-06-25 21:38:00 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2000-08-14 10:16:23 +00:00
|
|
|
on_media2_activate (GtkMenuItem *menuitem,
|
2000-06-25 21:38:00 +00:00
|
|
|
gpointer user_data)
|
|
|
|
{
|
2000-08-14 10:16:23 +00:00
|
|
|
printf("file1 activate\n");
|
2000-06-25 21:38:00 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
void
|
2000-08-14 10:16:23 +00:00
|
|
|
on_preferences1_activate (GtkMenuItem *menuitem,
|
2000-06-25 21:38:00 +00:00
|
|
|
gpointer user_data)
|
|
|
|
{
|
2000-08-14 10:16:23 +00:00
|
|
|
printf("file1 activate\n");
|
2000-06-25 21:38:00 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2000-08-14 10:16:23 +00:00
|
|
|
on_open2_activate (GtkMenuItem *menuitem,
|
2000-06-25 21:38:00 +00:00
|
|
|
gpointer user_data)
|
|
|
|
{
|
2000-08-14 10:16:23 +00:00
|
|
|
GladeXML *xml;
|
2000-08-18 20:35:48 +00:00
|
|
|
xml = glade_xml_new(DATADIR "gstplay.glade", "fileselection1");
|
2000-08-14 10:16:23 +00:00
|
|
|
/* connect the signals in the interface */
|
|
|
|
glade_xml_signal_autoconnect(xml);
|
|
|
|
open_file_selection = glade_xml_get_widget(xml, "fileselection1");
|
2000-06-25 21:38:00 +00:00
|
|
|
}
|
|
|
|
|
2000-07-05 10:21:08 +00:00
|
|
|
void
|
|
|
|
on_toggle_play_toggled (GtkToggleButton *togglebutton,
|
|
|
|
gpointer user_data)
|
|
|
|
{
|
|
|
|
update_buttons(0);
|
|
|
|
change_state(GSTPLAY_PLAYING);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
on_toggle_pause_toggled (GtkToggleButton *togglebutton,
|
|
|
|
gpointer user_data)
|
|
|
|
{
|
|
|
|
update_buttons(1);
|
|
|
|
change_state(GSTPLAY_PAUSE);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
on_toggle_stop_toggled (GtkToggleButton *togglebutton,
|
|
|
|
gpointer user_data)
|
|
|
|
{
|
|
|
|
update_buttons(2);
|
|
|
|
change_state(GSTPLAY_STOPPED);
|
|
|
|
}
|
|
|
|
|
2000-06-25 21:38:00 +00:00
|
|
|
void
|
|
|
|
on_hscale1_value_changed (GtkAdjustment *adj,
|
|
|
|
gpointer user_data)
|
|
|
|
{
|
2000-07-05 10:21:08 +00:00
|
|
|
int size = gst_util_get_int_arg(GTK_OBJECT(src),"size");
|
|
|
|
|
|
|
|
gtk_object_set(GTK_OBJECT(src),"offset",(int)(adj->value*size/100.0),NULL);
|
2000-06-25 21:38:00 +00:00
|
|
|
|
2000-07-05 10:21:08 +00:00
|
|
|
if (state != GSTPLAY_PLAYING) {
|
|
|
|
show_next_picture();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
on_drawingarea1_configure_event (GtkWidget *widget, GdkEventConfigure *event,
|
|
|
|
gpointer user_data)
|
|
|
|
{
|
|
|
|
gdk_draw_rectangle(widget->window,
|
|
|
|
widget->style->black_gc,
|
|
|
|
TRUE, 0,0,
|
|
|
|
widget->allocation.width,
|
|
|
|
widget->allocation.height);
|
|
|
|
|
|
|
|
gdk_draw_string(widget->window,widget->style->font,widget->style->white_gc, 8, 15, statustext);
|
|
|
|
gdk_draw_string(widget->window,widget->style->font,widget->style->white_gc, widget->allocation.width-100, 15, statusline);
|
2000-06-25 21:38:00 +00:00
|
|
|
}
|
|
|
|
|
2000-08-14 10:16:23 +00:00
|
|
|
void on_about_activate(GtkWidget *widget, gpointer data)
|
|
|
|
{
|
|
|
|
GladeXML *xml;
|
2000-08-18 20:35:48 +00:00
|
|
|
xml = glade_xml_new(DATADIR "gstplay.glade", "about");
|
2000-08-14 10:16:23 +00:00
|
|
|
/* connect the signals in the interface */
|
|
|
|
glade_xml_signal_autoconnect(xml);
|
|
|
|
}
|
|
|
|
|
|
|
|
void on_gstplay_destroy(GtkWidget *widget, gpointer data)
|
|
|
|
{
|
|
|
|
gtk_main_quit();
|
|
|
|
}
|
|
|
|
|