banshee r4952 - in trunk/banshee: . src/Extensions/Banshee.NowPlaying.Clutter/Banshee.NowPlaying.Clutter src/Extensions/Banshee.NowPlaying.Clutter/Clutter



Author: abock
Date: Sun Jan 25 03:39:51 2009
New Revision: 4952
URL: http://svn.gnome.org/viewvc/banshee?rev=4952&view=rev

Log:
2009-01-24  Aaron Bockover  <abock gnome org>

    * src/Extensions/Banshee.NowPlaying.Clutter/Clutter/Actor.cs:
    * src/Extensions/Banshee.NowPlaying.Clutter/Banshee.NowPlaying.Clutter/NowPlayingInterface.cs:
    More stuff just for fun



Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Extensions/Banshee.NowPlaying.Clutter/Banshee.NowPlaying.Clutter/NowPlayingInterface.cs
   trunk/banshee/src/Extensions/Banshee.NowPlaying.Clutter/Clutter/Actor.cs

Modified: trunk/banshee/src/Extensions/Banshee.NowPlaying.Clutter/Banshee.NowPlaying.Clutter/NowPlayingInterface.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.NowPlaying.Clutter/Banshee.NowPlaying.Clutter/NowPlayingInterface.cs	(original)
+++ trunk/banshee/src/Extensions/Banshee.NowPlaying.Clutter/Banshee.NowPlaying.Clutter/NowPlayingInterface.cs	Sun Jan 25 03:39:51 2009
@@ -49,6 +49,9 @@
         private Stage stage;
         private Texture video_texture;
         
+        private int center_x;
+        private int center_y;
+        
         public NowPlayingInterface ()
         {
             display = new Embed ();
@@ -65,13 +68,13 @@
             rotation_box.Spacing = 10;
             
             HScale x_angle = new HScale (0, 360, 1);
-            x_angle.ValueChanged += delegate { video_texture.RotationAngleX = x_angle.Value; };
+            x_angle.ValueChanged += delegate { video_texture.SetRotation (RotateAxis.X, x_angle.Value, center_x, center_y, 0); };
             
             HScale y_angle = new HScale (0, 360, 1);
-            y_angle.ValueChanged += delegate { video_texture.RotationAngleY = y_angle.Value; };
+            y_angle.ValueChanged += delegate { video_texture.SetRotation (RotateAxis.Y, y_angle.Value, center_x, center_y, 0); };
             
             HScale z_angle = new HScale (0, 360, 1);
-            z_angle.ValueChanged += delegate { video_texture.RotationAngleZ = z_angle.Value; };
+            z_angle.ValueChanged += delegate { video_texture.SetRotation (RotateAxis.Z, z_angle.Value, center_x, center_y, 0); };
             
             rotation_box.PackStart (x_angle, true, true, 0);
             rotation_box.PackStart (y_angle, true, true, 0);
@@ -108,6 +111,9 @@
                 new_y = 0;
             }
             
+            center_x = new_width / 2;
+            center_y = new_height / 2;
+            
             video_texture.SetPosition (new_x, new_y);
             video_texture.SetSize (new_width, new_height);
         }

Modified: trunk/banshee/src/Extensions/Banshee.NowPlaying.Clutter/Clutter/Actor.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.NowPlaying.Clutter/Clutter/Actor.cs	(original)
+++ trunk/banshee/src/Extensions/Banshee.NowPlaying.Clutter/Clutter/Actor.cs	Sun Jan 25 03:39:51 2009
@@ -31,6 +31,8 @@
 
 namespace Clutter
 {
+    public enum RotateAxis : int { X, Y, Z }
+
     public class Actor : GLib.InitiallyUnowned
     {
         public Actor (IntPtr raw) : base (raw) 
@@ -74,6 +76,15 @@
             clutter_actor_get_size (Handle, out width, out height);
         }
         
+        [DllImport ("clutter")]
+        private static extern void clutter_actor_set_rotation (IntPtr handle, RotateAxis axis, 
+            double angle, int x, int y, int z);
+            
+        public void SetRotation (RotateAxis axis, double angle, int x, int y, int z)
+        {
+            clutter_actor_set_rotation (Handle, axis, angle, x, y, z);
+        }
+        
         [GLib.Property ("rotation-angle-x")]
         public double RotationAngleX {
             get { using (GLib.Value val = GetProperty ("rotation-angle-x")) return (double)val; }



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