Exemple #1
0
        /// <summary>
        /// Triggers the manual matching when the background thread completed his job and reactivate elements
        /// of the GUI
        /// </summary>
        /// <param name="sender">The object sending the signal.</param>
        /// <param name="e">The event.</param>
        private void backgroundWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            if (e.Error != null)
            {
                this.showMessageBox("An error occured during the merging operation.");
            }
            else
            {
                // Open manual merging only if it both lists contains elements
                if (_theUser.getNbLocalSongs() != 0 && _theUser.getNbSpotifySongs() != 0)
                {
                    Form manualMergingForm = new ManualMergingGUI(_theUser);
                    manualMergingForm.Show();
                }

                playlistsListBox.Enabled      = true;
                spotifyMusicsListView.Enabled = true;
                localListView.Enabled         = true;
                browseButton.Enabled          = true;
                folderTextBox.Enabled         = true;
            }
        }
Exemple #2
0
        /// <summary>
        /// Triggers the synchronisation between the Spotify songs and the Local songs
        /// </summary>
        /// <param name="sender">The button instance</param>
        /// <param name="e">The event</param>
        /// <remarks>
        /// If all local songs did not have a match, a manual merging operation will
        /// be triggered
        /// </remarks>
        private void synchronizeButton_Click(object sender, EventArgs e)
        {
            playlistsListBox.Enabled      = false;
            spotifyMusicsListView.Enabled = false;
            localListView.Enabled         = false;
            browseButton.Enabled          = false;
            folderTextBox.Enabled         = false;

            progressBar.Value = 0;

            // Step 1: Retrieve all informations from Spotify

            progressBar.PerformStep();

            _theUser.fillSpotifySongs();

            progressBar.PerformStep();

            _theUser.fillLocalSongs();

            progressBar.PerformStep();

            // Step 2: Matching and tagging
            _theUser.matchSongs();
            progressBar.PerformStep();

            // Step 3: Open the form for manual matching
            Form manualMergingForm = new ManualMergingGUI(_theUser);

            manualMergingForm.Show();

            playlistsListBox.Enabled      = true;
            spotifyMusicsListView.Enabled = true;
            localListView.Enabled         = true;
            browseButton.Enabled          = true;
            folderTextBox.Enabled         = true;
        }