banshee r3800 - in trunk/banshee: . src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying
- From: abock svn gnome org
- To: svn-commits-list gnome org
- Subject: banshee r3800 - in trunk/banshee: . src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying
- Date: Sun, 20 Apr 2008 00:19:56 +0100 (BST)
Author: abock
Date: Sat Apr 19 23:19:55 2008
New Revision: 3800
URL: http://svn.gnome.org/viewvc/banshee?rev=3800&view=rev
Log:
2008-04-19 Aaron Bockover <abock gnome org>
* src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/FullscreenControls.cs:
Add the default accel group and make it as wide as the screen (probably
lame but gabaug was complaining)
* src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/FullscreenWindow.cs:
Add the default accel group and some custom keybindings for seeking
and showing/hiding the control bar
* src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/OverlayWindow.cs:
Make gabaug happy and move the bar to the bottom of the screen
Modified:
trunk/banshee/ChangeLog
trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/FullscreenControls.cs
trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/FullscreenWindow.cs
trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/OverlayWindow.cs
Modified: trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/FullscreenControls.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/FullscreenControls.cs (original)
+++ trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/FullscreenControls.cs Sat Apr 19 23:19:55 2008
@@ -39,10 +39,11 @@
{
private InterfaceActionService action_service;
- public FullscreenControls (Window toplevel) : base (toplevel, 0.85)
+ public FullscreenControls (Window toplevel, InterfaceActionService actionService) : base (toplevel, 1)
{
- action_service = ServiceManager.Get<InterfaceActionService> ();
+ action_service = actionService;
BorderWidth = 1;
+ AddAccelGroup (action_service.UIManager.AccelGroup);
BuildInterface ();
}
Modified: trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/FullscreenWindow.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/FullscreenWindow.cs (original)
+++ trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/FullscreenWindow.cs Sat Apr 19 23:19:55 2008
@@ -31,17 +31,77 @@
using System;
using Gtk;
+using Banshee.Gui;
+using Banshee.MediaEngine;
+using Banshee.ServiceStack;
+
namespace Banshee.NowPlaying
{
public class FullscreenWindow : Window
{
private Gtk.Window parent;
private FullscreenControls controls;
+ private InterfaceActionService action_service;
public FullscreenWindow (Window parent) : base (parent.Title)
{
this.parent = parent;
+ this.action_service = ServiceManager.Get<InterfaceActionService> ();
+
+ AddAccelGroup (action_service.UIManager.AccelGroup);
+
+ SetupWidget ();
+ }
+
+ protected override bool OnKeyPressEvent (Gdk.EventKey evnt)
+ {
+ PlayerEngineService player = ServiceManager.PlayerEngine;
+
+ bool control = (evnt.State & Gdk.ModifierType.ShiftMask) != 0;
+ bool shift = (evnt.State & Gdk.ModifierType.ControlMask) != 0;
+ bool mod = control || shift;
+
+ uint fixed_seek = 15000; // 15 seconds
+ uint fast_seek = player.Length > 0 ? (uint)(player.Length * 0.15) : fixed_seek; // 15% or fixed
+ uint slow_seek = player.Length > 0 ? (uint)(player.Length * 0.05) : fixed_seek; // 5% or fixed
+
+ switch (evnt.Key) {
+ case Gdk.Key.Escape:
+ Unfullscreen ();
+ Hide ();
+ return true;
+ case Gdk.Key.C:
+ case Gdk.Key.c:
+ case Gdk.Key.V:
+ case Gdk.Key.v:
+ case Gdk.Key.Return:
+ case Gdk.Key.KP_Enter:
+ case Gdk.Key.Tab:
+ if (controls == null || !controls.Visible) {
+ ShowControls ();
+ } else {
+ HideControls ();
+ }
+ return true;
+ case Gdk.Key.Right:
+ case Gdk.Key.rightarrow:
+ player.Position += mod ? fast_seek : slow_seek;
+ ShowControls ();
+ break;
+ case Gdk.Key.Left:
+ case Gdk.Key.leftarrow:
+ player.Position -= mod ? fast_seek : slow_seek;
+ ShowControls ();
+ break;
+ }
+ return base.OnKeyPressEvent (evnt);
+ }
+
+#region Widgetry and show/hide logic
+
+ private void SetupWidget ()
+ {
Deletable = false;
KeepAbove = true;
Decorated = false;
@@ -107,24 +167,14 @@
}
}
- protected override bool OnKeyPressEvent (Gdk.EventKey evnt)
- {
- switch (evnt.Key) {
- case Gdk.Key.Escape:
- Unfullscreen ();
- Hide ();
- return true;
- }
-
- return base.OnKeyPressEvent (evnt);
- }
-
+#endregion
+
#region Control Window
private void ShowControls ()
{
if (controls == null) {
- controls = new FullscreenControls (this);
+ controls = new FullscreenControls (this, action_service);
}
controls.Show ();
@@ -149,6 +199,8 @@
get {
if (controls == null || !controls.Visible) {
return false;
+ } else if (controls.IsActive) {
+ return true;
}
int cursor_x, cursor_y;
Modified: trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/OverlayWindow.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/OverlayWindow.cs (original)
+++ trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/OverlayWindow.cs Sat Apr 19 23:19:55 2008
@@ -37,7 +37,7 @@
private Window toplevel;
private double x_align = 0.5;
- private double y_align = 0.90;
+ private double y_align = 1;
private double width_scale;
public OverlayWindow (Window toplevel) : this (toplevel, 0.0)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]