/* This file is part of Clementine. Copyright 2014, Andre Siviero Clementine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Clementine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Clementine. If not, see . */ #ifndef SRC_UI_RIPCD_H_ #define SRC_UI_RIPCD_H_ #include #include #include #include #include #include #include "ui_ripcd.h" #include class Ui_RipCD; class Transcoder; struct TranscoderPreset; class RipCD : public QDialog { Q_OBJECT public: explicit RipCD(QWidget* parent = nullptr); ~RipCD(); bool CheckCDIOIsValid(); void BuildTrackListTable(); protected: void showEvent(QShowEvent* event); private: static const char* kSettingsGroup; static const int kProgressInterval; static const int kMaxDestinationItems; Transcoder* transcoder_; int queued_; int finished_success_; int finished_failed_; track_t i_tracks_; std::unique_ptr ui_; CdIo_t* cdio_; QList checkboxes_; QList generated_files_; QList tracks_to_rip_; QList track_names_; QString last_add_dir_; QPushButton* cancel_button_; QPushButton* close_button_; QPushButton* rip_button_; QString temporary_directory_; bool cancel_requested_; QMutex mutex_; void WriteWAVHeader(QFile* stream, int32_t i_bytecount); int NumTracksToRip(); void ThreadClickedRipButton(); QString TrimPath(const QString& path) const; QString GetOutputFileName(const QString& input, const TranscoderPreset& preset) const; QString ParseFileFormatString(const QString& file_format, int track_no) const; void SetWorking(bool working); void AddDestinationDirectory(QString dir); void RemoveTemporaryDirectory(); signals: void RippingComplete(); void SignalUpdateProgress(); private slots: void UpdateProgress(); void ThreadedTranscoding(); void ClickedRipButton(); void JobComplete(const QString& filename, bool success); void AllJobsComplete(); void AppendOutput(const QString& filename); void Options(); void AddDestination(); void Cancel(); void SelectAll(); void SelectNone(); void InvertSelection(); }; #endif // SRC_UI_RIPCD_H_