2016-10-03 00:47:02 -04:00
|
|
|
#ifndef UI_H
|
|
|
|
#define UI_H
|
|
|
|
|
|
|
|
#include <QWidget>
|
2016-10-16 17:04:21 -04:00
|
|
|
#include <QMainWindow>
|
2016-10-03 00:47:02 -04:00
|
|
|
#include <QVBoxLayout>
|
|
|
|
#include <QHBoxLayout>
|
|
|
|
#include <QSlider>
|
|
|
|
#include <QLabel>
|
|
|
|
#include <QDir>
|
|
|
|
#include <QFile>
|
2016-10-10 13:29:41 -04:00
|
|
|
#include <QMediaPlayer>
|
|
|
|
#include <QFileDialog>
|
|
|
|
#include <QStringList>
|
|
|
|
#include <QMessageBox>
|
|
|
|
#include <QFont>
|
|
|
|
#include <QApplication>
|
|
|
|
#include <QTimer>
|
2016-10-16 17:04:21 -04:00
|
|
|
#include <QToolButton>
|
|
|
|
#include <QMenu>
|
|
|
|
#include <QSystemTrayIcon>
|
|
|
|
#include <QIcon>
|
2016-10-23 21:26:58 -04:00
|
|
|
#include <QEvent>
|
|
|
|
#include <QAction>
|
|
|
|
#include <QCloseEvent>
|
|
|
|
#include <QCoreApplication>
|
2016-10-10 13:29:41 -04:00
|
|
|
|
|
|
|
#include "icon.h"
|
|
|
|
#include "../io/aud_file.h"
|
2016-10-16 17:04:21 -04:00
|
|
|
#include "../io/conf.h"
|
2016-10-03 00:47:02 -04:00
|
|
|
|
|
|
|
class Ui : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
2016-10-16 17:04:21 -04:00
|
|
|
QLabel *fileName;
|
|
|
|
QSlider *slider;
|
|
|
|
QMediaPlayer *player;
|
|
|
|
AudFile *ioDev;
|
|
|
|
QToolButton *settings;
|
|
|
|
QSystemTrayIcon *trayIcon;
|
|
|
|
Conf *conf;
|
|
|
|
QMenu *menu;
|
2016-10-23 21:26:58 -04:00
|
|
|
QMenu *trayMenu;
|
2016-10-16 17:04:21 -04:00
|
|
|
Icon *pausePlay;
|
|
|
|
Icon *open;
|
2016-10-23 21:26:58 -04:00
|
|
|
Icon *next;
|
|
|
|
Icon *prev;
|
|
|
|
Icon *stop;
|
2016-10-16 17:04:21 -04:00
|
|
|
bool pressed;
|
2016-10-10 13:29:41 -04:00
|
|
|
|
2016-10-23 21:26:58 -04:00
|
|
|
void fileDir(char direction);
|
|
|
|
void changeEvent(QEvent *event);
|
|
|
|
void closeEvent(QCloseEvent *event);
|
|
|
|
|
2016-10-10 13:29:41 -04:00
|
|
|
private slots:
|
|
|
|
|
|
|
|
void error(QMediaPlayer::Error error);
|
|
|
|
void sliderPressed();
|
|
|
|
void sliderReleased();
|
|
|
|
void posChanged(qint64 pos);
|
|
|
|
void openDialog();
|
|
|
|
void nextFile();
|
2016-10-23 21:26:58 -04:00
|
|
|
void prevFile();
|
|
|
|
void stopPlayer();
|
2016-10-10 13:29:41 -04:00
|
|
|
void play(const QString &path);
|
2016-10-23 21:26:58 -04:00
|
|
|
void trayActivated(QSystemTrayIcon::ActivationReason reason);
|
2016-10-03 00:47:02 -04:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
Ui(const QStringList &args, QWidget *parent = 0);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // UI_H
|