MythTV  master
editmetadata.h
Go to the documentation of this file.
1 #ifndef EDITMETADATA_H_
2 #define EDITMETADATA_H_
3 
4 // C++
5 #include <iostream>
6 
7 // MythTV
10 
11 class MythUIStateType;
12 class MythUIImage;
13 class MythUIButton;
14 class MythUIButtonList;
16 class MythUICheckBox;
17 class MythUISearchDialog;
18 
20 {
21  Q_OBJECT
22 
23  public:
24  EditMetadataCommon(MythScreenStack *parent, MusicMetadata *source_metadata, const QString &name);
25  EditMetadataCommon(MythScreenStack *parent, const QString &name)
26  : MythScreenType(parent, name) {}
27 
28  ~EditMetadataCommon(void) override;
29 
30  bool CreateCommon(void);
31 
32  bool keyPressEvent(QKeyEvent *event) override; // MythScreenType
33 
34  void setSaveMetadataOnly(void);
35 
36  signals:
37  void metadataChanged(void);
38 
39  protected slots:
40  void showSaveMenu(void);
41  static void saveToDatabase(void);
42  void saveToMetadata(void);
43  void saveAll(void);
44  void cleanupAndClose(void);
45 
46  protected:
47  static bool hasMetadataChanged(void);
48  void updateMetadata(void);
49  void searchForAlbumImages(void);
50  static void scanForImages(void);
51 
52  static bool s_metadataOnly;
55 
56  bool m_albumArtChanged {false};
57  QString m_searchType;
59 };
60 
62 {
63  Q_OBJECT
64 
65  public:
66  EditMetadataDialog(MythScreenStack *parent, MusicMetadata *source_metadata);
67  explicit EditMetadataDialog(MythScreenStack *parent);
68  ~EditMetadataDialog(void) override;
69 
70  bool Create(void) override; // MythScreenType
71 
72  bool keyPressEvent(QKeyEvent *event) override; // EditMetadataCommon
73  void customEvent(QEvent *event) override; // MythUIType
74 
75  protected slots:
76  void searchArtist(void) const;
77  void searchCompilationArtist(void) const;
78  void searchAlbum(void) const;
79  void searchGenre(void) const;
80 
81  void setArtist(const QString& artist);
82  void setCompArtist(const QString& compArtist);
83  void setAlbum(const QString& album);
84  void setGenre(const QString& genre);
86 
87  void artistLostFocus(void);
88  void albumLostFocus(void);
89  void genreLostFocus(void);
90 
91  void incRating(void);
92  void decRating(void);
93 
94  void checkClicked(bool state);
95 
96  void switchToAlbumArt(void);
97 
98  private:
99  void showMenu(void);
100  void fillWidgets(void);
101 
102  void updateArtistImage(void);
103  void updateAlbumImage(void);
104  void updateGenreImage(void);
105 
106  void updateRating(void);
107 
108  void searchForArtistImages(void);
109  void searchForGenreImages(void);
110 
111  //
112  // GUI stuff
113  //
117  MythUITextEdit *m_titleEdit {nullptr};
119 
120  MythUISpinBox *m_yearSpin {nullptr};
124 
128 
133 
137 
139 
141 };
142 
144 {
145  Q_OBJECT
146 
147  public:
148  explicit EditAlbumartDialog(MythScreenStack *parent);
149  ~EditAlbumartDialog() override;
150 
151  bool Create(void) override; // MythScreenType
152 
153  bool keyPressEvent(QKeyEvent *event) override; // EditMetadataCommon
154  void customEvent(QEvent *event) override; // MythUIType
155 
156  protected slots:
157  void switchToMetadata(void);
158  void showMenu(void);
159  void showTypeMenu(bool changeType = true);
161 
162  void rescanForImages(void);
163 
164  void doRemoveImageFromTag(bool doIt);
165 
166  private:
167  void updateImageGrid(void);
168  void copySelectedImageToTag(void);
169  void removeSelectedImageFromTag(void);
170  void startCopyImageToTag(void);
171  void copyImageToTag(ImageType imageType);
172  void doCopyImageToTag(const AlbumArtImage *image);
173  static void removeCachedImage(const AlbumArtImage *image);
174 
176 
177  //
178  // GUI stuff
179  //
181 
186 };
187 
188 #endif
EditMetadataDialog::m_searchGenreButton
MythUIButton * m_searchGenreButton
Definition: editmetadata.h:132
EditMetadataDialog::m_incRatingButton
MythUIButton * m_incRatingButton
Definition: editmetadata.h:126
MythUISearchDialog
Provide a dialog to quickly find an entry in a list.
Definition: mythdialogbox.h:399
EditMetadataCommon::updateMetadata
void updateMetadata(void)
Definition: editmetadata.cpp:111
EditMetadataDialog::m_trackSpin
MythUISpinBox * m_trackSpin
Definition: editmetadata.h:121
MythUIImage
Image widget, displays a single image or multiple images in sequence.
Definition: mythuiimage.h:97
EditAlbumartDialog::EditAlbumartDialog
EditAlbumartDialog(MythScreenStack *parent)
Definition: editmetadata.cpp:866
EditMetadataDialog::updateRating
void updateRating(void)
Definition: editmetadata.cpp:432
EditAlbumartDialog::copySelectedImageToTag
void copySelectedImageToTag(void)
Definition: editmetadata.cpp:1249
EditMetadataDialog::m_searchArtistButton
MythUIButton * m_searchArtistButton
Definition: editmetadata.h:129
EditMetadataDialog::Create
bool Create() override
Definition: editvideometadata.cpp:54
EditMetadataDialog::m_ratingState
MythUIStateType * m_ratingState
Definition: editmetadata.h:125
EditMetadataCommon::EditMetadataCommon
EditMetadataCommon(MythScreenStack *parent, const QString &name)
Definition: editmetadata.h:25
EditMetadataDialog::m_artistIcon
MythUIImage * m_artistIcon
Definition: editmetadata.h:134
EditMetadataDialog::m_discSpin
MythUISpinBox * m_discSpin
Definition: editmetadata.h:122
EditMetadataCommon::s_sourceMetadata
static MusicMetadata * s_sourceMetadata
Definition: editmetadata.h:54
EditMetadataDialog::checkClicked
void checkClicked(bool state)
Definition: editmetadata.cpp:517
EditMetadataCommon::searchForAlbumImages
void searchForAlbumImages(void)
search Google for images
Definition: editmetadata.cpp:265
EditMetadataCommon::scanForImages
static void scanForImages(void)
Definition: editmetadata.cpp:280
EditMetadataDialog::artistLostFocus
void artistLostFocus(void)
Definition: editmetadata.cpp:699
EditMetadataDialog::genreLostFocus
void genreLostFocus(void)
Definition: editmetadata.cpp:709
EditMetadataDialog::m_albumIcon
MythUIImage * m_albumIcon
Definition: editmetadata.h:135
MythScreenStack
Definition: mythscreenstack.h:16
EditMetadataCommon::EditMetadataCommon
EditMetadataCommon(MythScreenStack *parent, MusicMetadata *source_metadata, const QString &name)
Definition: editmetadata.cpp:42
MythUITextEdit
A text entry and edit widget.
Definition: mythuitextedit.h:34
EditAlbumartDialog::doCopyImageToTag
void doCopyImageToTag(const AlbumArtImage *image)
Definition: editmetadata.cpp:1318
EditMetadataDialog::m_albumartButton
MythUIButton * m_albumartButton
Definition: editmetadata.h:140
EditMetadataDialog::setArtist
void setArtist(const QString &artist)
Definition: editmetadata.cpp:553
MythScreenType
Screen in which all other widgets are contained and rendered.
Definition: mythscreentype.h:45
MusicMetadata
Definition: musicmetadata.h:80
EditMetadataDialog::updateArtistImage
void updateArtistImage(void)
Definition: editmetadata.cpp:559
EditMetadataCommon::hasMetadataChanged
static bool hasMetadataChanged(void)
Definition: editmetadata.cpp:246
EditMetadataDialog::incRating
void incRating(void)
Definition: editmetadata.cpp:408
EditAlbumartDialog::showTypeMenu
void showTypeMenu(bool changeType=true)
Definition: editmetadata.cpp:993
EditAlbumartDialog::removeCachedImage
static void removeCachedImage(const AlbumArtImage *image)
Definition: editmetadata.cpp:1371
EditMetadataDialog::setAlbum
void setAlbum(const QString &album)
Definition: editmetadata.cpp:623
EditMetadataDialog::decRating
void decRating(void)
Definition: editmetadata.cpp:414
MythUIButtonListItem
Definition: mythuibuttonlist.h:41
EditAlbumartDialog::doRemoveImageFromTag
void doRemoveImageFromTag(bool doIt)
Definition: editmetadata.cpp:1274
EditMetadataCommon::s_metadataOnly
static bool s_metadataOnly
Definition: editmetadata.h:52
EditAlbumartDialog::m_coverartImage
MythUIImage * m_coverartImage
Definition: editmetadata.h:182
EditMetadataDialog::setCompArtist
void setCompArtist(const QString &compArtist)
Definition: editmetadata.cpp:598
EditMetadataDialog::m_searchCompArtistButton
MythUIButton * m_searchCompArtistButton
Definition: editmetadata.h:130
EditMetadataCommon::~EditMetadataCommon
~EditMetadataCommon(void) override
Definition: editmetadata.cpp:54
EditMetadataCommon::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: editmetadata.cpp:86
EditMetadataDialog::searchCompilationArtist
void searchCompilationArtist(void) const
Definition: editmetadata.cpp:578
EditMetadataCommon::s_metadata
static MusicMetadata * s_metadata
Definition: editmetadata.h:53
EditMetadataDialog::m_compilationCheck
MythUICheckBox * m_compilationCheck
Definition: editmetadata.h:138
EditAlbumartDialog::~EditAlbumartDialog
~EditAlbumartDialog() override
Definition: editmetadata.cpp:872
EditMetadataDialog::switchToAlbumArt
void switchToAlbumArt(void)
Definition: editmetadata.cpp:498
MythUIButton
A single button widget.
Definition: mythuibutton.h:21
EditMetadataDialog::m_searchAlbumButton
MythUIButton * m_searchAlbumButton
Definition: editmetadata.h:131
EditMetadataCommon::m_albumArtChanged
bool m_albumArtChanged
Definition: editmetadata.h:56
EditMetadataDialog
Definition: editvideometadata.h:19
EditMetadataCommon::saveAll
void saveAll(void)
Definition: editmetadata.cpp:218
EditAlbumartDialog::m_imagefilenameText
MythUIText * m_imagefilenameText
Definition: editmetadata.h:185
EditAlbumartDialog::m_imagetypeText
MythUIText * m_imagetypeText
Definition: editmetadata.h:184
EditMetadataDialog::searchGenre
void searchGenre(void) const
Definition: editmetadata.cpp:646
EditAlbumartDialog::m_metadataButton
MythUIButton * m_metadataButton
Definition: editmetadata.h:180
EditMetadataDialog::searchAlbum
void searchAlbum(void) const
Definition: editmetadata.cpp:603
EditMetadataDialog::updateAlbumImage
void updateAlbumImage(void)
Definition: editmetadata.cpp:629
EditMetadataDialog::m_albumEdit
MythUITextEdit * m_albumEdit
Definition: editmetadata.h:116
EditAlbumartDialog::copyImageToTag
void copyImageToTag(ImageType imageType)
Definition: editmetadata.cpp:1240
MythUICheckBox
A checkbox widget supporting three check states - on,off,half and two conditions - selected and unsel...
Definition: mythuicheckbox.h:15
EditAlbumartDialog::removeSelectedImageFromTag
void removeSelectedImageFromTag(void)
Definition: editmetadata.cpp:1260
EditMetadataDialog::searchArtist
void searchArtist(void) const
Definition: editmetadata.cpp:533
EditMetadataDialog::m_artistEdit
MythUITextEdit * m_artistEdit
Definition: editmetadata.h:114
EditMetadataDialog::m_genreEdit
MythUITextEdit * m_genreEdit
Definition: editmetadata.h:118
EditMetadataCommon::setSaveMetadataOnly
void setSaveMetadataOnly(void)
Definition: editmetadata.cpp:237
EditAlbumartDialog::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: editmetadata.cpp:949
EditAlbumartDialog::m_imageFilename
QString m_imageFilename
Definition: editmetadata.h:175
EditMetadataDialog::ratingSpinChanged
void ratingSpinChanged(MythUIButtonListItem *item)
Definition: editmetadata.cpp:420
EditMetadataDialog::~EditMetadataDialog
~EditMetadataDialog() override
Definition: editvideometadata.cpp:49
EditMetadataCommon::CreateCommon
bool CreateCommon(void)
Definition: editmetadata.cpp:75
MythUIText
All purpose text widget, displays a text string.
Definition: mythuitext.h:28
EditMetadataDialog::setGenre
void setGenre(const QString &genre)
Definition: editmetadata.cpp:674
EditMetadataCommon::m_searchType
QString m_searchType
Definition: editmetadata.h:57
EditMetadataDialog::customEvent
void customEvent(QEvent *levent) override
Definition: editvideometadata.cpp:993
EditAlbumartDialog::gridItemChanged
void gridItemChanged(MythUIButtonListItem *item)
Definition: editmetadata.cpp:909
EditAlbumartDialog
Definition: editmetadata.h:143
EditMetadataCommon::cleanupAndClose
void cleanupAndClose(void)
Definition: editmetadata.cpp:188
EditMetadataDialog::m_genreIcon
MythUIImage * m_genreIcon
Definition: editmetadata.h:136
AlbumArtImage
Definition: musicmetadata.h:39
EditMetadataDialog::updateGenreImage
void updateGenreImage(void)
Definition: editmetadata.cpp:680
EditMetadataDialog::searchForGenreImages
void searchForGenreImages(void)
search flickr for genre images
Definition: editmetadata.cpp:715
EditAlbumartDialog::customEvent
void customEvent(QEvent *event) override
Definition: editmetadata.cpp:1096
MythUISpinBox
A widget for offering a range of numerical values where only the the bounding values and interval are...
Definition: mythuispinbox.h:16
EditAlbumartDialog::switchToMetadata
void switchToMetadata(void)
Definition: editmetadata.cpp:976
EditAlbumartDialog::m_coverartList
MythUIButtonList * m_coverartList
Definition: editmetadata.h:183
EditAlbumartDialog::startCopyImageToTag
void startCopyImageToTag(void)
Definition: editmetadata.cpp:1216
EditMetadataCommon::saveToMetadata
void saveToMetadata(void)
Definition: editmetadata.cpp:199
EditMetadataCommon::metadataChanged
void metadataChanged(void)
EditMetadataCommon::m_doneButton
MythUIButton * m_doneButton
Definition: editmetadata.h:58
EditAlbumartDialog::updateImageGrid
void updateImageGrid(void)
Definition: editmetadata.cpp:932
EditMetadataDialog::keyPressEvent
bool keyPressEvent(QKeyEvent *e) override
Key event handler.
Definition: editmetadata.cpp:49
MythUIButtonList
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
Definition: mythuibuttonlist.h:191
EditMetadataCommon
Definition: editmetadata.h:19
EditMetadataDialog::m_compArtistEdit
MythUITextEdit * m_compArtistEdit
Definition: editmetadata.h:115
EditMetadataCommon::showSaveMenu
void showSaveMenu(void)
Definition: editmetadata.cpp:154
EditAlbumartDialog::Create
bool Create(void) override
Definition: editmetadata.cpp:877
EditMetadataDialog::m_yearSpin
MythUISpinBox * m_yearSpin
Definition: editvideometadata.h:105
ImageType
ImageType
Definition: musicmetadata.h:28
EditMetadataDialog::searchForArtistImages
void searchForArtistImages(void)
search google for artist images
Definition: editmetadata.cpp:727
EditAlbumartDialog::rescanForImages
void rescanForImages(void)
search the tracks tag and the tracks directory for images
Definition: editmetadata.cpp:1204
EditMetadataDialog::m_titleEdit
MythUITextEdit * m_titleEdit
Definition: editvideometadata.h:93
EditAlbumartDialog::showMenu
void showMenu(void)
Definition: editmetadata.cpp:1034
EditMetadataDialog::albumLostFocus
void albumLostFocus(void)
Definition: editmetadata.cpp:704
musicmetadata.h
EditMetadataDialog::showMenu
void showMenu(void)
Definition: editmetadata.cpp:470
MythUIStateType
This widget is used for grouping other widgets for display when a particular named state is called....
Definition: mythuistatetype.h:22
EditMetadataDialog::EditMetadataDialog
EditMetadataDialog(MythScreenStack *lparent, const QString &lname, VideoMetadata *source_metadata, const VideoMetadataListManager &cache)
Definition: editvideometadata.cpp:37
mythscreentype.h
EditMetadataCommon::saveToDatabase
static void saveToDatabase(void)
Definition: editmetadata.cpp:206
EditMetadataDialog::m_decRatingButton
MythUIButton * m_decRatingButton
Definition: editmetadata.h:127
EditMetadataDialog::m_ratingSpin
MythUISpinBox * m_ratingSpin
Definition: editmetadata.h:123
EditMetadataDialog::fillWidgets
void fillWidgets()
Definition: editvideometadata.cpp:302