資源簡介
在網(wǎng)上已有源碼基礎上修改為ubuntu下可用 源程序在windows下運行正常
代碼片段和文件信息
#include?
#include?“implayer.h“
#include?“ui_implayer.h“
#include?
#include
#include
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(“/usr/bin/mplayer“);
????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“;
#ifdef?Q_WS_WIN
????args?<widgetview->winId()));
????args?<“-zoom“;
????args?<“-vo“?<“directx:noaccel“;
#else
????args?<widgetview->winId()));
????args?<“-zoom“;
#endif
????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);
?
- 上一篇:PMP 項目風險登記冊
- 下一篇:微機接口課程設計 電子琴
評論
共有 條評論