qt播放器qt mediaplayer

上传者: fenger_lfl | 上传时间: 2022-12-31 23:28:39 | 文件大小: 1.5MB | 文件类型: RAR
在网上找了一个别人的旧版本的播放器~自己更改了一天,终于可运行了,希望分享下同共学习; 不过出了少少问题:希望有经验的一起指导下: 运行环境:qt creator +windows 1、原计划是可支持视频播放的,现在只能加载间频(mp3),一加载视频就卡死 2.、自定义的进度条不起作用,不知为什么百分比槽连接不成功 connect(wmp, SIGNAL(PositionChange(double, double)),this, SLOT(Slot_onPositionChange(double, double))); 3、我用的是QAxWidget控件,这个是不是只支持windows的呢?或者还有没其实更好的? /******************************************************************************************* 项目名:QT播放器 Qt Mediaplayer 工程师:枫儿 完成时间:2009年12月28日 技术支持:嵌入式家园 www.studyarm.cn www.mcupark.com *******************************************************************************************/ #include "playerwindow.h" #include #include #include #include #include #include #include #include PlayerWindow::PlayerWindow() { //setCaption(tr("Media Player")); fileFilters = tr("Video files (*.mpg *.mpeg *.avi *.wmv)\n" //原来字符串换行也可这样用 "Audio files (*.mp3 *.wav)"); updateTimer = 0; setMouseTracking(true); this->wmp = new QAxWidget(this); wmp->setControl("{22D6F312-B0F6-11D0-94AB-0080C74C7E95}"); // wmp->setProperty("ShowControls", QVariant(false, 0)); wmp->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding); connect(wmp, SIGNAL(PlayStateChange(int, int)),this, SLOT(Slot_onPlayStateChange(int, int))); connect(wmp, SIGNAL(ReadyStateChange(ReadyStateConstants)),this, SLOT(Slot_onReadyStateChange(ReadyStateConstants))); connect(wmp, SIGNAL(PositionChange(double, double)),this, SLOT(Slot_onPositionChange(double, double))); this->openButton = new QPushButton(tr("&Open")); connect(openButton, SIGNAL(clicked()), this, SLOT(Slot_openFile())); this->playPauseButton = new QPushButton(tr("&Play")); connect(playPauseButton, SIGNAL(clicked()), wmp, SLOT(Play())); this->stopButton = new QPushButton(tr("&Stop")); connect(stopButton, SIGNAL(clicked()), wmp, SLOT(Stop())); this->seekSlider = new QSlider(Qt::Horizontal, this); seekSlider->setEnabled(false); connect(seekSlider, SIGNAL(valueChanged(int)),this, SLOT(Slot_sliderValueChanged(int))); connect(seekSlider, SIGNAL(sliderPressed()),wmp, SLOT(Pause())); QHBoxLayout *buttonLayout = new QHBoxLayout; buttonLayout->addWidget(openButton); buttonLayout->addWidget(playPauseButton); buttonLayout->addWidget(stopButton); QVBoxLayout *mainLayout = new QVBoxLayout(this); mainLayout->addWidget(wmp); mainLayout->addLayout(buttonLayout); mainLayout->addWidget(seekSlider); this->setLayout(mainLayout); }

文件下载

资源详情

[{"title":"( 24 个子文件 1.5MB ) qt播放器qt mediaplayer","children":[{"title":"QTmediaplayer","children":[{"title":"main.cpp <span style='color:#111;'> 639B </span>","children":null,"spread":false},{"title":"QTmediaplayer.suo <span style='color:#111;'> 10.50KB </span>","children":null,"spread":false},{"title":"QTmediaplayer.pro <span style='color:#111;'> 104B </span>","children":null,"spread":false},{"title":"QTmediaplayer.sln <span style='color:#111;'> 965B </span>","children":null,"spread":false},{"title":"vc80.pdb <span style='color:#111;'> 404.00KB </span>","children":null,"spread":false},{"title":"QTmediaplayer.vcproj.FENGER.fenger01.user <span style='color:#111;'> 1.38KB </span>","children":null,"spread":false},{"title":"QTmediaplayer.pro.user <span style='color:#111;'> 15.53KB </span>","children":null,"spread":false},{"title":"QTmediaplayer.vcproj.4EC093DAC072419.Administrator.user <span style='color:#111;'> 1.40KB </span>","children":null,"spread":false},{"title":"Makefile.Debug <span style='color:#111;'> 5.53KB </span>","children":null,"spread":false},{"title":"release","children":null,"spread":false},{"title":"QTmediaplayer.vcproj <span style='color:#111;'> 9.00KB </span>","children":null,"spread":false},{"title":"Makefile.Release <span style='color:#111;'> 5.58KB </span>","children":null,"spread":false},{"title":"playerwindow.cpp <span style='color:#111;'> 4.44KB </span>","children":null,"spread":false},{"title":"QTmediaplayer.ncb <span style='color:#111;'> 2.86MB </span>","children":null,"spread":false},{"title":"vc80.idb <span style='color:#111;'> 387.00KB </span>","children":null,"spread":false},{"title":"playerwindow.h <span style='color:#111;'> 1.40KB </span>","children":null,"spread":false},{"title":"Makefile <span style='color:#111;'> 5.83KB </span>","children":null,"spread":false},{"title":"debug","children":[{"title":"BuildLog.htm <span style='color:#111;'> 7.95KB </span>","children":null,"spread":false},{"title":"moc_playerwindow.o <span style='color:#111;'> 463.64KB </span>","children":null,"spread":false},{"title":"QTmediaplayer.exe <span style='color:#111;'> 2.23MB </span>","children":null,"spread":false},{"title":"moc_playerwindow.cpp <span style='color:#111;'> 3.26KB </span>","children":null,"spread":false},{"title":"main.obj <span style='color:#111;'> 37.98KB </span>","children":null,"spread":false},{"title":"main.o <span style='color:#111;'> 460.86KB </span>","children":null,"spread":false},{"title":"moc_playerwindow.obj <span style='color:#111;'> 37.83KB </span>","children":null,"spread":false},{"title":"playerwindow.o <span style='color:#111;'> 595.06KB </span>","children":null,"spread":false}],"spread":false}],"spread":false}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明