资源简介
在网上已有源码基础上修改为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 << tr(“-slave“);
args << “-quiet“;
#ifdef Q_WS_WIN
args << tr(“-wid“) << QString::number((unsigned int)(ui->widgetview->winId()));
args << “-zoom“;
args << “-vo“ << “directx:noaccel“;
#else
args << tr(“-wid“) << QString::number((unsigned int)(ui->widgetview->winId()));
args << “-zoom“;
#endif
args << fileName;
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 项目风险登记册
- 下一篇:微机接口课程设计 电子琴
相关资源
- Ubuntu Linux实用学习教程
- linux多串口通信,usb-can控制八个电机
- telnet 客户端和服务端源代码
- [Qt]Qt Creator汉化方法 qt汉化包
- qt实现音频采集
- 局域网聊天
- linux部署 kettle 超详细
- Qt自适应行高表头重载
- 基于Linux平台的网络聊天室设计
- 阿里云linux一键安装web环境sh-1.5.5.zi
- TimeDynamicListDemo.rar
- Qt实现游戏FlappyBird
- QT串口调试助手
- 基于TCP协议的QT聊天程序
- Qt加OpenGL实现鼠标控制视角
- Qt 4.8.4以及傻瓜式安装教程
- QT编写的电子书阅读器
- VM虚拟机镜像集合windowsxp windows 7wind
- Qt之生成png/jpg/bmp格式图片
- Qt开发中常用QSS样例
- QT之子窗口控件使用
- Qt做的windows运行win+r窗口
- QTopengl模块使用demo
- QT之dock使用
- QT使用openglES模块做的立方体程序
- qt做的温度计小程序
- QT计算器界面的ui文件
- qt界面跳转切换
- linux网络编程聊天工具代码
- linux C TCP/UDP客户端服务端的相互实时
评论
共有 条评论