File indexing completed on 2024-05-05 04:51:42

0001 /*
0002     SPDX-FileCopyrightText: 1998-2008 Sebastian Trueg <trueg@k3b.org>
0003     SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 
0006 #ifndef _K3B_AUDIOTRACK_TRM_LOOKUP_DIALOG_H_
0007 #define _K3B_AUDIOTRACK_TRM_LOOKUP_DIALOG_H_
0008 
0009 #include <QList>
0010 #include <QLabel>
0011 #include <QDialog>
0012 
0013 class QLabel;
0014 namespace K3b {
0015     class AudioTrack;
0016 }
0017 namespace K3b {
0018     class MusicBrainzJob;
0019 }
0020 namespace K3b {
0021     class BusyWidget;
0022 }
0023 class QEventLoop;
0024 class QPushButton;
0025 
0026 
0027 namespace K3b {
0028     class AudioTrackTRMLookupDialog : public QDialog
0029     {
0030         Q_OBJECT
0031 
0032     public:
0033         explicit AudioTrackTRMLookupDialog( QWidget* parent = 0 );
0034         ~AudioTrackTRMLookupDialog() override;
0035 
0036         /**
0037          * This will show the dialog and start the lookup
0038          */
0039         int lookup( const QList<AudioTrack*>& tracks );
0040 
0041     public Q_SLOTS:
0042         void reject() override;
0043 
0044     private Q_SLOTS:
0045         void slotMbJobFinished( bool );
0046         void slotMbJobInfoMessage( const QString&, int );
0047         void slotTrackFinished( K3b::AudioTrack* track, bool success );
0048 
0049     private:
0050         QLabel* m_infoLabel;
0051         BusyWidget* m_busyWidget;
0052         QPushButton* m_cancelButton;
0053         MusicBrainzJob* m_mbJob;
0054         QEventLoop* m_loop;
0055     };
0056 }
0057 
0058 #endif