Example #1
0
        private void Clear(bool disposing)
        {
            if (Populate)
            {
                if (disposing)
                {
                    PopulateModeSchema.Set("off");
                }
                else
                {
                    header_widget.SetManual();
                }
            }

            ServiceManager.DbConnection.Execute(@"
                DELETE FROM CorePlaylistEntries
                WHERE PlaylistID = ?", DbId
                                                );
            offset = 0;
            SetCurrentTrack(null);

            if (disposing)
            {
                return;
            }

            if (this == ServiceManager.PlaybackController.Source && ServiceManager.PlayerEngine.IsPlaying())
            {
                ServiceManager.PlayerEngine.Close();
            }

            Reload();
        }
Example #2
0
        public HeaderWidget CreateHeaderWidget()
        {
            var header_widget = new HeaderWidget(shuffler, populate_shuffle_mode, populate_from_name);

            header_widget.ModeChanged += delegate(object sender, EventArgs <RandomBy> e) {
                populate_shuffle_mode = e.Value.Id;
                PopulateModeSchema.Set(populate_shuffle_mode);
                UpdatePlayQueue();
                OnUpdated();
            };

            populate_shuffle_mode = header_widget.ShuffleModeId;

            header_widget.SourceChanged += delegate(object sender, EventArgs <DatabaseSource> e) {
                populate_from = e.Value;
                if (populate_from == null)
                {
                    populate_from_name = String.Empty;
                    PopulateFromSchema.Set(String.Empty);
                    return;
                }

                populate_from_name = e.Value.Name;
                PopulateFromSchema.Set(e.Value.Name);
                source_set_at = DateTime.Now;
                populate_from.Reload();
                Refresh();
            };

            return(header_widget);
        }