Sayonara Player
InfoDialogContainer.h
1 /* InfoDialogContainer.h */
2 
3 /* Copyright (C) 2011-2019 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 #ifndef INFO_DIALOG_CONTAINER_H_
22 #define INFO_DIALOG_CONTAINER_H_
23 
24 #include "Utils/Pimpl.h"
25 #include <QObject>
26 
27 enum class OpenMode : uint8_t
28 {
29  Info, Edit, Lyrics, Cover
30 };
31 
32 class GUI_InfoDialog;
33 
35 class InfoDialogContainerAsyncHandler : public QObject
36 {
37  Q_OBJECT
39 
40  friend class InfoDialogContainer;
41 
42  private:
43  InfoDialogContainerAsyncHandler(InfoDialogContainer* container, OpenMode mode);
45 
46  bool start();
47  bool is_running() const;
48 
49  private slots:
50  void scanner_finished();
51 };
52 
53 
62 {
64 
65  PIMPL(InfoDialogContainer)
66 
67  friend class GUI_InfoDialog;
68 
69  public:
71  virtual ~InfoDialogContainer();
72 
77  void info_dialog_closed();
78 
79  private:
80  void check_info_dialog();
81  bool init_dialog(OpenMode open_mode);
82 
83  void go(OpenMode open_mode, const MetaDataList& v_md);
84 
85  protected:
86  enum EditTab
87  {
88  TabText,
89  TabCover,
90  TabTagsFromPath
91  };
92 
99  virtual MD::Interpretation metadata_interpretation() const=0;
100 
106  virtual MetaDataList info_dialog_data() const=0;
107 
113  virtual bool has_metadata() const;
114 
120  virtual QStringList pathlist() const;
121 
122 
126  virtual void show_info();
127 
131  virtual void show_lyrics();
132 
136  virtual void show_edit();
137 
138  virtual void show_cover_edit();
139 };
140 
141 #endif
The GUI_InfoDialog class.
Definition: GUI_InfoDialog.h:46
An interface used to abstract the usage of the info dialog. An implementing class has to return the i...
Definition: InfoDialogContainer.h:61
Definition: InfoDialogContainer.h:35
The MetaDataList class.
Definition: MetaDataList.h:37
virtual MD::Interpretation metadata_interpretation() const =0
get the interpretation for the metadata. Maybe a list of metadata should be intrepeted as albums whil...
virtual void show_edit()
Show the tag editor.
virtual bool has_metadata() const
returns, if the widget can provide metadata instantly If false, the info dialog will the pathlist ...
virtual QStringList pathlist() const
Returns a list of paths. This is only used if has_metadata() returns false.
virtual MetaDataList info_dialog_data() const =0
get the metadata that should be used for the info dialog So for lists, the selected tracks are used h...
Definition: AbstractCoverLookup.h:30
void info_dialog_closed()
this function should not be called from outside. This function is triggered when the info dialog was ...
Definition: LyricLookup.h:36
virtual void show_info()
Show the Info dialogs&#39; info tab.
virtual void show_lyrics()
Show the Info dialogs&#39; lyrics tab.