-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainwindow.h
73 lines (65 loc) · 1.8 KB
/
mainwindow.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMenu>
#include <QWidget>
#include <QLayout>
#include <QMenuBar>
#include <QSplitter>
#include <QTreeView>
#include <QStandardItemModel>
#include "rightwidget.h"
#include "player.h"
#include "toast.h"
class MainWindow : public QWidget
{
Q_OBJECT
public:
MainWindow(QWidget *parent = 0);
~MainWindow();
public:
void init_player(Player* player);
void init_lockFile(QLockFile* file);
Toast *m_toast;
private:
void init_widget(void);
void init_menu(void);
void init_leftWidget(void);
void init_rightWidget(void);
void init_contextMenu(void);
void timerEvent(QTimerEvent *event);
void removeItem(int index);
void saveData(void);
private:
QVBoxLayout *m_mainLayout;
QSplitter *m_mainWidget;
QMenuBar *m_menuBar;
QMenu *m_fileMenu;
QMenu *m_helpMenu;
QMenu *m_contextMenu;
QAction *m_addMusic;
QAction *m_exit;
QAction *m_about;
QTreeView *m_musicListWidget;
QStandardItemModel *m_musicListModel;
RightWidget *m_rightWidget;
private:
Player *_m_player;
QLockFile *_m_lockFile;
int _m_removeId;
static QString sm_userDb;
const std::vector<std::pair<int, QString> >* _m_lyricsList;
private slots:
void AddMusic();
void About();
void PlayMusic(const QModelIndex &);
void Play(bool custom = false);
void Next();
void Prev();
void positionChange(qint64 pos);
void GetMetaInfo();
void ChangePositionCustom();
void contextMenu(QPoint p);
void remove(bool r);
};
void ShowToast( MainWindow* obj, const QString msg );
#endif // MAINWINDOW_H