summaryrefslogtreecommitdiffstats
path: root/src/library/autodj/autodjfeature.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/library/autodj/autodjfeature.cpp')
-rw-r--r--src/library/autodj/autodjfeature.cpp85
1 files changed, 55 insertions, 30 deletions
diff --git a/src/library/autodj/autodjfeature.cpp b/src/library/autodj/autodjfeature.cpp
index 3ec62d7d6b..9bba9e0221 100644
--- a/src/library/autodj/autodjfeature.cpp
+++ b/src/library/autodj/autodjfeature.cpp
@@ -8,18 +8,19 @@
#include "library/autodj/autodjfeature.h"
+#include "controllers/keyboard/keyboardeventfilter.h"
+#include "library/autodj/autodjprocessor.h"
+#include "library/autodj/dlgautodj.h"
+#include "library/crate/cratestorage.h"
#include "library/library.h"
#include "library/parser.h"
-#include "mixer/playermanager.h"
-#include "library/autodj/autodjprocessor.h"
#include "library/trackcollection.h"
-#include "library/autodj/dlgautodj.h"
#include "library/treeitem.h"
-#include "library/crate/cratestorage.h"
-#include "widget/wlibrary.h"
-#include "controllers/keyboard/keyboardeventfilter.h"
+#include "mixer/playermanager.h"
#include "sources/soundsourceproxy.h"
+#include "util/compatibility.h"
#include "util/dnd.h"
+#include "widget/wlibrary.h"
const QString AutoDJFeature::m_sAutoDJViewName = QString("Auto DJ");
@@ -58,8 +59,10 @@ AutoDJFeature::AutoDJFeature(Library* pLibrary,
qRegisterMetaType<AutoDJProcessor::AutoDJState>("AutoDJState");
m_pAutoDJProcessor = new AutoDJProcessor(
this, m_pConfig, pPlayerManager, m_iAutoDJPlaylistId, m_pTrackCollection);
- connect(m_pAutoDJProcessor, SIGNAL(loadTrackToPlayer(TrackPointer, QString, bool)),
- this, SIGNAL(loadTrackToPlayer(TrackPointer, QString, bool)));
+ connect(m_pAutoDJProcessor,
+ &AutoDJProcessor::loadTrackToPlayer,
+ this,
+ &AutoDJFeature::loadTrackToPlayer);
m_playlistDao.setAutoDJProcessor(m_pAutoDJProcessor);
// Create the "Crates" tree-item under the root item.
@@ -73,20 +76,30 @@ AutoDJFeature::AutoDJFeature(Library* pLibrary,
m_childModel.setRootItem(std::move(pRootItem));
// Be notified when the status of crates changes.
- connect(m_pTrackCollection, SIGNAL(crateInserted(CrateId)),
- this, SLOT(slotCrateChanged(CrateId)));
- connect(m_pTrackCollection, SIGNAL(crateUpdated(CrateId)),
- this, SLOT(slotCrateChanged(CrateId)));
- connect(m_pTrackCollection, SIGNAL(crateDeleted(CrateId)),
- this, SLOT(slotCrateChanged(CrateId)));
+ connect(m_pTrackCollection,
+ &TrackCollection::crateInserted,
+ this,
+ &AutoDJFeature::slotCrateChanged);
+ connect(m_pTrackCollection,
+ &TrackCollection::crateUpdated,
+ this,
+ &AutoDJFeature::slotCrateChanged);
+ connect(m_pTrackCollection,
+ &TrackCollection::crateDeleted,
+ this,
+ &AutoDJFeature::slotCrateChanged);
// Create context-menu items to allow crates to be added to, and removed
// from, the auto-DJ queue.
- connect(&m_crateMapper, SIGNAL(mapped(int)),
- this, SLOT(slotAddCrateToAutoDj(int)));
+ connect(&m_crateMapper,
+ QOverload<int>::of(&QSignalMapper::mapped),
+ this,
+ &AutoDJFeature::slotAddCrateToAutoDj);
m_pRemoveCrateFromAutoDj = new QAction(tr("Remove Crate as Track Source"), this);
- connect(m_pRemoveCrateFromAutoDj, SIGNAL(triggered()),
- this, SLOT(slotRemoveCrateFromAutoDj()));
+ connect(m_pRemoveCrateFromAutoDj,
+ &QAction::triggered,
+ this,
+ &AutoDJFeature::slotRemoveCrateFromAutoDj);
}
AutoDJFeature::~AutoDJFeature() {
@@ -111,19 +124,29 @@ void AutoDJFeature::bindWidget(WLibrary* libraryWidget,
m_pTrackCollection,
keyboard);
libraryWidget->registerView(m_sAutoDJViewName, m_pAutoDJView);
- connect(m_pAutoDJView, SIGNAL(loadTrack(TrackPointer)),
- this, SIGNAL(loadTrack(TrackPointer)));
- connect(m_pAutoDJView, SIGNAL(loadTrackToPlayer(TrackPointer, QString, bool)),
- this, SIGNAL(loadTrackToPlayer(TrackPointer, QString, bool)));
-
- connect(m_pAutoDJView, SIGNAL(trackSelected(TrackPointer)),
- this, SIGNAL(trackSelected(TrackPointer)));
+ connect(m_pAutoDJView,
+ &DlgAutoDJ::loadTrack,
+ this,
+ &AutoDJFeature::loadTrack);
+ connect(m_pAutoDJView,
+ &DlgAutoDJ::loadTrackToPlayer,
+ this,
+ &AutoDJFeature::loadTrackToPlayer);
+
+ connect(m_pAutoDJView,
+ &DlgAutoDJ::trackSelected,
+ this,
+ &AutoDJFeature::trackSelected);
// Be informed when the user wants to add another random track.
- connect(m_pAutoDJProcessor,SIGNAL(randomTrackRequested(int)),
- this,SLOT(slotRandomQueue(int)));
- connect(m_pAutoDJView, SIGNAL(addRandomButton(bool)),
- this, SLOT(slotAddRandomTrack()));
+ connect(m_pAutoDJProcessor,
+ &AutoDJProcessor::randomTrackRequested,
+ this,
+ &AutoDJFeature::slotRandomQueue);
+ connect(m_pAutoDJView,
+ &DlgAutoDJ::addRandomButton,
+ this,
+ &AutoDJFeature::slotAddRandomTrack);
}
TreeItemModel* AutoDJFeature::getChildModel() {
@@ -280,7 +303,9 @@ void AutoDJFeature::onRightClickChild(const QPoint& globalPos,
while (nonAutoDjCrates.populateNext(&crate)) {
auto pAction = std::make_unique<QAction>(crate.getName(), &crateMenu);
m_crateMapper.setMapping(pAction.get(), crate.getId().value());
- connect(pAction.get(), SIGNAL(triggered()), &m_crateMapper, SLOT(map()));
+ connect(pAction.get(),
+ &QAction::triggered,
+ [=](bool) { m_crateMapper.map(); });
crateMenu.addAction(pAction.get());
pAction.release();
}