// Catalog.GetString ("Music Library")
        public MusicLibrarySource() : base(Catalog.GetString("Music"), "Library", 40)
        {
            MediaTypes    = TrackMediaAttributes.Music | TrackMediaAttributes.AudioStream;
            NotMediaTypes = TrackMediaAttributes.Podcast | TrackMediaAttributes.VideoStream | TrackMediaAttributes.AudioBook;
            Properties.SetStringList("Icon.Name", "audio-x-generic", "source-library");

            // Migrate the old library-location schema, if necessary
            if (DatabaseConfigurationClient.Client.Get <int> ("MusicLibraryLocationMigrated", 0) != 1)
            {
                string old_location = OldLocationSchema.Get();
                if (!String.IsNullOrEmpty(old_location))
                {
                    BaseDirectory = old_location;
                }
                DatabaseConfigurationClient.Client.Set <int> ("MusicLibraryLocationMigrated", 1);
            }

            Section file_system = PreferencesPage.Add(new Section("file-system",
                                                                  Catalog.GetString("File System Organization"), 5));

            file_system.Add(new SchemaPreference <string> (LibrarySchema.FolderPattern,
                                                           Catalog.GetString("Folder hie_rarchy")));

            file_system.Add(new SchemaPreference <string> (LibrarySchema.FilePattern,
                                                           Catalog.GetString("File _name")));

            PreferencesPage.Add(new Section("misc", Catalog.GetString("Miscellaneous"), 10));
        }
Beispiel #2
0
        // Catalog.GetString ("Music Library")
        public MusicLibrarySource() : base(Catalog.GetString("Music"), "Library", 40)
        {
            MediaTypes    = TrackMediaAttributes.Music | TrackMediaAttributes.AudioStream;
            NotMediaTypes = TrackMediaAttributes.Podcast | TrackMediaAttributes.VideoStream | TrackMediaAttributes.AudioBook;
            Properties.SetStringList("Icon.Name", "audio-x-generic", "source-library");

            Properties.Set <string> ("SearchEntryDescription", Catalog.GetString("Search your music"));

            // Migrate the old library-location schema, if necessary
            if (DatabaseConfigurationClient.Client.Get <int> ("MusicLibraryLocationMigrated", 0) != 1)
            {
                string old_location = OldLocationSchema.Get();
                if (!String.IsNullOrEmpty(old_location))
                {
                    BaseDirectory = old_location;
                }
                DatabaseConfigurationClient.Client.Set <int> ("MusicLibraryLocationMigrated", 1);
            }

            SetFileNamePattern(MusicFileNamePattern);

            Section misc = PreferencesPage.Add(new Section("misc",
                                                           Catalog.GetString("Miscellaneous"), 10));

            misc.Add(new SchemaPreference <bool> (LibrarySchema.SortByAlbumYear,
                                                  Catalog.GetString("_Sort an artist's albums by year, not title"), null,
                                                  delegate {
                DatabaseTrackModel.Resort();
                DatabaseTrackModel.Reload();
            }
                                                  ));
        }