1 // (c) 2004 Mark Kretschmann <markey@web.de>
2 // (c) 2004 Pierpaolo Di Panfilo <pippo_dp@libero.it>
3 // (c) 2005 Alexandre Pereira de Oliveira <aleprj@gmail.com>
4 // See COPYING file for licensing information.
6 #ifndef AMAROK_TAGDIALOG_H
7 #define AMAROK_TAGDIALOG_H
9 #include "config-amarok.h"
12 #include "metabundle.h" //stack alloc
13 #include "playlist/PlaylistItem.h"
14 #include "tagdialogbase.h" //baseclass
16 #include "meta/Meta.h"
18 #include <khtml_part.h>
19 #include <KUrl> //stack alloc
24 #include <QtGui/QWidget>
33 class TagDialog
: public TagDialogBase
39 enum Changes
{ NOCHANGE
=0, SCORECHANGED
=1, TAGSCHANGED
=2, LYRICSCHANGED
=4, RATINGCHANGED
=8, LABELSCHANGED
=16 };
40 enum Tabs
{ SUMMARYTAB
, TAGSTAB
, LYRICSTAB
, STATSTAB
, LABELSTAB
};
42 explicit TagDialog( const KUrl
& url
, QWidget
* parent
= 0 );
43 explicit TagDialog( const KUrl::List list
, QWidget
* parent
= 0 );
44 TagDialog( const MetaBundle
& mb
, Playlist::Item
* item
, QWidget
* parent
= 0 );
45 explicit TagDialog( const Meta::TrackList
&tracks
, QWidget
*parent
= 0 );
46 explicit TagDialog( Meta::TrackPtr track
, QWidget
*parent
= 0 );
49 void setTab( int id
);
51 friend class TagSelect
;
54 void lyricsChanged( const QString
& );
57 void openUrlRequest(const KUrl
&url
);
68 void loadCover( const QString
&artist
, const QString
&album
);
70 void musicbrainzQuery();
71 void guessFromFilename();
72 void setFileNameSchemes();
73 void queryDone( KTRMResultList results
, QString error
);
74 void fillSelected( KTRMResult selected
);
75 void resetMusicbrainz();
80 void readMultipleTracks();
81 void setMultipleTracksMode();
82 void setSingleTrackMode();
87 void storeTags( const KUrl
& url
);
88 void storeTags( const KUrl
& url
, int changes
, const MetaBundle
&mb
);
89 void storeLabels( const KUrl
&url
, const QStringList
&labels
);
90 void loadTags( const KUrl
& url
);
91 void loadLyrics( const KUrl
& url
);
92 void loadLabels( const KUrl
&url
);
93 MetaBundle
bundleForURL( const KUrl
&url
);
94 float scoreForURL( const KUrl
&url
);
95 int ratingForURL( const KUrl
&url
);
96 QString
lyricsForURL( const KUrl
&url
);
97 QStringList
labelsForURL( const KUrl
&url
);
98 QStringList
getCommonLabels();
100 bool writeTag( MetaBundle
&mb
, bool updateCB
=true );
101 const QString
unknownSafe( QString
);
102 const QStringList
statisticsData();
103 void applyToAllTracks();
105 const QStringList
filenameSchemes();
107 QStringList
labelListFromText( const QString
&text
);
108 void generateDeltaForLabelList( const QStringList
&list
);
109 QString
generateHTML( const QStringList
&labels
);
112 KUrl::List::iterator m_currentURL
;
115 Playlist::Item
* m_playlistItem
;
116 QMap
<QString
, MetaBundle
> storedTags
;
117 QMap
<QString
, float> storedScores
;
118 QMap
<QString
, int> storedRatings
;
119 QMap
<QString
, QString
> storedLyrics
;
120 QMap
<QString
, QStringList
> newLabels
;
121 QMap
<QString
, QStringList
> originalLabels
;
122 KUrl::List m_urlList
;
123 QString m_buttonMbText
;
125 QString m_currentCover
;
126 QStringList m_labels
;
127 QStringList m_addedLabels
;
128 QStringList m_removedLabels
;
130 QString m_commaSeparatedLabels
;
131 KHTMLPart
*m_labelCloud
;
132 //HTMLView *m_labelCloud;
135 Meta::TrackList m_tracks
;
136 Meta::TrackPtr m_currentTrack
;
140 #endif /*AMAROK_TAGDIALOG_H*/