Exemplo n.º 1
0
        public LocalPlaylistsRoot(LocalPlaylistCreator aCreator, OptionFolderPath aOptionSaveDirectory)
        {
            iLock                = new object();
            iCreator             = aCreator;
            iOptionSaveDirectory = aOptionSaveDirectory;

            // initialise as being in its error state
            iPlaylists = null;
            iWrapped   = new LocalPlaylistsRootError(kRootId);
            iWrapped.EventContentUpdated += ContentUpdated;
            iWrapped.EventContentAdded   += ContentAdded;
            iWrapped.EventContentRemoved += ContentRemoved;

            Refresh();
        }
Exemplo n.º 2
0
        public LocalPlaylistsRootOk(string aRootId, LocalPlaylists aPlaylists, LocalPlaylistCreator aCreator)
        {
            iPlaylists = aPlaylists;
            iPlaylists.EventPlaylistAdded    += PlaylistAdded;
            iPlaylists.EventPlaylistRemoved  += PlaylistRemoved;
            iPlaylists.EventPlaylistsChanged += PlaylistsChanged;
            iCreator = aCreator;

            iMetadata            = new playlistContainer();
            iMetadata.Id         = aRootId;
            iMetadata.Title      = aRootId;
            iMetadata.ChildCount = (int)iPlaylists.Count;
            iMetadata.Restricted = false;
            iMetadata.Searchable = true;
        }
Exemplo n.º 3
0
        public LocalPlaylistSupport(HelperKinsky aHelper, LocalPlaylistFileNameGenerator aNameGenerator)
        {
            // create the options page
            OptionPage optionPage = new OptionPage("Local Playlists");

            iOptionSaveDirectory = new OptionFolderPath("playlistpath", "Local playlist path", "Path where local playlists are saved", Path.Combine(aHelper.DataPath.FullName, "Playlists"));
            optionPage.Add(iOptionSaveDirectory);
            aHelper.AddOptionPage(optionPage);

            // listen for changes to the save directory option
            iOptionSaveDirectory.EventValueChanged += SaveDirectoryChanged;

            iCreator       = new LocalPlaylistCreator(aNameGenerator);
            iRootContainer = new LocalPlaylistsRoot(iCreator, iOptionSaveDirectory);
        }