From: Guenter B. <gu...@us...> - 2002-10-15 23:51:02
|
Update of /cvsroot/xine/gnome-xine/src In directory usw-pr-cvs1:/tmp/cvs-serv18488/src Modified Files: actions.c gtkxine.c gtkxine.h playlist.c Log Message: adapted to latest api plus a nice more gnome-like icon Index: actions.c =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/actions.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- actions.c 19 Sep 2002 21:07:54 -0000 1.7 +++ actions.c 15 Oct 2002 23:50:59 -0000 1.8 @@ -86,31 +86,31 @@ xine_event_t xine_event; xine_event.type = XINE_EVENT_INPUT_UP; - gtk_xine_send_event (GTK_XINE (gtx) , &xine_event); + gtk_xine_event_send (GTK_XINE (gtx) , &xine_event); } void action_menu_down (void) { xine_event_t xine_event; xine_event.type = XINE_EVENT_INPUT_DOWN; - gtk_xine_send_event (GTK_XINE (gtx) , &xine_event); + gtk_xine_event_send (GTK_XINE (gtx) , &xine_event); } void action_menu_left (void) { xine_event_t xine_event; xine_event.type = XINE_EVENT_INPUT_LEFT; - gtk_xine_send_event (GTK_XINE (gtx) , &xine_event); + gtk_xine_event_send (GTK_XINE (gtx) , &xine_event); } void action_menu_right (void) { xine_event_t xine_event; xine_event.type = XINE_EVENT_INPUT_RIGHT; - gtk_xine_send_event (GTK_XINE (gtx) , &xine_event); + gtk_xine_event_send (GTK_XINE (gtx) , &xine_event); } void action_menu_select (void) { xine_event_t xine_event; xine_event.type = XINE_EVENT_INPUT_SELECT; - gtk_xine_send_event (GTK_XINE (gtx) , &xine_event); + gtk_xine_event_send (GTK_XINE (gtx) , &xine_event); } void action_save_state (void) { @@ -122,7 +122,7 @@ fname = g_strconcat(g_get_home_dir(), "/.gnome_xine/config", NULL); - gtk_xine_save_config (GTK_XINE (gtx), fname); + gtk_xine_config_save (GTK_XINE (gtx), fname); g_free (fname); } Index: gtkxine.c =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/gtkxine.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- gtkxine.c 19 Sep 2002 20:52:43 -0000 1.27 +++ gtkxine.c 15 Oct 2002 23:50:59 -0000 1.28 @@ -111,8 +111,9 @@ /* FIXME: use gnome-config to load/store config values */ snprintf (this->configfile, 255, "%s/.gnome_xine/config", getenv ("HOME")); - xine_load_config (this->xine, this->configfile); + xine_config_load (this->xine, this->configfile); + this->stream = NULL; this->vo_driver = NULL; this->ao_driver = NULL; this->display = NULL; @@ -164,12 +165,12 @@ *dest_pixel_aspect = video_pixel_aspect * gxine->display_ratio; } -static const xine_vo_driver_t *load_video_out_driver(GtkXine *this) { +static xine_vo_driver_t *load_video_out_driver(GtkXine *this) { double res_h, res_v; x11_visual_t vis; const char *video_driver_id; - const xine_vo_driver_t *vo_driver; + xine_vo_driver_t *vo_driver; vis.display = this->display; vis.screen = this->screen; @@ -213,9 +214,9 @@ (void *) &vis); } -static const xine_ao_driver_t *load_audio_out_driver (GtkXine *this) { +static xine_ao_driver_t *load_audio_out_driver (GtkXine *this) { - const xine_ao_driver_t *ao_driver; + xine_ao_driver_t *ao_driver; const char *audio_driver_id; /* try to init audio with stored information */ @@ -259,7 +260,7 @@ if (event.xexpose.count != 0) break; - xine_gui_send_vo_data (this->xine, + xine_gui_send_vo_data (this->stream, XINE_GUI_SEND_EXPOSE_EVENT, &event); break; @@ -273,7 +274,7 @@ } if (event.type == this->completion_event) { - xine_gui_send_vo_data (this->xine, + xine_gui_send_vo_data (this->stream, XINE_GUI_SEND_COMPLETION_EVENT, &event); /* printf ("gtkxine: completion event\n"); */ } @@ -394,7 +395,10 @@ * init xine engine */ - xine_init (this->xine, this->ao_driver, this->vo_driver); + xine_init (this->xine); + + this->stream = xine_stream_new (this->xine, this->ao_driver, + this->vo_driver); values.foreground = BlackPixel (this->display, this->screen); values.background = WhitePixel (this->display, this->screen); @@ -444,7 +448,7 @@ printf ("gtkxine: saving configuration...\n"); - xine_save_config (this->xine, this->configfile); + xine_config_save (this->xine, this->configfile); /* exit xine */ @@ -510,7 +514,7 @@ printf ("gtkxine: calling xine_open, mrl = '%s'\n", mrl); - return xine_open (gtx->xine, mrl); + return xine_open (gtx->stream, mrl); } gint gtk_xine_play (GtkXine *gtx, @@ -523,7 +527,7 @@ printf ("gtkxine: calling xine_play start_pos = %d, start_time = %d\n", pos, start_time); - return xine_play (gtx->xine, pos, start_time); + return xine_play (gtx->stream, pos, start_time); } gint gtk_xine_trick_mode (GtkXine *gtx, @@ -531,9 +535,9 @@ g_return_val_if_fail (gtx != NULL, 0); g_return_val_if_fail (GTK_IS_XINE (gtx), 0); - g_return_val_if_fail (gtx->xine != NULL, 0); + g_return_val_if_fail (gtx->stream != NULL, 0); - return xine_trick_mode (gtx->xine, mode, value); + return xine_trick_mode (gtx->stream, mode, value); } gint gtk_xine_get_pos_length (GtkXine *gtx, gint *pos_stream, @@ -541,88 +545,88 @@ gint *length_time) { g_return_val_if_fail (gtx != NULL, 0); g_return_val_if_fail (GTK_IS_XINE (gtx), 0); - g_return_val_if_fail (gtx->xine != NULL, 0); + g_return_val_if_fail (gtx->stream != NULL, 0); - return xine_get_pos_length (gtx->xine, pos_stream, pos_time, length_time); + return xine_get_pos_length (gtx->stream, pos_stream, pos_time, length_time); } void gtk_xine_stop (GtkXine *gtx) { g_return_if_fail (gtx != NULL); g_return_if_fail (GTK_IS_XINE (gtx)); - g_return_if_fail (gtx->xine != NULL); + g_return_if_fail (gtx->stream != NULL); - xine_stop (gtx->xine); + xine_stop (gtx->stream); } gint gtk_xine_get_error (GtkXine *gtx) { g_return_val_if_fail (gtx != NULL, 0); g_return_val_if_fail (GTK_IS_XINE (gtx), 0); - g_return_val_if_fail (gtx->xine != NULL, 0); + g_return_val_if_fail (gtx->stream != NULL, 0); - return xine_get_error (gtx->xine); + return xine_get_error (gtx->stream); } gint gtk_xine_get_status (GtkXine *gtx) { g_return_val_if_fail (gtx != NULL, 0); g_return_val_if_fail (GTK_IS_XINE (gtx), 0); - g_return_val_if_fail (gtx->xine != NULL, 0); + g_return_val_if_fail (gtx->stream != NULL, 0); - return xine_get_status (gtx->xine); + return xine_get_status (gtx->stream); } void gtk_xine_set_param (GtkXine *gtx, gint param, gint value) { g_return_if_fail (gtx != NULL); g_return_if_fail (GTK_IS_XINE (gtx)); - g_return_if_fail (gtx->xine != NULL); + g_return_if_fail (gtx->stream != NULL); - xine_set_param (gtx->xine, param, value); + xine_set_param (gtx->stream, param, value); } gint gtk_xine_get_param (GtkXine *gtx, gint param) { g_return_val_if_fail (gtx != NULL, 0); g_return_val_if_fail (GTK_IS_XINE (gtx), 0); - g_return_val_if_fail (gtx->xine != NULL, 0); + g_return_val_if_fail (gtx->stream != NULL, 0); - return xine_get_param (gtx->xine, param); + return xine_get_param (gtx->stream, param); } -const gchar *gtk_xine_get_audio_lang (GtkXine *gtx, gint channel) { +gint gtk_xine_get_audio_lang (GtkXine *gtx, gint channel, gchar *lang) { g_return_val_if_fail (gtx != NULL, 0); g_return_val_if_fail (GTK_IS_XINE (gtx), 0); - g_return_val_if_fail (gtx->xine != NULL, 0); + g_return_val_if_fail (gtx->stream != NULL, 0); - return xine_get_audio_lang (gtx->xine, channel); + return xine_get_audio_lang (gtx->stream, channel, lang); } -const gchar *gtk_xine_get_spu_lang (GtkXine *gtx, gint channel) { +gint gtk_xine_get_spu_lang (GtkXine *gtx, gint channel, gchar *lang) { g_return_val_if_fail (gtx != NULL, 0); g_return_val_if_fail (GTK_IS_XINE (gtx), 0); - g_return_val_if_fail (gtx->xine != NULL, 0); + g_return_val_if_fail (gtx->stream != NULL, 0); - return xine_get_spu_lang (gtx->xine, channel); + return xine_get_spu_lang (gtx->stream, channel, lang); } gint gtk_xine_get_stream_info (GtkXine *gtx, gint info) { g_return_val_if_fail (gtx != NULL, 0); g_return_val_if_fail (GTK_IS_XINE (gtx), 0); - g_return_val_if_fail (gtx->xine != NULL, 0); + g_return_val_if_fail (gtx->stream != NULL, 0); - return xine_get_stream_info (gtx->xine, info); + return xine_get_stream_info (gtx->stream, info); } const gchar *gtk_xine_get_meta_info (GtkXine *gtx, gint info) { g_return_val_if_fail (gtx != NULL, 0); g_return_val_if_fail (GTK_IS_XINE (gtx), 0); - g_return_val_if_fail (gtx->xine != NULL, 0); + g_return_val_if_fail (gtx->stream != NULL, 0); - return xine_get_meta_info (gtx->xine, info); + return xine_get_meta_info (gtx->stream, info); } #define MWM_HINTS_DECORATIONS (1L << 1) @@ -645,7 +649,7 @@ g_return_if_fail (gtx != NULL); g_return_if_fail (GTK_IS_XINE (gtx)); - g_return_if_fail (gtx->xine != NULL); + g_return_if_fail (gtx->stream != NULL); if (fullscreen == gtx->fullscreen_mode) return; @@ -716,7 +720,7 @@ gtx->toplevel, RevertToNone, CurrentTime); XMoveWindow (gtx->display, gtx->fullscreen_window, 0, 0); - xine_gui_send_vo_data (gtx->xine, + xine_gui_send_vo_data (gtx->stream, XINE_GUI_SEND_DRAWABLE_CHANGED, (void*)gtx->fullscreen_window); @@ -731,7 +735,7 @@ } else { - xine_gui_send_vo_data (gtx->xine, + xine_gui_send_vo_data (gtx->stream, XINE_GUI_SEND_DRAWABLE_CHANGED, (void*)gtx->video_window); @@ -745,7 +749,7 @@ g_return_val_if_fail (gtx != NULL, 0); g_return_val_if_fail (GTK_IS_XINE (gtx), 0); - g_return_val_if_fail (gtx->xine != NULL, 0); + g_return_val_if_fail (gtx->stream != NULL, 0); return gtx->fullscreen_mode; } @@ -759,9 +763,9 @@ g_return_val_if_fail (gtx != NULL, 0); g_return_val_if_fail (GTK_IS_XINE (gtx), 0); - g_return_val_if_fail (gtx->xine != NULL, 0); + g_return_val_if_fail (gtx->stream != NULL, 0); - return xine_get_current_frame (gtx->xine, width, height, ratio_code, format, + return xine_get_current_frame (gtx->stream, width, height, ratio_code, format, img); } @@ -802,16 +806,6 @@ return xine_register_log_cb (gtx->xine, cb, user_data); } -gint gtk_xine_register_report_codec_cb (GtkXine *gtx, - xine_report_codec_cb_t report_callback, - void *user_data) { - g_return_val_if_fail (gtx != NULL, 0); - g_return_val_if_fail (GTK_IS_XINE (gtx), 0); - g_return_val_if_fail (gtx->xine != NULL, 0); - - return xine_register_report_codec_cb (gtx->xine, report_callback, user_data); -} - gchar **gtk_xine_get_browsable_input_plugin_ids (GtkXine *gtx) { g_return_val_if_fail (gtx != NULL, NULL); @@ -887,60 +881,41 @@ xine_config_update_entry (gtx->xine, entry); } -void gtk_xine_load_config (GtkXine *gtx, +void gtk_xine_config_load (GtkXine *gtx, const gchar *cfg_filename) { g_return_if_fail (gtx != NULL); g_return_if_fail (GTK_IS_XINE (gtx)); g_return_if_fail (gtx->xine != NULL); - xine_load_config (gtx->xine, cfg_filename); + xine_config_load (gtx->xine, cfg_filename); } -void gtk_xine_save_config (GtkXine *gtx, +void gtk_xine_config_save (GtkXine *gtx, const gchar *cfg_filename) { g_return_if_fail (gtx != NULL); g_return_if_fail (GTK_IS_XINE (gtx)); g_return_if_fail (gtx->xine != NULL); - xine_save_config (gtx->xine, cfg_filename); + xine_config_save (gtx->xine, cfg_filename); } -void gtk_xine_reset_config (GtkXine *gtx) { +void gtk_xine_config_reset (GtkXine *gtx) { g_return_if_fail (gtx != NULL); g_return_if_fail (GTK_IS_XINE (gtx)); g_return_if_fail (gtx->xine != NULL); - xine_reset_config (gtx->xine); + xine_config_reset (gtx->xine); } -gint gtk_xine_register_event_listener (GtkXine *gtx, - xine_event_listener_cb_t listener, - void *user_data) { - g_return_val_if_fail (gtx != NULL, 0); - g_return_val_if_fail (GTK_IS_XINE (gtx), 0); - g_return_val_if_fail (gtx->xine != NULL, 0); - - return xine_register_event_listener (gtx->xine, listener, user_data); -} - -gint gtk_xine_remove_event_listener (GtkXine *gtx, - xine_event_listener_cb_t listener) { - g_return_val_if_fail (gtx != NULL, 0); - g_return_val_if_fail (GTK_IS_XINE (gtx), 0); - g_return_val_if_fail (gtx->xine != NULL, 0); - - return xine_remove_event_listener (gtx->xine, listener); -} - -void gtk_xine_send_event (GtkXine *gtx, - xine_event_t *event) { +void gtk_xine_event_send (GtkXine *gtx, + const xine_event_t *event) { g_return_if_fail (gtx != NULL); g_return_if_fail (GTK_IS_XINE (gtx)); - g_return_if_fail (gtx->xine != NULL); + g_return_if_fail (gtx->stream != NULL); - xine_send_event (gtx->xine, event); + xine_event_send (gtx->stream, event); } Index: gtkxine.h =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/gtkxine.h,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- gtkxine.h 19 Sep 2002 01:51:57 -0000 1.15 +++ gtkxine.h 15 Oct 2002 23:50:59 -0000 1.16 @@ -45,10 +45,12 @@ { GtkWidget widget; - const xine_t *xine; + xine_t *xine; + xine_stream_t *stream; + char configfile[256]; - const xine_vo_driver_t *vo_driver; - const xine_ao_driver_t *ao_driver; + xine_vo_driver_t *vo_driver; + xine_ao_driver_t *ao_driver; x11_visual_t vis; double display_ratio; Display *display; @@ -111,10 +113,12 @@ gint gtk_xine_get_param (GtkXine *gtx, gint param); - const gchar *gtk_xine_get_audio_lang (GtkXine *gtx, - gint channel); - const gchar *gtk_xine_get_spu_lang (GtkXine *gtx, - gint channel); + gint gtk_xine_get_audio_lang (GtkXine *gtx, + gint channel, + gchar *lang); + gint gtk_xine_get_spu_lang (GtkXine *gtx, + gint channel, + gchar *lang); void gtk_xine_set_fullscreen (GtkXine *gtx, gint fullscreen); @@ -136,10 +140,6 @@ xine_log_cb_t cb, void *user_data); - gint gtk_xine_register_report_codec_cb (GtkXine *gtx, - xine_report_codec_cb_t report_codec, - void *user_data); - gchar **gtk_xine_get_browsable_input_plugin_ids (GtkXine *gtx) ; xine_mrl_t **gtk_xine_get_browse_mrls (GtkXine *gtx, const gchar *plugin_id, @@ -156,19 +156,16 @@ const gchar *key, xine_cfg_entry_t *entry); void gtk_xine_config_update_entry (GtkXine *gtx, xine_cfg_entry_t *entry); - void gtk_xine_load_config (GtkXine *gtx, + void gtk_xine_config_load (GtkXine *gtx, const gchar *cfg_filename); - void gtk_xine_save_config (GtkXine *gtx, + void gtk_xine_config_save (GtkXine *gtx, const gchar *cfg_filename); - void gtk_xine_reset_config (GtkXine *gtx); + void gtk_xine_config_reset (GtkXine *gtx); + + xine_event_queue_t *gtk_xine_event_new_queue (GtkXine *gtx); - gint gtk_xine_register_event_listener (GtkXine *gtx, - xine_event_listener_cb_t listener, - void *user_data); - gint gtk_xine_remove_event_listener (GtkXine *gtx, - xine_event_listener_cb_t listener); - void gtk_xine_send_event (GtkXine *gtx, - xine_event_t *event); + void gtk_xine_event_send (GtkXine *gtx, + const xine_event_t *event); /* FIXME: OSD missing */ Index: playlist.c =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/playlist.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- playlist.c 19 Sep 2002 22:28:39 -0000 1.2 +++ playlist.c 15 Oct 2002 23:50:59 -0000 1.3 @@ -248,10 +248,10 @@ cur_sel = row; } -static void xine_event_cb (void *user_data, xine_event_t *event) { +static void xine_event_cb (void *user_data, const xine_event_t *event) { switch (event->type) { - case XINE_EVENT_PLAYBACK_FINISHED: + case XINE_EVENT_UI_PLAYBACK_FINISHED: if (cur_sel<(GTK_CLIST(clist)->rows-1)) { gtk_clist_select_row (GTK_CLIST (clist), cur_sel+1, 0); @@ -333,7 +333,17 @@ playlist_load (); - gtk_xine_register_event_listener (GTK_XINE(gtx), xine_event_cb, NULL); + /* + * event handling + */ + { + xine_event_queue_t *queue; + + queue = xine_event_new_queue (GTK_XINE(gtx)->stream); + + xine_event_create_listener_thread (queue, xine_event_cb, NULL); + + } } |