问题描述
- 基于madplay 用QT写播放软件的问题
-
QT版本 QT5.5
PC平台 ubunt 14.04 32位操作系统
应用平台CW210开发板
项目目的
基于madplay工具,通过QT,制作一款mp3播放软件
软件功能 播放/暂停/继续/停止/上一首/下一首/音量增/音量减
目前已经实现了播放功能,
但是实习不了其他功能,
以下是代码
**********************************************************
T-Car.pro
------------------------------------------------------------------------------------------------------------
######################################################################Automatically generated by qmake (2.01a) ?? 9? 19 16:29:07 2015
######################################################################
TEMPLATE = app
TARGET =
DEPENDPATH += .
INCLUDEPATH += .
INCLUDEPATH += /opt/project/hwlib/
LIBS += -L/opt/project/hwlib/ -lmp3Input
HEADERS += t_car.h
mp3thread.h
FORMS += t_car.ui
SOURCES += main.cpp t_car.cpp
mp3thread.cpp
t_car.h ------------------------------------------------------------------------------------------------ #ifndef T_CAR_H
#define T_CAR_H
#include
#include
#include
#include
#include "mp3thread.h"
#include "mp3.h"namespace Ui {
class T_Car;
}class T_Car : public QMainWindow
{
Q_OBJECTpublic:
explicit T_Car(QWidget *parent = 0);
~T_Car();private slots:
void on_mp3_play_on_clicked();
void on_mp3_play_stop_clicked();
void on_mp3_play_continue_clicked();
void on_mp3_turn_last_clicked();
void on_mp3_turn_lould_clicked();
void on_mp3_turn_low_clicked();
void on_mp3_next_song_clicked();
void on_mp3_play_pause_clicked();private:
Ui::T_Car *ui;
mp3thread *mp3_thread;
};#endif // T_CAR_H
mp3thread.h
#ifndef MP3THREAD_H
#define MP3THREAD_H#include
#include "mp3.h"class mp3thread:public QThread
{
Q_OBJECT
public:
explicit mp3thread(QObject *parent= 0);
void run(void);signals:
public slots:
};
#endif // MP3THREAD_H
mp3thread.cpp
#include "mp3thread.h"
mp3thread::mp3thread(QObject *parent):QThread(parent)
{}
void mp3thread::run(){
printf("*********************************
");
mp3_start();
}
t_car.cpp
#include "t_car.h"
#include "ui_t_car.h"T_Car::T_Car(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::T_Car)
{
ui->setupUi(this);
mp3_thread = new mp3thread();
}T_Car::~T_Car()
{
delete ui;
}void T_Car::on_mp3_play_on_clicked()
{
mp3_thread->start();
}void T_Car::on_mp3_play_stop_clicked()
{
mp3_config('s');
mp3_thread->terminate();
}void T_Car::on_mp3_play_continue_clicked()
{
mp3_config('c');
}void T_Car::on_mp3_turn_last_clicked()
{
mp3_config('f');
}void T_Car::on_mp3_turn_lould_clicked()
{
mp3_config('+');
}void T_Car::on_mp3_turn_low_clicked()
{
mp3_config('-');
}void T_Car::on_mp3_next_song_clicked()
{
mp3_config('>');
}void T_Car::on_mp3_play_pause_clicked()
{
mp3_config('p');
}
main.cpp
#include "t_car.h"
#includeint main(int argc, char *argv[])
{
QApplication a(argc, argv);
T_Car w;
w.show();return a.exec();
}
解决方案
http://www.pudn.com/downloads421/sourcecode/unix_linux/detail1782712.html
解决方案二:
解决某些qt软件的乱码问题