public NowPlayingSource() : base("now-playing", Catalog.GetString("Now Playing"), 10, "now-playing")
        {
            Properties.SetString("Icon.Name", "applications-multimedia");
            Properties.Set <bool> ("Nereid.SourceContents.HeaderVisible", false);
            Properties.SetString("ActiveSourceUIResource", "ActiveSourceUI.xml");

            var simplified_conf = CreateSchema <bool> ("simplified_mode");

            var actions = new BansheeActionGroup("NowPlaying");

            actions.AddImportant(new ToggleActionEntry("SimplifyNowPlaying", null, Catalog.GetString("Simplify"),
                                                       "F9", Catalog.GetString("Hide/Show the source list, menu, toolbar, and status bar"),
                                                       delegate {
                bool simple = !Properties.Get <bool> ("Nereid.SimpleUI");
                Properties.Set <bool> ("Nereid.SimpleUI", simple);
                (actions["SimplifyNowPlaying"] as ToggleAction).Active = simple;
                simplified_conf.Set(simple);
            }, simplified_conf.Get())
                                 );
            Properties.Set <bool> ("Nereid.SimpleUI", simplified_conf.Get());
            Properties.Set <BansheeActionGroup> ("ActiveSourceActions", actions);

            now_playing_interface = new NowPlayingInterface();
            Properties.Set <ISourceContents> ("Nereid.SourceContents", now_playing_interface);

            ServiceManager.SourceManager.AddSource(this);

            ServiceManager.PlaybackController.Transition   += OnPlaybackControllerTransition;
            ServiceManager.PlaybackController.TrackStarted += OnPlaybackControllerTrackStarted;
            ServiceManager.PlayerEngine.ConnectEvent(OnTrackInfoUpdated, PlayerEvent.TrackInfoUpdated);
            ServiceManager.PlayerEngine.ConnectEvent(OnCreateVideoWindow, PlayerEvent.PrepareVideoWindow);
        }
Beispiel #2
0
        public void Dispose()
        {
            ServiceManager.PlaybackController.Transition   -= OnPlaybackControllerTransition;
            ServiceManager.PlaybackController.TrackStarted -= OnPlaybackControllerTrackStarted;
            ServiceManager.PlayerEngine.DisconnectEvent(OnTrackInfoUpdated);

            if (now_playing_interface != null)
            {
                now_playing_interface.Destroy();
                now_playing_interface.Dispose();
                now_playing_interface = null;
            }
        }
        public override void Activate()
        {
            if (now_playing_interface == null)
            {
                now_playing_interface = new NowPlayingInterface();
                Properties.Set <ISourceContents> ("Nereid.SourceContents", now_playing_interface);
            }

            if (now_playing_interface != null)
            {
                now_playing_interface.OverrideFullscreen();
            }
        }
        public NowPlayingSource() : base("now-playing", Catalog.GetString("Now Playing"), 10, "now-playing")
        {
            now_playing_interface = new NowPlayingInterface();

            Properties.SetString("Icon.Name", "applications-multimedia");
            Properties.Set <ISourceContents> ("Nereid.SourceContents", now_playing_interface);
            Properties.Set <bool> ("Nereid.SourceContents.HeaderVisible", false);
            Properties.SetString("ActiveSourceUIResource", "ActiveSourceUI.xml");

            ServiceManager.SourceManager.AddSource(this);

            ServiceManager.PlaybackController.Transition   += OnPlaybackControllerTransition;
            ServiceManager.PlaybackController.TrackStarted += OnPlaybackControllerTrackStarted;
            ServiceManager.PlayerEngine.ConnectEvent(OnTrackInfoUpdated, PlayerEvent.TrackInfoUpdated);
        }
Beispiel #5
0
        public override void Activate()
        {
            if (now_playing_interface == null)
            {
                now_playing_interface = new NowPlayingInterface();
                Properties.Set <ISourceContents> ("Nereid.SourceContents", now_playing_interface);

                if (substitute_audio_display != null)
                {
                    now_playing_interface.Contents.SetSubstituteAudioDisplay(substitute_audio_display);
                    substitute_audio_display = null;
                }
            }

            if (now_playing_interface != null)
            {
                now_playing_interface.OverrideFullscreen();
            }
        }
Beispiel #6
0
        public override void Activate()
        {
            if (now_playing_interface == null) {
                now_playing_interface = new NowPlayingInterface ();
                Properties.Set<ISourceContents> ("Nereid.SourceContents", now_playing_interface);

                if (substitute_audio_display != null) {
                    now_playing_interface.Contents.SetSubstituteAudioDisplay (substitute_audio_display);
                    substitute_audio_display = null;
                }
            }

            if (now_playing_interface != null) {
                now_playing_interface.OverrideFullscreen ();
            }
        }
Beispiel #7
0
        public void Dispose()
        {
            ServiceManager.PlaybackController.Transition -= OnPlaybackControllerTransition;
            ServiceManager.PlaybackController.TrackStarted -= OnPlaybackControllerTrackStarted;
            ServiceManager.PlayerEngine.DisconnectEvent (OnTrackInfoUpdated);

            if (now_playing_interface != null) {
                now_playing_interface.Destroy ();
                now_playing_interface.Dispose ();
                now_playing_interface = null;
            }
        }