-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplayerwindow.h
144 lines (121 loc) · 3.24 KB
/
playerwindow.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#ifndef PLAYERWINDOW_H
#define PLAYERWINDOW_H
#include <QApplication>
#include <QDesktopWidget>
#include <QMainWindow>
#include <QBoxLayout>
#include <QMouseEvent>
#include <QCloseEvent>
#include <QKeyEvent>
#include <QMenuBar>
#include <QList>
#include "library.h"
#include "titlebar.h"
#include "topbar.h"
#include "middleview.h"
#include "bottombar.h"
#include "player.h"
#include "login.h"
//#include "googledrive.h"
#include "maths.h"
#include "pix.h"
#include "croplabel.h"
#include "album.h"
#include "albumsong.h"
#include "artistview.h"
#include "artistlistitem.h"
#include "songmenu.h"
#include "tageditor.h"
#ifdef Q_OS_MAC
#include "objectivec.h"
#endif
class PlayerWindow : public QMainWindow
{
Q_OBJECT
public:
PlayerWindow(Library*,QString,QString);
//MENU ITEMS
QMenu *fileMenu;
QMenu *accountMenu;
QAction *addMusicAct;
QAction *loginAct;
QAction *logoutAct;
QAction *exitAct;
//VARIABLES
QString currentArtist;
QString viewMode;
QString playingFrom;
QString libraryLocation;
QList<ArtistListItem*> artistListItems;
QList<Album*> albums;
QList<AlbumSong*> albumSongs;
QList<AlbumSong*> selectedAlbumSongs;
QVariantList selectedSongs;
bool logged;
bool goingToExit = false;
//UTILITIES
Pix p;
Maths math;
QDir d;
//BRAINS
// GoogleDrive *drive;
Library *library;
Player *player = new Player();
//ELEMENTS
TopBar *topBar = new TopBar();
QWidget *frame = new QWidget();
TitleBar *titleBar = new TitleBar();
TagEditor *tagEditor = new TagEditor();
BottomBar *bottomBar = new BottomBar();
MiddleView *middleView = new MiddleView();
QBoxLayout *frameLayout = new QBoxLayout(QBoxLayout::TopToBottom,frame);
//EVENTS
bool eventFilter(QObject *obj, QEvent *event);
void closeEvent(QCloseEvent * event);
public slots:
//CONSTRUCTORS
void setupUI();
void setupLibrary(Library *lib, QString token, QString refresh);
void setupViewsAndWidgets();
void setupTopBarMenus();
void setupConnections();
void setupSettings();
void setUserInfo();
void setLibraryLocation(QString);
//METHODS
void refreshLibrary();
void playFromArtist(QString SongId);
void logout();
void quitApp();
void showSongMenu(QString);
void createMenuFromData();
void deleteSongsFromLocal();
void showTagEditor();
void songsEdited(QVariantList);
//FINDERS
bool existArtistListItem(QString);
bool existAlbum(QString,QString);
bool existAlbumSong(QString);
ArtistListItem *getArtistListItem(QString);
Album *getAlbum(QString,QString);
AlbumSong *getAlbumSong(QString);
QVariantMap getSong(QString id);
//EVENTS
void leftItemSelected(QString);
void artistSelected(QString);
void imageReady();
void showSongPlaying(QVariantMap songData);
void deletedFromBoth(QString);
//SONGS
void albumSongSelected(QString songId);
void songRightClicked(QString songId);
void songDeletionEnd();
void createPlayList(QString key, QString from);
void shuffleArtist();
void shuffleAlbum(QString,QString);
void moreAlbum(QString,QString);
void moreArtist();
signals:
void showLoginWindow();
};
#endif // PLAYERWINDOW_H