#pragma once #include #include #include "engine/Track.h" #include "engine/ReencodeJob.h" class QComboBox; class QLineEdit; class QPushButton; class QTableWidget; class QLabel; class QProgressBar; namespace engine { class AlbumReencoder; } class ReencodeDialog : public QDialog { Q_OBJECT public: explicit ReencodeDialog(const QList &tracks, QWidget *parent = nullptr); ~ReencodeDialog(); private slots: void onPresetChanged(int index); void onBrowseOutput(); void onStartStop(); void onTrackStarted (int index, const QString &title); void onTrackFinished(int index, bool ok, const QString &outPath, const QString &err); void onAllFinished (int succeeded, int failed); private: void buildUi(); void populateTrackTable(); void setRunning(bool running); void updateOverallProgress(); QList m_tracks; QList m_presets; QComboBox *m_presetCombo { nullptr }; QLabel *m_presetDesc { nullptr }; QLineEdit *m_outputDir { nullptr }; QPushButton *m_browseBtn { nullptr }; QTableWidget *m_table { nullptr }; QProgressBar *m_overallBar { nullptr }; QLabel *m_statusLabel { nullptr }; QPushButton *m_startStopBtn { nullptr }; QPushButton *m_closeBtn { nullptr }; engine::AlbumReencoder *m_reencoder { nullptr }; int m_doneCount { 0 }; int m_totalCount { 0 }; };