Skip to content

Commit

Permalink
Merge branch '2.2' of github.com:mixxxdj/mixxx
Browse files Browse the repository at this point in the history
  • Loading branch information
Holzhaus committed Mar 1, 2020
2 parents 4ffe4ea + adb2c3c commit 99bfeef
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 36 deletions.
2 changes: 1 addition & 1 deletion res/controllers/Numark-Mixtrack-Platinum-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -1230,7 +1230,7 @@ MixtrackPlatinum.scratchEnable = function (deck) {
var alpha = 1.0/8;
var beta = alpha/32;

engine.scratchEnable(deck, 1011, 33+1/3, alpha, beta);
engine.scratchEnable(deck, 1240, 33+1/3, alpha, beta);
MixtrackPlatinum.stopScratchTimer(deck);
};

Expand Down
14 changes: 14 additions & 0 deletions src/engine/channels/enginedeck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ EngineDeck::EngineDeck(const ChannelHandleAndGroup& handle_group,
m_bPassthroughIsActive = false;
m_bPassthroughWasActive = false;

// Ensure that input is configured before enabling passthrough
m_pPassing->connectValueChangeRequest(
this,
&EngineDeck::slotPassthroughChangeRequest,
Qt::DirectConnection);

// Set up passthrough toggle button
connect(m_pPassing, &ControlObject::valueChanged,
this, &EngineDeck::slotPassingToggle,
Expand Down Expand Up @@ -163,3 +169,11 @@ bool EngineDeck::isPassthroughActive() const {
void EngineDeck::slotPassingToggle(double v) {
m_bPassthroughIsActive = v > 0;
}

void EngineDeck::slotPassthroughChangeRequest(double v) {
if (v <= 0 || m_pInputConfigured->get() > 0) {
m_pPassing->setAndConfirm(v);
} else {
emit noPassthroughInputConfigured();
}
}
4 changes: 4 additions & 0 deletions src/engine/channels/enginedeck.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,12 @@ class EngineDeck : public EngineChannel, public AudioDestination {
// Return whether or not passthrough is active
bool isPassthroughActive() const;

signals:
void noPassthroughInputConfigured();

public slots:
void slotPassingToggle(double v);
void slotPassthroughChangeRequest(double v);

private:
UserSettingsPointer m_pConfig;
Expand Down
14 changes: 0 additions & 14 deletions src/mixer/basetrackplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ BaseTrackPlayerImpl::BaseTrackPlayerImpl(QObject* pParent,
pEffectsManager, defaultOrientation);

m_pInputConfigured = std::make_unique<ControlProxy>(group, "input_configured", this);
m_pPassthroughEnabled = std::make_unique<ControlProxy>(group, "passthrough", this);
m_pPassthroughEnabled->connectValueChanged(this, &BaseTrackPlayerImpl::slotPassthroughEnabled);
#ifdef __VINYLCONTROL__
m_pVinylControlEnabled = std::make_unique<ControlProxy>(group, "vinylcontrol_enabled", this);
m_pVinylControlEnabled->connectValueChanged(this, &BaseTrackPlayerImpl::slotVinylControlEnabled);
Expand Down Expand Up @@ -499,18 +497,6 @@ void BaseTrackPlayerImpl::setupEqControls() {
m_pPitchAdjust = std::make_unique<ControlProxy>(group, "pitch_adjust", this);
}

void BaseTrackPlayerImpl::slotPassthroughEnabled(double v) {
bool configured = m_pInputConfigured->toBool();
bool passthrough = v > 0.0;

// Warn the user if they try to enable passthrough on a player with no
// configured input.
if (!configured && passthrough) {
m_pPassthroughEnabled->set(0.0);
emit noPassthroughInputConfigured();
}
}

void BaseTrackPlayerImpl::slotVinylControlEnabled(double v) {
#ifdef __VINYLCONTROL__
bool configured = m_pInputConfigured->toBool();
Expand Down
3 changes: 0 additions & 3 deletions src/mixer/basetrackplayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ class BaseTrackPlayer : public BasePlayer {
void newTrackLoaded(TrackPointer pLoadedTrack);
void loadingTrack(TrackPointer pNewTrack, TrackPointer pOldTrack);
void playerEmpty();
void noPassthroughInputConfigured();
void noVinylControlInputConfigured();
};

Expand Down Expand Up @@ -86,7 +85,6 @@ class BaseTrackPlayerImpl : public BaseTrackPlayer {
private slots:
void slotCloneChannel(EngineChannel* pChannel);
void slotCloneFromDeck(double deck);
void slotPassthroughEnabled(double v);
void slotVinylControlEnabled(double v);
void slotWaveformZoomValueChangeRequest(double pressed);
void slotWaveformZoomUp(double pressed);
Expand Down Expand Up @@ -140,7 +138,6 @@ class BaseTrackPlayerImpl : public BaseTrackPlayer {
std::unique_ptr<ControlProxy> m_pRateRatio;
std::unique_ptr<ControlProxy> m_pPitchAdjust;
std::unique_ptr<ControlProxy> m_pInputConfigured;
std::unique_ptr<ControlProxy> m_pPassthroughEnabled;
std::unique_ptr<ControlProxy> m_pVinylControlEnabled;
std::unique_ptr<ControlProxy> m_pVinylControlStatus;
};
Expand Down
6 changes: 4 additions & 2 deletions src/mixer/playermanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,10 @@ void PlayerManager::addDeckInner() {

Deck* pDeck = new Deck(this, m_pConfig, m_pEngine, m_pEffectsManager,
m_pVisualsManager, orientation, group);
connect(pDeck, SIGNAL(noPassthroughInputConfigured()),
this, SIGNAL(noDeckPassthroughInputConfigured()));
connect(pDeck->getEngineDeck(),
&EngineDeck::noPassthroughInputConfigured,
this,
&PlayerManager::noDeckPassthroughInputConfigured);
connect(pDeck, SIGNAL(noVinylControlInputConfigured()),
this, SIGNAL(noVinylControlInputConfigured()));

Expand Down
30 changes: 14 additions & 16 deletions src/widget/wtracktableview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -599,11 +599,9 @@ void WTrackTableView::slotMouseDoubleClicked(const QModelIndex &index) {
}

TrackPointer pTrack = trackModel->getTrack(index);
VERIFY_OR_DEBUG_ASSERT(pTrack) {
return;
if (pTrack) {
emit loadTrack(pTrack);
}

emit loadTrack(pTrack);
} else if (doubleClickAction == DlgPrefLibrary::ADD_TO_AUTODJ_BOTTOM
&& modelHasCapabilities(TrackModel::TRACKMODELCAPS_ADDTOAUTODJ)) {
addToAutoDJ(PlaylistDAO::AutoDJSendLoc::BOTTOM);
Expand Down Expand Up @@ -1959,13 +1957,11 @@ void WTrackTableView::slotScaleBpm(int scale) {

const QModelIndexList selectedTrackIndices = selectionModel()->selectedRows();
for (const auto& index : selectedTrackIndices) {
TrackPointer track = trackModel->getTrack(index);
if (!track->isBpmLocked()) { // bpm is not locked
BeatsPointer beats = track->getBeats();
if (beats != nullptr) {
beats->scale(static_cast<Beats::BPMScale>(scale));
} else {
continue;
TrackPointer pTrack = trackModel->getTrack(index);
if (pTrack && !pTrack->isBpmLocked()) {
BeatsPointer pBeats = pTrack->getBeats();
if (pBeats) {
pBeats->scale(static_cast<Beats::BPMScale>(scale));
}
}
}
Expand All @@ -1980,8 +1976,10 @@ void WTrackTableView::lockBpm(bool lock) {
const QModelIndexList selectedTrackIndices = selectionModel()->selectedRows();
// TODO: This should be done in a thread for large selections
for (const auto& index : selectedTrackIndices) {
TrackPointer track = trackModel->getTrack(index);
track->setBpmLocked(lock);
TrackPointer pTrack = trackModel->getTrack(index);
if (pTrack) {
pTrack->setBpmLocked(lock);
}
}
}

Expand Down Expand Up @@ -2012,9 +2010,9 @@ void WTrackTableView::slotClearBeats() {
const QModelIndexList selectedTrackIndices = selectionModel()->selectedRows();
// TODO: This should be done in a thread for large selections
for (const auto& index : selectedTrackIndices) {
TrackPointer track = trackModel->getTrack(index);
if (!track->isBpmLocked()) {
track->setBeats(BeatsPointer());
TrackPointer pTrack = trackModel->getTrack(index);
if (pTrack && !pTrack->isBpmLocked()) {
pTrack->setBeats(BeatsPointer());
}
}
}
Expand Down

0 comments on commit 99bfeef

Please sign in to comment.