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
74 protected:
75 void customEvent(QEvent *event) override; // MythUIType
76
77 protected slots:
78 void searchArtist(void) const;
79 void searchCompilationArtist(void) const;
80 void searchAlbum(void) const;
81 void searchGenre(void) const;
82
83 void setArtist(const QString& artist);
84 void setCompArtist(const QString& compArtist);
85 void setAlbum(const QString& album);
86 void setGenre(const QString& genre);
88
89 void artistLostFocus(void);
90 void albumLostFocus(void);
91 void genreLostFocus(void);
92
93 void incRating(void);
94 void decRating(void);
95
96 void checkClicked(bool state);
97
98 void switchToAlbumArt(void);
99
100 private:
101 void showMenu(void);
102 void fillWidgets(void);
103
104 void updateArtistImage(void);
105 void updateAlbumImage(void);
106 void updateGenreImage(void);
107
108 void updateRating(void);
109
110 void searchForArtistImages(void);
111 void searchForGenreImages(void);
112
113 //
114 // GUI stuff
115 //
119 MythUITextEdit *m_titleEdit {nullptr};
121
122 MythUISpinBox *m_yearSpin {nullptr};
126
130
135
139
141
143};
144
146{
147 Q_OBJECT
148
149 public:
150 explicit EditAlbumartDialog(MythScreenStack *parent);
151 ~EditAlbumartDialog() override;
152
153 bool Create(void) override; // MythScreenType
154
155 bool keyPressEvent(QKeyEvent *event) override; // EditMetadataCommon
156
157 protected:
158 void customEvent(QEvent *event) override; // MythUIType
159
160 protected slots:
161 void switchToMetadata(void);
162 void showMenu(void);
163 void showTypeMenu(bool changeType = true);
165
166 void rescanForImages(void);
167
168 void doRemoveImageFromTag(bool doIt);
169
170 private:
171 void updateImageGrid(void);
172 void copySelectedImageToTag(void);
174 void startCopyImageToTag(void);
175 void copyImageToTag(ImageType imageType);
176 void doCopyImageToTag(const AlbumArtImage *image);
177 static void removeCachedImage(const AlbumArtImage *image);
178
180
181 //
182 // GUI stuff
183 //
185
190};
191
192#endif
static void removeCachedImage(const AlbumArtImage *image)
MythUIImage * m_coverartImage
Definition: editmetadata.h:186
MythUIButtonList * m_coverartList
Definition: editmetadata.h:187
void updateImageGrid(void)
MythUIButton * m_metadataButton
Definition: editmetadata.h:184
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:189
MythUIText * m_imagetypeText
Definition: editmetadata.h:188
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:133
MythUIImage * m_artistIcon
Definition: editmetadata.h:136
MythUIButton * m_decRatingButton
Definition: editmetadata.h:129
void customEvent(QEvent *event) override
void setAlbum(const QString &album)
void switchToAlbumArt(void)
void updateArtistImage(void)
MythUIButton * m_searchCompArtistButton
Definition: editmetadata.h:132
void searchForArtistImages(void)
search google for artist images
MythUIButton * m_incRatingButton
Definition: editmetadata.h:128
void checkClicked(bool state)
void setGenre(const QString &genre)
MythUIButton * m_albumartButton
Definition: editmetadata.h:142
void setArtist(const QString &artist)
MythUITextEdit * m_compArtistEdit
Definition: editmetadata.h:117
void searchCompilationArtist(void) const
MythUISpinBox * m_trackSpin
Definition: editmetadata.h:123
void searchForGenreImages(void)
search flickr for genre images
void fillWidgets(void)
void searchArtist(void) const
void genreLostFocus(void)
MythUITextEdit * m_albumEdit
Definition: editmetadata.h:118
void setCompArtist(const QString &compArtist)
void ratingSpinChanged(MythUIButtonListItem *item)
MythUICheckBox * m_compilationCheck
Definition: editmetadata.h:140
MythUIImage * m_genreIcon
Definition: editmetadata.h:138
MythUITextEdit * m_titleEdit
~EditMetadataDialog(void) override
void artistLostFocus(void)
MythUITextEdit * m_genreEdit
Definition: editmetadata.h:120
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:131
MythUIButton * m_searchGenreButton
Definition: editmetadata.h:134
MythUIImage * m_albumIcon
Definition: editmetadata.h:137
void searchAlbum(void) const
void searchGenre(void) const
void updateGenreImage(void)
MythUIStateType * m_ratingState
Definition: editmetadata.h:127
MythUISpinBox * m_ratingSpin
Definition: editmetadata.h:125
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
MythUITextEdit * m_artistEdit
Definition: editmetadata.h:116
MythUISpinBox * m_yearSpin
void albumLostFocus(void)
MythUISpinBox * m_discSpin
Definition: editmetadata.h:124
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:19
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:31