Exemplo n.º 1
0
 private void toolStripMenuItem_DeleteUselessFile_Click(object sender, EventArgs e)
 {
     for (int i = dSkinGridList_PlayList_LocalList.RowCount - 1; i >= 0; i--)
     {
         DSkinGridListRow dr = dSkinGridList_PlayList_LocalList.Rows[i];
         if (!File.Exists(dr.Cells[1].Text))
         {
             dSkinGridList_PlayList_LocalList.Rows.Remove(dr);
             string        sql     = "delete from LocalList " + " where FileFullName = '" + dr.Cells[2].Text + "'";
             SQLiteCommand command = new SQLiteCommand(sql, mainfrm.SQLiteConn);
             command.ExecuteNonQuery();
         }
     }
     dSkinGridList_PlayList_LocalList.LayoutContent();
 }
Exemplo n.º 2
0
        private void toolStripMenuItem_MoveTop_Click(object sender, EventArgs e)
        {
            DSkinGridListRow dr_SelFirst = dSkinGridList_PlayList_LocalList.SelectedItems[0];

            if (0 == dSkinGridList_PlayList_LocalList.Rows.IndexOf(dr_SelFirst))
            {
                return;
            }

            for (int i = 0; i < dSkinGridList_PlayList_LocalList.SelectedItems.Count; i++)
            {
                DSkinGridListRow dr = dSkinGridList_PlayList_LocalList.SelectedItems[i];
                dSkinGridList_PlayList_LocalList.Rows.Remove(dSkinGridList_PlayList_LocalList.SelectedItems[i]);
                dSkinGridList_PlayList_LocalList.Rows.Insert(i, dr);
            }
        }
Exemplo n.º 3
0
 private void toolStripMenuItem_LocalList_Delete_Click(object sender, EventArgs e)
 {
     if (dSkinGridList_PlayList_LocalList.SelectedItems.Count > 0)
     {
         for (int i = 0; i < dSkinGridList_PlayList_LocalList.SelectedItems.Count; i++)
         {
             DSkinGridListRow dr = dSkinGridList_PlayList_LocalList.SelectedItems[i];
             dSkinGridList_PlayList_LocalList.Rows.Remove(dr);
             string        sql     = "delete from LocalList " + " where FileFullName = '" + dr.Cells[2].Text + "'";
             SQLiteCommand command = new SQLiteCommand(sql, mainfrm.SQLiteConn);
             command.ExecuteNonQuery();
         }
     }
     dSkinGridList_PlayList_LocalList.LayoutContent();
     dSkinGridList_PlayList_LocalList.SelectedItems.Clear();
 }
Exemplo n.º 4
0
        private void toolStripMenuItem_MoveBottom_Click(object sender, EventArgs e)
        {
            int nCount = dSkinGridList_PlayList_LocalList.RowCount;
            DSkinGridListRow dr_SelLast = dSkinGridList_PlayList_LocalList.SelectedItems[dSkinGridList_PlayList_LocalList.SelectedItems.Count - 1];

            if (dr_SelLast == dSkinGridList_PlayList_LocalList.Rows[nCount - 1])
            {
                return;
            }

            for (int i = 0; i < dSkinGridList_PlayList_LocalList.SelectedItems.Count; i++)
            {
                DSkinGridListRow dr = dSkinGridList_PlayList_LocalList.SelectedItems[i];
                dSkinGridList_PlayList_LocalList.Rows.Remove(dSkinGridList_PlayList_LocalList.SelectedItems[i]);
                dSkinGridList_PlayList_LocalList.Rows.Insert(nCount - 1 - i, dr);
            }
        }
Exemplo n.º 5
0
        private void toolStripMenuItem_MoveUp_Click(object sender, EventArgs e)
        {
            DSkinGridListRow dr_SelFirst = dSkinGridList_PlayList_LocalList.SelectedItems[0];
            int index = dSkinGridList_PlayList_LocalList.Rows.IndexOf(dr_SelFirst);

            if (0 == index)
            {
                return;
            }

            for (int i = 0; i < dSkinGridList_PlayList_LocalList.SelectedItems.Count; i++)
            {
                DSkinGridListRow dr = dSkinGridList_PlayList_LocalList.SelectedItems[i];
                string           strFileFullName = dr.Cells[2].Text;
                dSkinGridList_PlayList_LocalList.Rows.Remove(dSkinGridList_PlayList_LocalList.SelectedItems[i]);
                dSkinGridList_PlayList_LocalList.Rows.Insert(index - 1 + i, dr);
            }
            ReadLocalList();
        }
Exemplo n.º 6
0
        private void toolStripMenuItem_PlayFromStart_Click(object sender, EventArgs e)
        {
            mainfrm.b_PlayTV = false;
            DSkinGridListRow dr = dSkinGridList_PlayList_LocalList.SelectedItem;

            if (dr == null)
            {
                mainfrm.OpenFile();
            }
            else
            {
                string str_LocalURL = dr.Cells[2].Text;
                if (str_LocalURL == "")
                {
                    return;
                }
                mainfrm.OpenFile(str_LocalURL, 0);

                Console.WriteLine(str_LocalURL);
            }
        }
Exemplo n.º 7
0
        private void PlaySelectedLocalFile()
        {
            mainfrm.b_PlayTV = false;
            DSkinGridListRow dr = dSkinGridList_PlayList_LocalList.SelectedItem;

            if (dr == null)
            {
                mainfrm.OpenFile();
            }
            else
            {
                string str_LocalURL = dr.Cells[2].Text;
                if (str_LocalURL == "")
                {
                    return;
                }
                mainfrm.str_NowPlaying = Path.GetFileName(str_LocalURL);
                //int nPosition = Convert.ToInt32(dr.Cells[3].Text);
                mainfrm.OpenFile(str_LocalURL, -1);

                Console.WriteLine(str_LocalURL);
            }
        }
Exemplo n.º 8
0
        private void FileInfoFrm_Load(object sender, EventArgs e)
        {
            InitGridList();
            SetColumnWidth();
            mainfrm         = (MainForm)this.Owner;
            this.BackColor  = Color.FromArgb(mainfrm.n_BackColorTransparency, this.BackColor);
            this.EnabledDWM = mainfrm.b_EnableDWM;
            //if (mainfrm.b_ImageFuzzy)
            //{
            //    Bitmap bt = mainfrm.BackImageCurrent;
            //    Rectangle rect = new Rectangle(0, 0, bt.Width, bt.Height);
            //    DSkin.ImageEffects.GaussianBlur(bt, ref rect, 20, false);
            //    this.BackgroundImage = bt;
            //}
            //else
            //{
            //    this.BackgroundImage = mainfrm.BackImageCurrent;
            //}
            //this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
            if (mainfrm.axPlayer1.GetState() == (int)PublicClass.PLAY_STATE.PS_PLAY)
            {
                if (!mainfrm.b_PlayTV)
                {
                    string str_Url = mainfrm.axPlayer1.GetConfig(4);
                    try
                    {
                        int n_MaxGongYueShu = MaxGongYueShu(mainfrm.axPlayer1.GetVideoWidth(), mainfrm.axPlayer1.GetVideoHeight());

                        dSkinGridList_FileInfo.Rows.AddRow("文件名", Path.GetFileName(str_Url));
                        dSkinGridList_FileInfo.Rows.AddRow("文件类型", Path.GetExtension(str_Url).Replace(".", ""));
                        dSkinGridList_FileInfo.Rows.AddRow("文件路径", Path.GetDirectoryName(str_Url));
                        dSkinGridList_FileInfo.Rows.AddRow("文件大小", (Convert.ToInt64(mainfrm.axPlayer1.GetConfig(5)) / 1024 / 1024).ToString() + "MB (" + mainfrm.axPlayer1.GetConfig(5) + " bytes)");
                        dSkinGridList_FileInfo.Rows.AddRow("文件尺寸", mainfrm.axPlayer1.GetVideoWidth().ToString() + " x " + mainfrm.axPlayer1.GetVideoHeight().ToString()
                                                           + " (画面比例 " + (mainfrm.axPlayer1.GetVideoWidth() / n_MaxGongYueShu).ToString() + ":"
                                                           + (mainfrm.axPlayer1.GetVideoHeight() / n_MaxGongYueShu).ToString() + ")");
                        dSkinGridList_FileInfo.Rows.AddRow("文件长度", FileHelper.GetAccurateTime(mainfrm.axPlayer1.GetDuration()));
                        dSkinGridList_FileInfo.Rows.AddRow("文件创建时间", FileHelper.GetFileCreateTime(str_Url));
                        dSkinGridList_FileInfo.Rows.AddRow("上次访问时间", FileHelper.GetFileLastAccessTime(str_Url));

                        for (int i = 0; i < dSkinGridList_FileInfo.RowCount; i++)
                        {
                            DSkinGridListRow dr = dSkinGridList_FileInfo.Rows[i];
                            for (int j = 0; j < dr.Cells.Count; j++)
                            {
                                DSkinGridListCell dc = dr.Cells[j];
                                Font font            = new Font("宋体", 9, FontStyle.Regular);
                                dc.Font = font;
                            }
                        }

                        dSkinGridList_FileInfo.LayoutContent();
                    }
                    catch { }
                }
                else
                {
                    int n_MaxGongYueShu = MaxGongYueShu(mainfrm.axPlayer1.GetVideoWidth(), mainfrm.axPlayer1.GetVideoHeight());
                    dSkinGridList_FileInfo.Rows.AddRow("文件名", mainfrm.TitleBarPanel.Text);
                    dSkinGridList_FileInfo.Rows.AddRow("文件尺寸", mainfrm.axPlayer1.GetVideoWidth().ToString() + " x " + mainfrm.axPlayer1.GetVideoHeight().ToString()
                                                       + " (画面比例 " + (mainfrm.axPlayer1.GetVideoWidth() / n_MaxGongYueShu).ToString() + ":"
                                                       + (mainfrm.axPlayer1.GetVideoHeight() / n_MaxGongYueShu).ToString() + ")");
                    dSkinGridList_FileInfo.LayoutContent();
                }
            }
        }