summaryrefslogtreecommitdiffstats
path: root/src/library/export/trackexportwizard.h
blob: f1cd2217ba847f98f91829a3a4038f9bbe6a3d1a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// TrackExportWizard handles exporting a list of tracks to an external directory
//
// TODO:
//   * Dedupe the list of trackpointers
//   * Detect duplicate filenames and munge to prevent collisions.
//   * Offer the option to transcode files to the codec of choice (e.g.,
//     FLAC -> AIFF for CDJ
//   * Export sidecar metadata files for import into Mixxx

#ifndef TRACKEXPORT_H
#define TRACKEXPORT_H

#include <QString>
#include <QScopedPointer>

#include "preferences/usersettings.h"
#include "library/export/trackexportdlg.h"
#include "library/export/trackexportworker.h"
#include "trackinfoobject.h"

// A controller class for creating the export worker and UI.
class TrackExportWizard : public QObject {
  Q_OBJECT
  public:
    TrackExportWizard(QWidget *parent, UserSettingsPointer pConfig,
                      QList<TrackPointer> tracks)
            : m_parent(parent), m_pConfig(pConfig), m_tracks(tracks) { }
    virtual ~TrackExportWizard() { }

    // Displays a dialog requesting destination directory, then performs
    // track export if a folder is chosen.  Handles errors gracefully.
    void exportTracks();

  private:
    bool selectDestinationDirectory();

    QWidget* m_parent;
    UserSettingsPointer m_pConfig;
    QList<TrackPointer> m_tracks;
    QScopedPointer<TrackExportDlg> m_dialog;
    QScopedPointer<TrackExportWorker> m_worker;
};

#endif  // TRACKEXPORT_H