c3ec7e7085
context menu, it will also show the app when double clicked. AudFile::getDuration() and AudFile::duration() can now calculate the length of the audio based on the rate at which QMediaPlayer calls AudFile::seek() and the amount of data it pulls at a time. it converts that time internally to a string, where it is then used to display on Ui::timeDisp. i've also modified the minimize to tray function as a feasure that can be turned on/off within Conf and added the needed check box to the config menu.
81 lines
1.3 KiB
C++
81 lines
1.3 KiB
C++
#ifndef CONF_H
|
|
#define CONF_H
|
|
|
|
#include <QObject>
|
|
#include <QWidgetAction>
|
|
#include <QMenu>
|
|
#include <QSlider>
|
|
#include <QWidget>
|
|
#include <QHBoxLayout>
|
|
#include <QLabel>
|
|
#include <QCheckBox>
|
|
#include <QFile>
|
|
#include <QDir>
|
|
#include <QApplication>
|
|
|
|
#include "idm.h"
|
|
#include "../gui/icon.h"
|
|
|
|
class MenuItem : public QWidgetAction
|
|
{
|
|
Q_OBJECT
|
|
|
|
private:
|
|
|
|
QString str;
|
|
QWidget *wid;
|
|
|
|
QWidget *createWidget(QWidget *parent);
|
|
|
|
public:
|
|
|
|
MenuItem(const QString &label, QWidget *widget, QObject *parent = 0);
|
|
};
|
|
|
|
class Conf : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
private:
|
|
|
|
enum DataType
|
|
{
|
|
LAST_PATH = 1,
|
|
NEXT_FILE,
|
|
VOLUME,
|
|
TRAY_ICON
|
|
};
|
|
|
|
QString lastPath;
|
|
bool showTrayIcon;
|
|
bool nextFileState;
|
|
int volumeValue;
|
|
|
|
void sync();
|
|
QString confPath();
|
|
|
|
public slots:
|
|
|
|
void setLastPath(const QString &path);
|
|
void setNextFile(bool state);
|
|
void setVolume(int value);
|
|
void setTrayIcon(bool state);
|
|
|
|
public:
|
|
|
|
QString getLastPath();
|
|
bool nextFile();
|
|
bool trayIcon();
|
|
void populateOptionsMenu(QMenu *menu, QWidget *parent);
|
|
int getVolume();
|
|
|
|
Conf(QObject *parent = 0);
|
|
|
|
signals:
|
|
|
|
void volume(int value);
|
|
void enableTrayIcon(bool state);
|
|
};
|
|
|
|
#endif // CONF_H
|