/// <summary>
        /// Dowload track
        /// </summary>
        /// <param name="trackName">The name of the trac without extension</param>
        /// <param name="defaultExtension">The default audio extension in the format .{extension} (example: .mp3)</param>
        public DownloadTrackWindow(string trackName, string defaultExtension)
        {
            InitializeComponent();
            _isInFileMode = true;
            _defaultExtension = defaultExtension;
            SelectedPath = Path.Combine(HurricaneSettings.Instance.Config.DownloadSettings.DownloadFolder,
                trackName + defaultExtension);
            CheckIfFileExists();

            DownloadSettings = HurricaneSettings.Instance.Config.DownloadSettings;
            OnPropertyChanged("DownloadSettings");
        }
        /// <summary>
        /// Download tracks
        /// </summary>
        public DownloadTrackWindow()
        {
            InitializeComponent();

            _isInFileMode = false;
            SelectedPath = HurricaneSettings.Instance.Config.DownloadSettings.DownloadFolder;
            CanAccept = true;

            DownloadSettings = HurricaneSettings.Instance.Config.DownloadSettings;
            OnPropertyChanged("DownloadSettings");
            Title = Application.Current.Resources["DownloadTracks"].ToString();
        }
Beispiel #3
0
        public void AddEntry <T>(T download, DownloadSettings settings, string fileName) where T : IDownloadable, IMusicInformation
        {
            HasEntries = true;
            var entry = new DownloadEntry
            {
                IsWaiting         = true,
                DownloadFilename  = fileName,
                Trackname         = download.DownloadFilename,
                DownloadParameter = download.DownloadParameter,
                DownloadMethod    = download.DownloadMethod,
                MusicInformation  = download,
                DownloadSettings  = settings.Clone()
            };

            Entries.Add(entry);
            _hasToCheck = true;
            DownloadTracks();
        }
Beispiel #4
0
        public async static Task <bool> DownloadAndConfigureTrack(IDownloadable downloadInformation, IMusicInformation musicInformation, string fileName, Action <double> progressChangedAction, DownloadSettings settings)
        {
            if (!await DownloadTrack(downloadInformation, fileName, progressChangedAction))
            {
                return(false);
            }

            if (settings.IsConverterEnabled)
            {
                var oldFile = new FileInfo(fileName);
                oldFile.MoveTo(GeneralHelper.GetFreeFileName(oldFile.Directory, oldFile.Extension).FullName); //We move the downloaded file to a temp location
                await ffmpeg.ConvertFile(oldFile.FullName, fileName, settings.Bitrate, settings.Format);
            }

            //TagLib# destroys all aac files...
            if (settings.AddTags && settings.Format != AudioFormat.AAC)
            {
                await AddTags(musicInformation, fileName);
            }
            return(true);
        }
Beispiel #5
0
 public override sealed void SetStandardValues()
 {
     SoundOutDeviceID = SoundOutManager.DefaultDevicePlaceholder;
     DisableNotificationInGame = true;
     ShowMagicArrowBelowCursor = true;
     WaveSourceBits = 16;
     SampleRate = -1;
     var language = Languages.FirstOrDefault(x => x.Code == Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName);
     Language = language == null ? "en" : language.Code;
     Notification = NotificationType.Top;
     ApplicationDesign = new ApplicationDesign();
     ApplicationDesign.SetStandard();
     NotificationShowTime = 5000;
     RememberTrackImportPlaylist = false;
     PlaylistToImportTrack = null;
     LoadAlbumCoverFromInternet = true;
     DownloadAlbumCoverQuality = ImageQuality.Maximum;
     SaveCoverLocal = false;
     TrimTrackname = true;
     ShowArtistAndTitle = true;
     SoundOutMode = WasapiOut.IsSupportedOnCurrentPlatform ? SoundOutMode.WASAPI : SoundOutMode.DirectSound;
     Latency = 100;
     IsCrossfadeEnabled = false;
     CrossfadeDuration = 4;
     UseThinHeaders = true;
     MinimizeToTray = false;
     ShowNotificationIfMinimizeToTray = true;
     Downloader = new DownloadManager();
     TabControlTransition = TransitionType.Left;
     ShowProgressInTaskbar = true;
     AppCommunicationSettings = new AppCommunicationSettings();
     AppCommunicationSettings.SetStandard();
     DownloadSettings = new DownloadSettings();
     DownloadSettings.SetDefault();
     CheckForHurricaneUpdates = true;
     CheckForYoutubeDlUpdates = true;
     Passwords = new List<PasswordEntry>();
 }
Beispiel #6
0
 /// <summary>
 /// Converts the file
 /// </summary>
 /// <param name="fileName">The path to the file which should become converted</param>
 /// <param name="newFileName">The name of the new file WITHOUT extension</param>
 /// <param name="settings"></param>
 public static Task ConvertFile(string fileName, string newFileName, DownloadSettings settings)
 {
     return ConvertFile(fileName, newFileName, settings.Bitrate, settings.Format);
 }
Beispiel #7
0
 /// <summary>
 /// Converts the file
 /// </summary>
 /// <param name="fileName">The path to the file which should become converted</param>
 /// <param name="newFileName">The name of the new file WITHOUT extension</param>
 /// <param name="settings"></param>
 public static Task ConvertFile(string fileName, string newFileName, DownloadSettings settings)
 {
     return(ConvertFile(fileName, newFileName, settings.Bitrate, settings.Format));
 }