Beispiel #1
0
        private void listView_List_DoubleClick(object sender, EventArgs e)
        {
            if (listView_List.SelectedItems.Count > 0)
            {
                FrmClass.Example_PlayPath = listView_List.SelectedItems[0].SubItems[3].Text.Trim();
                if (!File.Exists(FrmClass.Example_PlayPath))
                {
                    MessageBox.Show("没有找到该媒体文件。");
                    return;
                }
                ((Frm_Libretto)FrmClass.F_Libretto).FrmMessage(0, 0);
                string Tem_Lyric = FrmClass.Example_PlayPath;
                Tem_Lyric = Tem_Lyric.Substring(0, Tem_Lyric.LastIndexOf(Convert.ToChar("."))) + ".lrc";
                FileInfo SFInfo = new FileInfo(Tem_Lyric);
                if (SFInfo.Exists == true)
                {
                    FrmClass.Example_ifLy = true;
                    Cla_FrmClass.ArrayList_Close(FrmClass.Example_ArrLyric);
                    FrmClass.Example_ArrLyric = new System.Collections.ArrayList(Cla_FrmClass.LRC_Lyric(Tem_Lyric));

                    FrmClass.Example_LyC = 0;
                    ((Frm_Libretto)FrmClass.F_Libretto).FrmMessage(Cla_FrmClass.LRC_Lyric(Tem_Lyric));
                }
                else
                {
                    FrmClass.Example_ifLy = false;
                }

                FrmClass.Example_LyC = 0;
                ((Frm_Play)FrmClass.F_MPlay).FrmMessage(0, FrmClass.Example_PlayPath);
                ((Frm_Play)FrmClass.F_MPlay).Show_BendInfo(FrmClass.Example_PlayPath);
                if (FrmClass.Example_ListMark < 0)
                {
                    FrmClass.Example_ListMark = 0;
                }
                listView_List.Items[FrmClass.Example_ListMark].BackColor = Color.DarkSeaGreen;
                listView_List.SelectedItems[0].BackColor = Color.DarkGreen;
                FrmClass.Example_ListMark = listView_List.SelectedItems[0].Index;
            }
        }
Beispiel #2
0
        Random rand = new Random();                 //定义随机变量
        #endregion

        #region  "播放"窗体接收的消息
        /// <summary>
        /// "播放"窗体接收的消息
        /// </summary>
        /// <param FileN="string">播放文件的路径</param>
        public void FrmMessage(int Sign, string Tem_Str)
        {
            switch (Sign)
            {
            case 0:
            {
                timer_Bend.Enabled     = false;
                timer_ShowTime.Enabled = false;
                Example_PlayPause      = 1;
                pictureBox_Play.Image  = null;
                pictureBox_Play.Image  = (Image)Properties.Resources.播放按钮;
                pictureBox_Play.Tag    = 8;

                ((Frm_Libretto)FrmClass.F_Libretto).FrmMessage(0, 0);
                string Tem_Lyric = FrmClass.Example_PlayPath;
                Tem_Lyric = Tem_Lyric.Substring(0, Tem_Lyric.LastIndexOf(Convert.ToChar("."))) + ".lrc";
                FileInfo SFInfo = new FileInfo(Tem_Lyric);

                if (SFInfo.Exists == true)
                {
                    FrmClass.Example_ifLy = true;
                    Cla_FrmClass.ArrayList_Close(FrmClass.Example_ArrLyric);
                    FrmClass.Example_ArrLyric = new System.Collections.ArrayList(Cla_FrmClass.LRC_Lyric(Tem_Lyric));

                    FrmClass.Example_LyC = 0;
                    string Tem_upArr = FrmClass.Example_ArrLyric[FrmClass.Example_LyC].ToString();
                    Example_UpD   = Convert.ToInt32(Tem_upArr.Substring(0, Tem_upArr.IndexOf(Convert.ToChar("|")))) / 1000;
                    Example_UpS   = Tem_upArr.Substring(Tem_upArr.IndexOf(Convert.ToChar("|")) + 1, Tem_upArr.Length - Tem_upArr.IndexOf(Convert.ToChar("|")) - 1);
                    Tem_upArr     = FrmClass.Example_ArrLyric[FrmClass.Example_LyC + 1].ToString();
                    Example_DownD = Convert.ToInt32(Tem_upArr.Substring(0, Tem_upArr.IndexOf(Convert.ToChar("|")))) / 1000;

                    ((Frm_Libretto)FrmClass.F_Libretto).FrmMessage(Cla_FrmClass.LRC_Lyric(Tem_Lyric));
                }
                Example_NoncePause = 2;
                ((Frm_Screen)FrmClass.F_Screen).FrmMessage(0, FrmClass.Example_PlayPath, this);
                Show_BendInfo(FrmClass.Example_PlayPath);
                Bend_State(2);
                break;
            }

            case 1:
            {
                Show_BendInfo(FrmClass.Example_PlayPath);
                break;
            }
            }
        }