"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/xitk/event.c" between
xine-ui-0.99.13.tar.bz2 and xine-ui-0.99.14.tar.bz2

About: xine is a free video player which plays mpeg-2 and mpeg-1 video, DVDs (unlocked/unencrypted only), video CDs, SVCDs, and AVI files (using Win32 codecs) with synchronized audio and video, and optionally fullscreen using the Xv extensions in Xfree86 4.x (user interface).

event.c  (xine-ui-0.99.13.tar.bz2):event.c  (xine-ui-0.99.14.tar.bz2)
/* /*
* Copyright (C) 2000-2021 the xine project * Copyright (C) 2000-2022 the xine project
* *
* This file is part of xine, a unix video player. * This file is part of xine, a unix video player.
* *
* xine is free software; you can redistribute it and/or modify * xine is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* xine is distributed in the hope that it will be useful, * xine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 607 skipping to change at line 607
break; break;
case ACTID_PLAYLIST: case ACTID_PLAYLIST:
gui_playlist_show (NULL, gui); gui_playlist_show (NULL, gui);
break; break;
case ACTID_TOGGLE_VISIBLITY: case ACTID_TOGGLE_VISIBLITY:
panel_toggle_visibility (NULL, gui->panel); panel_toggle_visibility (NULL, gui->panel);
break; break;
case ACTID_FLIP_V:
case ACTID_FLIP_H:
#ifdef XINE_VO_TRANSFORM_FLIP_H
{
int flags = gui->transform.flags ^ (action == ACTID_FLIP_H ? 1 : 2);
flags = ((flags & 1) ? XINE_VO_TRANSFORM_FLIP_H : 0)
| ((flags & 2) ? XINE_VO_TRANSFORM_FLIP_V : 0);
xine_set_param (gui->stream, XINE_PARAM_VO_TRANSFORM, flags);
flags = xine_get_param (gui->stream, XINE_PARAM_VO_TRANSFORM);
if (flags != -1) {
flags = ((flags & XINE_VO_TRANSFORM_FLIP_H) ? 1 : 0)
| ((flags & XINE_VO_TRANSFORM_FLIP_V) ? 2 : 0);
if (flags != gui->transform.flags) {
gui->transform.flags = flags;
osd_display_info (gui, "%s", gui->transform.msg[flags & 3]);
}
}
}
#endif
break;
case ACTID_TOGGLE_FULLSCREEN: case ACTID_TOGGLE_FULLSCREEN:
{ {
int yes = numeric_set int yes = numeric_set
? ((!!numeric_arg) ^ (!!(video_window_get_fullscreen_mode (gui->vw in) & FULLSCR_MODE))) ? ((!!numeric_arg) ^ (!!(video_window_get_fullscreen_mode (gui->vw in) & FULLSCR_MODE)))
: 1; : 1;
if (yes) if (yes)
gui_set_fullscreen_mode (NULL, gui); gui_set_fullscreen_mode (NULL, gui);
} }
break; break;
skipping to change at line 1136 skipping to change at line 1158
xine_event.type = XINE_EVENT_PVR_SAVE; xine_event.type = XINE_EVENT_PVR_SAVE;
xine_event.data = &ev_data; xine_event.data = &ev_data;
xine_event.data_length = sizeof(xine_pvr_save_data_t); xine_event.data_length = sizeof(xine_pvr_save_data_t);
xine_event.stream = gui->stream; xine_event.stream = gui->stream;
xine_event_send(gui->stream, &xine_event); xine_event_send(gui->stream, &xine_event);
} }
break; break;
case ACTID_PLAYLIST_OPEN: case ACTID_PLAYLIST_OPEN:
if (sarg) { if (sarg) {
mediamark_load_mediamarks (gui, sarg); gui_playlist_add_item (gui, sarg, 1, GUI_ITEM_TYPE_PLAYLIST, 1);
gui_set_current_mmk (gui, mediamark_get_current_mmk (gui)); gui_current_set_index (gui, GUI_MMK_CURRENT);
playlist_update_playlist (gui); playlist_update_playlist (gui);
if ((!is_playback_widgets_enabled (gui->panel)) && gui->playlist.num) if ((!is_playback_widgets_enabled (gui->panel)) && gui->playlist.num)
enable_playback_controls (gui->panel, 1); enable_playback_controls (gui->panel, 1);
} }
break; break;
default: default:
break; break;
} }
skipping to change at line 1196 skipping to change at line 1218
* Start playback of an entry in playlist * Start playback of an entry in playlist
*/ */
int gui_playlist_play (gGui_t *gui, int idx) { int gui_playlist_play (gGui_t *gui, int idx) {
int ret = 1; int ret = 1;
osd_hide (gui); osd_hide (gui);
panel_reset_slider (gui->panel); panel_reset_slider (gui->panel);
if(idx >= gui->playlist.num) if(idx >= gui->playlist.num)
return 0; return 0;
gui_set_current_mmk_by_index (gui, idx); gui_current_set_index (gui, idx);
pthread_mutex_lock(&gui->mmk_mutex); gui_playlist_lock (gui);
if (!gui_xine_open_and_play (gui, gui->mmk.mrl, gui->mmk.sub, 0, if (!gui_xine_open_and_play (gui, gui->mmk.mrl, gui->mmk.sub, 0,
gui->mmk.start, gui->mmk.av_offset, gui->mmk.spu_offset, gui->mmk.start, gui->mmk.av_offset, gui->mmk.spu_offset,
!mediamark_have_alternates (&(gui->mmk))) && !mediamark_have_alternates (&(gui->mmk))) &&
(!mediamark_have_alternates(&(gui->mmk)) || (!mediamark_have_alternates(&(gui->mmk)) ||
!gui_open_and_play_alternates (gui, &(gui->mmk), gui->mmk.sub))) !gui_open_and_play_alternates (gui, &(gui->mmk), gui->mmk.sub)))
ret = 0; ret = 0;
pthread_mutex_unlock(&gui->mmk_mutex); gui_playlist_unlock (gui);
return ret; return ret;
} }
/* /*
* Start playback to next entry in playlist (or stop the engine, then display lo go). * Start playback to next entry in playlist (or stop the engine, then display lo go).
*/ */
void gui_playlist_start_next (gGui_t *gui) { void gui_playlist_start_next (gGui_t *gui) {
if (gui->ignore_next) if (gui->ignore_next)
return; return;
skipping to change at line 1228 skipping to change at line 1250
panel_reset_slider (gui->panel); panel_reset_slider (gui->panel);
if(gui->playlist.control & PLAYLIST_CONTROL_STOP) { if(gui->playlist.control & PLAYLIST_CONTROL_STOP) {
if(!(gui->playlist.control & PLAYLIST_CONTROL_STOP_PERSIST)) if(!(gui->playlist.control & PLAYLIST_CONTROL_STOP_PERSIST))
gui->playlist.control &= ~PLAYLIST_CONTROL_STOP; gui->playlist.control &= ~PLAYLIST_CONTROL_STOP;
gui_display_logo (gui); gui_display_logo (gui);
return; return;
} }
if (is_playback_widgets_enabled (gui->panel) && (!gui->playlist.num)) { if (is_playback_widgets_enabled (gui->panel) && (!gui->playlist.num)) {
gui_set_current_mmk (gui, NULL); gui_current_set_index (gui, GUI_MMK_NONE);
enable_playback_controls (gui->panel, 0); enable_playback_controls (gui->panel, 0);
gui_display_logo (gui); gui_display_logo (gui);
return; return;
} }
switch(gui->playlist.loop) { switch(gui->playlist.loop) {
case PLAYLIST_LOOP_NO_LOOP: case PLAYLIST_LOOP_NO_LOOP:
case PLAYLIST_LOOP_LOOP: case PLAYLIST_LOOP_LOOP:
gui->playlist.cur++; gui->playlist.cur++;
skipping to change at line 1341 skipping to change at line 1363
pthread_mutex_init (&gui->event_mutex, &attr); pthread_mutex_init (&gui->event_mutex, &attr);
pthread_cond_init (&gui->event_safe, NULL); pthread_cond_init (&gui->event_safe, NULL);
gui->event_reject = 1; gui->event_reject = 1;
gui->event_pending = 0; gui->event_pending = 0;
/* /*
* init playlist * init playlist
*/ */
for (i = 0; i < p->num_files; i++) { for (i = 0; i < p->num_files; i++) {
char *file = p->filenames[i]; const char *file = p->filenames[i];
/* grab recursively all files from dir */
if(is_a_dir(file)) {
if(file[strlen(file) - 1] == '/')
file[strlen(file) - 1] = '\0';
mediamark_collect_from_directory (gui, file); gui_playlist_add_item (gui, file, GUI_MAX_DIR_LEVELS, GUI_ITEM_TYPE_AUTO, 0)
} ;
else {
if(mrl_look_like_playlist(file))
(void) mediamark_concat_mediamarks (gui, file);
else {
char *sub = NULL;
if((sub = (char *)get_last_double_semicolon(file)) != NULL) {
if(is_ipv6_last_double_semicolon(file))
sub = NULL;
else {
*sub = 0;
sub += 2;
}
}
mediamark_append_entry (gui, (const char *)file, (const char *)file, sub
, 0, -1, 0, 0);
}
}
} }
gui->playlist.cur = gui->playlist.num ? 0 : -1; gui->playlist.cur = gui->playlist.num ? 0 : -1;
if((gui->playlist.loop == PLAYLIST_LOOP_SHUFFLE) || if((gui->playlist.loop == PLAYLIST_LOOP_SHUFFLE) ||
(gui->playlist.loop == PLAYLIST_LOOP_SHUF_PLUS)) (gui->playlist.loop == PLAYLIST_LOOP_SHUF_PLUS))
gui->playlist.cur = mediamark_get_shuffle_next (gui); gui->playlist.cur = mediamark_get_shuffle_next (gui);
gui->is_display_mrl = 0; gui->is_display_mrl = 0;
gui->mrl_overrided = 0; gui->mrl_overrided = 0;
/* gui->new_pos = -1; */ /* gui->new_pos = -1; */
/* /*
* *
*/ */
gui->transform.msg[0] = _("Video upright");
gui->transform.msg[1] = _("Video mirrored");
gui->transform.msg[2] = _("Video upside down");
gui->transform.msg[3] = _("Video upside down and mirrored");
gui->transform.flags = 0;
use_x_lock_display = use_x_lock_display =
xine_config_register_bool (gui->xine, "gui.use_XLockDisplay", 1, xine_config_register_bool (gui->xine, "gui.use_XLockDisplay", 1,
_("Enable extra XLib thread safety."), _("Enable extra XLib thread safety."),
_("This is needed for some very old XLib/XCB versions.\n" _("This is needed for some very old XLib/XCB versions.\n"
"Otherwise, it may boost or brake performance - just try out."), "Otherwise, it may boost or brake performance - just try out."),
CONFIG_LEVEL_ADV, NULL, NULL); CONFIG_LEVEL_ADV, NULL, NULL);
use_synchronized_x11 = use_synchronized_x11 =
xine_config_register_bool (gui->xine, "gui.xsynchronize", xine_config_register_bool (gui->xine, "gui.xsynchronize",
0, 0,
skipping to change at line 1508 skipping to change at line 1510
skin_server_url_cb, skin_server_url_cb,
gui); gui);
config_update_string (gui->xine, "gui.skin_server_url", config_update_string (gui->xine, "gui.skin_server_url",
gui->skin_server_url ? gui->skin_server_url : server); gui->skin_server_url ? gui->skin_server_url : server);
gui->osd.enabled = gui->osd.enabled =
xine_config_register_bool (gui->xine, "gui.osd_enabled", xine_config_register_bool (gui->xine, "gui.osd_enabled",
1, 1,
_("Enable OSD support"), _("Enable OSD support"),
_("Enabling OSD permit to display some status/infor mations " _("Enabling OSD permit one to display some status/i nformations "
"in output window."), "in output window."),
CONFIG_LEVEL_BEG, CONFIG_LEVEL_BEG,
osd_enabled_cb, osd_enabled_cb,
gui); gui);
gui->osd.use_unscaled = gui->osd.use_unscaled =
xine_config_register_bool (gui->xine, "gui.osd_use_unscaled", xine_config_register_bool (gui->xine, "gui.osd_use_unscaled",
1, 1,
_("Use unscaled OSD"), _("Use unscaled OSD"),
_("Use unscaled (full screen resolution) OSD if pos sible"), _("Use unscaled (full screen resolution) OSD if pos sible"),
skipping to change at line 1645 skipping to change at line 1647
p->prefered_visual, p->install_colormap, use_x_lock_display ); p->prefered_visual, p->install_colormap, use_x_lock_display );
if (!gui->vwin) { if (!gui->vwin) {
printf ("gui.init: ERROR: video window unavailable.\n"); printf ("gui.init: ERROR: video window unavailable.\n");
} }
/* kbinding might open an error dialog (double keymapping), which produces a s egfault, /* kbinding might open an error dialog (double keymapping), which produces a s egfault,
* when done before the video_window_init(). */ * when done before the video_window_init(). */
gui->kbindings = kbindings_init_kbinding (gui, gui->keymap_file); gui->kbindings = kbindings_init_kbinding (gui, gui->keymap_file);
gui->kbindings_enabled = !!gui->kbindings; gui->kbindings_enabled = !!gui->kbindings;
gui_set_current_mmk (gui, mediamark_get_current_mmk (gui)); gui_current_set_index (gui, GUI_MMK_CURRENT);
panel_init (gui); panel_init (gui);
gui->event_reject = 0; gui->event_reject = 0;
} }
/* /*
* *
*/ */
typedef struct { typedef struct {
gGui_t *gui; gGui_t *gui;
skipping to change at line 1728 skipping to change at line 1730
for(i = 0; autoscan_plugins[i] != NULL; ++i) { for(i = 0; autoscan_plugins[i] != NULL; ++i) {
if(!strcasecmp(autoscan_plugins[i], gui->autoscan_plugin)) { if(!strcasecmp(autoscan_plugins[i], gui->autoscan_plugin)) {
int num_mrls, j; int num_mrls, j;
const char * const *autoplay_mrls = xine_get_autoplay_mrls (gui->xine, const char * const *autoplay_mrls = xine_get_autoplay_mrls (gui->xine,
gui->autoscan_plugin, gui->autoscan_plugin,
&num_mrls); &num_mrls);
if(autoplay_mrls) { if(autoplay_mrls) {
for (j = 0; j < num_mrls; j++) for (j = 0; j < num_mrls; j++)
mediamark_append_entry (gui, autoplay_mrls[j], gui_playlist_append (gui, autoplay_mrls[j],
autoplay_mrls[j], NULL, 0, -1, 0, 0); autoplay_mrls[j], NULL, 0, -1, 0, 0);
gui->playlist.cur = 0; gui->playlist.cur = 0;
gui_set_current_mmk (gui, mediamark_get_current_mmk (gui)); gui_current_set_index (gui, GUI_MMK_CURRENT);
} }
} }
} }
} }
} }
enable_playback_controls (gui->panel, (gui->playlist.num > 0)); enable_playback_controls (gui->panel, (gui->playlist.num > 0));
/* We can't handle signals here, xitk handle this, so /* We can't handle signals here, xitk handle this, so
* give a function callback for this. * give a function callback for this.
skipping to change at line 1805 skipping to change at line 1807
gui_execute_action_id (gui, ACTID_TOGGLE_FULLSCREEN); gui_execute_action_id (gui, ACTID_TOGGLE_FULLSCREEN);
#ifdef HAVE_XINERAMA #ifdef HAVE_XINERAMA
/* The user wants to see in xinerama fullscreen mode */ /* The user wants to see in xinerama fullscreen mode */
for (i = actions_on_start(gui->actions_on_start, ACTID_TOGGLE_XINERAMA_FULLS CREEN); i > 0; i--) for (i = actions_on_start(gui->actions_on_start, ACTID_TOGGLE_XINERAMA_FULLS CREEN); i > 0; i--)
gui_execute_action_id (gui, ACTID_TOGGLE_XINERAMA_FULLSCREEN); gui_execute_action_id (gui, ACTID_TOGGLE_XINERAMA_FULLSCREEN);
#endif #endif
/* User load a playlist on startup */ /* User load a playlist on startup */
if(actions_on_start(gui->actions_on_start, ACTID_PLAYLIST)) { if(actions_on_start(gui->actions_on_start, ACTID_PLAYLIST)) {
gui_set_current_mmk (gui, mediamark_get_current_mmk (gui)); gui_current_set_index (gui, GUI_MMK_CURRENT);
if(gui->playlist.num) { if(gui->playlist.num) {
gui->playlist.cur = 0; gui->playlist.cur = 0;
if (!is_playback_widgets_enabled (gui->panel)) if (!is_playback_widgets_enabled (gui->panel))
enable_playback_controls (gui->panel, 1); enable_playback_controls (gui->panel, 1);
} }
} }
if(actions_on_start(gui->actions_on_start, ACTID_TOGGLE_INTERLEAVE)) if(actions_on_start(gui->actions_on_start, ACTID_TOGGLE_INTERLEAVE))
gui_toggle_interlaced (gui); gui_toggle_interlaced (gui);
skipping to change at line 1847 skipping to change at line 1849
startup.session_opts = session_opts; startup.session_opts = session_opts;
startup.start = auto_start; startup.start = auto_start;
xitk_run (gui->xitk, on_start, &startup, on_stop, gui); xitk_run (gui->xitk, on_start, &startup, on_stop, gui);
} }
/* save playlist */ /* save playlist */
if(gui->playlist.mmk && gui->playlist.num) { if(gui->playlist.mmk && gui->playlist.num) {
char buffer[XITK_PATH_MAX + XITK_NAME_MAX + 1]; char buffer[XITK_PATH_MAX + XITK_NAME_MAX + 1];
snprintf(buffer, sizeof(buffer), "%s/.xine/xine-ui_old_playlist.tox", xine_g et_homedir()); snprintf(buffer, sizeof(buffer), "%s/.xine/xine-ui_old_playlist.tox", xine_g et_homedir());
mediamark_save_mediamarks (gui, buffer); gui_playlist_save (gui, buffer);
} }
gui->running = 0; gui->running = 0;
deinit_session(); deinit_session();
kbindings_save_kbinding (gui, gui->kbindings, gui->keymap_file); kbindings_save_kbinding (gui, gui->kbindings, gui->keymap_file);
kbindings_free_kbinding(&gui->kbindings); kbindings_free_kbinding(&gui->kbindings);
/* /*
* Close X display before unloading modules linked against libGL.so * Close X display before unloading modules linked against libGL.so
 End of changes. 16 change blocks. 
42 lines changed or deleted 44 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)