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