Beispiel #1
0
        /// <summary>
        /// Based upon the given root folder, this will create the path of the music file while maintaining the structure as defined by 'Folder' and the album and artist fields.
        /// This will include all necessary subdirectories within the root folder.
        /// </summary>
        /// <param name="targetFolder">Root folder as basis for the path (usually the music collection folder)</param>
        /// <returns>Path of the music file, will all naming options (parent folders, album names etc.) included</returns>
        public string GetDestination(string targetFolder)
        {
            FileInfo sourceFile = new FileInfo(Source);
            string   newPath    = MusicFolder.GetPath(targetFolder, Folder);

            //Console.WriteLine("Source " + sourceFile + " new " + newPath);

            if (Folder == MusicFolder.Folders.ALBUM || Folder == MusicFolder.Folders.FILMMUSIK ||
                Folder == MusicFolder.Folders.PODCASTS || Folder == MusicFolder.Folders.LIEDER)
            {
                if (HasParent())
                {
                    if (AlternateParentFolder != null)
                    {
                        newPath = Path.Combine(newPath, AlternateParentFolder);
                    }
                    else if (AlbumParentFolder != null)
                    {
                        newPath = Path.Combine(newPath, AlbumParentFolder);
                    }
                }

                //Console.WriteLine("Folder: "+ CreateFolderName() + " File: " + CreateFileName(sourceFile, true));

                //Console.WriteLine("Destination: " + Path.Combine(newPath, CreateFolderName(), CreateFileName(sourceFile, true)));
                return(Path.Combine(newPath, CreateFolderName(), CreateFileName(sourceFile, Folder != MusicFolder.Folders.LIEDER)));
            }
            else
            {
                //Console.WriteLine("Destination = Source: " + Source);
                return(Source);
            }
        }
Beispiel #2
0
        //private static MenuItem[] folderMenu = new MenuItem[] { new MenuItem(MusicFolder.GetFolderName(MusicFolder.Folders.ALBUM)), new MenuItem(MusicFolder.GetFolderName(MusicFolder.Folders.FILMMUSIK)), new MenuItem(MusicFolder.GetFolderName(MusicFolder.Folders.PODCASTS)) };

        public MainWindow()
        {
            InitializeComponent();

            buttonCopy.Enabled = false;
            AllowOverride      = true;

            musicDirectory    = Application.StartupPath;
            playlistDirectory = MusicFolder.GetPath(musicDirectory, MusicFolder.Folders.PLAYLISTS);

            musicFolderField.Text    = musicDirectory;
            playlistFolderField.Text = playlistDirectory;
        }