totem r6260 - in trunk: . src src/backend



Author: pwithnall
Date: Wed Apr 15 06:53:25 2009
New Revision: 6260
URL: http://svn.gnome.org/viewvc/totem?rev=6260&view=rev

Log:
2009-04-15  Philip Withnall  <philip tecnocode co uk>

	* src/backend/bacon-video-widget-gst-0.10.c (resize_video_window),
	(bacon_video_widget_init), (bacon_video_widget_set_zoom),
	(bacon_video_widget_get_zoom):
	* src/backend/bacon-video-widget-xine.c
	(bacon_video_widget_realize), (bacon_video_widget_set_zoom),
	(bacon_video_widget_get_zoom):
	* src/backend/bacon-video-widget.h:
	* src/totem-object.c (totem_action_zoom),
	(totem_action_zoom_relative):
	* src/totem-private.h: Change bacon_video_widget_set_zoom to take a
	double. (Closes: #577961)



Modified:
   trunk/ChangeLog
   trunk/src/backend/bacon-video-widget-gst-0.10.c
   trunk/src/backend/bacon-video-widget-xine.c
   trunk/src/backend/bacon-video-widget.h
   trunk/src/totem-object.c
   trunk/src/totem-private.h

Modified: trunk/src/backend/bacon-video-widget-gst-0.10.c
==============================================================================
--- trunk/src/backend/bacon-video-widget-gst-0.10.c	(original)
+++ trunk/src/backend/bacon-video-widget-gst-0.10.c	Wed Apr 15 06:53:25 2009
@@ -184,7 +184,7 @@
   gint                         video_fps_n;
   gint                         video_fps_d;
 
-  gint                         zoom;
+  gdouble                      zoom;
   
   gchar                       *media_device;
 
@@ -872,7 +872,7 @@
   }
 
   /* apply zoom factor */
-  ratio = ratio * bvw->priv->zoom / 100;
+  ratio = ratio * bvw->priv->zoom;
 
   width *= ratio;
   height *= ratio;
@@ -1080,7 +1080,7 @@
   priv->tagcache = NULL;
   priv->audiotags = NULL;
   priv->videotags = NULL;
-  priv->zoom = 100;
+  priv->zoom = 1.0;
 
   priv->lock = g_mutex_new ();
 
@@ -3638,7 +3638,7 @@
 
 void
 bacon_video_widget_set_zoom (BaconVideoWidget *bvw,
-                             int               zoom)
+                             double            zoom)
 {
   g_return_if_fail (bvw != NULL);
   g_return_if_fail (BACON_IS_VIDEO_WIDGET (bvw));
@@ -3648,11 +3648,11 @@
     resize_video_window (bvw);
 }
 
-int
+double
 bacon_video_widget_get_zoom (BaconVideoWidget *bvw)
 {
-  g_return_val_if_fail (bvw != NULL, 100);
-  g_return_val_if_fail (BACON_IS_VIDEO_WIDGET (bvw), 100);
+  g_return_val_if_fail (bvw != NULL, 1.0);
+  g_return_val_if_fail (BACON_IS_VIDEO_WIDGET (bvw), 1.0);
 
   return bvw->priv->zoom;
 }

Modified: trunk/src/backend/bacon-video-widget-xine.c
==============================================================================
--- trunk/src/backend/bacon-video-widget-xine.c	(original)
+++ trunk/src/backend/bacon-video-widget-xine.c	Wed Apr 15 06:53:25 2009
@@ -176,7 +176,7 @@
 	double volume;
 	BvwAudioOutType audio_out_type;
 	gint64 stream_length;
-	int zoom;
+	double zoom;
 
 	GAsyncQueue *queue;
 	int video_width, video_height;
@@ -1253,7 +1253,7 @@
 	bvw->priv->ev_queue = xine_event_new_queue (bvw->priv->stream);
 
 	/* Set the zoom that might have been recorded */
-	if (bvw->priv->zoom != 0)
+	if (bvw->priv->zoom != 0.0)
 		bacon_video_widget_set_zoom (bvw, bvw->priv->zoom);
 
 	/* Setup xine events */
@@ -3621,12 +3621,12 @@
 }
 
 void
-bacon_video_widget_set_zoom (BaconVideoWidget *bvw, int zoom)
+bacon_video_widget_set_zoom (BaconVideoWidget *bvw, double zoom)
 {
 	g_return_if_fail (bvw != NULL);
 	g_return_if_fail (BACON_IS_VIDEO_WIDGET (bvw));
 	g_return_if_fail (bvw->priv->xine != NULL);
-	g_return_if_fail (zoom >= 0 && zoom <= 400);
+	g_return_if_fail (zoom >= 0.0 && zoom <= 4.0);
 
 	if (bvw->priv->stream == NULL) {
 		/* No stream yet, remember the zoom level */
@@ -3635,22 +3635,22 @@
 	}
 
 	xine_set_param (bvw->priv->stream,
-			XINE_PARAM_VO_ZOOM_X, zoom);
+			XINE_PARAM_VO_ZOOM_X, (int) (zoom * 100));
 	xine_set_param (bvw->priv->stream,
-			XINE_PARAM_VO_ZOOM_Y, zoom);
+			XINE_PARAM_VO_ZOOM_Y, (int) (zoom * 100));
 }
 
-int
+double
 bacon_video_widget_get_zoom (BaconVideoWidget *bvw)
 {
-	g_return_val_if_fail (bvw != NULL, 100);
-	g_return_val_if_fail (BACON_IS_VIDEO_WIDGET (bvw), 100);
-	g_return_val_if_fail (bvw->priv->xine != NULL, 100);
+	g_return_val_if_fail (bvw != NULL, 1.0);
+	g_return_val_if_fail (BACON_IS_VIDEO_WIDGET (bvw), 1.0);
+	g_return_val_if_fail (bvw->priv->xine != NULL, 1.0);
 
 	if (bvw->priv->stream == NULL)
-		return 100;
+		return 1.0;
 
-	return xine_get_param (bvw->priv->stream, XINE_PARAM_VO_ZOOM_X);
+	return (double) xine_get_param (bvw->priv->stream, XINE_PARAM_VO_ZOOM_X) / 100.0;
 }
 
 int

Modified: trunk/src/backend/bacon-video-widget.h
==============================================================================
--- trunk/src/backend/bacon-video-widget.h	(original)
+++ trunk/src/backend/bacon-video-widget.h	Wed Apr 15 06:53:25 2009
@@ -258,8 +258,8 @@
 						  float ratio);
 
 void bacon_video_widget_set_zoom		 (BaconVideoWidget *bvw,
-						  int zoom);
-int bacon_video_widget_get_zoom			 (BaconVideoWidget *bvw);
+						  double zoom);
+double bacon_video_widget_get_zoom		 (BaconVideoWidget *bvw);
 
 int bacon_video_widget_get_video_property        (BaconVideoWidget *bvw,
 						  BvwVideoProperty

Modified: trunk/src/totem-object.c
==============================================================================
--- trunk/src/totem-object.c	(original)
+++ trunk/src/totem-object.c	Wed Apr 15 06:53:25 2009
@@ -85,9 +85,9 @@
 #define SEEK_FORWARD_LONG_OFFSET 10*60
 #define SEEK_BACKWARD_LONG_OFFSET -3*60
 
-#define ZOOM_UPPER 200
-#define ZOOM_RESET 100
-#define ZOOM_LOWER 10
+#define ZOOM_UPPER 2.0
+#define ZOOM_RESET 1.0
+#define ZOOM_LOWER 0.1
 #define ZOOM_DISABLE (ZOOM_LOWER - 1)
 #define ZOOM_ENABLE (ZOOM_UPPER + 1)
 
@@ -1900,7 +1900,7 @@
 }
 
 static void
-totem_action_zoom (Totem *totem, int zoom)
+totem_action_zoom (Totem *totem, double zoom)
 {
 	GtkAction *action;
 	gboolean zoom_reset, zoom_in, zoom_out;
@@ -1933,9 +1933,9 @@
 }
 
 void
-totem_action_zoom_relative (Totem *totem, int off_pct)
+totem_action_zoom_relative (Totem *totem, double off_pct)
 {
-	int zoom;
+	double zoom;
 
 	zoom = bacon_video_widget_get_zoom (totem->bvw);
 	totem_action_zoom (totem, zoom + off_pct);

Modified: trunk/src/totem-private.h
==============================================================================
--- trunk/src/totem-private.h	(original)
+++ trunk/src/totem-private.h	Wed Apr 15 06:53:25 2009
@@ -170,13 +170,13 @@
 #define VOLUME_DOWN_OFFSET (-0.08)
 #define VOLUME_UP_OFFSET (0.08)
 
-#define ZOOM_IN_OFFSET 1
-#define ZOOM_OUT_OFFSET -1
+#define ZOOM_IN_OFFSET 0.01
+#define ZOOM_OUT_OFFSET -0.01
 
 void	totem_action_open			(Totem *totem);
 void	totem_action_open_location		(Totem *totem);
 void	totem_action_eject			(Totem *totem);
-void	totem_action_zoom_relative		(Totem *totem, int off_pct);
+void	totem_action_zoom_relative		(Totem *totem, double off_pct);
 void	totem_action_zoom_reset			(Totem *totem);
 void	totem_action_show_help			(Totem *totem);
 void	totem_action_show_properties		(Totem *totem);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]