示例#1
0
        public OptionPageSetup(HelperKinskyJukebox aHelper)
            : base("Setup")
        {
            iHelper = aHelper;

            iCollectionLocation = new OptionFolderPath("scandirectory", "Scan Directory", "Select the directory to scan for music (root directory of your music collection)", "");
            Add(iCollectionLocation);

            iCollectionHttpLocation = new OptionUri("scanurl", "URL of Scan Directory", "Web accessible address of your scan directory." + Environment.NewLine + "If you are using a NAS based webserver, please enter a valid http location (i.e. http://<ip address of nas>/<music share>)." + Environment.NewLine + "Click the 'Test' button to insure this location opens in a web browser and points to your Scan Directory (root directory of your music collection)." + Environment.NewLine + "Otherwise, you can allow Kinsky Jukebox to run as an Http server by ticking this option box (valid network interface must be selected)." + Environment.NewLine + "Kinsky Jukebox would need to remain running during music playback as it would be serving the music to your DS device.", "http://");
            iCollectionHttpLocation.IncludeTestButton();
            Add(iCollectionHttpLocation);

            iUseHttpServer = new OptionBool("usehttpserver", "Use KinskyJukebox as Http Server", "Use Kinsky Jukebox in place of a dedicated http server for your music (valid network interface must be selected, Kinsky Jukebox would need to remain running during music playback as it would be serving the music to your DS device). URL of scan directory is ignored if this setting is enabled.", false);
            Add(iUseHttpServer);

            iCompilationsFolder = new OptionFolderName("compliationsfoldername", "Compilations Folder Name", "Select the folder where your compilation albums are stored. By default any folder name containing 'compilation' or 'various' will be classed as a compilation folder." + Environment.NewLine + "Should reside within your Scan Directory (root directory of your music collection).", "");
            Add(iCompilationsFolder);

            iRandomize = new OptionBool("randomiselargeplaylists", "Randomize Large Playlists", "Randomize playlists larger than " + MediaCollection.kPlaylistMaxTracks + " tracks. Otherwise the first " + MediaCollection.kPlaylistMaxTracks + " tracks only will be used.", true);
            Add(iRandomize);

            // linked options
            iCollectionHttpLocation.Enabled   = !iUseHttpServer.Native;
            EventUseHttpServerChanged        += UseHttpServerChanged;
            iUseHttpServer.Enabled            = (iHelper.Stack.Status.State == EStackState.eOk);
            iHelper.Stack.EventStatusChanged += EventStackStatusChanged; // linked to iUseHttpServer
        }
示例#2
0
        public LocalPlaylists(IHelper aHelper, bool aAddOptionPage)
        {
            iLock = new object();

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

            if (aAddOptionPage)
            {
                // create the options page
                OptionPage optionPage = new OptionPage("Local Playlists");
                optionPage.Add(iOptionSaveDirectory);
                aHelper.AddOptionPage(optionPage);
            }
            else
            {
                aHelper.AddOption(iOptionSaveDirectory);
            }

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

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

            Refresh();
        }
示例#3
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();
        }
示例#4
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);
        }