【vc++精品源码栏目提醒】:网学会员,鉴于大家对vc++精品源码十分关注,论文会员在此为大家搜集整理了“精品论文_基于MFC的多媒体播放器的实现 - 期刊论文”一文,供大家参考学习!
信息技术 年第 3 期 2009Information Technology 中图分类号 :TP311 文献标识码 :A 文章编号 :1009 - 2552 2009 03 - 0080 - 03 基于 MFC 的多媒体播放器的实现 1 2 刘雅琴 夏玉杰 1. 洛阳师范学院信息技术学院 洛阳 471022 2. 洛阳师范学院物理与电子信息学院 洛阳 471022 要 摘 : 在VC 6. 0 平台上利用 Windows Media Player 控件实现了在程序中播放一段视频和音频 的功能 。
测试结果证明该方法简单易行 极大缩短了程序的开发时间 。
关键词 : MFC 控件 消息 ActiveX Realization of multimedia player based on MFC LIU Ya2qin XIA Yu2jie 1 2 1. College of Information Technology Luoyang Normal University Luoyang 471022 China 2. College of Physics and Electronic Information Luoyang Normal University Luoyang 471022 China Abstract : This paper realizes the functions of playing a section of video and audio using Windows Media Player control on the paltform of VC 6. 0. The test results show that this method is simple and shortens development time of the program greatly. Key words : MFC control message ActiveX0 引言 CWMPSettings 负责播放器的基本设置等 。
下面以 MFC Microsoft Foundation Class 是 用 来 编 写 windows media player10 为例列出它的常用类和方法 Windows 应用程序的 C 类集 其中封装了大部分 见表 1 。
Windows API 函数和 Windows 控件 使用 MFC 类库和 2 基于 MFC 的多媒体播放器的实现Visual C 提供的高度可视的应用程序开发工具 本系统利用 windows media player 控件 在VC 平可使应用程序开发变得简单 提高代码的可靠性和 台上 实现播放、 暂停、继续和停止音频视频文件。
其 1 - 2 可重用性 。
随着多媒体性能的极大提升 程序 实现步骤为 下面的源码中粗斜体字为添加的代码 :中经常要播放一段视频或者一段音频 如果能够简 1 创建一个项目文件 名称为 PlayMedia单地插入音频和视频 将极大缩短程序的开发时 打开 VisualC 6. 0 使用 AppWizard exe 建立 一个 MFC SDI 的应用程序 项目文件名称为 Play2 3 间 。
本 文 基 于 MFC 在 Visual C 环 境 下 利 用Windows Media Player 控件实现了音频视频文件的 Media 。
播放 。
2 激活添加 ActiveX 控件对话框 并插入 Win21 Windows Media Player 播放器 dows Media Player 控件 在程序中简单地插入视频和音频 可以采用 在项目创建完成后 需要通过 Project Add ToWindows Media Player 控件来完成该任务 。
4 Project Components and Controls 菜单项目激活添加 Windows Media Player 是 Windows 系统自带的媒 ActiveX 控件对话框 然后选择 Windows Media Player 体播放器 通常 简 称 WMP 可 以 播 放 MP3 WMA 点击 Insert 按钮向项目中插入该控件 。
该版本的控WAV 等音频文件 视频方面可以播放 AVI MPEG 1 2 “ 件名为 Windows Media Player ” 相应的控件文件变 2安装 DVD 解码器以后可以播放 MPEG 2 DVD 等 。
为 wmp . dll 。
Windows Media Player 控件将功能封装在多个类中 收稿日期 : 2008 - 07 - 14每个类负责逻辑上相对独立的一组功能 CWMP2 作者简介 : 刘雅琴 1969 - 女 副教授 硕士 1994 年本科毕业于河Player4 类负责与 Windows Media Player 控件进行交 南师范大学 2004 年在西安电子科技大学获取硕士学互 。
CWMPControls 类 负 责 对 媒 体 播 放 的 控 制 位 主要研究方向为多媒体技术 。
— 80 — 表1 Windows Media Player10 常用的类与方法 ∏ BOOL m - bPaused ∏记录暂停状态的变量 类 方法 说明 ∏ ∏ Operations GetCurrentMedia 获得当前的媒体对象 …… GetControls 返回