Sayonara Player
InfoDialogContainer.h
1 /* InfoDialogContainer.h */
2 
3 /* Copyright (C) 2011-2020 Michael Lugmair (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 isRunning() const;
48 
49  private slots:
50  void scannerFinished();
51 };
52 
53 
62 {
64 
65  PIMPL(InfoDialogContainer)
66 
67  friend class GUI_InfoDialog;
68 
69  public:
71  virtual ~InfoDialogContainer();
72 
77  void infoDialogClosed();
78 
79  private:
80  void checkInfoDialog();
81  bool initDialog(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 metadataInterpretation() const=0;
100 
106  virtual MetaDataList infoDialogData() const=0;
107 
113  virtual bool hasMetadata() const;
114 
120  virtual QStringList pathlist() const;
121 
125  virtual void showInfo();
126 
130  virtual void showLyrics();
131 
135  virtual void showEdit();
136 
140  virtual void showCoverEdit();
141 };
142 
143 #endif
The GUI_InfoDialog class.
Definition: GUI_InfoDialog.h:45
An interface used to abstract the usage of the info dialog. An implementing class has to return the i...
Definition: InfoDialogContainer.h:61
virtual void showCoverEdit()
Show the cover tab withing the tag editor.
Definition: InfoDialogContainer.h:35
virtual void showInfo()
Show the Info dialogs' info tab.
virtual void showEdit()
Show the tag editor.
The MetaDataList class.
Definition: MetaDataList.h:35
void infoDialogClosed()
this function should not be called from outside. This function is triggered when the info dialog was ...
virtual bool hasMetadata() const
returns, if the widget can provide metadata instantly If false, the info dialog will the pathlist
virtual MetaDataList infoDialogData() const =0
get the metadata that should be used for the info dialog So for lists, the selected tracks are used h...
virtual void showLyrics()
Show the Info dialogs' lyrics tab.
virtual QStringList pathlist() const
Returns a list of paths. This is only used if has_metadata() returns false.
virtual MD::Interpretation metadataInterpretation() const =0
get the interpretation for the metadata. Maybe a list of metadata should be intrepeted as albums whil...