Exemplo n.º 1
0
 /// <summary>
 /// Change lyrics
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnChangeWords_Click(object sender, EventArgs e)
 {
     if (Application.OpenForms.OfType <frmPlayer>().Count() > 0)
     {
         frmPlayer frmPlayer = GetForm <frmPlayer>();
         frmPlayer.DisplayEditLyricsForm();
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Button: Save tags into the Midi file
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnSave_Click(object sender, EventArgs e)
        {
            bool   bModified = false;
            string tx        = string.Empty;

            sequence1.TagTitle      = txtTitle.Text.Trim();
            sequence1.TagArtist     = txtArtist.Text.Trim();
            sequence1.TagAlbum      = txtAlbum.Text.Trim();
            sequence1.TagDate       = txtDate.Text.Trim();
            sequence1.TagGenre      = txtGenre.Text.Trim();
            sequence1.TagEditor     = txtEditor.Text.Trim();
            sequence1.TagCopyright  = txtCopyright.Text.Trim();
            sequence1.TagEvaluation = txtEvaluation.Text.Trim();
            sequence1.TagComment    = txtComment.Text.Trim();

            string[] S;
            string   newline = string.Empty;


            sequence1.ITag.Clear();
            sequence1.KTag.Clear();
            sequence1.LTag.Clear();
            sequence1.TTag.Clear();
            sequence1.VTag.Clear();
            sequence1.WTag.Clear();

            tx = txtITag.Text.Trim();
            S  = tx.Split(new string[] { "\n", "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
            foreach (string line in S)
            {
                newline = line.Trim();
                if (newline != "")
                {
                    sequence1.ITag.Add(line.Trim());
                }
            }
            tx = txtKTag.Text.Trim();
            S  = tx.Split(new string[] { "\n", "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
            foreach (string line in S)
            {
                newline = line.Trim();
                if (newline != "")
                {
                    sequence1.KTag.Add(line.Trim());
                }
            }
            tx = txtLTag.Text.Trim();
            S  = tx.Split(new string[] { "\n", "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
            foreach (string line in S)
            {
                newline = line.Trim();
                if (newline != "")
                {
                    sequence1.LTag.Add(line.Trim());
                }
            }
            tx = txtTTag.Text.Trim();
            S  = tx.Split(new string[] { "\n", "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
            foreach (string line in S)
            {
                newline = line.Trim();
                if (newline != "")
                {
                    sequence1.TTag.Add(line.Trim());
                }
            }
            tx = txtVTag.Text.Trim();
            S  = tx.Split(new string[] { "\n", "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
            foreach (string line in S)
            {
                newline = line.Trim();
                if (newline != "")
                {
                    sequence1.VTag.Add(line.Trim());
                }
            }
            tx = txtWTag.Text.Trim();
            S  = tx.Split(new string[] { "\n", "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
            foreach (string line in S)
            {
                newline = line.Trim();
                if (newline != "")
                {
                    sequence1.WTag.Add(line.Trim());
                }
            }


            if (sequence1.TagTitle != "" || sequence1.TagArtist != "" || sequence1.TagAlbum != "" || sequence1.TagDate != "" || sequence1.TagGenre != "" || sequence1.TagEditor != "" || sequence1.TagCopyright != "" || sequence1.TagEvaluation != "" || sequence1.TagComment != "")
            {
                bModified = true;
            }

            if (sequence1.ITag.Count != 0 || sequence1.KTag.Count != 0 || sequence1.LTag.Count != 0 || sequence1.TTag.Count != 0 || sequence1.VTag.Count != 0 || sequence1.WTag.Count != 0)
            {
                bModified = true;
            }


            if (bModified == true)
            {
                AddTags();

                if (Application.OpenForms.OfType <frmPlayer>().Count() > 0)
                {
                    frmPlayer frmPlayer = GetForm <frmPlayer>();
                    frmPlayer.FileModified();
                }
                MessageBox.Show("Tags saved successfully", "Karaboss", MessageBoxButtons.OK, MessageBoxIcon.Information);

                this.Close();
            }
        }