Main.cpp
- #include <QApplication>
- #include "mplayer.h"
- int main(int argc, char **argv)
- {
- QApplication app(argc, argv);
- MPlayer player; //实例最终的MPlayer类
- player.show(); //显示界面
- return app.exec(); //运行程序
- }
- mplayer.h
- #ifndef _MPLAYER_H
- #define _MPLAYER_H
- #include <QIcon>
- #include <QProcess>
- #include <QTimer>
- #include <QStringList>
- #include <QDir>
- #include <QTime>
- #include <QString>
- #include "ui_mplayer.h"
- class MPlayer:public QDialog,private Ui_Dialog
- {
- Q_OECT
- public:
- MPlayer(QWidget *parent = 0);
- public:
- QTime int_to_time(int);
- public slots:
- void play_pause_slots(); //暂停
- void stop_slots(); //停止
- void previous_slots(); //上一曲
- void next_slots(); //下一曲
- void seek_slots(int);
- void get_time_slots(); //得到播放时间
- void set_volume_slots(int); //设置音量
- void set_sound_slots(); //静音
- void playerReward_slots(); //快退
- void playerForward_slots(); //快进
- void back_message_slots(); //更新显示信息
- private:
- QProcess *process;
- QStringList files;
- QDir directory;
- int file_count;
- QString file_name;
- bool isPlay;
- bool isSound;
- bool isStop;
- QTimer *timer;
- int file_length;
- int curr_time;
- };
- #endif
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/bofangqi/article-34872-7.html
特别好
你不靠原始股上市能发大财