JustAudio/gui/icon.h
Maurice O'Neal 10e5af0588 I've fully written out code for the base of the app and tested to to be
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.
2016-10-10 13:29:41 -04:00

54 lines
853 B
C++

#ifndef ICON_H
#define ICON_H
#include <QWidget>
#include <QLabel>
#include <QMediaPlayer>
#include <QMouseEvent>
#include <QSvgRenderer>
#include <QPixmap>
#include <QPainter>
#include <QPaintEvent>
#include <QApplication>
#include <QRect>
#include <QDesktopWidget>
class Icon : public QLabel
{
Q_OBJECT
public:
enum IconType
{
PAUSE_PLAY,
SETTINGS,
OPEN
};
Icon(IconType t, QWidget *parent = 0);
public slots:
void stateChanged(QMediaPlayer::State state);
private:
IconType type;
QMediaPlayer::State playerState;
QString svgFile;
void mouseReleaseEvent(QMouseEvent *event);
void paintEvent(QPaintEvent *);
void loadImg(const QString &path);
signals:
void pause();
void play();
void settings();
void open();
};
#endif // ICON_H