public OptionPageOrganisation()
            : base("Organisation")
        {
            iSortTypeNew = new OptionBool("sortnew", "Sort by " + MediaCollection.SortTypeToString(MediaCollection.SortType.eNew), "When sorting your scanned collection, include a " + MediaCollection.SortTypeToString(MediaCollection.SortType.eNew) + " category", true);
            Add(iSortTypeNew);

            iNewMusicCutoffDays = new OptionNumber("newcutoff", "New music cutoff (days)", "Music files created/modified before the specified cutoff will included when scanning by 'New'", 14, 1, 999);
            Add(iNewMusicCutoffDays);

            iSortTypeArtistAlbum = new OptionBool("sortartistalbum", "Sort by " + MediaCollection.SortTypeToString(MediaCollection.SortType.eArtistAlbum), "When sorting your scanned collection, include a " + MediaCollection.SortTypeToString(MediaCollection.SortType.eArtistAlbum) + " category", true);
            Add(iSortTypeArtistAlbum);

            iSortByYear = new OptionBoolEnum("albumarrangement", "Album Arrangement", "Albums can either be arranged alphabetically or by year (as Year/Album, oldest to newest like a discography)", false, "Arrange Albums by Year", "Arrange Albums Alphabetically");
            Add(iSortByYear);

            iSortTypeArtist = new OptionBool("sortartist", "Sort by " + MediaCollection.SortTypeToString(MediaCollection.SortType.eArtist), "When sorting your scanned collection, include a " + MediaCollection.SortTypeToString(MediaCollection.SortType.eArtist) + " category", false);
            Add(iSortTypeArtist);

            iIgnoreCompilations = new OptionBoolEnum("groupcompilations", "Group Compilation Artists", "Group compilation artists as 'Various' or retain artist names (only applies when scanning by 'Artist', done automatically when scanning by 'Artist/Album')", false, "Group as 'Various'", "Retain Artist Names");
            Add(iIgnoreCompilations);

            iSortTypeAlbum = new OptionBool("sortalbum", "Sort by " + MediaCollection.SortTypeToString(MediaCollection.SortType.eAlbum), "When sorting your scanned collection, include a " + MediaCollection.SortTypeToString(MediaCollection.SortType.eAlbum) + " category", false);
            Add(iSortTypeAlbum);

            iSortTypeGenre = new OptionBool("sortgenre", "Sort by " + MediaCollection.SortTypeToString(MediaCollection.SortType.eGenre), "When sorting your scanned collection, include a " + MediaCollection.SortTypeToString(MediaCollection.SortType.eGenre) + " category", false);
            Add(iSortTypeGenre);

            iSortTypeComposer = new OptionBool("sortcomposer", "Sort by " + MediaCollection.SortTypeToString(MediaCollection.SortType.eComposer), "When sorting your scanned collection, include a " + MediaCollection.SortTypeToString(MediaCollection.SortType.eComposer) + " category", false);
            Add(iSortTypeComposer);

            iSortTypeConductor = new OptionBool("sortconductor", "Sort by " + MediaCollection.SortTypeToString(MediaCollection.SortType.eConductor), "When sorting your scanned collection, include a " + MediaCollection.SortTypeToString(MediaCollection.SortType.eConductor) + " category", false);
            Add(iSortTypeConductor);

            iSortTypeArtistAz = new OptionBool("sortartistaz", "Sort by " + MediaCollection.SortTypeToString(MediaCollection.SortType.eArtistAz), "When sorting your scanned collection, include a " + MediaCollection.SortTypeToString(MediaCollection.SortType.eArtistAz) + " category", false);
            Add(iSortTypeArtistAz);

            iSortTypeTitleAz = new OptionBool("sorttitleaz", "Sort by " + MediaCollection.SortTypeToString(MediaCollection.SortType.eTitleAz), "When sorting your scanned collection, include a " + MediaCollection.SortTypeToString(MediaCollection.SortType.eTitleAz) + " category", false);
            Add(iSortTypeTitleAz);

            iSortTypeAlbumArtistAlbum = new OptionBool("sortalbumartistalbum", "Sort by " + MediaCollection.SortTypeToString(MediaCollection.SortType.eAlbumArtistAlbum), "When sorting your scanned collection, include a " + MediaCollection.SortTypeToString(MediaCollection.SortType.eAlbumArtistAlbum) + " category", false);
            Add(iSortTypeAlbumArtistAlbum);

            iSortTypeAlbumArtist = new OptionBool("sortalbumartist", "Sort by " + MediaCollection.SortTypeToString(MediaCollection.SortType.eAlbumArtist), "When sorting your scanned collection, include a " + MediaCollection.SortTypeToString(MediaCollection.SortType.eAlbumArtist) + " category", false);
            Add(iSortTypeAlbumArtist);

            iSortTypeAll = new OptionBool("sortall", "Sort by " + MediaCollection.SortTypeToString(MediaCollection.SortType.eAll), "When sorting your scanned collection, include a " + MediaCollection.SortTypeToString(MediaCollection.SortType.eAll) + " category", false);
            Add(iSortTypeAll);

            iIncludeLocalRadio = new OptionBoolEnum("localradio", "Local Radio", "Creates a group of playlists of local radio stations (provided by TuneIn Radio) if selected", false, "Create Local Radio Playlists", "Ignore");
            Add(iIncludeLocalRadio);

            // linked options
            iNewMusicCutoffDays.Enabled = iSortTypeNew.Native;
            EventSortTypeNewChanged    += SortTypeNewChanged;
            iIgnoreCompilations.Enabled = iSortTypeArtist.Native;
            EventSortTypeArtistChanged += SortTypeArtistChanged;
        }
示例#2
0
        public TrackMetadata(string aFile, HelperKinskyJukebox aHelper)
        {
            // File Info
            FilePath = Path.GetFullPath(aFile);
            try {
                AlbumArtPath = FindArtwork(Path.GetDirectoryName(FilePath));
            }
            catch (Exception) {
            }
            try {
                AgeInDays = (DateTime.Today - File.GetCreationTime(aFile)).Days;
            }
            catch (Exception) {
            }

            // Check for compilation
            try {
                IsCompilation = MediaCollection.IsCompilation(FilePath, aHelper);
            }
            catch (Exception) {
            }

            bool artistVarious = (aHelper.OptionPageOrganisation.IgnoreCompilations && IsCompilation);

            try {
                // populate metadata from tags if it is there
                TagLib.File tagFile = TagLib.File.Create(aFile);
                Title       = tagFile.Tag.Title;
                Album       = tagFile.Tag.Album;
                Artist      = tagFile.Tag.FirstPerformer;
                AlbumArtist = tagFile.Tag.FirstAlbumArtist;
                Genre       = tagFile.Tag.FirstGenre;
                Composer    = tagFile.Tag.FirstComposer;
                Conductor   = tagFile.Tag.Conductor;
                Track       = tagFile.Tag.Track;
                Disc        = tagFile.Tag.Disc;
                DiscCount   = tagFile.Tag.DiscCount;
                Year        = tagFile.Tag.Year.ToString();
                Duration    = new Upnp.Time((int)tagFile.Properties.Duration.TotalSeconds).ToString();
                MimeType    = tagFile.MimeType;
            }
            catch (Exception) {
            }

            // deal with missing data and unwanted data
            if (Title == null)
            {
                Title = Path.GetFileNameWithoutExtension(aFile);
            }
            if (Album == null)
            {
                Album = "Unknown";
            }
            if (Artist == null)
            {
                Artist = "Unknown";
            }
            else if (artistVarious)
            {
                Artist = kCompilationsArtist;
            }
            if (AlbumArtist == null)
            {
                AlbumArtist = "Unknown";
            }
            if (Genre == null)
            {
                Genre = "Unknown";
            }
            if (Composer == null)
            {
                Composer = "Unknown";
            }
            if (Year == null || Year.Length != 4)
            {
                Year = "Unknown";
            }
            if (Duration == null)
            {
                Duration = "Unknown";
            }
            if (Conductor == null)
            {
                Conductor = "Unknown";
            }
            if (MimeType == null)
            {
                MimeType = "Unknown";
            }
            if (aHelper.OptionPageOrganisation.SortByYear)
            {
                Album = Year + "/" + Album;
            }
        }
示例#3
0
        public FormPrint(HelperKinskyJukebox aHelper, TreeView aPresets, bool aPreview, uint aPresetCount, DProgressChanged aProgressChanged)
        {
            iHelper                 = aHelper;
            iTreeViewPreset         = aPresets;
            iDocumentPreview        = aPreview;
            iPresetCount            = aPresetCount;
            iProgressChanged        = aProgressChanged;
            iUserOptionsApplication = aHelper.ApplicationOptions;
            InitializeComponent();
            if (aPreview)
            {
                this.Icon = Icon.FromHandle(Properties.Resources.PrintPreview.GetHicon());
            }
            else
            {
                this.Icon = Icon.FromHandle(Properties.Resources.Print.GetHicon());
            }

            int index = 0;

            printSectionCheckedListBox.Items.Add(ApplicationOptions.kToc);
            printSectionCheckedListBox.SetItemChecked(index++, iHelper.ApplicationOptions.IsPrintSectionEnabled(ApplicationOptions.kToc));
            foreach (TreeNode bookmark in aPresets.Nodes)
            {
                printSectionCheckedListBox.Items.Add(bookmark.Text);
                if (bookmark.Text == MediaCollection.SortTypeToString(MediaCollection.SortType.eAll))
                {
                    iAllIndex = index;
                }
                printSectionCheckedListBox.SetItemChecked(index++, iHelper.ApplicationOptions.IsPrintSectionEnabled(bookmark.Text));
            }
            switch (iUserOptionsApplication.PrintPageLayout)
            {
            case ApplicationOptions.PrintPageLayoutOptions.ePortraitWithTrackDetails: {
                iPageLayoutTrackDetailsPortrait.Checked = true;
                break;
            }

            case ApplicationOptions.PrintPageLayoutOptions.ePortraitWithoutTrackDetails: {
                iPageLayoutAlbumArtOnlyPortrait.Checked = true;
                break;
            }

            case ApplicationOptions.PrintPageLayoutOptions.eLandscapeWithTrackDetails: {
                iPageLayoutTrackDetailsLandscape.Checked = true;
                break;
            }

            case ApplicationOptions.PrintPageLayoutOptions.eLandscapeWithoutTrackDetails: {
                iPageLayoutAlbumArtOnlyLandscape.Checked = true;
                break;
            }
            }

            iPagesPerSheet.SelectedIndex = iUserOptionsApplication.PrintPagesPerSheetIndex;
            iPrintOrderBooklet.Checked   = iUserOptionsApplication.PrintOrderBooklet;

            if (iUserOptionsApplication.PrintDocumentType == ApplicationOptions.PrintDocumentTypeOptions.eRtf)
            {
                iDocTypeRtf.Checked = true;
            }
            else
            {
                iDocTypePdf.Checked = true;
            }
        }