資源簡介
QT 視頻播放,支持多種視頻播放,可以快進,快退,暫停,停止,調節聲音。如初次運行請執行,文件夾下的mplayer的mplayer.exe即可。

代碼片段和文件信息
#include?
#include?“implayer.h“
#include?“ui_implayer.h“
IMplayer::IMplayer(QWidget?*parent)?:
????QMainWindow(parent)
????ui(new?Ui::IMplayer)
{
????isMute?=?0;
????isPlay?=?1;
????isLength?=?1;
????timePos?=?0;
????timeLength?=?0;
????ui->setupUi(this);
????ui->scheduleSlider->setRange(0999);
????ui->voiceSlider->setRange(0?99);
????mplayerProcess?=?new?QProcess(this);
????mplayerProcess->setProcessChannelMode(QProcess::MergedChannels);
????//mplayerProgram?=?tr(“D:/workstation/IMplayer/mplayer/mplayer.exe“);
????mplayerProgram?=?tr(“../mplayer/mplayer.exe“);
????timeClock?=?new?QTimer(this);
????connect(mplayerProcess?SIGNAL(readyReadStandardOutput())?this?SLOT(back_Message_slot()));
????connect(timeClock?SIGNAL(timeout())?this?SLOT(back_posMessage_slot()));
}
IMplayer::~IMplayer()
{
????delete?ui;
}
void?IMplayer::setUI()
{
}
void?IMplayer::play(QString?fileName)
{
????mplayerProcess->close();
????ui->posTimeLineEdit->setText(“00:00:00“);
????ui->lengthTimeLineEdit->setText(“00:00:00“);
????ui->scheduleSlider->setValue(0);
????ui->voiceSlider->setValue(99);
????ui->playPushButton->setEnabled(1);
????ui->pausePushButton->setEnabled(1);
????ui->stopPushButton->setEnabled(1);
????ui->stepPushButton->setEnabled(1);
????ui->backPushButton->setEnabled(1);
????ui->scheduleSlider->setEnabled(1);
????ui->voiceSlider->setEnabled(1);
????ui->quietPushButton->setEnabled(1);
????QStringList?args;
????args?<????args?<“-quiet“;
????args?<“-zoom“;
????args?<widget->winId()));
????args?<“-vo“?<“directx:noaccel“;
????args?<
????timePos?=?0;
????//ui->posTimeLineEdit->setText(“00:00:00“);
????timeLength?=?1;
????isLength?=?1;
????mplayerProcess->start(mplayerProgram?args);
????mplayerProcess->write(“get_time_length\n“);
}
void?IMplayer::on_playPushButton_clicked()
{
????if(isPlay?==?0)
????{
????????mplayerProcess->write(“pause\n“);
????????isPlay?=?1;
????????timeClock->start();
????}
}
void?IMplayer::on_pausePushButton_clicked()
{
????if(isPlay?==?1)
????{
????????mplayerProcess->write(“pause\n“);
????????//timeClock->isActive()=?false;
????????isPlay?=?0;
????????timeClock->stop();
????}
}
void?IMplayer::on_stopPushButton_clicked()
{
????timeClock->stop();
????mplayerProcess->write(“pausing_keep?stop\n“);
????ui->posTimeLineEdit->setText(“00:00:00“);
????ui->lengthTimeLineEdit->setText(“00:00:00“);
????ui->scheduleSlider->setValue(0);
????ui->voiceSlider->setValue(99);
????ui->playPushButton->setDisabled(1);
????ui->pausePushButton->setDisabled(1);
????ui->stopPushButton->setDisabled(1);
????ui->stepPushButton->setDisabled(1);
????ui->backPushButton->setDisabled(1);
????ui->scheduleSlider->setDisabled(1);
????ui->voiceSlider->setDisabled(1);
????ui->quietPushButton->setIcon(QIcon(tr(“:/images/images/voice.png“)));
????ui-
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????9972??2009-11-02?14:45??IMpla
?????文件??????10781??2009-11-02?14:45??IMpla
?????文件???????2073??2006-10-20?15:26??IMpla
?????文件???????9057??2009-11-02?14:45??IMpla
?????文件???????9748??2009-11-02?14:45??IMpla
?????文件??????17669??2010-08-17?11:04??IMpla
?????文件??????10015??2009-11-02?14:45??IMpla
?????文件???????9351??2009-11-02?14:45??IMpla
?????文件???????5896??2009-11-02?14:46??IMpla
?????文件??????18217??2010-08-17?10:59??IMpla
?????文件????????445??2010-08-17?11:06??IMpla
?????文件???????7209??2010-09-03?11:28??IMpla
?????文件???????1401??2010-09-01?08:45??IMpla
?????文件????????362??2010-08-19?15:55??IMpla
?????文件??????37243??2013-04-03?13:39??IMpla
?????文件??????13571??2010-09-03?11:40??IMpla
?????文件??????16997??2010-08-30?09:33??IMpla
?????文件????????191??2010-09-01?13:09??IMpla
?????文件????1149147??2010-09-03?11:28??IMpla
?????文件?????489974??2010-09-03?11:28??IMpla
?????文件?????114801??2010-09-03?10:50??IMpla
?????文件???????4030??2010-09-03?10:50??IMpla
?????文件?????129484??2010-09-03?10:50??IMpla
?????文件????????500??2010-08-16?11:00??IMpla
?????文件?????535942??2010-08-17?11:21??IMpla
?????文件?????110762??2010-08-17?11:21??IMpla
?????文件???????6245??2010-08-19?16:04??IMpla
?????文件???????6748??2010-08-19?16:04??IMpla
?????文件???????6843??2010-08-19?16:04??IMpla
?????文件??????16528??2010-08-30?09:33??IMpla
............此處省略68個文件信息
評論
共有 條評論