/* * private void SetTrackProgress() * { * if (awn != null && service != null) * { * if (service.CurrentTrack == null) * { * UnsetTrackProgress(); * } * else * { * uint total = Convert.ToUInt32(service.CurrentTrack.Duration.TotalSeconds); * uint current = service.Position; * int progress = 100; * if (total > 0) * progress = Convert.ToInt32(current * 100 / total); * //awn.SetProgressByName(taskName, progress); * awn.SetInfoByName(taskName, progress.ToString()); * Console.WriteLine("{0} - {1} - {2}", current, total, progress); * } * } * } * * * private void Progress(object sender, EventArgs e) * { * SetTrackProgress(); * System.Threading.Thread.Sleep(1000); * } * * private void ProgressCallback(IAsyncResult ar) * { * //timer.EndInvoke(ar); * //timer.BeginInvoke(new AsyncCallback(this.ProgressCallback), timer); * } */ private void UnsetIcon() { if (awn != null) { for (int i = 0; i < taskName.Length; i++) { awn.UnsetTaskIconByName(taskName[i]); } awn.UnsetTaskIconByName(this.PossibleTitle); } }
void IExtensionService.Initialize() { try { Log.DebugFormat("BansheeAwn. Starting {0}", Application.ActiveClient.ClientId); awn = DBus.Bus.Session.GetObject <IAvantWindowNavigator> ("com.google.code.Awn", new DBus.ObjectPath("/com/google/code/Awn")); // Dummy call to check that awn is really there awn.UnsetTaskIconByName("banshee-dummy"); service = ServiceManager.PlayerEngine; service.ConnectEvent(new PlayerEventHandler(this.OnEventChanged)); Log.Debug("BansheeAwn - Initialized"); } catch (Exception ex) { Log.Warning("BansheeAwn - Failed loading Awn Extension. ", ex); awn = null; } }
void IExtensionService.Initialize () { try { Log.DebugFormat ("BansheeAwn. Starting {0}", Application.ActiveClient.ClientId); awn = DBus.Bus.Session.GetObject<IAvantWindowNavigator> ("com.google.code.Awn", new DBus.ObjectPath ("/com/google/code/Awn")); // Dummy call to check that awn is really there awn.UnsetTaskIconByName ("banshee-dummy"); service = ServiceManager.PlayerEngine; service.ConnectEvent (new PlayerEventHandler (this.OnEventChanged)); Log.Debug ("BansheeAwn - Initialized"); } catch (Exception ex) { Log.Exception ("BansheeAwn - Failed loading Awn Extension. ", ex); awn = null; } }