Пример #1
0
 public Recorder(FrmEspionSpotify espionSpotifyForm, UserSettings userSettings, Track track)
 {
     SongGotDeleted = false;
     _form          = espionSpotifyForm;
     _userSettings  = userSettings;
     _track         = track;
 }
Пример #2
0
 public Recorder(FrmEspionSpotify espionSpotifyForm, UserSettings userSettings, Track track)
 {
     _form         = espionSpotifyForm;
     _userSettings = userSettings;
     _track        = track;
     _fileManager  = new FileManager(_userSettings, _track);
 }
Пример #3
0
        public FrmEspionSpotify()
        {
            SuspendLayout();
            Instance = this;
            InitializeComponent();

            Rnd       = new Random();
            Rm        = new ResourceManager(typeof(english));
            BackImage = Resources.spytify_logo;

            if (Settings.Default.Directory == "")
            {
                Settings.Default.Directory = Environment.GetFolderPath(Environment.SpecialFolder.MyMusic);
                Settings.Default.Save();
            }

            _charSeparator = Settings.Default.AddSeparators ? "_" : " ";
            _minTime       = Settings.Default.MinLength;
            _formatValue   = (Recorder.Format)Settings.Default.Format;
            _strucDossiers = Settings.Default.AddFolders;
            _bCdTrack      = Settings.Default.AddNumsAsTrack;
            _bNumFile      = Settings.Default.AddNumsInfrontFile;
            _num           = 1;

            var indexLanguage = Settings.Default.Language;
            var indexBitRate  = Settings.Default.Bitrate;

            tcMenu.SelectedIndex = Settings.Default.TabNo;

            rbMp3.Checked                    = Settings.Default.Format == 0;
            rbWav.Checked                    = Settings.Default.Format == 1;
            tbMinTime.Value                  = Settings.Default.MinLength / 5;
            tgAddSeparators.Checked          = Settings.Default.AddSeparators;
            tgNumTracks.Checked              = Settings.Default.AddNumsAsTrack;
            tgNumFiles.Checked               = Settings.Default.AddNumsInfrontFile;
            tgAddFolders.Checked             = Settings.Default.AddFolders;
            txtPath.Text                     = Settings.Default.Directory;
            tgDisableAds.Checked             = ManageHosts.AreAdsDisabled(ManageHosts.HostsSystemPath);
            folderBrowserDialog.SelectedPath = Settings.Default.Directory;

            SetLanguageDropDown();

            var language = (LanguageType)indexLanguage;

            SetLanguage(language);

            cbBitRate.SelectedIndex  = indexBitRate;
            cbLanguage.SelectedIndex = indexLanguage;

            _sound = new VolumeWin();

            tbVolumeWin.Value = _sound.DefaultAudioDeviceVolume;
            lblSoundCard.Text = _sound.DefaultAudioEndPointDevice.FriendlyName;
            lblVolume.Text    = _sound.DefaultAudioDeviceVolume + @"%";

            ResumeLayout();
            GitHub.NewestVersion();
        }
Пример #4
0
 public Recorder(FrmEspionSpotify espionSpotifyForm, string path, LAMEPreset bitrate, Format format,
                 Song song, int minTime, bool strucDossiers, string charSeparator, bool bCdTrack, bool bNumFile, int compteur)
 {
     SongGotDeleted = false;
     _form          = espionSpotifyForm;
     _path          = path;
     _bitrate       = bitrate;
     _format        = format;
     _song          = song;
     _minTime       = minTime;
     _strucDossiers = strucDossiers;
     _charSeparator = charSeparator;
     _compteur      = compteur;
     _bCdTrack      = bCdTrack;
     _bNumFile      = bNumFile;
 }
Пример #5
0
        public Watcher(FrmEspionSpotify espionSpotifyForm, string path, LAMEPreset bitrate,
                       Recorder.Format format, VolumeWin sound, int minTime, bool strucDossiers,
                       string charSeparator, bool bCdTrack, bool bNumFile, int cdNumTrack)
        {
            if (path == null)
            {
                path = "";
            }

            _form          = espionSpotifyForm;
            _path          = path;
            _bitrate       = bitrate;
            _format        = format;
            _sound         = sound;
            NumTrack       = bCdTrack || bNumFile ? cdNumTrack : -1;
            _minTime       = minTime;
            _strucDossiers = strucDossiers;
            _charSeparator = charSeparator;
            _bCdTrack      = bCdTrack;
            _bNumFile      = bNumFile;
        }
Пример #6
0
 public Watcher(FrmEspionSpotify form, UserSettings userSettings)
 {
     _form         = form;
     _userSettings = userSettings;
 }
Пример #7
0
        public FrmEspionSpotify()
        {
            SuspendLayout();

            Instance = this;
            InitializeComponent();

            _userSettings = new UserSettings();
            Rm            = new ResourceManager(typeof(english));
            BackImage     = Resources.spytify_logo;

            if (Settings.Default.Directory.Equals(string.Empty))
            {
                Settings.Default.Directory = Environment.GetFolderPath(Environment.SpecialFolder.MyMusic);
                Settings.Default.Save();
            }

            if (Settings.Default.AnalyticsCID.Equals(string.Empty))
            {
                Settings.Default.AnalyticsCID = Analytics.GenerateCID();
                Settings.Default.Save();
            }

            _analytics = new Analytics(Settings.Default.AnalyticsCID, Assembly.GetExecutingAssembly().GetName().Version.ToString());
            Task.Run(async() => await _analytics.LogAction("launch"));

            var clientId = Settings.Default.SpotifyAPIClientId;
            var secretId = Settings.Default.SpotifyAPISecretId;

            if (!string.IsNullOrEmpty(clientId) && !string.IsNullOrEmpty(secretId))
            {
                ExternalAPI.Instance = new MediaTags.SpotifyAPI(clientId, secretId);
            }

            var indexLanguage            = Settings.Default.Language;
            var indexBitRate             = Settings.Default.Bitrate;
            var indexAudioEndPointDevice = Settings.Default.AudioEndPointDeviceIndex.ToNullableInt();

            tcMenu.SelectedIndex = Settings.Default.TabNo;

            rbMp3.Checked             = Settings.Default.MediaFormat == 0;
            rbWav.Checked             = Settings.Default.MediaFormat == 1;
            tbMinTime.Value           = Settings.Default.MinimumRecordedLengthSeconds / 5;
            tgEndingSongDelay.Checked = Settings.Default.EndingSongDelayEnabled;
            tgAddSeparators.Checked   = Settings.Default.TrackTitleSeparatorEnabled;
            tgNumTracks.Checked       = Settings.Default.OrderNumberInMediaTagEnabled;
            tgNumFiles.Checked        = Settings.Default.OrderNumberInfrontOfFileEnabled;
            tgAddFolders.Checked      = Settings.Default.GroupByFoldersEnabled;
            txtPath.Text         = Settings.Default.Directory;
            tgDisableAds.Checked = ManageHosts.AreAdsDisabled(ManageHosts.HostsSystemPath);
            tgMuteAds.Checked    = Settings.Default.MuteAdsEnabled;
            tgDuplicateAlreadyRecordedTrack.Checked = Settings.Default.DuplicateAlreadyRecordedTrack;
            folderBrowserDialog.SelectedPath        = Settings.Default.Directory;

            SetLanguageDropDown();

            var language = (LanguageType)indexLanguage;

            SetLanguage(language);

            cbBitRate.SelectedIndex  = indexBitRate;
            cbLanguage.SelectedIndex = indexLanguage;

            _userSettings.OutputPath  = Settings.Default.Directory;
            _userSettings.Bitrate     = ((KeyValuePair <LAMEPreset, string>)cbBitRate.SelectedItem).Key;
            _userSettings.MediaFormat = (MediaFormat)Settings.Default.MediaFormat;
            _userSettings.MinimumRecordedLengthSeconds    = Settings.Default.MinimumRecordedLengthSeconds;
            _userSettings.GroupByFoldersEnabled           = Settings.Default.GroupByFoldersEnabled;
            _userSettings.TrackTitleSeparator             = Settings.Default.TrackTitleSeparatorEnabled ? "_" : " ";
            _userSettings.OrderNumberInMediaTagEnabled    = Settings.Default.OrderNumberInMediaTagEnabled;
            _userSettings.OrderNumberInfrontOfFileEnabled = Settings.Default.OrderNumberInfrontOfFileEnabled;
            _userSettings.EndingTrackDelayEnabled         = Settings.Default.EndingSongDelayEnabled;
            _userSettings.DuplicateAlreadyRecordedTrack   = Settings.Default.DuplicateAlreadyRecordedTrack;
            _userSettings.InternalOrderNumber             = 1;
            _userSettings.AudioEndPointDeviceIndex        = indexAudioEndPointDevice; // TODO: settings default stay last saved

            _audioSession = new MainAudioSession(indexAudioEndPointDevice);
            SetAudioEndPointDevicesDropDown();
            UpdateAudioEndPointFields();

            var lastVersionPrompted = Settings.Default.LastVersionPrompted.ToVersion();

            lnkRelease.Visible = lastVersionPrompted != null && lastVersionPrompted > Assembly.GetExecutingAssembly().GetName().Version;

            ResumeLayout();

            GitHub.GetVersion();
        }
Пример #8
0
 public Watcher(FrmEspionSpotify form, UserSettings userSettings)
 {
     _form         = form;
     _userSettings = userSettings;
     _userSettings.InternalOrderNumber--;
 }
Пример #9
0
        public FrmEspionSpotify()
        {
            SuspendLayout();

            Instance = this;
            InitializeComponent();

            _userSettings = new UserSettings();
            Rm            = new ResourceManager(typeof(english));
            BackImage     = Resources.spytify_logo;

            if (Settings.Default.Directory.Equals(string.Empty))
            {
                Settings.Default.Directory = Environment.GetFolderPath(Environment.SpecialFolder.MyMusic);
                Settings.Default.Save();
            }

            if (Settings.Default.AnalyticsCID.Equals(string.Empty))
            {
                Settings.Default.AnalyticsCID = Analytics.GenerateCID();
                Settings.Default.Save();
            }
            _analytics = new Analytics(Settings.Default.AnalyticsCID, Assembly.GetExecutingAssembly().GetName().Version.ToString());
            Task.Run(async() => await _analytics.LogAction("launch"));

            var indexLanguage = Settings.Default.Language;
            var indexBitRate  = Settings.Default.Bitrate;

            tcMenu.SelectedIndex = Settings.Default.TabNo;

            rbMp3.Checked             = Settings.Default.MediaFormat == 0;
            rbWav.Checked             = Settings.Default.MediaFormat == 1;
            tbMinTime.Value           = Settings.Default.MinimumRecordedLengthSeconds / 5;
            tgEndingSongDelay.Checked = Settings.Default.EndingSongDelayEnabled;
            tgAddSeparators.Checked   = Settings.Default.TrackTitleSeparatorEnabled;
            tgNumTracks.Checked       = Settings.Default.OrderNumberInMediaTagEnabled;
            tgNumFiles.Checked        = Settings.Default.OrderNumberInfrontOfFileEnabled;
            tgAddFolders.Checked      = Settings.Default.GroupByFoldersEnabled;
            txtPath.Text         = Settings.Default.Directory;
            tgDisableAds.Checked = ManageHosts.AreAdsDisabled(ManageHosts.HostsSystemPath);
            tgMuteAds.Checked    = Settings.Default.MuteAdsEnabled;
            tgDuplicateAlreadyRecordedTrack.Checked = Settings.Default.DuplicateAlreadyRecordedTrack;
            folderBrowserDialog.SelectedPath        = Settings.Default.Directory;

            SetLanguageDropDown();

            var language = (LanguageType)indexLanguage;

            SetLanguage(language);

            cbBitRate.SelectedIndex  = indexBitRate;
            cbLanguage.SelectedIndex = indexLanguage;

            _audioSession = new MainAudioSession();

            tbVolumeWin.Value = _audioSession.DefaultAudioDeviceVolume;
            lblSoundCard.Text = _audioSession.DefaultAudioEndPointDevice.FriendlyName;
            lblVolume.Text    = _audioSession.DefaultAudioDeviceVolume + @"%";

            _userSettings.OutputPath  = Settings.Default.Directory;
            _userSettings.Bitrate     = ((KeyValuePair <LAMEPreset, string>)cbBitRate.SelectedItem).Key;
            _userSettings.MediaFormat = (MediaFormat)Settings.Default.MediaFormat;
            _userSettings.MinimumRecordedLengthSeconds    = Settings.Default.MinimumRecordedLengthSeconds;
            _userSettings.GroupByFoldersEnabled           = Settings.Default.GroupByFoldersEnabled;
            _userSettings.TrackTitleSeparator             = Settings.Default.TrackTitleSeparatorEnabled ? "_" : " ";
            _userSettings.OrderNumberInMediaTagEnabled    = Settings.Default.OrderNumberInMediaTagEnabled;
            _userSettings.OrderNumberInfrontOfFileEnabled = Settings.Default.OrderNumberInfrontOfFileEnabled;
            _userSettings.EndingTrackDelayEnabled         = Settings.Default.EndingSongDelayEnabled;
            _userSettings.DuplicateAlreadyRecordedTrack   = Settings.Default.DuplicateAlreadyRecordedTrack;
            _userSettings.InternalOrderNumber             = 1;

            ResumeLayout();
            GitHub.NewestVersion();
        }