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
11class MythUIStateType;
12class MythUIImage;
13class MythUIButton;
16class MythUICheckBox;
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);
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
static void removeCachedImage(const AlbumArtImage *image)
MythUIImage * m_coverartImage
Definition: editmetadata.h:182
MythUIButtonList * m_coverartList
Definition: editmetadata.h:183
void updateImageGrid(void)
MythUIButton * m_metadataButton
Definition: editmetadata.h:180
EditAlbumartDialog(MythScreenStack *parent)
~EditAlbumartDialog() override
bool Create(void) override
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
void copyImageToTag(ImageType imageType)
void copySelectedImageToTag(void)
void switchToMetadata(void)
void removeSelectedImageFromTag(void)
void rescanForImages(void)
search the tracks tag and the tracks directory for images
void showTypeMenu(bool changeType=true)
void gridItemChanged(MythUIButtonListItem *item)
void startCopyImageToTag(void)
void doRemoveImageFromTag(bool doIt)
MythUIText * m_imagefilenameText
Definition: editmetadata.h:185
MythUIText * m_imagetypeText
Definition: editmetadata.h:184
void doCopyImageToTag(const AlbumArtImage *image)
void customEvent(QEvent *event) override
bool CreateCommon(void)
void updateMetadata(void)
static void saveToDatabase(void)
static bool hasMetadataChanged(void)
static bool s_metadataOnly
Definition: editmetadata.h:52
static void scanForImages(void)
MythUIButton * m_doneButton
Definition: editmetadata.h:58
void searchForAlbumImages(void)
search Google for images
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
EditMetadataCommon(MythScreenStack *parent, MusicMetadata *source_metadata, const QString &name)
static MusicMetadata * s_sourceMetadata
Definition: editmetadata.h:54
EditMetadataCommon(MythScreenStack *parent, const QString &name)
Definition: editmetadata.h:25
~EditMetadataCommon(void) override
void metadataChanged(void)
void cleanupAndClose(void)
void setSaveMetadataOnly(void)
void saveToMetadata(void)
void showSaveMenu(void)
static MusicMetadata * s_metadata
Definition: editmetadata.h:53
MythUIButton * m_searchAlbumButton
Definition: editmetadata.h:131
MythUIImage * m_artistIcon
Definition: editmetadata.h:134
MythUIButton * m_decRatingButton
Definition: editmetadata.h:127
void customEvent(QEvent *event) override
void setAlbum(const QString &album)
void switchToAlbumArt(void)
void updateArtistImage(void)
MythUIButton * m_searchCompArtistButton
Definition: editmetadata.h:130
void searchForArtistImages(void)
search google for artist images
MythUIButton * m_incRatingButton
Definition: editmetadata.h:126
void checkClicked(bool state)
void setGenre(const QString &genre)
MythUIButton * m_albumartButton
Definition: editmetadata.h:140
void setArtist(const QString &artist)
MythUITextEdit * m_compArtistEdit
Definition: editmetadata.h:115
void searchCompilationArtist(void) const
MythUISpinBox * m_trackSpin
Definition: editmetadata.h:121
void searchForGenreImages(void)
search flickr for genre images
void fillWidgets(void)
void searchArtist(void) const
void genreLostFocus(void)
MythUITextEdit * m_albumEdit
Definition: editmetadata.h:116
void setCompArtist(const QString &compArtist)
void ratingSpinChanged(MythUIButtonListItem *item)
MythUICheckBox * m_compilationCheck
Definition: editmetadata.h:138
MythUIImage * m_genreIcon
Definition: editmetadata.h:136
MythUITextEdit * m_titleEdit
~EditMetadataDialog(void) override
void artistLostFocus(void)
MythUITextEdit * m_genreEdit
Definition: editmetadata.h:118
bool Create(void) override
EditMetadataDialog(MythScreenStack *lparent, const QString &lname, VideoMetadata *source_metadata, const VideoMetadataListManager &cache)
void updateRating(void)
MythUIButton * m_searchArtistButton
Definition: editmetadata.h:129
MythUIButton * m_searchGenreButton
Definition: editmetadata.h:132
MythUIImage * m_albumIcon
Definition: editmetadata.h:135
void searchAlbum(void) const
void searchGenre(void) const
void updateGenreImage(void)
MythUIStateType * m_ratingState
Definition: editmetadata.h:125
MythUISpinBox * m_ratingSpin
Definition: editmetadata.h:123
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
MythUITextEdit * m_artistEdit
Definition: editmetadata.h:114
MythUISpinBox * m_yearSpin
void albumLostFocus(void)
MythUISpinBox * m_discSpin
Definition: editmetadata.h:122
void updateAlbumImage(void)
Screen in which all other widgets are contained and rendered.
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
A single button widget.
Definition: mythuibutton.h:22
A checkbox widget supporting three check states - on,off,half and two conditions - selected and unsel...
Image widget, displays a single image or multiple images in sequence.
Definition: mythuiimage.h:98
Provide a dialog to quickly find an entry in a list.
A widget for offering a range of numerical values where only the the bounding values and interval are...
Definition: mythuispinbox.h:23
This widget is used for grouping other widgets for display when a particular named state is called.
A text entry and edit widget.
All purpose text widget, displays a text string.
Definition: mythuitext.h:29
ImageType
Definition: musicmetadata.h:35