• 大小: 261KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-04
  • 语言: C#
  • 标签:

资源简介

支持mp3 mp4,avi,wma,rm等等

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using QuartzTypeLib;//播放器
using System.Runtime.InteropServices;//播放声音
namespace MYplayer
{
    public partial class mediaplayer : Form
    {
        private System.ComponentModel.IContainer components;
        private const int WM_APP = 0x8000;
        private const int WM_GRAPHNOTIFY = WM_APP + 1;
        private const int EC_COMPLETE = 0x01;
        private const int WS_CHILD = 0x40000000;
        private const int WS_CLIPCHILDREN = 0x2000000;

        private FilgraphManager m_objFilterGraph = null;
        private IBasicAudio m_objBasicAudio = null;
        private IVideoWindow m_objVideoWindow = null;
        private IMediaEvent m_objMediaEvent = null;
        private IMediaEventEx m_objMediaEventEx = null;
        private IMediaPosition m_objMediaPosition = null;
        private IMediaControl m_objMediaControl = null;
        enum MediaStatus { None Stopped Paused Running };
        private MediaStatus m_CurrentStatus = MediaStatus.None;
        OpenFileDialog openFileDialog;

        private int second = 0;
        private int minute = 0;
        private int hour = 0;
        private bool flag = false;
        

        public mediaplayer()
        {
            InitializeComponent();
            this.tsbt_open.Enabled = true;
            this.tsbt_play.Enabled = false;
            this.tsbt_stop.Enabled = false;
            this.tsbt_pause.Enabled = false;
           
        }

        

        private void tsbt_play_Click(object sender EventArgs e)
        {
            
            m_objMediaControl.Run();
            m_CurrentStatus = MediaStatus.Running;
            this.tsbt_play.Enabled = false;
            this.tsbt_stop.Enabled = true;
            this.tsbt_pause.Enabled = true;
            this.flag = true;
           
        }
        //播放文件

        private void tsbt_pause_Click(object sender EventArgs e)
        {
            m_objMediaControl.Pause();
            m_CurrentStatus = MediaStatus.Paused;
            this.tsbt_play.Enabled = true;
            this.tsbt_stop.Enabled = true;
            this.tsbt_pause.Enabled = false;
            this.flag = false;
        }
        //暂停播放

        private void tsbt_stop_Click(object sender EventArgs e)
        {
            m_objMediaControl.Stop();
            m_objMediaPosition.CurrentPosition = 0;
            m_CurrentStatus = MediaStatus.Stopped;
            CleanUp();
            this.tsbt_play.Enabled = false;
            this.tsbt_stop.Enabled = false;
            this.tsbt_pause.Enabled = false;
            ToolStripMenuItem_play.Enabled = false;
            
            this.flag = false;
            
        }
        //停止播放

        private void tsbt_close_Click(object sender EventArgs e)
        {
          

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件     516096  2006-08-18 11:50  MYplayer\MYplayer\bin\Debug\IrisSkin2.dll

     文件      30720  2009-04-16 21:51  MYplayer\MYplayer\bin\Debug\MYplayer.exe

     文件      32256  2009-04-16 21:51  MYplayer\MYplayer\bin\Debug\MYplayer.pdb

     文件      14328  2009-04-17 12:27  MYplayer\MYplayer\bin\Debug\MYplayer.vshost.exe

     文件        490  2007-07-21 01:33  MYplayer\MYplayer\bin\Debug\MYplayer.vshost.exe.manifest

     文件      16262  2006-03-22 12:32  MYplayer\MYplayer\bin\Debug\OneBlue.ssk

     文件      18944  2007-12-07 08:45  MYplayer\MYplayer\bin\Debug\QuartzTypeLib.dll

     文件      13180  2006-03-22 06:00  MYplayer\MYplayer\bin\Debug\XPOrange.ssk

     文件      18944  2007-12-07 08:45  MYplayer\MYplayer\bin\QuartzTypeLib.dll

     文件      10581  2009-04-16 21:51  MYplayer\MYplayer\mediaplayer.cs

     文件      15115  2009-04-16 21:48  MYplayer\MYplayer\mediaplayer.Designer.cs

     文件      25705  2009-04-16 21:48  MYplayer\MYplayer\mediaplayer.resx

     文件       3889  2009-04-16 21:48  MYplayer\MYplayer\MYplayer.csproj

     文件        168  2009-04-15 22:30  MYplayer\MYplayer\MYplayer.csproj.user

     文件        853  2009-04-17 12:27  MYplayer\MYplayer\obj\Debug\MYplayer.csproj.FileListAbsolute.txt

     文件        853  2009-04-16 21:48  MYplayer\MYplayer\obj\Debug\MYplayer.csproj.GenerateResource.Cache

     文件      30720  2009-04-16 21:51  MYplayer\MYplayer\obj\Debug\MYplayer.exe

     文件      13272  2009-04-16 21:49  MYplayer\MYplayer\obj\Debug\MYplayer.mediaplayer.resources

     文件      32256  2009-04-16 21:51  MYplayer\MYplayer\obj\Debug\MYplayer.pdb

     文件        180  2009-04-16 21:49  MYplayer\MYplayer\obj\Debug\MYplayer.Properties.Resources.resources

     文件       6728  2009-04-16 21:48  MYplayer\MYplayer\obj\Debug\ResolveAssemblyReference.cache

     文件       4608  2009-04-15 22:31  MYplayer\MYplayer\obj\Debug\TempPE\Properties.Resources.Designer.cs.dll

     文件        310  2007-12-07 08:51  MYplayer\MYplayer\obj\MYplayer.csproj.FileList.txt

     文件        474  2007-12-07 08:47  MYplayer\MYplayer\Program.cs

     文件       1174  2007-12-07 08:38  MYplayer\MYplayer\Properties\AssemblyInfo.cs

     文件       2840  2009-04-15 22:31  MYplayer\MYplayer\Properties\Resources.Designer.cs

     文件       5612  2007-12-07 08:38  MYplayer\MYplayer\Properties\Resources.resx

     文件       1106  2009-04-15 22:31  MYplayer\MYplayer\Properties\Settings.Designer.cs

     文件        249  2007-12-07 08:38  MYplayer\MYplayer\Properties\Settings.settings

     文件        914  2009-04-15 22:31  MYplayer\MYplayer.sln

............此处省略19个文件信息

评论

共有 条评论

相关资源