-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathsidebar.h
152 lines (113 loc) · 4.1 KB
/
sidebar.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
145
146
147
148
149
150
151
152
/*
* Copyright (C) 2020, KylinSoft Co., Ltd.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef SIDEBAR_H
#define SIDEBAR_H
#include <QFrame>
#include <QLabel>
#include <QVBoxLayout>
#include <QPushButton>
#include <QToolButton>
#include <QStackedWidget>
#include <QTableWidget>
#include <QTableWidgetItem>
#include <QListWidget>
#include <QListWidgetItem>
#include <QDialog>
#include <QLineEdit>
#include <QGraphicsDropShadowEffect>
#include <QPainter>
#include "changelistwid.h"
#include "songitem.h"
#include "allpupwindow.h"
#include "widgetstyle.h"
#include "playsongarea.h"
struct PlayListNew
{
int id;
QString hash; //表名
};
class SideBar :public QFrame
{
Q_OBJECT
public:
explicit SideBar(QWidget *parent = nullptr);
QLabel *recommendLabel;
QPushButton *logoLabel;
QLabel *logoNameLabel;
QToolButton *PlayListBtn; //歌曲列表
QLabel *MySongListLabel;
QPushButton *addSongListBtn;
QToolButton *pButton; //按钮text
QListWidgetItem *newSongList[20]; //包括我喜欢在内的所有item
QListWidget *songListWidget;
QToolButton *newSongListBtn[20]; //包括我喜欢在内所有的歌单按钮
QStackedWidget *rightChangeWid; //进行界面切换 右部除标题栏和播放区域之外的部分
MusicListWid *musicListChangeWid[20]; //我喜欢,以及预留出的新建歌单对应的切换界面
MusicListWid *myMusicListWid; //歌曲列表按钮对应的切换界面
QSqlTableModel *sidemodel;
QSqlTableModel *readmodel;
QStringList allmusiclist;
QStringList allListName;
AllPupWindow *newSonglistPup; //新建歌单弹出窗口
AllPupWindow *renameSongListPup; //重命名弹窗
AllPupWindow *promptRenamePlayList; //默认歌单重命名第二次弹窗
AllPupWindow *promptSongListPup; // 您确定删除歌单吗?
AllPupWindow *promptRemovePlayList; //默认歌单删除第二次弹窗
AllPupWindow *promptExistListPup; //歌单名已存在
QMenu *menu;
QAction *listPlayAct;
QAction *listNextAct;
QAction *listDeleAct;
QAction *listSongAct;
int currentMusicPlaylist = -2;
// 当前播放列表索引
int currentPlayList = 0;
// 当前选中列表索引
int currentSelectList = -1;
int btnIndex;
void sidecolor();
int currentPlayIndex = -1; //高亮相关
// 判断删除歌单歌曲时跳过高亮
bool skipPlaylistHighlight = false;
public:
// void songListBtncolor(); //歌单按钮(包括我喜欢)样式
public:
PlayListNew playListNew;
QStringList playListName; //歌单名
QString enterLineEdit(QString text); //获取歌单名的hash
public slots:
void addSongList();
void initDefaultMusicList();
void createSongList(); //获取歌单
void addItemToSongList(); //创建歌单
void deleteSongList(); //删除歌单
void ChangePage();
void AlterPage();
// void AlterthisPage();
void on_musicListChangeWid_customContextMenuRequested(const QPoint &pos);
void listPlayAct_slot();
void listNextAct_slot();
void addMusicToPlayList(QAction *listact);
void deleteMusicFromSongList();
void listSongAct_slot(); // 歌单中歌曲信息
// void updataplaylistwidget(int value);//更新playlistWidget
// void on_musicListChangeWid_doubleClicked(QListWidgetItem *item);
// void Music_playlist_stateChang(QMediaPlayer::State state);//播放状态改变
private:
void initTopWidget();
};
#endif // SIDEBAR_H