10e5af0588
working, also added svg icons to the user interface. the settings button currently does nothing (still work in progress). during testing, i discovered QMediaPlayer would have trouble playing some music files that have an ID3 tag so AudFile was created as a way to read the size of the ID3 tag and step over it when QMediaPlayer reads from the file. although it fixed the playback issue, QMediaPlayer is now having trouble calculating the duration properly without the tag. i already have a solution to the porblem in mind, more to come in the next commit.
58 lines
1.0 KiB
C++
58 lines
1.0 KiB
C++
#ifndef UI_H
|
|
#define UI_H
|
|
|
|
#include <QWidget>
|
|
#include <QVBoxLayout>
|
|
#include <QHBoxLayout>
|
|
#include <QSlider>
|
|
#include <QLabel>
|
|
#include <QDir>
|
|
#include <QFile>
|
|
#include <QMediaPlayer>
|
|
#include <QUrl>
|
|
#include <QFileDialog>
|
|
#include <QStringList>
|
|
#include <QMessageBox>
|
|
#include <QFont>
|
|
#include <QApplication>
|
|
#include <QRect>
|
|
#include <QDesktopWidget>
|
|
#include <QTimer>
|
|
|
|
#include "icon.h"
|
|
#include "../io/aud_file.h"
|
|
|
|
class Ui : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
private:
|
|
|
|
QLabel *fileName;
|
|
QSlider *slider;
|
|
QMediaPlayer *player;
|
|
AudFile *ioDev;
|
|
Icon *pausePlay;
|
|
Icon *settings;
|
|
Icon *open;
|
|
QString fileDir;
|
|
bool pressed;
|
|
|
|
private slots:
|
|
|
|
void error(QMediaPlayer::Error error);
|
|
void sliderPressed();
|
|
void sliderReleased();
|
|
void posChanged(qint64 pos);
|
|
void durationChanged(qint64 len);
|
|
void openDialog();
|
|
void nextFile();
|
|
void play(const QString &path);
|
|
|
|
public:
|
|
|
|
Ui(const QStringList &args, QWidget *parent = 0);
|
|
};
|
|
|
|
#endif // UI_H
|