diff gui/dialog/menu.c @ 37081:e8559b9913ff

New GUI feature: Rotate a video. It is accessible from the context menu. Based on a complain by Linus about video players that don't easily allow rotating a video. (Thanks to compn for pointing that out.) Realize the feature by adding and/or removing appropriate video filters. Additionally, add new GUI message evSetRotation and update documentation.
author ib
date Thu, 24 Apr 2014 14:41:04 +0000
parents 8927089e83ed
children d4fbf2eb4a04
line wrap: on
line diff
--- a/gui/dialog/menu.c	Thu Apr 24 13:51:20 2014 +0000
+++ b/gui/dialog/menu.c	Thu Apr 24 14:41:04 2014 +0000
@@ -98,6 +98,11 @@
 #include "pixmaps/tv.xpm"
 #endif
 #include "pixmaps/empty1px.xpm"
+#include "pixmaps/rotate.xpm"
+#include "pixmaps/rotate0.xpm"
+#include "pixmaps/rotate180.xpm"
+#include "pixmaps/rotate90ccw.xpm"
+#include "pixmaps/rotate90cw.xpm"
 
 int gtkPopupMenu;
 int gtkPopupMenuParam;
@@ -442,6 +447,7 @@
 GtkWidget * DVDAudioLanguageMenu;
 GtkWidget * DVDSubtitleLanguageMenu;
 GtkWidget * AspectMenu;
+GtkWidget * RotationMenu;
 GtkWidget * VCDSubMenu;
 GtkWidget * VCDTitleMenu;
 GtkWidget * CDSubMenu;
@@ -614,8 +620,26 @@
 
   if ( guiInfo.VideoWindow )
    {
+    AddSeparator( Menu );
+    RotationMenu=AddSubMenu( window1, (const char*)rotate_xpm, Menu,MSGTR_GUI_Rotation );
+    N=AddMenuCheckItem( window1, (const char*)rotate0_xpm, RotationMenu,MSGTR_GUI__none_, guiInfo.Rotation == -1, evSetRotation );
+    D=AddMenuCheckItem( window1, (const char*)rotate90cw_xpm, RotationMenu,MSGTR_GUI_Rotation90CW, guiInfo.Rotation == 1, evSetRotation + ( 90 << 16 ) );
+    F=AddMenuCheckItem( window1, (const char*)rotate90ccw_xpm, RotationMenu,MSGTR_GUI_Rotation90CCW, guiInfo.Rotation == 2, evSetRotation + ( -90 << 16 ) );
+    H=AddMenuCheckItem( window1, (const char*)rotate180_xpm, RotationMenu,MSGTR_GUI_Rotation180, guiInfo.Rotation == 8, evSetRotation + ( 180 << 16 ) );
+
+    if ( !guiInfo.Playing )
+     {
+      gtk_widget_set_sensitive( N,FALSE );
+      gtk_widget_set_sensitive( D,FALSE );
+      gtk_widget_set_sensitive( F,FALSE );
+      gtk_widget_set_sensitive( H,FALSE );
+     }
+   }
+
+  if ( guiInfo.VideoWindow )
+   {
     int a11 = False, a169 = False, a43 = False, a235 = False;
-    AddSeparator( Menu );
+
     if (movie_aspect == -1.0f) a11 = True;
     else
      {