diff --git a/src/devices/cddadevice.h b/src/devices/cddadevice.h index f2a068927..907f3f011 100644 --- a/src/devices/cddadevice.h +++ b/src/devices/cddadevice.h @@ -54,6 +54,7 @@ class CddaDevice : public ConnectedDevice { // Check whether a valid device handle was opened. bool IsValid() const; void WatchForDiscChanges(bool watch); + void LoadSongs(); static QStringList url_schemes() { return QStringList() << "cdda"; } @@ -77,8 +78,6 @@ class CddaDevice : public ConnectedDevice { void CheckDiscChanged(); private: - void LoadSongs(); - CdIo_t* cdio_; QTimer disc_changed_timer_; CddaSongLoader cdda_song_loader_; diff --git a/src/ripper/ripcddialog.cpp b/src/ripper/ripcddialog.cpp index e60aea27c..06dcd8083 100644 --- a/src/ripper/ripcddialog.cpp +++ b/src/ripper/ripcddialog.cpp @@ -63,8 +63,7 @@ RipCDDialog::RipCDDialog(DeviceManager* device_manager, QWidget* parent) cdda_devices_( device_manager->FindDevicesByUrlSchemes(CddaDevice::url_schemes())), working_(false), - cdda_device_(), - loader_(nullptr) { + cdda_device_() { Q_ASSERT(device_manager); // Init ui_->setupUi(this); @@ -314,8 +313,7 @@ void RipCDDialog::InvertSelection() { } void RipCDDialog::DeviceSelected(int device_index) { - // disconnecting from previous loader and device, if any - if (loader_) disconnect(loader_, nullptr, this, nullptr); + // disconnecting from previous device, if any if (cdda_device_) disconnect(cdda_device_.get(), nullptr, this, nullptr); ResetDialog(); @@ -338,15 +336,9 @@ void RipCDDialog::DeviceSelected(int device_index) { } connect(cdda_device_.get(), SIGNAL(DiscChanged()), SLOT(DiscChanged())); - - // get SongLoader from device and connect signals - loader_ = cdda_device_->loader(); - Q_ASSERT(loader_); - - connect(loader_, SIGNAL(SongsUpdated(SongList)), SLOT(SongsLoaded(SongList))); - - // load songs from new SongLoader - loader_->LoadSongs(); + connect(cdda_device_.get(), SIGNAL(SongsDiscovered(SongList)), + SLOT(SongsLoaded(SongList))); + cdda_device_->LoadSongs(); } void RipCDDialog::Finished(Ripper* ripper) { diff --git a/src/ripper/ripcddialog.h b/src/ripper/ripcddialog.h index 7ac94e6c8..6ced2e438 100644 --- a/src/ripper/ripcddialog.h +++ b/src/ripper/ripcddialog.h @@ -29,7 +29,6 @@ class QCloseEvent; class QLineEdit; class QShowEvent; -class CddaSongLoader; class Ripper; class Ui_RipCDDialog; class CddaDevice; @@ -90,7 +89,6 @@ class RipCDDialog : public QDialog { QList cdda_devices_; bool working_; std::shared_ptr cdda_device_; - CddaSongLoader* loader_; SongList songs_; }; #endif // SRC_RIPPER_RIPCDDIALOG_H_