RipCDDialog now uses CddaSongLoader from passed in CddaDevice

This commit is contained in:
Lukas Prediger 2021-05-30 16:18:31 +03:00 committed by John Maguire
parent 14d5c25d37
commit ae3037984c
4 changed files with 6 additions and 4 deletions

View File

@ -55,6 +55,8 @@ void CddaDevice::Init() { LoadSongs(); }
void CddaDevice::Refresh() {}
CddaSongLoader* CddaDevice::loader() { return &cdda_song_loader_; }
void CddaDevice::WatchForDiscChanges(bool watch) {
if (watch && !disc_changed_timer_.isActive())
disc_changed_timer_.start(CddaDevice::kDiscChangePollingIntervalMs);

View File

@ -42,6 +42,7 @@ class CddaDevice : public ConnectedDevice {
void Refresh();
bool CopyToStorage(const MusicStorage::CopyJob&) { return false; }
bool DeleteFromStorage(const MusicStorage::DeleteJob&) { return false; }
CddaSongLoader* loader();
void WatchForDiscChanges(bool watch);
static const int kDiscChangePollingIntervalMs;

View File

@ -58,10 +58,9 @@ RipCDDialog::RipCDDialog(std::shared_ptr<CddaDevice> cdda_device,
ui_(new Ui_RipCDDialog),
ripper_(new Ripper(this)),
working_(false),
loader_(nullptr),
cdda_device_(std::move(cdda_device)) {
cdda_device_(std::move(cdda_device)),
loader_(cdda_device_->loader()) {
Q_ASSERT(cdda_device_);
loader_ = new CddaSongLoader(cdda_device_->url(), this);
// Init
ui_->setupUi(this);

View File

@ -90,7 +90,7 @@ class RipCDDialog : public QDialog {
std::unique_ptr<Ui_RipCDDialog> ui_;
Ripper* ripper_;
bool working_;
CddaSongLoader* loader_;
std::shared_ptr<CddaDevice> cdda_device_;
CddaSongLoader* loader_;
};
#endif // SRC_RIPPER_RIPCDDIALOG_H_