Sayonara Player
GUI_LocalLibrary.h
1 /* GUI_LocalLibrary.h */
2 
3 /* Copyright (C) 2011-2017 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  * GUI_LocalLibrary.h
24  *
25  * Created on: Apr 24, 2011
26  * Author: Lucio Carreras
27  */
28 
29 #ifndef GUI_LOCAL_LIBRARY_H_
30 #define GUI_LOCAL_LIBRARY_H_
31 
32 #include "GUI_AbstractLibrary.h"
33 
34 class GUI_LibraryInfoBox;
35 class GUI_ImportFolder;
36 class LocalLibraryMenu;
37 class AlbumCoverView;
38 class AlbumCoverModel;
39 
40 namespace Ui { class GUI_LocalLibrary; }
41 
43  public GUI_AbstractLibrary
44 {
45  Q_OBJECT
46 
47 public:
48  explicit GUI_LocalLibrary(QWidget* parent=nullptr);
49  virtual ~GUI_LocalLibrary();
50 
51  QComboBox* get_libchooser() const;
52  QMenu* get_menu() const;
53 
54 
55 protected:
56  void showEvent(QShowEvent* e) override;
57  void init_shortcuts() override;
58 
59  Library::ReloadQuality show_quality_dialog();
60 
61 
62 private slots:
63 
64  void switch_album_view();
65 
66  void disc_pressed(int disc);
67  void lib_no_lib_path();
68  void progress_changed(const QString& type, int progress);
69 
70  void genre_selection_changed(const QModelIndex& index);
71  void date_selection_changed(const QModelIndex& index);
72 
73  void reload_library_requested();
74  void import_dirs_requested();
75  void import_files_requested();
76  void import_files(const QStringList& files);
77 
78  // importer requests dialog
79  void import_dialog_requested();
80 
81  // set library path clicked
82  void set_library_path_clicked();
83 
84  void splitter_artist_moved(int pos, int idx);
85  void splitter_tracks_moved(int pos, int idx);
86  void splitter_genre_moved(int pos, int idx);
87  void splitter_date_moved(int pos, int idx);
88 
89  // reimplemented from Abstract Library
90  Library::TrackDeletionMode show_delete_dialog(int n_tracks) override;
91  void reload_finished();
92 
93  void show_info_box();
94 
95  // reimplemented from Sayonara widget
96  void language_changed() override;
97 
98  void _sl_libpath_changed();
99  void clear_button_pressed() override;
100 
101 protected slots:
102  void lib_fill_albums(const AlbumList& albums) override;
103  void lib_fill_tracks(const MetaDataList& v_md) override;
104 
105 private:
106  Ui::GUI_LocalLibrary* ui=nullptr;
107  GUI_LibraryInfoBox* _library_info_box=nullptr;
108  GUI_ImportFolder* _ui_importer=nullptr;
109  LocalLibraryMenu* _local_library_menu=nullptr;
110 
111  AlbumCoverView* _acv = nullptr;
112  AlbumCoverModel* _acm = nullptr;
113 
114  void init_album_cover_view();
115 };
116 
117 
118 #endif /* GUI_LocalLibrary_H_ */
119 
Definition: GUI_ImportFolder.h:31
TrackDeletionMode
The TrackDeletionMode enum.
Definition: LibraryNamespaces.h:35
Definition: ui_GUI_SomaFM.h:216
ReloadQuality
The ReloadQuality enum.
Definition: LibraryNamespaces.h:46
Definition: ui_GUI_LocalLibrary.h:485
Definition: AlbumCoverModel.h:34
Definition: MetaDataList.h:39
The AlbumList class.
Definition: Album.h:78
Definition: GUI_AbstractLibrary.h:49
Definition: GUI_LibraryInfoBox.h:32
Definition: LocalLibraryMenu.h:30
Definition: AlbumCoverView.h:30
Definition: GUI_LocalLibrary.h:42