2015-02-18 20:05:35 +01:00
|
|
|
/* This file is part of Clementine.
|
|
|
|
Copyright 2014, Andre Siviero <altsiviero@gmail.com>
|
2021-06-01 17:51:00 +02:00
|
|
|
Copyright 2021, Lukas Prediger <lumip@lumip.de>
|
2015-02-18 20:05:35 +01:00
|
|
|
|
|
|
|
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 <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SRC_RIPPER_RIPCDDIALOG_H_
|
|
|
|
#define SRC_RIPPER_RIPCDDIALOG_H_
|
|
|
|
|
|
|
|
#include <QDialog>
|
2022-01-23 17:07:15 +01:00
|
|
|
#include <QTimer>
|
2020-09-18 16:15:19 +02:00
|
|
|
#include <memory>
|
2015-02-18 20:05:35 +01:00
|
|
|
|
|
|
|
#include "core/song.h"
|
|
|
|
|
|
|
|
class QCheckBox;
|
2018-07-07 10:26:11 +02:00
|
|
|
class QCloseEvent;
|
2015-02-18 20:05:35 +01:00
|
|
|
class QLineEdit;
|
2018-07-07 10:26:11 +02:00
|
|
|
class QShowEvent;
|
2015-02-18 20:05:35 +01:00
|
|
|
|
|
|
|
class Ripper;
|
|
|
|
class Ui_RipCDDialog;
|
2021-05-30 14:23:37 +02:00
|
|
|
class CddaDevice;
|
2021-06-01 17:51:00 +02:00
|
|
|
class DeviceManager;
|
|
|
|
class DeviceInfo;
|
2015-02-18 20:05:35 +01:00
|
|
|
|
|
|
|
class RipCDDialog : public QDialog {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2021-06-16 16:53:41 +02:00
|
|
|
explicit RipCDDialog(DeviceManager* device_manager,
|
2021-05-30 14:23:37 +02:00
|
|
|
QWidget* parent = nullptr);
|
2015-02-18 20:05:35 +01:00
|
|
|
~RipCDDialog();
|
|
|
|
|
|
|
|
protected:
|
2021-06-03 20:28:46 +02:00
|
|
|
void closeEvent(QCloseEvent* event) override;
|
|
|
|
void showEvent(QShowEvent* event) override;
|
2015-02-18 20:05:35 +01:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void ClickedRipButton();
|
|
|
|
void Options();
|
|
|
|
void AddDestination();
|
|
|
|
void SelectAll();
|
|
|
|
void SelectNone();
|
|
|
|
void InvertSelection();
|
2021-06-01 17:51:00 +02:00
|
|
|
void DeviceSelected(int device_index);
|
2022-01-25 21:02:11 +01:00
|
|
|
void Finished(Ripper* ripper, float progress_to_display);
|
2021-09-04 13:21:55 +02:00
|
|
|
void SongsLoaded(const SongList& songs);
|
2021-05-30 14:23:37 +02:00
|
|
|
void DiscChanged();
|
2021-08-22 14:04:43 +02:00
|
|
|
void FormatStringUpdated();
|
2021-08-23 16:18:49 +02:00
|
|
|
void UpdateFileNamePreviews();
|
2021-09-04 13:21:55 +02:00
|
|
|
void DiscEditChanged(const QString& disc_string);
|
|
|
|
void YearEditChanged(const QString& year_string);
|
|
|
|
void UpdateMetadataEdits();
|
|
|
|
void UpdateMetadataFromGUI();
|
2022-01-25 21:02:11 +01:00
|
|
|
void TranscodingProgressTimeout(Ripper* ripper);
|
2015-02-18 20:05:35 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
static const char* kSettingsGroup;
|
|
|
|
static const int kMaxDestinationItems;
|
2022-01-23 17:07:15 +01:00
|
|
|
static const int kTranscodingProgressIntervalMs;
|
2015-02-18 20:05:35 +01:00
|
|
|
|
|
|
|
void AddDestinationDirectory(QString dir);
|
|
|
|
void SetWorking(bool working);
|
2018-07-05 14:40:48 +02:00
|
|
|
void ResetDialog();
|
2021-06-01 17:51:00 +02:00
|
|
|
void InitializeDevices();
|
2021-08-22 14:04:43 +02:00
|
|
|
void EnableIfPossible();
|
|
|
|
void UpdateTrackListTable();
|
2015-02-18 20:05:35 +01:00
|
|
|
|
|
|
|
QList<QCheckBox*> checkboxes_;
|
|
|
|
QString last_add_dir_;
|
|
|
|
QPushButton* cancel_button_;
|
|
|
|
QPushButton* close_button_;
|
|
|
|
QPushButton* rip_button_;
|
|
|
|
std::unique_ptr<Ui_RipCDDialog> ui_;
|
2021-06-16 16:53:41 +02:00
|
|
|
DeviceManager* device_manager_;
|
2021-06-01 17:51:00 +02:00
|
|
|
QList<DeviceInfo*> cdda_devices_;
|
2015-02-18 20:07:05 +01:00
|
|
|
bool working_;
|
2021-05-30 14:23:37 +02:00
|
|
|
std::shared_ptr<CddaDevice> cdda_device_;
|
2021-08-22 14:04:43 +02:00
|
|
|
SongList songs_;
|
2022-01-23 17:07:15 +01:00
|
|
|
QTimer transcoding_progress_timer_;
|
|
|
|
QMetaObject::Connection transcoding_progress_timer_connection_;
|
2015-02-18 20:05:35 +01:00
|
|
|
};
|
|
|
|
#endif // SRC_RIPPER_RIPCDDIALOG_H_
|