Inheritance: Banshee.Playlist.PlaylistSource, IBasicPlaybackController, IPlayQueue, IDBusExportable, IDisposable
        public PlayQueueActions (PlayQueueSource playqueue) : base ("playqueue")
        {
            this.playqueue = playqueue;

            Add (new ActionEntry [] {
                new ActionEntry ("AddToPlayQueueAction", Stock.Add,
                    Catalog.GetString ("Add to Play Queue"), "q",
                    Catalog.GetString ("Append selected songs to the play queue"),
                    OnAddToPlayQueue)
            });

            AddImportant (
                new ActionEntry ("RefreshPlayQueueAction", Stock.Refresh,
                    Catalog.GetString ("Refresh"), null,
                    Catalog.GetString ("Refresh random tracks in the play queue"),
                    OnRefreshPlayQueue),

                new ActionEntry ("ShufflePlayQueue", null,
                    Catalog.GetString ("Shuffle"), null,
                    Catalog.GetString ("Randomize the playback order of items in the play queue"),
                    OnShufflePlayQueue),

                new ActionEntry ("AddPlayQueueTracksAction", Stock.Add,
                    Catalog.GetString ("Add More"), null,
                    Catalog.GetString ("Add more random tracks to the play queue"),
                    OnAddPlayQueueTracks),

                new ActionEntry ("ClearPlayQueueAction", Stock.Clear,
                    Catalog.GetString ("Clear"), null,
                    Catalog.GetString ("Remove all tracks from the play queue"),
                    OnClearPlayQueue)
            );

            this["ShufflePlayQueue"].IconName = "media-playlist-shuffle";

            Add (new ToggleActionEntry [] {
                new ToggleActionEntry ("ClearPlayQueueOnQuitAction", null,
                    Catalog.GetString ("Clear on Quit"), null,
                    Catalog.GetString ("Clear the play queue when quitting"),
                    OnClearPlayQueueOnQuit, PlayQueueSource.ClearOnQuitSchema.Get ())
            });

            AddUiFromFile ("GlobalUI.xml");

            playqueue.Updated += OnUpdated;
            ServiceManager.SourceManager.ActiveSourceChanged += OnSourceUpdated;

            OnUpdated (null, null);

            Register ();
        }
        public PlayQueueActions(PlayQueueSource playqueue) : base("playqueue")
        {
            this.playqueue = playqueue;

            Add(new ActionEntry [] {
                new ActionEntry("AddToPlayQueueAction", Stock.Add,
                                Catalog.GetString("Add to Play Queue"), "q",
                                Catalog.GetString("Append selected songs to the play queue"),
                                OnAddToPlayQueue)
            });

            AddImportant(
                new ActionEntry("RefreshPlayQueueAction", Stock.Refresh,
                                Catalog.GetString("Refresh"), null,
                                Catalog.GetString("Refresh random tracks in the play queue"),
                                OnRefreshPlayQueue)
                );

            AddImportant(
                new ActionEntry("AddPlayQueueTracksAction", Stock.Add,
                                Catalog.GetString("Add More"), null,
                                Catalog.GetString("Add more random tracks to the play queue"),
                                OnAddPlayQueueTracks)
                );

            AddImportant(
                new ActionEntry("ClearPlayQueueAction", Stock.Clear,
                                Catalog.GetString("Clear"), null,
                                Catalog.GetString("Remove all tracks from the play queue"),
                                OnClearPlayQueue)
                );

            Add(new ToggleActionEntry [] {
                new ToggleActionEntry("ClearPlayQueueOnQuitAction", null,
                                      Catalog.GetString("Clear on Quit"), null,
                                      Catalog.GetString("Clear the play queue when quitting"),
                                      OnClearPlayQueueOnQuit, PlayQueueSource.ClearOnQuitSchema.Get())
            });

            AddUiFromFile("GlobalUI.xml");

            playqueue.Updated += OnUpdated;
            ServiceManager.SourceManager.ActiveSourceChanged += OnSourceUpdated;

            OnUpdated(null, null);

            Register();
        }
        public PlayQueueActions(PlayQueueSource playqueue) : base("playqueue")
        {
            this.playqueue = playqueue;

            Add(new ActionEntry [] {
                new ActionEntry("AddToPlayQueueAction", Stock.Add,
                                Catalog.GetString("Add to Play Queue"), "q",
                                Catalog.GetString("Append selected songs to the play queue"),
                                OnAddToPlayQueue),

                new ActionEntry("AddToPlayQueueAfterAction", null,
                                Catalog.GetString("Play After"), null,
                                Catalog.GetString("Add selected songs after the currently playing track, album, or artist"),
                                null),

                new ActionEntry("AddToPlayQueueAfterCurrentTrackAction", null,
                                Catalog.GetString("Current Track"), null,
                                Catalog.GetString("Add selected songs to the play queue after the currently playing song"),
                                OnAddToPlayQueueAfterCurrentTrack),

                new ActionEntry("AddToPlayQueueAfterCurrentAlbumAction", null,
                                Catalog.GetString("Current Album"), null,
                                Catalog.GetString("Add selected songs to the play queue after the currently playing album"),
                                OnAddToPlayQueueAfterCurrentAlbum),

                new ActionEntry("AddToPlayQueueAfterCurrentArtistAction", null,
                                Catalog.GetString("Current Artist"), null,
                                Catalog.GetString("Add selected songs to the play queue after the currently playing artist"),
                                OnAddToPlayQueueAfterCurrentArtist)
            });

            AddImportant(
                new ActionEntry("RefreshPlayQueueAction", Stock.Refresh,
                                Catalog.GetString("Refresh"), null,
                                Catalog.GetString("Refresh random tracks in the play queue"),
                                OnRefreshPlayQueue),

                new ActionEntry("ShufflePlayQueue", null,
                                Catalog.GetString("Shuffle"), null,
                                Catalog.GetString("Randomize the playback order of items in the play queue"),
                                OnShufflePlayQueue),

                new ActionEntry("AddPlayQueueTracksAction", Stock.Add,
                                Catalog.GetString("Add More"), null,
                                Catalog.GetString("Add more random tracks to the play queue"),
                                OnAddPlayQueueTracks),

                new ActionEntry("ClearPlayQueueAction", Stock.Clear,
                                Catalog.GetString("Clear"), null,
                                Catalog.GetString("Remove all tracks from the play queue"),
                                OnClearPlayQueue)
                );

            this["ShufflePlayQueue"].IconName = "media-playlist-shuffle";

            Add(new ToggleActionEntry [] {
                new ToggleActionEntry("ClearPlayQueueOnQuitAction", null,
                                      Catalog.GetString("Clear on Quit"), null,
                                      Catalog.GetString("Clear the play queue when quitting"),
                                      OnClearPlayQueueOnQuit, PlayQueueSource.ClearOnQuitSchema.Get())
            });

            AddUiFromFile("GlobalUI.xml");

            playqueue.Updated += OnUpdated;
            ServiceManager.SourceManager.ActiveSourceChanged += OnSourceUpdated;
            ServiceManager.PlayerEngine.ConnectEvent(OnPlayerEvent, PlayerEvent.StateChange);
            ServiceManager.PlaybackController.SourceChanged += OnPlaybackSourceChanged;

            OnUpdated(null, null);

            Register();
        }
        public PlayQueueActions (PlayQueueSource playqueue) : base ("playqueue")
        {
            this.playqueue = playqueue;

            Add (new ActionEntry [] {
                new ActionEntry ("AddToPlayQueueAction", Stock.Add,
                    Catalog.GetString ("Add to Play Queue"), "q",
                    Catalog.GetString ("Append selected songs to the play queue"),
                    OnAddToPlayQueue),

                new ActionEntry ("AddToPlayQueueAfterAction", null,
                    Catalog.GetString ("Play After"), null,
                    Catalog.GetString ("Add selected songs after the currently playing track, album, or artist"),
                    null),

                new ActionEntry ("AddToPlayQueueAfterCurrentTrackAction", null,
                    Catalog.GetString ("Current Track"), null,
                    Catalog.GetString ("Add selected songs to the play queue after the currently playing song"),
                    OnAddToPlayQueueAfterCurrentTrack),

                new ActionEntry ("AddToPlayQueueAfterCurrentAlbumAction", null,
                    Catalog.GetString ("Current Album"), null,
                    Catalog.GetString ("Add selected songs to the play queue after the currently playing album"),
                    OnAddToPlayQueueAfterCurrentAlbum),

                new ActionEntry ("AddToPlayQueueAfterCurrentArtistAction", null,
                    Catalog.GetString ("Current Artist"), null,
                    Catalog.GetString ("Add selected songs to the play queue after the currently playing artist"),
                    OnAddToPlayQueueAfterCurrentArtist)
            });

            AddImportant (
                new ActionEntry ("RefreshPlayQueueAction", Stock.Refresh,
                    Catalog.GetString ("Refresh"), null,
                    Catalog.GetString ("Refresh random tracks in the play queue"),
                    OnRefreshPlayQueue),

                new ActionEntry ("ShufflePlayQueue", null,
                    Catalog.GetString ("Shuffle"), null,
                    Catalog.GetString ("Randomize the playback order of items in the play queue"),
                    OnShufflePlayQueue),

                new ActionEntry ("AddPlayQueueTracksAction", Stock.Add,
                    Catalog.GetString ("Add More"), null,
                    Catalog.GetString ("Add more random tracks to the play queue"),
                    OnAddPlayQueueTracks),

                new ActionEntry ("ClearPlayQueueAction", Stock.Clear,
                    Catalog.GetString ("Clear"), null,
                    Catalog.GetString ("Remove all tracks from the play queue"),
                    OnClearPlayQueue)
            );

            this["ShufflePlayQueue"].IconName = "media-playlist-shuffle";

            Add (new ToggleActionEntry [] {
                new ToggleActionEntry ("ClearPlayQueueOnQuitAction", null,
                    Catalog.GetString ("Clear on Quit"), null,
                    Catalog.GetString ("Clear the play queue when quitting"),
                    OnClearPlayQueueOnQuit, PlayQueueSource.ClearOnQuitSchema.Get ())
            });

            AddUiFromFile ("GlobalUI.xml");

            playqueue.Updated += OnUpdated;
            ServiceManager.SourceManager.ActiveSourceChanged += OnSourceUpdated;
            ServiceManager.PlayerEngine.ConnectEvent (OnPlayerEvent, PlayerEvent.StateChange);
            ServiceManager.PlaybackController.SourceChanged += OnPlaybackSourceChanged;

            OnUpdated (null, null);

            Register ();
        }
 public PlayQueueTrackListModel(
     BansheeDbConnection conn, IDatabaseTrackModelProvider provider, PlayQueueSource source) :
     base(conn, provider, source)
 {
     this.source = source;
 }
 public PlayQueueTrackListModel(
     BansheeDbConnection conn, IDatabaseTrackModelProvider provider, PlayQueueSource source)
     : base(conn, provider, source)
 {
     this.source = source;
 }
        private void InitPlayQueue(PlayQueueSource play_queue)
        {
            if (actions == null) {
                play_queue.Populate = false;
                played_songs_number = PlayQueueSource.PlayedSongsNumberSchema.Get ();
                var service = ServiceManager.Get<PreferenceService> ();
                var section = service["source-specific"].ChildPages[play_queue.PreferencesPageId][null];
                played_songs_number_pref = (SchemaPreference<int>) section[PlayQueueSource.PlayedSongsNumberSchema.Key];
                played_songs_number_pref.Value = 0;

                actions = new MuinsheeActions (play_queue);
                actions.Actions.AddActionGroup (actions);
                ServiceManager.SourceManager.SetActiveSource (play_queue);
                play_queue.TrackModel.Reloaded += HandleTrackModelReloaded;

                BuildPrimaryLayout ();
                ConnectEvents ();

                track_view.SetModel (play_queue.TrackModel);

                InitialShowPresent ();
            }
        }