73a8c03fa1
and added some options to the menu that changes the behaviour of the app. such as turning on/off the auto playing of files and the directory and volume control. this is all kept persistent using an IDM formated file in the app's config directory. still having issues with it not calculating the durations properly but i now know why. it's because QMediaPlayer can't calculate the durations of VBR files (variable bit- rate) properly. other than that, everything seems to be working perfectly. i'll add more feasures such as a next/previous file button and a stop button.
63 lines
1.2 KiB
C++
63 lines
1.2 KiB
C++
#ifndef UI_H
|
|
#define UI_H
|
|
|
|
#include <QWidget>
|
|
#include <QMainWindow>
|
|
#include <QVBoxLayout>
|
|
#include <QHBoxLayout>
|
|
#include <QSlider>
|
|
#include <QLabel>
|
|
#include <QDir>
|
|
#include <QFile>
|
|
#include <QMediaPlayer>
|
|
#include <QFileDialog>
|
|
#include <QStringList>
|
|
#include <QMessageBox>
|
|
#include <QFont>
|
|
#include <QApplication>
|
|
#include <QTimer>
|
|
#include <QToolButton>
|
|
#include <QMenu>
|
|
#include <QSystemTrayIcon>
|
|
#include <QIcon>
|
|
|
|
#include "icon.h"
|
|
#include "../io/aud_file.h"
|
|
#include "../io/conf.h"
|
|
|
|
class Ui : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
private:
|
|
|
|
QLabel *fileName;
|
|
QSlider *slider;
|
|
QMediaPlayer *player;
|
|
AudFile *ioDev;
|
|
QToolButton *settings;
|
|
QSystemTrayIcon *trayIcon;
|
|
Conf *conf;
|
|
QMenu *menu;
|
|
Icon *pausePlay;
|
|
Icon *open;
|
|
bool pressed;
|
|
|
|
private slots:
|
|
|
|
void error(QMediaPlayer::Error error);
|
|
void sliderPressed();
|
|
void sliderReleased();
|
|
void posChanged(qint64 pos);
|
|
void durChanged(qint64 len);
|
|
void openDialog();
|
|
void nextFile();
|
|
void play(const QString &path);
|
|
|
|
public:
|
|
|
|
Ui(const QStringList &args, QWidget *parent = 0);
|
|
};
|
|
|
|
#endif // UI_H
|