openbsd-ports/x11/gnome-mplayer/patches/patch-src_gui_c
dcoppa d95647b025 Add 50% larger display of video
(upstream svn revision r2187)

Fix seeking in the media_tracker when the mouse button is released
(upstream svn revision r66 of gmtk)
2011-12-06 16:05:44 +00:00

205 lines
10 KiB
Plaintext

$OpenBSD: patch-src_gui_c,v 1.21 2011/12/06 16:05:44 dcoppa Exp $
Fix an issue when alsa is not being used
(upstream svn revision r2151)
Raise event on incomplete QuickTime file, and mark it for retry
(fix apple.com/trailers) - upstream svn revision r2152
Bugfix: ATTRIBUTE_FORCE_CACHE not being processed
(upstream svn revision r2172)
Bugfix: correctly set/initialize the media_device attribute
(upstream svn revision r2165)
Fix handling of mouse, panel and controls visibility when
going to/returning from fullscreen (upstream svn r2167 - r2169)
Bugfix: 'f' not going to/returning from fullscreen
(upstream svn revision r2161)
Add 50% larger display of video
(upstream svn revision r2187)
Fix problem with seeking in the tracker
(upstream svn revision r2176)
Fix speed multipliers and speed reset (upstream svn revision r2180)
--- src/gui.c.orig Mon Jun 27 16:59:45 2011
+++ src/gui.c Tue Dec 6 16:55:32 2011
@@ -106,6 +106,7 @@ PLAYSTATE media_state_to_playstate(GmtkMediaPlayerMedi
void set_media_player_attributes(GtkWidget * widget)
{
gmtk_media_player_set_attribute_boolean(GMTK_MEDIA_PLAYER(media), ATTRIBUTE_ENABLE_DEBUG, verbose);
+ gmtk_media_player_set_attribute_boolean(GMTK_MEDIA_PLAYER(media), ATTRIBUTE_FORCE_CACHE, forcecache);
gmtk_media_player_set_attribute_double(GMTK_MEDIA_PLAYER(media), ATTRIBUTE_CACHE_SIZE, cache_size);
gmtk_media_player_set_attribute_string(GMTK_MEDIA_PLAYER(media), ATTRIBUTE_VO, vo);
gmtk_media_player_set_attribute_string(GMTK_MEDIA_PLAYER(media), ATTRIBUTE_EXTRA_OPTS, extraopts);
@@ -146,6 +147,7 @@ void set_media_player_attributes(GtkWidget * widget)
} else {
gmtk_media_player_set_attribute_boolean(GMTK_MEDIA_PLAYER(media), ATTRIBUTE_DISABLE_UPSCALING, FALSE);
}
+ gmtk_media_player_set_media_device(GMTK_MEDIA_PLAYER(media), idledata->device);
}
@@ -1608,6 +1610,8 @@ void status_icon_context_callback(GtkStatusIcon * stat
gboolean motion_notify_callback(GtkWidget * widget, GdkEventMotion * event, gpointer data)
{
GTimeVal currenttime;
+ GtkAllocation fs_allocation;
+ GtkAllocation fs_controls_allocation;
g_get_current_time(&currenttime);
last_movement_time = currenttime.tv_sec;
@@ -1617,7 +1621,17 @@ gboolean motion_notify_callback(GtkWidget * widget, Gd
printf("motion noticed at %li\n",currenttime.tv_sec);
}
*/
- g_idle_add(make_panel_and_mouse_visible, NULL);
+ if (fullscreen) {
+ get_allocation(window, &fs_allocation);
+ get_allocation(controls_box, &fs_controls_allocation);
+ if (event->y > (fs_allocation.height - fs_controls_allocation.height)) {
+ g_idle_add(make_panel_and_mouse_visible, NULL);
+ } else {
+ hide_fs_controls();
+ }
+ } else {
+ g_idle_add(make_panel_and_mouse_visible, NULL);
+ }
return FALSE;
}
@@ -1826,7 +1840,7 @@ gboolean window_key_callback(GtkWidget * widget, GdkEv
gmtk_media_player_set_attribute_integer_delta(GMTK_MEDIA_PLAYER(media), ATTRIBUTE_SATURATION, 5);
return FALSE;
case GDK_bracketleft:
- gmtk_media_player_set_attribute_double(GMTK_MEDIA_PLAYER(media), ATTRIBUTE_SPEED_MULTIPLIER, 0.90);
+ gmtk_media_player_set_attribute_double(GMTK_MEDIA_PLAYER(media), ATTRIBUTE_SPEED_MULTIPLIER, 0.9091);
return FALSE;
case GDK_bracketright:
gmtk_media_player_set_attribute_double(GMTK_MEDIA_PLAYER(media), ATTRIBUTE_SPEED_MULTIPLIER, 1.10);
@@ -1838,7 +1852,7 @@ gboolean window_key_callback(GtkWidget * widget, GdkEv
gmtk_media_player_set_attribute_double(GMTK_MEDIA_PLAYER(media), ATTRIBUTE_SPEED_MULTIPLIER, 2.0);
return FALSE;
case GDK_BackSpace:
- gmtk_media_player_set_attribute_double(GMTK_MEDIA_PLAYER(media), ATTRIBUTE_SPEED_MULTIPLIER, 1.0);
+ gmtk_media_player_set_attribute_double(GMTK_MEDIA_PLAYER(media), ATTRIBUTE_SPEED_SET, 1.0);
return FALSE;
case GDK_9:
#ifdef GTK2_12_ENABLED
@@ -1908,6 +1922,10 @@ gboolean window_key_callback(GtkWidget * widget, GdkEv
delete_callback(NULL, NULL, NULL);
}
return FALSE;
+ case GDK_f:
+ if (idledata->videopresent)
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem_fullscreen), !fullscreen);
+ return FALSE;
case GDK_a:
if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem_view_aspect_follow_window))) {
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem_view_aspect_default), TRUE);
@@ -3315,6 +3333,16 @@ void menuitem_view_onetoone_callback(GtkMenuItem * men
}
+void menuitem_view_onetoonepointfive_callback(GtkMenuItem * menuitem, void *data)
+{
+ IdleData *idle = (IdleData *) data;
+ idle->width = (gint) gmtk_media_player_get_attribute_double(GMTK_MEDIA_PLAYER(media), ATTRIBUTE_WIDTH) * 1.5;
+ idle->height = (gint) gmtk_media_player_get_attribute_double(GMTK_MEDIA_PLAYER(media), ATTRIBUTE_HEIGHT) * 1.5;
+ non_fs_width = 0;
+ non_fs_height = 0;
+ resize_window(idle);
+}
+
void menuitem_view_twotoone_callback(GtkMenuItem * menuitem, void *data)
{
IdleData *idle = (IdleData *) data;
@@ -5073,7 +5101,7 @@ void menuitem_config_callback(GtkMenuItem * menuitem,
gtk_spin_button_set_value(GTK_SPIN_BUTTON(config_volume), gm_pref_store_get_int(gm_store, VOLUME));
gm_pref_store_free(gm_store);
gtk_entry_set_width_chars(GTK_ENTRY(config_volume), 6);
- gtk_entry_set_editable(GTK_ENTRY(config_volume), FALSE);
+ gtk_editable_set_editable(GTK_EDITABLE(config_volume), FALSE);
gtk_entry_set_alignment(GTK_ENTRY(config_volume), 1);
gtk_widget_show(config_volume);
i++;
@@ -5845,6 +5873,7 @@ void player_attribute_changed_callback(GmtkMediaTracke
gtk_widget_set_sensitive(GTK_WIDGET(menuitem_view_onetoone), idledata->videopresent);
gtk_widget_set_sensitive(GTK_WIDGET(menuitem_view_onetotwo), idledata->videopresent);
gtk_widget_set_sensitive(GTK_WIDGET(menuitem_view_twotoone), idledata->videopresent);
+ gtk_widget_set_sensitive(GTK_WIDGET(menuitem_view_onetoonepointfive), idledata->videopresent);
gtk_widget_set_sensitive(GTK_WIDGET(menuitem_view_advanced), idledata->videopresent);
gtk_widget_set_sensitive(GTK_WIDGET(menuitem_view_aspect), idledata->videopresent);
gtk_widget_set_sensitive(GTK_WIDGET(menuitem_view_aspect_default), idledata->videopresent);
@@ -6052,6 +6081,11 @@ void player_attribute_changed_callback(GmtkMediaTracke
g_strlcpy(idledata->media_info, text, 1024);
g_thread_create(get_cover_art, metadata, FALSE, NULL);
break;
+
+ case ATTRIBUTE_RETRY_ON_FULL_CACHE:
+ idledata->retry_on_full_cache = gmtk_media_player_get_attribute_boolean (GMTK_MEDIA_PLAYER(media), ATTRIBUTE_RETRY_ON_FULL_CACHE);
+ break;
+
default:
if (verbose) {
printf("Unhandled attribute change %i\n", attribute);
@@ -6229,6 +6263,19 @@ void player_position_changed_callback(GmtkMediaTracker
}
}
+gboolean tracker_value_changed_callback(GtkWidget * widget, gint value, gpointer data)
+{
+ if (gmtk_media_player_get_attribute_boolean(GMTK_MEDIA_PLAYER(media), ATTRIBUTE_SEEKABLE)) {
+ if (!autopause) {
+ if (gmtk_media_player_get_state(GMTK_MEDIA_PLAYER(media)) != MEDIA_STATE_STOP) {
+ gmtk_media_player_seek(GMTK_MEDIA_PLAYER(media), value * 1.0, SEEK_PERCENT);
+ }
+ }
+ }
+
+ return FALSE;
+}
+
gboolean tracker_difference_callback(GtkWidget * widget, gdouble difference, void *data)
{
@@ -6787,6 +6834,8 @@ GtkWidget *create_window(gint windowid)
gtk_menu_shell_append(GTK_MENU_SHELL(menu_view), GTK_WIDGET(menuitem_view_twotoone));
menuitem_view_onetotwo = GTK_MENU_ITEM(gtk_image_menu_item_new_with_mnemonic(_("_Half Size (1:2)")));
gtk_menu_shell_append(GTK_MENU_SHELL(menu_view), GTK_WIDGET(menuitem_view_onetotwo));
+ menuitem_view_onetoonepointfive = GTK_MENU_ITEM(gtk_image_menu_item_new_with_mnemonic(_("_50% larger (1.5:1)")));
+ gtk_menu_shell_append(GTK_MENU_SHELL(menu_view), GTK_WIDGET(menuitem_view_onetoonepointfive));
menuitem_view_aspect = GTK_MENU_ITEM(gtk_menu_item_new_with_mnemonic(_("_Aspect")));
menu_view_aspect = GTK_MENU(gtk_menu_new());
gtk_widget_show(GTK_WIDGET(menuitem_view_aspect));
@@ -6840,6 +6889,8 @@ GtkWidget *create_window(gint windowid)
G_CALLBACK(menuitem_view_twotoone_callback), idledata);
g_signal_connect(G_OBJECT(menuitem_view_onetotwo), "activate",
G_CALLBACK(menuitem_view_onetotwo_callback), idledata);
+ g_signal_connect(G_OBJECT(menuitem_view_onetoonepointfive), "activate",
+ G_CALLBACK(menuitem_view_onetoonepointfive_callback), idledata);
g_signal_connect(G_OBJECT(menuitem_view_aspect_default),
"activate", G_CALLBACK(menuitem_view_aspect_callback), NULL);
g_signal_connect(G_OBJECT(menuitem_view_aspect_four_three),
@@ -7146,6 +7197,7 @@ GtkWidget *create_window(gint windowid)
tracker = GMTK_MEDIA_TRACKER(gmtk_media_tracker_new());
gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(tracker), TRUE, TRUE, 2);
g_signal_connect(G_OBJECT(tracker), "difference-changed", G_CALLBACK(tracker_difference_callback), NULL);
+ g_signal_connect(G_OBJECT(tracker), "value-changed", G_CALLBACK(tracker_value_changed_callback), NULL);
g_signal_connect(G_OBJECT(tracker), "button_press_event", G_CALLBACK(progress_callback), NULL);
g_signal_connect_swapped(G_OBJECT(media), "position_changed",
G_CALLBACK(player_position_changed_callback), tracker);
@@ -7372,7 +7424,7 @@ void show_window(gint windowid)
gtk_widget_set_sensitive(GTK_WIDGET(menuitem_view_onetoone), FALSE);
gtk_widget_set_sensitive(GTK_WIDGET(menuitem_view_onetotwo), FALSE);
gtk_widget_set_sensitive(GTK_WIDGET(menuitem_view_twotoone), FALSE);
- gtk_widget_set_sensitive(GTK_WIDGET(menuitem_view_twotoone), FALSE);
+ gtk_widget_set_sensitive(GTK_WIDGET(menuitem_view_onetoonepointfive), FALSE);
gtk_widget_set_sensitive(GTK_WIDGET(menuitem_view_aspect), FALSE);
gtk_widget_set_sensitive(GTK_WIDGET(menuitem_view_aspect_default), FALSE);
gtk_widget_set_sensitive(GTK_WIDGET(menuitem_view_aspect_four_three), FALSE);