Sayonara Player
LibraryViewAlbum.h
1 /* LibraryViewAlbum.h */
2 
3 /* Copyright (C) 2011-2016 Lucio Carreras
4  *
5  * This file is part of sayonara player
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11 
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16 
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 
22 
23 #ifndef LIBRARYVIEWALBUM_H
24 #define LIBRARYVIEWALBUM_H
25 
26 #include <QTimer>
27 
28 #include "Helper/MetaData/Album.h"
29 #include "GUI/Library/Views/LibraryView.h"
30 #include <QModelIndex>
31 
32 class DiscPopupMenu;
34 {
35  Q_OBJECT
36 
37 signals:
38  void sig_disc_pressed(int);
39 
40 protected slots:
41  void index_clicked(const QModelIndex& idx);
42 
43 public:
44  explicit LibraryViewAlbum(QWidget *parent=nullptr);
45 
46 
47 protected:
48  QList< QList<quint8> > _discnumbers;
49  DiscPopupMenu* _discmenu=nullptr;
50  QPoint _discmenu_point;
51 
52  virtual void calc_discmenu_point(QModelIndex idx);
53  virtual void delete_discmenu();
54  virtual void init_discmenu(QModelIndex idx);
55  virtual void show_discmenu();
56 
57  virtual void rc_menu_show(const QPoint& p);
58 
59 public:
60  template <typename T, typename ModelType>
61  void fill(const T& input_data){
62  _discnumbers.clear();
63 
64  for(const Album& album: input_data){
65  _discnumbers << album.discnumbers;
66  }
67 
68  LibraryView::fill<T, ModelType>(input_data);
69  }
70 };
71 
72 #endif // LIBRARYVIEWALBUM_H
Definition: DiscPopupMenu.h:49
Definition: LibraryView.h:61
Definition: LibraryViewAlbum.h:33
The Album class.
Definition: Album.h:40
Definition: org_mpris_media_player2_adaptor.h:20