JustAudio/io/conf.h
Maurice O'Neal c3ec7e7085 made better use of Ui::trayActivated() so it can not only display the
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.
2016-10-25 20:00:33 -04:00

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