Inheritance: IInitializeService, IDelayedInitializeService, IRequiredService, IPlayerEngineService, IDisposable
Beispiel #1
0
 public MediaPlayer ()
 {
     playback_service = ServiceManager.PlaybackController;
     engine_service = ServiceManager.PlayerEngine;
     changed_properties = new Dictionary<string, object> ();
     invalidated_properties = new List<string> ();
 }
Beispiel #2
0
        void IExtensionService.Initialize ()
        {
            elements_service = ServiceManager.Get<GtkElementsService> ();
            interface_action_service = ServiceManager.Get<InterfaceActionService> ();
            source_manager = ServiceManager.SourceManager;
            player = ServiceManager.PlayerEngine;

            if (!ServiceStartup ()) {
                ServiceManager.ServiceStarted += OnServiceStarted;
            }
        }
Beispiel #3
0
        private void OnServiceStarted (ServiceStartedArgs args)
        {
            if (args.Service is Banshee.Gui.InterfaceActionService) {
                interface_action_service = (InterfaceActionService)args.Service;
            } else if (args.Service is GtkElementsService) {
                elements_service = (GtkElementsService)args.Service;
            } else if (args.Service is SourceManager) {
                source_manager = ServiceManager.SourceManager;
            } else if (args.Service is PlayerEngineService) {
                player = ServiceManager.PlayerEngine;
            }

            ServiceStartup ();
        }
Beispiel #4
0
        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;
            }
        }
        public PlaybackControllerService()
        {
            InstantiateStacks ();

            player_engine = ServiceManager.PlayerEngine;
            player_engine.PlayWhenIdleRequest += OnPlayerEnginePlayWhenIdleRequest;
            player_engine.ConnectEvent (OnPlayerEvent,
                PlayerEvent.RequestNextTrack |
                PlayerEvent.EndOfStream |
                PlayerEvent.StartOfStream |
                PlayerEvent.StateChange |
                PlayerEvent.Error,
                true);

            ServiceManager.SourceManager.ActiveSourceChanged += delegate {
                ITrackModelSource active_source = ServiceManager.SourceManager.ActiveSource as ITrackModelSource;
                if (active_source != null && source_auto_set_at == source_set_at && !player_engine.IsPlaying ()) {
                    Source = active_source;
                    source_auto_set_at = source_set_at;
                }
            };
        }
Beispiel #6
0
        private void RunMainLoop()
        {
            ThreadAssist.InitializeMainThread();
            ThreadAssist.ProxyToMainHandler = Banshee.ServiceStack.Application.Invoke;

            service = new PlayerEngineService();

            service.PlayWhenIdleRequest += delegate { play_when_idles++; };
            service.TrackIntercept      += delegate { track_intercepts++; return(false); };

            // TODO call each test w/ permutations of Gapless enabled/disabled, RG enabled/disabled

            try {
                ServiceManager.RegisterService(service);
            } catch {}

            ((IInitializeService)service).Initialize();
            ((IDelayedInitializeService)service).DelayedInitialize();

            main_loop = new GLib.MainLoop();
            started   = true;
            main_loop.Run();
        }
Beispiel #7
0
        public MediaPlayer ()
        {
            playback_service = ServiceManager.PlaybackController;
            engine_service = ServiceManager.PlayerEngine;
            playlist_sources = new Dictionary<string, AbstractPlaylistSource> ();
            changed_properties = new Dictionary<string, object> ();
            current_properties = new Dictionary<string, object> ();
            invalidated_properties = new List<string> ();

            var interface_service = ServiceManager.Get<InterfaceActionService> ();
            fullscreen_action = interface_service.ViewActions["FullScreenAction"] as Gtk.ToggleAction;
        }
Beispiel #8
0
        private void RunMainLoop ()
        {
            ThreadAssist.InitializeMainThread ();
            ThreadAssist.ProxyToMainHandler = Banshee.ServiceStack.Application.Invoke;

            service = new PlayerEngineService ();

            service.PlayWhenIdleRequest += delegate { play_when_idles++; };
            service.TrackIntercept += delegate { track_intercepts++; return false; };

            // TODO call each test w/ permutations of Gapless enabled/disabled, RG enabled/disabled

            try {
                ServiceManager.RegisterService (service);
            } catch {}

            ((IInitializeService)service).Initialize ();
            ((IDelayedInitializeService)service).DelayedInitialize ();

            main_loop = new GLib.MainLoop ();
            started = true;
            main_loop.Run ();
        }
        void IExtensionService.Initialize()
        {
            try
            {

                Log.Debug("BansheeAwn. Starting..." + Banshee.ServiceStack.Application.ActiveClient.ClientId);

                awn = NDesk.DBus.Bus.Session.GetObject<IAvantWindowNavigator> ("com.google.code.Awn",
                                                              new NDesk.DBus.ObjectPath ("/com/google/code/Awn"));
                if (awn == null)
                    throw new NullReferenceException();
                service = ServiceManager.PlayerEngine;

                service.ConnectEvent(new PlayerEventHandler(this.OnEventChanged));

                Log.Debug("BansheeAwn - Initialized");

            }
            catch (Exception ex)
            {
                Log.Debug("BansheeAwn - Failed loading Awn Extension. " + ex.Message);
            }
        }
 void IDisposable.Dispose()
 {
     UnsetIcon ();
     //UnsetTrackProgress();
     service = null;
     awn = null;
 }